XUL:toolbar
From MDC
« XUL Reference home [ Examples | Attributes | Properties | Methods | Related ]
A container which typically contains a row of buttons. It is a type of box that defaults to horizontal orientation. It can be collapsed with a grippy when the toolbar is placed inside a toolbox. The toolbar should always have an id attribute. Firefox supports toolbar customization, whereas the Mozilla browser does not.
More information is available in the XUL tutorial.
- Attributes
- currentset, customindex, customizable, defaultset, grippyhidden, grippytooltiptext, mode, toolbarname
- Properties
- accessibleType, currentSet, firstPermanentChild, lastPermanentChild, toolbarName
- Methods
- insertItem
[edit] Examples
<toolbox>
<toolbar id="nav-toolbar">
<toolbarbutton id="nav-users" accesskey="U" label="Users"/>
<toolbarbutton id="nav-groups" accesskey="p" label="Groups"/>
<toolbarbutton id="nav-events" accesskey="E" label="Events" disabled="true"/>
</toolbar>
</toolbox>
[edit] Attributes
|
Inherited from XUL element |
- currentset
- Firefox only
- Type: comma-separated string
- The current set of displayed items on the toolbar. This will be modified when the user customizes the toolbar. The value of this attribute should be a comma-separated list of item IDs from the toolbarpalette or, additionally, any of the following strings: "
separator", "spring", "spacer".
- customindex
- Firefox only
- Type: integer
- This value is the index of the toolbar in the list of the custom toolbars. The value is updated automatically by the toolbar customization dialog.
- customizable
- Firefox only
- Type: boolean
- Set this attribute to
trueon toolbars that can be customized. This causes the set of buttons to be persisted across sessions.
- defaultset
- Firefox only
- Type: comma-separated list of item ids
- The default set of displayed items on the toolbar. This should be set to a comma-separated list of item IDs from the toolbarpalette. For example,
back-button,forward-button,print-button.
- grippyhidden
- Not in Firefox
- Type: boolean
- When set to
true, the grippy will be hidden. When set tofalse, the default, the grippy will be shown.
- grippytooltiptext
- Not in Firefox
- Type: string
- The text to appear on the tooltip for the toolbar's grippy when the toolbar is collapsed. This would be used to label the grippy so that the user knows which toolbar it represents.
- mode
- Firefox only
- Type: one of the values below
- How the toolbarbuttons on the toolbar are displayed.
-
icons: Show only icons. -
text: Show only text. -
full: Show both.
- toolbarname
- Firefox only
- Type: string
- The name of the toolbar, which is listed on the Show/Hide toolbars menu.
[edit] Properties
|
Inherited from XUL element Inherited from DOM element |
- accessibleType
- Type: integer
- A value indicating the type of accessibility object for the element.
- currentSet
- Firefox only
- Type: comma-separated list of strings
- Holds a comma-separated list of the IDs of the items currently on the toolbar. For spacers, separators, and flexible spacers the following strings are used instead of IDs: "
spacer", "separator", "spring". An empty toolbar has acurrentSetvalue of"__empty".
- You may change the current set of items by setting this property. Be careful, as setting this property doesn't automatically update the currentset attribute.
- firstPermanentChild
- Firefox only
- Type: element
- The first permanent child of the toolbar. A permanent child is one that is not customizable and remains on the toolbar. Items that are placed directly inside the toolbar without being in the toolbarpalette are permanent.
- lastPermanentChild
- Firefox only
- Type: element
- The last permanent child of the toolbar. A permanent child is one that is not customizable and remains on the toolbar. Items that are placed directly inside the toolbar without being in the toolbarpalette are permanent.
- toolbarName
- Firefox only
- Type: string
- The name of the toolbar.
[edit] Methods
- insertItem( id, beforeNode, wrapper, beforePermanent )
- Firefox only
- Return type: element
- Add an item with the given id to the toolbar. The new item is added just before the item given by the second argument. If the second argument is
null, but the beforePermanent argument istrue, the item is added to the beginning of the toolbar before the first permanent item. Otherwise, if the beforePermanent argument isfalse, the new item is added to the end of the toolbar. The third argument can be used to wrap the new item in another element. Usually, the last argument will benullas it is mainly for the use of the customize dialog.
The id should match an element in the toolbar's toolbarpalette. Some special ids may also be used to create special spacing items:
-
separator: A separator, which is drawn as a vertical bar. -
spacer: A non-flexible space. -
spring: A flexible space.
The method returns the DOM element for the created item.
|
Inherited from XUL element Inherited from DOM element |
[edit] Related
- Elements
- toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbarspring, toolbox
- Interfaces
- nsIAccessibleProvider