|
IDL Reference Guide: IDL GUIBuilder Widget Reference |
|
Tree widgets present a hierarchical view that can be used to organize a wide variety of data structures and information.
When you first create a tree widget, it appears in the interface as a blank control, containing no nodes. To add nodes to the tree widget, right-click on the tree widget and select Edit Tree from the context menu. See Using the Tree Editor for details on constructing a a tree hierarchy.
When programming in IDL, you create tree widgets using the WIDGET_TREE function. For more information, see WIDGET_TREE.
For tree widgets, you can set common attributes and tree-specific attributes. For a list of common attributes, see Common Attributes. These are the tree widget-specific attributes:
The Multiple Selection attribute determines whether the tree widget can perform multiple selection operations. Set this property to True to enable multiple selection, which allows the user to select multiple tree nodes by holding down the Control key while selecting with the mouse. By default this property is set to False.
In the generated *.pro file, this value is specified with the MULTIPLE keyword to the widget creation routine.
The Tab Mode attribute specifies what support the widget has for receiving or losing focus through tabbing. By default, this value is set to Inherit.
| Note It is not possible to tab to disabled (Sensitive = False) or hidden (Visible = False) widgets. |
Allowable values are:
| Note The default tab mode of a widget is Inherit. The tabbing support defined for the parent base, described in Base Widget Attributes, is inherited by widget children unless otherwise specified. |
| Note In widget applications on the UNIX platform, the Motif library controls what widgets are brought into and released from focus using tabbing. The TAB_MODE keyword value is always zero, and any attempt to change it is ignored when running a widget application on the UNIX platform. Tabbing behavior may vary significantly between UNIX platforms; do not rely on a particular behavior being duplicated on all UNIX systems. |
In the generated *.pro file, this value is specified with the TAB_MODE keyword to the widget creation routine. For more information on tabbing among widgets, see Tabbing in Widget Applications.
For tree widgets, you can set common event properties and tree-specific event properties. By default, event values are not set. For a list of events common to all widgets, see Common Events.
These are the tree widget-specific event properties:
The OnContextEvent value is the routine name that is called when the user clicks the right-hand mouse button over the tree widget. In the generated *_eventcb.pro file, the event calling sequence looks like this:
pro <RoutineName>, Event
where RoutineName is the name of the event procedure you specify. Event is the event structure returned when the user clicks the right-hand mouse button and is of the following type:
{WIDGET_CONTEXT, ID:0L, TOP:0L, HANDLER:0L, X:0L, Y:0L}
The X and Y fields give the device coordinates at which the event occurred, measured from the upper left corner of the base widget.
The OnTreeExpand value is the routine that is called when a folder expand/collapse event is detected. When you set this value, the calling sequence looks like this in the generated *_eventcb.pro file:
pro <RoutineName>, Event
where RoutineName is the name of the event procedure you specify. Event is the event structure returned when a user changes the selected tab, and is of the following type:
{WIDGET_TREE_EXPAND, ID:0L, TOP:0L, HANDLER:0L, TYPE:1, EXPAND:0L}
The EXPAND field contains 1 (one) if the folder expanded or 0 (zero) if the folder collapsed.
The OnTreeSelect value is the routine that is called when the selection state of an item in the tree changes. When you set this value, the calling sequence looks like this in the generated *_eventcb.pro file:
pro <RoutineName>, Event
where RoutineName is the name of the event procedure you specify.
Event is the event structure returned when a user changes the selected tab, and is of the following type:
{WIDGET_TREE_SEL, ID:0L, TOP:0L, HANDLER:0L, TYPE:0, CLICKS:0L}
The CLICKS field indicates the number of mouse-button clicks that occurred when the event took place. This field contains 1 (one) when the item is selected, or 2 when the user double-clicks on the item.
IDL Online Help (March 06, 2007)