Visit Mozilla.org

XUL:splitter

From MDC

« XUL Reference home    [ Examples | Attributes | Properties | Methods | Related ]

An element which should appear before or after an element inside a container. When the splitter is dragged, the sibling elements of the splitter are resized. If a grippy is placed inside the splitter, one sibling element of the splitter is collapsed when the grippy is clicked.

More information is available in the XUL tutorial.

Attributes
collapse, resizeafter, resizebefore, state, substate
Style classes
tree-splitter

[edit] Examples

(example needed)

[edit] Attributes

Inherited from XUL element
align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width

collapse
Type: one of the values below
Determines which side of the splitter is collapsed when its grippy is clicked. If this attribute is not specified, the splitter will not cause a collapse. You should put a grippy element inside the splitter when it is used for collapsing.
  • none: No collapsing occurs.
  • before: When the grippy is clicked, the element immediately before the splitter in the same parent is collapsed so that its width or height is 0.
  • after: When the grippy is clicked, the element immediately after the splitter in the same parent is collapsed so that its width or height is 0.
  • both: Either the element immediately before the splitter, or the element immediately after the splitter can be collapsed, if the size of that element would fall below the minimum size due to the position of the splitter. New in Firefox 3

resizeafter
Type: one of the values below
This attribute indicates which element to the right or below the splitter should be resized when the splitter is repositioned.
  • closest: The element immediately to the right or below the splitter resizes.
  • farthest: The element that is the farthest away from the splitter to the right or below the splitter resizes.
  • grow: The elements to the right or below the splitter do not change size (unless they are flexible) when the splitter is dragged, but instead the entire container changes size.
  • flex: The closest flexible element resizes. New in Firefox 3

resizebefore
Type: one of the values below
This attribute indicates which element to the left or above the splitter should be resized when the splitter is repositioned.
  • closest: The element immediately to the left or above the splitter resizes.
  • farthest: The element that is the farthest away from the splitter to the left or above the splitter resizes.
  • flex: The closest flexible element resizes. New in Firefox 3

state
Type: one of the values below
Indicates whether the splitter has collapsed content or not. This attribute will be updated automatically as the splitter is moved, and is generally used in a stylesheet to apply a different appearance for each state.
  • open: The content either before or after the splitter, depending on the value of the collapsed attribute, is currently displayed.
  • collapsed: The content either before or after the splitter is collapsed and is not visible.
  • dragging: The user is current adjusting the position of the splitter, typically by dragging it with the mouse.

substate
Type: one of the values below
On splitters which have state="collapsed" and collapse="both", determines which direction the splitter is actually collapsed in. Since collapse="both" is a Gecko 1.9+ feature, this will have no effect on earlier versions.
  • before: The element immediately before the splitter is collapsed.
  • after: The element immediately after the splitter is collapsed.

[edit] Properties

Inherited from XUL element
align, allowEvents, boxObject, builder, className, collapsed, contextMenu, controllers, currentItem, database, datasources, dir, flex, height, hidden, id, left, listBoxObject, maxHeight, maxWidth, menu, minHeight, minWidth, observes, ordinal, orient, pack, persist, ref, resource, statusText, style, tooltip, tooltipText, top, value, width

Inherited from DOM element
attributes, childNodes, cloneNode, firstChild, lastChild, localName, namespaceURI, nextSibling, nodeName, nodeType, nodeValue, ownerDocument, parentNode, prefix, previousSibling, tagName

[edit] Methods

Inherited from XUL element
blur, click, doCommand, focus, getElementsByAttribute

Inherited from DOM element
addEventListener, appendChild, dispatchEvent, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, hasAttribute, hasAttributeNS, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, removeEventListener, replaceChild, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS

[edit] Style classes

The following classes may be used to style the element. These classes should be used instead of changing the style of the element directly since they will fit more naturally with the user's selected theme.

tree-splitter
This splitter is intended to be used in tree columns (in-between treecol elements). The splitter will be drawn with no width so that it isn't visible, however, the columns may still be resized.


	<tree id="tree1" flex="1" height="300" enableColumnDrag="true">
	  <treecols>
    	    <treecol id="name" label="Name" flex="1"/>
	    <splitter class="tree-splitter"/>
    	    <treecol id="id" label="ID" flex="1"/>
	    <splitter class="tree-splitter"/>
    	    <treecol id="date" label="Date" flex="1"/>
	    <splitter class="tree-splitter"/>
	  </treecols>
	  <treechildren/>
	</tree>

[edit] Related

TBD