Resizer in Resizable Dialog in XUL? - Mozilla

This is a discussion on Resizer in Resizable Dialog in XUL? - Mozilla ; Hello. My addon shows a dialog using: windowWatcher.openWindow(null, "chrome://thunderplunger/content/cleanAccounts.xul", "", "chrome,modal,centerscreen,resizable,alwaysRaised,h eight=280,width=600", argsString); The dialog is indeed resizable. However, on my windows boxes, there is no resizer widget shown so users are not clear that the dialog can indeed be ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Resizer in Resizable Dialog in XUL?

  1. Resizer in Resizable Dialog in XUL?

    Hello. My addon shows a dialog using:

    windowWatcher.openWindow(null,
    "chrome://thunderplunger/content/cleanAccounts.xul", "",
    "chrome,modal,centerscreen,resizable,alwaysRaised,h eight=280,width=600",
    argsString);

    The dialog is indeed resizable. However, on my windows boxes, there is
    no resizer widget shown so users are not clear that the dialog can
    indeed be resized.

    So I wanted to add a resizer element to make this clear. I have tried
    adding it as the first and as the last element in the dialog's
    definition. In neither case does the resizer widget show up in the
    bottom right (this was my dir parameter).

    When placed as the last element in the definition, the widget shows
    about the dialog buttons.

    Can anyone tell me what I am doing wrong here or if it is simply not
    possible to do this?

  2. Re: Resizer in Resizable Dialog in XUL?

    whitedavidp@fastmail.us pisze:
    > Hello. My addon shows a dialog using:
    >
    > windowWatcher.openWindow(null,
    > "chrome://thunderplunger/content/cleanAccounts.xul", "",
    > "chrome,modal,centerscreen,resizable,alwaysRaised,h eight=280,width=600",
    > argsString);
    >
    > The dialog is indeed resizable. However, on my windows boxes, there is
    > no resizer widget shown so users are not clear that the dialog can
    > indeed be resized.
    >
    > So I wanted to add a resizer element to make this clear. I have tried
    > adding it as the first and as the last element in the dialog's
    > definition. In neither case does the resizer widget show up in the
    > bottom right (this was my dir parameter).
    >
    > When placed as the last element in the definition, the widget shows
    > about the dialog buttons.
    >
    > Can anyone tell me what I am doing wrong here or if it is simply not
    > possible to do this?




    In CSS file for your dialog, put:

    ------------------------ "*.css" BEGIN ---------
    dialog {
    -moz-binding: url("chrome://MyExtension/content/dialog.xml#dialog")
    !important;
    padding-top: 0px !important;
    padding-bottom: 0px !important;
    -moz-padding-start: 0px !important;
    -moz-padding-end: 0px !important;
    }

    dialog > stack > .paddingBox{
    padding-top: 8px;
    padding-bottom: 10px;
    -moz-padding-start: 8px;
    -moz-padding-end: 10px;
    }
    ------------------------ "*.css" END ---------


    In "content/dialog.xml" put:

    ------------------------ "content/dialog.xml" BEGIN ---------


    xmlns="http://www.mozilla.org/xbl"

    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    xmlns:xbl="http://www.mozilla.org/xbl">

    extends="chrome://global/content/bindings/dialog.xml#dialog">













    xbl:inherits="pack=buttonpack,align=buttonalign,dir=buttondir,or ient=buttonorient"
    pack="end">
    hidden="true"/>







    ------------------------ "content/dialog.xml" END ---------


    Now in your XUL add (just after or just before ):



    It should work now.


    How it works?
    It is modification of original bindind, with a little modified
    anonymous XUL. New XUL allows working properly.
    Caveats: If Mozilla modify original binding for there may be
    need to fix this custom binding accordingly.



    BTW, do not pass width and height in openWindow call.
    It is better to specify them as attributes.
    and try use "persist" attribute.

    Check this example:

    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    screenX="100"
    screenY="150"
    width="600"
    height="450"
    persist="width height screenX screenY"
    >


    Attribute 'persist="width height screenX screenY"' make you window to
    remember last position and size, so next time it will open in
    user-preferred place.

    --
    Arivald

  3. Re: Resizer in Resizable Dialog in XUL?

    Thanks for the detailed (very) response and explanation. Do you think
    this is a shortcoming in TB (and perhaps FF) that should have a
    bug/enhancement request placed against it? Perhaps I am just
    simple-minded but I'd think that any chrome window (at least on Windows
    platforms) that is re-sizable should get one of these automatically.

    David

    Arivald wrote:
    > whitedavidp@fastmail.us pisze:
    >> Hello. My addon shows a dialog using:
    >>
    >> windowWatcher.openWindow(null,
    >> "chrome://thunderplunger/content/cleanAccounts.xul", "",
    >> "chrome,modal,centerscreen,resizable,alwaysRaised,h eight=280,width=600",
    >> argsString);
    >>
    >> The dialog is indeed resizable. However, on my windows boxes, there is
    >> no resizer widget shown so users are not clear that the dialog can
    >> indeed be resized.
    >>
    >> So I wanted to add a resizer element to make this clear. I have tried
    >> adding it as the first and as the last element in the dialog's
    >> definition. In neither case does the resizer widget show up in the
    >> bottom right (this was my dir parameter).
    >>
    >> When placed as the last element in the definition, the widget shows
    >> about the dialog buttons.
    >>
    >> Can anyone tell me what I am doing wrong here or if it is simply not
    >> possible to do this?

    >
    >
    >
    > In CSS file for your dialog, put:
    >
    > ------------------------ "*.css" BEGIN ---------
    > dialog {
    > -moz-binding: url("chrome://MyExtension/content/dialog.xml#dialog")
    > !important;
    > padding-top: 0px !important;
    > padding-bottom: 0px !important;
    > -moz-padding-start: 0px !important;
    > -moz-padding-end: 0px !important;
    > }
    >
    > dialog > stack > .paddingBox{
    > padding-top: 8px;
    > padding-bottom: 10px;
    > -moz-padding-start: 8px;
    > -moz-padding-end: 10px;
    > }
    > ------------------------ "*.css" END ---------
    >
    >
    > In "content/dialog.xml" put:
    >
    > ------------------------ "content/dialog.xml" BEGIN ---------
    >
    >
    > > xmlns="http://www.mozilla.org/xbl"
    >
    > xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    > xmlns:xbl="http://www.mozilla.org/xbl">
    >
    > > extends="chrome://global/content/bindings/dialog.xml#dialog">
    >
    >
    >
    >
    >
    >

    >

    >
    >
    >
    >

    >
    > >
    > xbl:inherits="pack=buttonpack,align=buttonalign,dir=buttondir,or ient=buttonorient"
    >
    > pack="end">
    > > hidden="true"/>
    >

    >

    >

    >

    >

    >

    >

    > ------------------------ "content/dialog.xml" END ---------
    >
    >
    > Now in your XUL add (just after or just before ):
    >
    >
    >
    > It should work now.
    >
    >
    > How it works?
    > It is modification of original bindind, with a little modified
    > anonymous XUL. New XUL allows working properly.
    > Caveats: If Mozilla modify original binding for there may be
    > need to fix this custom binding accordingly.
    >
    >
    >
    > BTW, do not pass width and height in openWindow call.
    > It is better to specify them as attributes.
    > and try use "persist" attribute.
    >
    > Check this example:
    >
    > > xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    > screenX="100"
    > screenY="150"
    > width="600"
    > height="450"
    > persist="width height screenX screenY"
    > >

    >
    > Attribute 'persist="width height screenX screenY"' make you window to
    > remember last position and size, so next time it will open in
    > user-preferred place.
    >


  4. Re: Resizer in Resizable Dialog in XUL?

    whitedavidp@fastmail.us pisze:
    > David
    >
    > Arivald wrote:
    >> whitedavidp@fastmail.us pisze:
    >>> Hello. My addon shows a dialog using:
    >>>
    >>> windowWatcher.openWindow(null,
    >>> "chrome://thunderplunger/content/cleanAccounts.xul", "",
    >>> "chrome,modal,centerscreen,resizable,alwaysRaised,h eight=280,width=600",
    >>> argsString);
    >>>
    >>> The dialog is indeed resizable. However, on my windows boxes, there
    >>> is no resizer widget shown so users are not clear that the dialog can
    >>> indeed be resized.
    >>>
    >>> So I wanted to add a resizer element to make this clear. I have tried
    >>> adding it as the first and as the last element in the dialog's
    >>> definition. In neither case does the resizer widget show up in the
    >>> bottom right (this was my dir parameter).
    >>>
    >>> When placed as the last element in the definition, the widget shows
    >>> about the dialog buttons.
    >>>
    >>> Can anyone tell me what I am doing wrong here or if it is simply not
    >>> possible to do this?

    >>
    >>
    >>
    >> [...]


    > Thanks for the detailed (very) response and explanation. Do you think
    > this is a shortcoming in TB (and perhaps FF) that should have a
    > bug/enhancement request placed against it? Perhaps I am just
    > simple-minded but I'd think that any chrome window (at least on Windows
    > platforms) that is re-sizable should get one of these automatically.
    >


    Yes, i think it is bug.
    Simply developers of and assume they always will
    be fixed-size, but forgot to mention it in documentation.

    I already published fix for (which have a lot of bugs) at
    bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=410766
    But nobody at Mozilla takes care of it...
    Mozilla/Bugzilla becomes too "zilla" and may die someday as other big
    reptiles ;-)

    Fix for you takes about 10 min of work, and it is not perfect. For
    example it does not support with different "dir" attrib.
    I posted it here for other extensions developers.


    --
    Arivald

+ Reply to Thread