A container for toolbar
s. It is a type of box but defaults to vertical orientation. If a toolbar
is placed inside a toolbox
, a grippy
is displayed on its left or upper edge. The user may click the grippy
to collapse the toolbar
. If multiple toolbars are placed in the same toolbox
, they will all collapse into the same row. The Firefox browser does not have grippies so toolbars cannot be collapsed and expanded.
Note: Gecko 2.0 adds support for external toolbars. These are toolbars that are not children of a toolbox
. You can associate an external toolbar
with a toolbox
for the purpose of managing your toolbars by setting the toolboxid
property on the toolbar. The external toolbars associated with a toolbox are listed in the array of elements provided by the toolbox's externalToolbars
property.
More information is available in the XUL tutorial.
If you'd like to detect when toolbars in a toolbox are changed, see Toolbar customization events.
- Properties
- accessible, customToolbarCount, externalToolbars, palette, toolbarset
- Methods
- appendCustomToolbar, collapseToolbar, expandToolbar
Examples
<?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="yourwindow" xmlns="https://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="toolbox example" width="300"> <toolbox> <toolbar> <toolbarbutton label="Back"/> <toolbarbutton label="Forward"/> <toolbarbutton label="Home"/> </toolbar> <toolbar> <toolbarbutton label="Stop"/> <toolbarbutton label="Reload"/> </toolbar> </toolbox> <textbox multiline="true" value="We have two toolbars inside of one toolbox above." width="20"/> </window>
Attributes
Inherited from XUL element |
Properties
-
accessible
-
Type:
nsIAccessible
- Returns the accessibility object for the element.
-
customToolbarCount
- Firefox only
- Type: integer
-
The number of custom
toolbar
s currently within thetoolbox
.
externalToolbars
- Type: array of elements
- An array of external toolbars; that is,
toolbar
elements that should be considered to be members of thistoolbox
, even if they are not actually children of the toolbox.
-
palette
- Firefox only
- Type: element
- The
toolbarpalette
within thetoolbox
.
-
toolbarset
- Firefox only
- Type: element
- The
toolbarset
within thetoolbox
.
Methods
-
appendCustomToolbar( name, currentset )
- Firefox only
- Return type: element
- Adds a custom
toolbar
to thetoolbox
with the given <var>name</var>. You can supply a comma-separated list of toolbar item ids as the second argument to add some items by default. The method returns the DOM element for the created toolbar.
-
collapseToolbar( toolbar )
- Not in Firefox
- Return type: no return value
- Collapse the given <var>toolbar</var> which should be contained within the
toolbox
.
-
expandToolbar( toolbar )
- Not in Firefox
- Return type: no return value
- Expand the given <var>toolbar</var> which should be contained in the
toolbox
.
Related
- Elements
-
toolbar
,toolbarbutton
,toolbargrippy
,toolbaritem
,toolbarpalette
,toolbarseparator
,toolbarset
,toolbarspacer
,toolbarspring
- Interfaces
-
nsIAccessibleProvider