From d02653406dcdb0a33529f5c7f1f783d8c8ccd79d Mon Sep 17 00:00:00 2001
From: treectrl
@@ -539,11 +543,10 @@ Database Name: showButtons
pathName item element cget itemDesc column element option pathName item element configure itemDesc column element ?option? ?value? ?option value ...?
-pathName item element perstate itemDesc column element option ?stateList?
-pathName item expand itemDesc ?-recurse?
-pathName item firstchild parent ?child?
-pathName item id itemDesc
-pathName item image itemDesc ?column? ?image? ?column image ...?
-pathName item isancestor itemDesc descendant
-pathName item isopen itemDesc
-pathName item lastchild parent ?child?
-pathName item nextsibling sibling ?next?
-pathName item numchildren itemDesc
-pathName item order itemDesc ?-visible?
-pathName item parent itemDesc
-pathName item prevsibling sibling ?prev?
-pathName item range first last
-pathName item remove itemDesc
-pathName item rnc itemDesc
-pathName item sort itemDesc ?option ...?
-pathName item span itemDesc ?column? ?numColumns? ?column numColumns ...?
-pathName item state command itemDesc ?arg ...?
-pathName item state forcolumn itemDesc column ?stateDescList?
-pathName item state get itemDesc ?stateName?
-pathName item state set itemDesc ?lastItem? stateDescList
-pathName item style command itemDesc ?arg ...?
-pathName item style elements itemDesc column
-pathName item style map itemDesc column style map
-pathName item style set itemDesc ?column? ?style? ?column style ...?
-pathName item text itemDesc ?column? ?text? ?column text ...?
-pathName item toggle itemDesc ?-recurse?
-pathName marquee option ?arg ...?
-pathName marquee anchor ?x y?
-pathName marquee cget option
-pathName marquee configure ?option? ?value? ?option value ...?
-pathName marquee coords ?x1 y1 x2 y2?
-pathName marquee corner ?x y?
-pathName marquee identify
-pathName notify option ?arg ...?
-pathName notify bind ?object? ?pattern? ?+??script?
-pathName notify configure object pattern ?option? ?value? ?option value ...?
-pathName notify detailnames eventName
-pathName notify eventnames
-pathName notify generate pattern ?charMap? ?percentsCommand?
-pathName notify install pattern ?percentsCommand?
-pathName notify install detail eventName detail ?percentsCommand?
-pathName notify install event eventName ?percentsCommand?
-pathName notify linkage pattern
-pathName notify linkage eventName ?detail?
-pathName notify unbind object ?pattern?
-pathName notify uninstall pattern
-pathName notify uninstall detail eventName detail
-pathName notify uninstall event eventName
-pathName numcolumns
-pathName numitems
-pathName orphans
-pathName range first last
-pathName state option ?stateName?
-pathName state define stateName
-pathName state linkage stateName
-pathName state names
-pathName state undefine ?stateName ...?
-pathName see itemDesc
-pathName selection option arg
-pathName selection add first ?last?
-pathName selection anchor ?itemDesc?
-pathName selection clear ?first? ?last?
-pathName selection count
-pathName selection get
-pathName selection includes itemDesc
-pathName selection modify select deselect
-pathName style option ?element? ?arg arg ...?
-pathName style cget style option
-pathName style configure style ?option? ?value? ?option value ...?
-pathName style create style ?option value ...?
-pathName style delete ?style ...?
-pathName style elements style ?elementList?
-pathName style layout style element ?option? ?value? ?option value ...?
-pathName style names
-pathName toggle ?-recurse? ?itemDesc ...?
-pathName xview ?args?
-pathName xview
-pathName xview moveto fraction
-pathName xview scroll number what
-pathName yview ?args?
-pathName yview
-pathName yview moveto fraction
+pathName yview scroll number what
+pathName item enabled itemDesc ?boolean?
+pathName item expand itemDesc ?-recurse?
+pathName item firstchild parent ?child?
+pathName item id itemDesc
+pathName item image itemDesc ?column? ?image? ?column image ...?
+pathName item isancestor itemDesc descendant
+pathName item isopen itemDesc
+pathName item lastchild parent ?child?
+pathName item nextsibling sibling ?next?
+pathName item numchildren itemDesc
+pathName item order itemDesc ?-visible?
+pathName item parent itemDesc
+pathName item prevsibling sibling ?prev?
+pathName item range first last
+pathName item remove itemDesc
+pathName item rnc itemDesc
+pathName item sort itemDesc ?option ...?
+pathName item span itemDesc ?column? ?numColumns? ?column numColumns ...?
+pathName item state command itemDesc ?arg ...?
+pathName item state forcolumn itemDesc column ?stateDescList?
+pathName item state get itemDesc ?stateName?
+pathName item state set itemDesc ?lastItem? stateDescList
+pathName item style command itemDesc ?arg ...?
+pathName item style elements itemDesc column
+pathName item style map itemDesc column style map
+pathName item style set itemDesc ?column? ?style? ?column style ...?
+pathName item text itemDesc ?column? ?text? ?column text ...?
+pathName item toggle itemDesc ?-recurse?
+pathName marquee option ?arg ...?
+pathName marquee anchor ?x y?
+pathName marquee cget option
+pathName marquee configure ?option? ?value? ?option value ...?
+pathName marquee coords ?x1 y1 x2 y2?
+pathName marquee corner ?x y?
+pathName marquee identify
+pathName notify option ?arg ...?
+pathName notify bind ?object? ?pattern? ?+??script?
+pathName notify configure object pattern ?option? ?value? ?option value ...?
+pathName notify detailnames eventName
+pathName notify eventnames
+pathName notify generate pattern ?charMap? ?percentsCommand?
+pathName notify install pattern ?percentsCommand?
+pathName notify install detail eventName detail ?percentsCommand?
+pathName notify install event eventName ?percentsCommand?
+pathName notify linkage pattern
+pathName notify linkage eventName ?detail?
+pathName notify unbind object ?pattern?
+pathName notify uninstall pattern
+pathName notify uninstall detail eventName detail
+pathName notify uninstall event eventName
+pathName numcolumns
+pathName numitems
+pathName orphans
+pathName range first last
+pathName scan option args
+pathName scan mark x y
+pathName scan dragto x y ?gain?
+pathName state option ?stateName?
+pathName state define stateName
+pathName state linkage stateName
+pathName state names
+pathName state undefine ?stateName ...?
+pathName see itemDesc
+pathName selection option arg
+pathName selection add first ?last?
+pathName selection anchor ?itemDesc?
+pathName selection clear ?first? ?last?
+pathName selection count
+pathName selection get
+pathName selection includes itemDesc
+pathName selection modify select deselect
+pathName style option ?element? ?arg arg ...?
+pathName style cget style option
+pathName style configure style ?option? ?value? ?option value ...?
+pathName style create style ?option value ...?
+pathName style delete ?style ...?
+pathName style elements style ?elementList?
+pathName style layout style element ?option? ?value? ?option value ...?
+pathName style names
+pathName toggle ?-recurse? ?itemDesc ...?
+pathName xview ?args?
+pathName xview
+pathName xview moveto fraction
+pathName xview scroll number what
+pathName yview ?args?
+pathName yview
+pathName yview moveto fraction pathName yview scroll number what DESCRIPTION
Database Class: ShowButtons
@@ -580,8 +583,9 @@ Database Name: showRootButton
Database Class: ShowRootButton
@@ -1561,7 +1565,14 @@ and dynamic, see STATES) is used in place of the current s
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+The word QUALIFIERS above represents a list of zero or more of the
+following terms that changes which item is chosen:
+
+
-
-
-
-
-
-
-
@@ -3450,13 +3487,13 @@ Use the item one column to the left in the same row.
Use the item of the first column in the same row.
-
-
@@ -3464,12 +3501,12 @@ Use the next sibling of the item.
Use the parent of the item.
-
-
@@ -3481,7 +3518,7 @@ Use the item one column to the right in the same row.
Use the item of the last column in the same row.
-
@@ -3489,6 +3526,34 @@ Use the nth child of the item's parent.
Use the item in the first row of this column.
+
+To get the first item in the list that is enabled:
+
+$T item id "first state enabled"
+
+$T item id "first state !open" + |
+$T item id "first visible" + |
diff --git a/doc/treectrl.man b/doc/treectrl.man index 6dc91cb..f146735 100644 --- a/doc/treectrl.man +++ b/doc/treectrl.man @@ -3,7 +3,7 @@ See the file "license.terms" for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - $Id: treectrl.man,v 1.34 2006/09/08 22:10:04 treectrl Exp $} + $Id: treectrl.man,v 1.35 2006/09/16 20:04:52 treectrl Exp $} ][manpage_begin treectrl n 2.1.1] [moddesc {Tk Commands}] [titledesc {Create and manipulate hierarchical multicolumn widgets}] @@ -245,11 +245,10 @@ or [const extended]; the default value is [const browse]. [tkoption_def -showbuttons showButtons ShowButtons] Specifies a boolean value that determines whether this widget -displays a button to the left of any item. -If the button is actually drawn can be configured for every item -with the [cmd {item hasbutton}] widget command, but if this option is -set to false, the configuration of an item has no effect. +leaves indentation space to display the expand/collapse buttons next to items. The default value is true. +The item option [option -button] determines whether any item has a button. +See also the treectrl option [option -showrootbutton]. [tkoption_def -showheader showHeader ShowHeader] Specifies a boolean value that determines whether this widget @@ -270,8 +269,9 @@ The default value is true. [tkoption_def -showrootbutton showRootButton ShowRootButton] Specifies a boolean value that determines whether this widget -should draw a button before the root item. -The default value is false. +leaves indentation space to display the expand/collapse button next to the +root item. The default value is false. +The item option [option -button] determines whether the root item has a button. [tkoption_def -showrootlines showRootLines ShowRootLines] Specifies a boolean value that determines whether this widget @@ -1089,6 +1089,11 @@ and dynamic, see [sectref STATES]) is used in place of the current state for [list_end] +[call [arg pathName] [cmd {item enabled}] [arg itemDesc] [opt [arg boolean]]] +Returns 1 if the item described by [arg itemDesc] has the +state [const enabled] switched on, 0 otherwise. If [arg boolean] is specified, +the [const enabled] state is set accordingly. + [call [arg pathName] [cmd {item expand}] [arg itemDesc] [opt [option -recurse]]] Switches on the [const open] state of the item(s) described by [arg itemDesc]. If the item has descendants, they are now displayed. @@ -1655,6 +1660,29 @@ by means of the [cmd {item remove}] widget command. The root item is not returne [call [arg pathName] [cmd range] [arg first] [arg last]] Deprecated. Use the [cmd {item range}] command instead. +[call [arg pathName] [cmd scan] [arg option] [arg args]] +This command is used to implement scanning on treectrls. It has two forms, +depending on [arg option]: +[list_begin definitions] + +[call [arg pathName] [cmd {scan mark}] [arg x] [arg y]] +Records [arg x] and [arg y] and the treectrl's current view; used in conjunction with +later [cmd {scan dragto}] commands. Typically this command is associated with a +mouse button press in the widget and [arg x] and [arg y] are the coordinates of the +mouse. It returns an empty string. + +[call [arg pathName] [cmd {scan dragto}] [arg x] [arg y] [opt [arg gain]]] +This command computes the difference between its [arg x] and [arg y] arguments (which +are typically mouse coordinates) and the [arg x] and [arg y] arguments to the last +[cmd {scan mark}] command for the widget. It then adjusts the view by [arg gain] +times the difference in coordinates, where [arg gain] defaults to 10. This +command is typically associated with mouse motion events in the widget, +to produce the effect of dragging the treectrl at high speed through its window. +The return value is an empty string. +[list_end] + + + [call [arg pathName] [cmd state] [arg option] [opt [arg stateName]]] This command is used to manipulate the list of user-defined states, see section [sectref STATES] below. @@ -2290,8 +2318,10 @@ the root item will become the active item. This state can be modified by means of the widget command [cmd activate]. [lst_item [const enabled]] -This state is set for every item, when it is created. -It cannot be modified. +This state is set for every item when it is created. +Disabled items cannot be selected and are ignored by the default bindings +when navigating via the keyboard. +This state can be modified by means of the widget command [cmd {item enabled}]. [lst_item [const focus]] This state is set for every item, @@ -2667,18 +2697,14 @@ Indicates the anchor item of the selection, i.e. normally the item specified as argument of the last successful [cmd {selection anchor}] widget command, or the root item if no such call happened yet. -[lst_item "[const first] [opt [const visible]]"] -Indicates the first item of the treectrl, i.e. the root item. -If [const visible] is specified and the widget is configured with -[option -showroot] [const no], the first visible child of the root node -is specified instead. +[lst_item "[const first] [arg QUALIFIERS]"] +Indicates the first item of the treectrl (the root item), +or the first item matching [arg QUALIFIERS]. -[lst_item "[const end] [opt [const visible]]"] -[lst_item "[const last] [opt [const visible]]"] -Indicates the last item of the treectrl. -If [const visible] is specified and the last item is currently not visible, -i.e. one of its father nodes is collapsed, -the last visible item is specified instead. +[lst_item "[const end] [arg QUALIFIERS]"] +[lst_item "[const last] [arg QUALIFIERS]"] +Indicates the last item of the treectrl, +or the last item matching [arg QUALIFIERS]. [lst_item "[const nearest] [arg {x y}]"] Indicates the item nearest to the point given by [arg x] and [arg y]. @@ -2688,7 +2714,7 @@ Indicates the item in the given [arg row] and [arg column]. The row and column corresponds to the on-screen arrangement of items as determined by the -orient and -wrap options. -You can memorize [const rnc] as abbreviation of "row 'n' column". +You can memorize [const rnc] as an abbreviation of "row 'n' column". [lst_item [const root]] Indicates the root item of the treectrl. @@ -2711,13 +2737,13 @@ Use the item one row below in this column. [lst_item [const bottom]] Use the item in the last row of this column. -[lst_item "[const child] [arg n] [opt [const visible]]"] +[lst_item "[const child] [arg n] [arg QUALIFIERS]"] Use the [arg n]th child of the item. -[lst_item "[const firstchild] [opt [const visible]]"] +[lst_item "[const firstchild] [arg QUALIFIERS]"] Use the first child of the item. -[lst_item "[const lastchild] [opt [const visible]]"] +[lst_item "[const lastchild] [arg QUALIFIERS]"] Use the last child of the item. [lst_item [const left]] @@ -2726,22 +2752,22 @@ Use the item one column to the left in the same row. [lst_item [const leftmost]] Use the item of the first column in the same row. -[lst_item "[const next] [opt [const visible]]"] -Use the next item, which is the first existant (or visible) item of the +[lst_item "[const next] [arg QUALIFIERS]"] +Use the next item, which is the first item from the following list: the first child, the next sibling or the next sibling of -the nearest parent which has one. +the nearest ancestor which has one. -[lst_item "[const nextsibling] [opt [const visible]]"] +[lst_item "[const nextsibling] [arg QUALIFIERS]"] Use the next sibling of the item. [lst_item [const parent]] Use the parent of the item. -[lst_item "[const prev] [opt [const visible]]"] +[lst_item "[const prev] [arg QUALIFIERS]"] Use the last child of the previous sibling, or the parent if there is no previous sibling. -[lst_item "[const prevsibling] [opt [const visible]]"] +[lst_item "[const prevsibling] [arg QUALIFIERS]"] Use the previous sibling of the item. [lst_item [const right]] @@ -2750,13 +2776,40 @@ Use the item one column to the right in the same row. [lst_item [const rightmost]] Use the item of the last column in the same row. -[lst_item "[const sibling] [arg n] [opt [const visible]]"] +[lst_item "[const sibling] [arg n] [arg QUALIFIERS]"] Use the [arg n]th child of the item's parent. [lst_item [const top]] Use the item in the first row of this column. [list_end] +The word [arg QUALIFIERS] above represents a list of zero or more of the +following terms that changes which item is chosen: + +[list_begin definitions] +[lst_item "[const state] [arg stateList]"] +[arg StateList] is a list of item state names (static and dynamic, see [sectref STATES]). +Only items that have the given states set (or unset if the '!' prefix is used) +are considered. +[nl] +To get the first item in the list that is enabled: +[example_begin] +$T item id "first state enabled" +[example_end] +To get the first item in the list that is not open: +[example_begin] +$T item id "first state !open" +[example_end] + +[lst_item [const visible]] +When this qualifier is given, only items that are displayed are considered. +[nl] +To get the first item in the list that is displayed: +[example_begin] +$T item id "first visible" +[example_end] +[list_end] + [section {EVENTS AND SCRIPT SUBSTITUTIONS}] The [arg script] argument to [cmd {notify bind}] is a Tcl script, which will be diff --git a/doc/treectrl.n b/doc/treectrl.n index e39e5a6..06c5ea8 100644 --- a/doc/treectrl.n +++ b/doc/treectrl.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" $Id: treectrl.n,v 1.50 2006/09/08 22:10:04 treectrl Exp $ +'\" $Id: treectrl.n,v 1.51 2006/09/16 20:04:52 treectrl Exp $ .so man.macros .TH "treectrl" n 2.1.1 treectrl "Tk Commands" .BS @@ -149,6 +149,8 @@ package require \fBtreectrl 2.1.1\fR .sp \fIpathName\fR \fBitem element perstate\fR \fIitemDesc\fR \fIcolumn\fR \fIelement\fR \fIoption\fR ?\fIstateList\fR? .sp +\fIpathName\fR \fBitem enabled\fR \fIitemDesc\fR ?\fIboolean\fR? +.sp \fIpathName\fR \fBitem expand\fR \fIitemDesc\fR ?\fB-recurse\fR? .sp \fIpathName\fR \fBitem firstchild\fR \fIparent\fR ?\fIchild\fR? @@ -255,6 +257,12 @@ package require \fBtreectrl 2.1.1\fR .sp \fIpathName\fR \fBrange\fR \fIfirst\fR \fIlast\fR .sp +\fIpathName\fR \fBscan\fR \fIoption\fR \fIargs\fR +.sp +\fIpathName\fR \fBscan mark\fR \fIx\fR \fIy\fR +.sp +\fIpathName\fR \fBscan dragto\fR \fIx\fR \fIy\fR ?\fIgain\fR? +.sp \fIpathName\fR \fBstate\fR \fIoption\fR ?\fIstateName\fR? .sp \fIpathName\fR \fBstate define\fR \fIstateName\fR @@ -740,11 +748,10 @@ Database Class: \fBShowButtons\fR .fi .IP Specifies a boolean value that determines whether this widget -displays a button to the left of any item. -If the button is actually drawn can be configured for every item -with the \fBitem hasbutton\fR widget command, but if this option is -set to false, the configuration of an item has no effect. +leaves indentation space to display the expand/collapse buttons next to items. The default value is true. +The item option \fB-button\fR determines whether any item has a button. +See also the treectrl option \fB-showrootbutton\fR. .LP .nf .ta 6c @@ -793,8 +800,9 @@ Database Class: \fBShowRootButton\fR .fi .IP Specifies a boolean value that determines whether this widget -should draw a button before the root item. -The default value is false. +leaves indentation space to display the expand/collapse button next to the +root item. The default value is false. +The item option \fB-button\fR determines whether the root item has a button. .LP .nf .ta 6c @@ -1641,6 +1649,11 @@ and dynamic, see \fBSTATES\fR) is used in place of the current state for \fIitem\fR and \fIcolumn.\fR .RE .TP +\fIpathName\fR \fBitem enabled\fR \fIitemDesc\fR ?\fIboolean\fR? +Returns 1 if the item described by \fIitemDesc\fR has the +state \fBenabled\fR switched on, 0 otherwise. If \fIboolean\fR is specified, +the \fBenabled\fR state is set accordingly. +.TP \fIpathName\fR \fBitem expand\fR \fIitemDesc\fR ?\fB-recurse\fR? Switches on the \fBopen\fR state of the item(s) described by \fIitemDesc\fR. If the item has descendants, they are now displayed. @@ -2162,6 +2175,27 @@ by means of the \fBitem remove\fR widget command. The root item is not returned. \fIpathName\fR \fBrange\fR \fIfirst\fR \fIlast\fR Deprecated. Use the \fBitem range\fR command instead. .TP +\fIpathName\fR \fBscan\fR \fIoption\fR \fIargs\fR +This command is used to implement scanning on treectrls. It has two forms, +depending on \fIoption\fR: +.RS +.TP +\fIpathName\fR \fBscan mark\fR \fIx\fR \fIy\fR +Records \fIx\fR and \fIy\fR and the treectrl's current view; used in conjunction with +later \fBscan dragto\fR commands. Typically this command is associated with a +mouse button press in the widget and \fIx\fR and \fIy\fR are the coordinates of the +mouse. It returns an empty string. +.TP +\fIpathName\fR \fBscan dragto\fR \fIx\fR \fIy\fR ?\fIgain\fR? +This command computes the difference between its \fIx\fR and \fIy\fR arguments (which +are typically mouse coordinates) and the \fIx\fR and \fIy\fR arguments to the last +\fBscan mark\fR command for the widget. It then adjusts the view by \fIgain\fR +times the difference in coordinates, where \fIgain\fR defaults to 10. This +command is typically associated with mouse motion events in the widget, +to produce the effect of dragging the treectrl at high speed through its window. +The return value is an empty string. +.RE +.TP \fIpathName\fR \fBstate\fR \fIoption\fR ?\fIstateName\fR? This command is used to manipulate the list of user-defined states, see section \fBSTATES\fR below. @@ -2774,8 +2808,10 @@ the root item will become the active item. This state can be modified by means of the widget command \fBactivate\fR. .TP \fBenabled\fR -This state is set for every item, when it is created. -It cannot be modified. +This state is set for every item when it is created. +Disabled items can not be selected and are ignored by the default bindings +when navigating via the keyboard. +This state can be modified by means of the widget command \fBitem enabled\fR. .TP \fBfocus\fR This state is set for every item, @@ -3125,19 +3161,15 @@ Indicates the anchor item of the selection, i.e. normally the item specified as argument of the last successful \fBselection anchor\fR widget command, or the root item if no such call happened yet. .TP -\fBfirst\fR ?\fBvisible\fR? -Indicates the first item of the treectrl, i.e. the root item. -If \fBvisible\fR is specified and the widget is configured with -\fB-showroot\fR \fBno\fR, the first visible child of the root node -is specified instead. +\fBfirst\fR \fIQUALIFIERS\fR +Indicates the first item of the treectrl (the root item), +or the first item matching \fIQUALIFIERS\fR. .TP -\fBend\fR ?\fBvisible\fR? +\fBend\fR \fIQUALIFIERS\fR .TP -\fBlast\fR ?\fBvisible\fR? -Indicates the last item of the treectrl. -If \fBvisible\fR is specified and the last item is currently not visible, -i.e. one of its father nodes is collapsed, -the last visible item is specified instead. +\fBlast\fR \fIQUALIFIERS\fR +Indicates the last item of the treectrl, +or the last item matching \fIQUALIFIERS\fR. .TP \fBnearest\fR \fIx y\fR Indicates the item nearest to the point given by \fIx\fR and \fIy\fR. @@ -3147,7 +3179,7 @@ Indicates the item in the given \fIrow\fR and \fIcolumn\fR. The row and column corresponds to the on-screen arrangement of items as determined by the -orient and -wrap options. -You can memorize \fBrnc\fR as abbreviation of "row 'n' column". +You can memorize \fBrnc\fR as an abbreviation of "row 'n' column". .TP \fBroot\fR Indicates the root item of the treectrl. @@ -3167,13 +3199,13 @@ Use the item one row below in this column. \fBbottom\fR Use the item in the last row of this column. .TP -\fBchild\fR \fIn\fR ?\fBvisible\fR? +\fBchild\fR \fIn\fR \fIQUALIFIERS\fR Use the \fIn\fRth child of the item. .TP -\fBfirstchild\fR ?\fBvisible\fR? +\fBfirstchild\fR \fIQUALIFIERS\fR Use the first child of the item. .TP -\fBlastchild\fR ?\fBvisible\fR? +\fBlastchild\fR \fIQUALIFIERS\fR Use the last child of the item. .TP \fBleft\fR @@ -3182,22 +3214,22 @@ Use the item one column to the left in the same row. \fBleftmost\fR Use the item of the first column in the same row. .TP -\fBnext\fR ?\fBvisible\fR? -Use the next item, which is the first existant (or visible) item of the +\fBnext\fR \fIQUALIFIERS\fR +Use the next item, which is the first item from the following list: the first child, the next sibling or the next sibling of -the nearest parent which has one. +the nearest ancestor which has one. .TP -\fBnextsibling\fR ?\fBvisible\fR? +\fBnextsibling\fR \fIQUALIFIERS\fR Use the next sibling of the item. .TP \fBparent\fR Use the parent of the item. .TP -\fBprev\fR ?\fBvisible\fR? +\fBprev\fR \fIQUALIFIERS\fR Use the last child of the previous sibling, -or the parent if there is no previos sibling. +or the parent if there is no previous sibling. .TP -\fBprevsibling\fR ?\fBvisible\fR? +\fBprevsibling\fR \fIQUALIFIERS\fR Use the previous sibling of the item. .TP \fBright\fR @@ -3206,11 +3238,41 @@ Use the item one column to the right in the same row. \fBrightmost\fR Use the item of the last column in the same row. .TP -\fBsibling\fR \fIn\fR ?\fBvisible\fR? +\fBsibling\fR \fIn\fR \fIQUALIFIERS\fR Use the \fIn\fRth child of the item's parent. .TP \fBtop\fR Use the item in the first row of this column. +The word \fIQUALIFIERS\fR above represents a list of zero or more of the +following terms that changes which item is chosen: +.TP +\fBstate\fR \fIstateList\fR +\fIStateList\fR is a list of item state names (static and dynamic, see \fBSTATES\fR). +Only items that have the given states set (or unset if the '!' prefix is used) +are considered. +.sp +To get the first item in the list that is enabled: +.nf + +$T item id "first state enabled" + +.fi +To get the first item in the list that is not open: +.nf + +$T item id "first state !open" + +.fi +.TP +\fBvisible\fR +When this qualifier is given, only items that are displayed are considered. +.sp +To get the first item in the list that is displayed: +.nf + +$T item id "first visible" + +.fi .SH "EVENTS AND SCRIPT SUBSTITUTIONS" The \fIscript\fR argument to \fBnotify bind\fR is a Tcl script, which will be evaluated whenever the given event is generated. \fIScript\fR will be executed -- cgit v0.12