From 815149504a1d9ee231974b6f36dbb595c4b7f2bc Mon Sep 17 00:00:00 2001 From: treectrl Date: Mon, 23 May 2005 21:32:48 +0000 Subject: Added -columnprefix and -itemprefix options. Added "column dragcget" and "column dragconfigure" commands. Added all the dynamic events generated by the library scripts. Added example of . --- doc/treectrl.html | 667 +++++++++++++++++++++++++++++++++--------------------- doc/treectrl.man | 122 +++++++++- doc/treectrl.n | 141 +++++++++++- 3 files changed, 662 insertions(+), 268 deletions(-) diff --git a/doc/treectrl.html b/doc/treectrl.html index 0c8cccf..7c06911 100644 --- a/doc/treectrl.html +++ b/doc/treectrl.html @@ -1,10 +1,10 @@ - treectrl - Tk Commands - @@ -33,135 +33,137 @@ package require treectrl 2.0
pathName column count pathName column create ?option value ...? pathName column delete column -pathName column index column -pathName column id column -pathName column list ?-visible? -pathName column move column before -pathName column neededwidth column -pathName column order column ?-visible? -pathName column width column -pathName compare itemDesc1 op itemDesc2 -pathName configure ?option? ?value option value ...? -pathName contentbox -pathName debug option ?arg arg ...? -pathName debug cget element option -pathName debug configure element ?option? ?value? ?option value ...? -pathName debug dinfo -pathName debug scroll -pathName depth ?itemDesc? -pathName dragimage option ?arg ...? -pathName dragimage add itemDesc ?column? ?element? -pathName dragimage cget option -pathName dragimage clear -pathName dragimage configure ?option? ?value? ?option value ...? -pathName dragimage offset ?x y? -pathName element option ?element? ?arg arg ...? -pathName element cget element option -pathName element configure element ?option? ?value? ?option value ...? -pathName element create element type ?option value ...? -pathName element delete ?element ...? -pathName element names -pathName element type element -pathName expand ?-recurse? ?itemDesc ...? -pathName identify x y -pathName index itemDesc -pathName item option ?arg ...? -pathName item ancestors itemDesc -pathName item bbox itemDesc ?column? ?element? -pathName item cget itemDesc option -pathName item children itemDesc -pathName item collapse itemDesc ?-recurse? -pathName item compare itemDesc1 op itemDesc2 -pathName item complex itemDesc list ... -pathName item configure itemDesc ?option? ?value? ?option value ...? -pathName item count -pathName item create ?option value ...? -pathName item delete first ?last? -pathName item dump itemDesc -pathName item element command itemDesc column element ?arg ...? -pathName item element actual itemDesc column element option -pathName item element cget itemDesc column element option -pathName item element configure itemDesc column element ?option? ?value? ?option value ...? -pathName item expand itemDesc ?-recurse? -pathName item firstchild parent ?child? -pathName item id itemDesc -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 remove itemDesc -pathName item rnc itemDesc -pathName item sort itemDesc ?option ...? -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 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 column dragcget option +pathName column dragconfigure ?option? ?value? ?option value ...? +pathName column index column +pathName column id column +pathName column list ?-visible? +pathName column move column before +pathName column neededwidth column +pathName column order column ?-visible? +pathName column width column +pathName compare itemDesc1 op itemDesc2 +pathName configure ?option? ?value option value ...? +pathName contentbox +pathName debug option ?arg arg ...? +pathName debug cget element option +pathName debug configure element ?option? ?value? ?option value ...? +pathName debug dinfo +pathName debug scroll +pathName depth ?itemDesc? +pathName dragimage option ?arg ...? +pathName dragimage add itemDesc ?column? ?element? +pathName dragimage cget option +pathName dragimage clear +pathName dragimage configure ?option? ?value? ?option value ...? +pathName dragimage offset ?x y? +pathName element option ?element? ?arg arg ...? +pathName element cget element option +pathName element configure element ?option? ?value? ?option value ...? +pathName element create element type ?option value ...? +pathName element delete ?element ...? +pathName element names +pathName element type element +pathName expand ?-recurse? ?itemDesc ...? +pathName identify x y +pathName index itemDesc +pathName item option ?arg ...? +pathName item ancestors itemDesc +pathName item bbox itemDesc ?column? ?element? +pathName item cget itemDesc option +pathName item children itemDesc +pathName item collapse itemDesc ?-recurse? +pathName item compare itemDesc1 op itemDesc2 +pathName item complex itemDesc list ... +pathName item configure itemDesc ?option? ?value? ?option value ...? +pathName item count +pathName item create ?option value ...? +pathName item delete first ?last? +pathName item dump itemDesc +pathName item element command itemDesc column element ?arg ...? +pathName item element actual itemDesc column element option +pathName item element cget itemDesc column element option +pathName item element configure itemDesc column element ?option? ?value? ?option value ...? +pathName item expand itemDesc ?-recurse? +pathName item firstchild parent ?child? +pathName item id itemDesc +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 remove itemDesc +pathName item rnc itemDesc +pathName item sort itemDesc ?option ...? +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 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

DESCRIPTION

@@ -300,6 +302,17 @@ of the button to the left of an item in any of the forms acceptable to Tk_GetPixels.

+

Command-Line Switch: -columnprefix
+Database Name: columnPrefix
+Database Class: ColumnPrefix
+
+Specifies an ascii string that changes the way column ids are reported and +processed. If this option is a non-empty string, the usual integer value +of a column id is prefixed with the given string. This can aid debugging +but it is important your code doesn't assume column ids are integers if you +use it. + +

Command-Line Switch: -columnproxy
Database Name: columnProxy
Database Class: ColumnProxy
@@ -376,6 +389,17 @@ every item has the height requested by the arrangement of elements in each column. Items are never shorter than the maximum height of a button.

+
Command-Line Switch: -itemprefix
+Database Name: itemPrefix
+Database Class: ItemPrefix
+
+Specifies an ascii string that changes the way item ids are reported and +processed. If this option is a non-empty string, the usual integer value +of an item id is prefixed with the given string. This can aid debugging +but it is important your code doesn't assume item ids are integers if you +use it. + +

Command-Line Switch: -linecolor
Database Name: lineColor
Database Class: LineColor
@@ -734,12 +758,63 @@ Deletes the specified column from the treectrl widget. If all, all columns except the tail column are deleted.

-
pathName column index column
+
pathName column dragcget option
+ +
pathName column dragconfigure ?option? ?value? ?option value ...?
+ +The user can move a column within a treectrl by drag-and-drop. Feedback consists +of a semi-transparent photo image of the header of the column being dragged +and a 2-pixel-thick vertical line to indicate where the column may be dropped. +The drag image consists of a colored background rectangle plus the image and/or +text displayed in the column header. The 2-pixel-thick line will be drawn +over the left edge of the column before which the dragged column may be dropped. +

+ +The library scripts generate a <ColumnDrag-accept> event when the user has +successfully drag-and-drop'd a column. You will have to bind a script to this +event if you want to move the dragged column. +

+ +The following configuration options are supported: +

+
+
-enable boolean
+Controls whether the user is allowed to rearrange columns by drag-and-drop. + +

+
-imagealpha alpha
+Alpha is an integer from 0 (invisible) to 255 (opaque) controlling the +transparency of the drag image. Any value outside this range is clipped. + +

+
-imagecolor background
+Background is the color of the drag image background rectangle. + +

+
-imagecolumn column
+Column specifies the column to create the drag image from. + +

+
-imageoffset offset
+Offset is the horizontal screen distance the drag image is offset from its +starting position. + +

+
-indicatorcolor color
+Color is the color of the 2-pixel-thick line. + +

+
-indicatorcolumn column
+The 2-pixel-thick line will be drawn over the left edge of column. + +
+ +
pathName column index column
-Deprecated. Use column id +Deprecated. Use column id instead.

-
pathName column id column
+
pathName column id column
This command resolves the column description column into a unique column identifier (see COLUMN DESCRIPTION below). @@ -747,14 +822,14 @@ If the column described by column doesn't exist, this command an empty string.

-
pathName column list ?-visible?
+
pathName column list ?-visible?
This command returns a list of identifiers for every column (except the tail) from left to right. If -visible is given, only columns whose -visible option is true are returned.

-
pathName column move column before
+
pathName column move column before
Moves the specified column to the left of the column specified by before. @@ -762,7 +837,7 @@ If before is the string tail, the column column will become the last column.

-
pathName column neededwidth column
+
pathName column neededwidth column
This command returns a decimal string giving the needed width of the column specified by column. @@ -770,7 +845,7 @@ The needed width is the maximum of the width of the column header and the width of the widest currently visible item.

-
pathName column order column ?-visible?
+
pathName column order column ?-visible?
This command returns a decimal string giving the position of column in the list of columns starting from zero for the leftmost column. @@ -779,7 +854,7 @@ option is true are considered, and -1 is returned if column's option is false.

-
pathName column width column
+
pathName column width column
This command returns a decimal string giving the width in pixels of the column specified by column, @@ -787,12 +862,12 @@ even if the treectrl is configured to not display the column headers by means of the -showheader option. -
pathName compare itemDesc1 op itemDesc2
+
pathName compare itemDesc1 op itemDesc2
Deprecated. Use the item compare command instead.

-
pathName configure ?option? ?value option value ...?
+
pathName configure ?option? ?value option value ...?
Query or modify the configuration options of the widget. If no option is specified, returns a list describing all of @@ -808,7 +883,7 @@ this case the command returns an empty string. command.

-
pathName contentbox
+
pathName contentbox
Returns a list with four elements giving an approximate bounding box for the space used to display the items inside the columns, @@ -816,7 +891,7 @@ i.e. the space of the treectrl widget without the surrounding borders and the column headers.

-
pathName debug option ?arg arg ...?
+
pathName debug option ?arg arg ...?
This command is used to facilitate debugging of the treectrl widget. The exact behavior of the command depends on the option argument @@ -825,7 +900,7 @@ The following forms of the command are supported:

-
pathName debug cget element option
+
pathName debug cget element option
This command returns the current value of the debugging option named option. @@ -833,7 +908,7 @@ named option. debug configure widget command.

-
pathName debug configure element ?option? ?value? ?option value ...?
+
pathName debug configure element ?option? ?value? ?option value ...?
This command is similar to the configure widget command except that it modifies debugging options @@ -889,7 +964,7 @@ Setting this option has only an effect, if the debugging options -enable and -display are switched on.
-
pathName debug dinfo
+
pathName debug dinfo
For every of the treectrl widget a line with some internal valuess info about all items @@ -897,12 +972,12 @@ is printed to stdout. The command returns the empty string.

-
pathName debug scroll
+
pathName debug scroll
Returns a string useful for debugging vertical scrolling. -
pathName depth ?itemDesc?
+
pathName depth ?itemDesc?
If the additional argument itemDesc is specified, returns a decimal string giving the depth of @@ -912,7 +987,7 @@ If no itemDesc is specified, the maximum depth of all items in the treectrl widget is returned instead.

-
pathName dragimage option ?arg ...?
+
pathName dragimage option ?arg ...?
This command is used to manipulate the dragimage, one or more dotted lines around rectangular regions of the treectrl widget. @@ -922,7 +997,7 @@ The following forms of the command are supported:

-
pathName dragimage add itemDesc ?column? ?element?
+
pathName dragimage add itemDesc ?column? ?element?
Adds the shapes of the item described by itemDesc to the shapes of the dragimage. @@ -935,7 +1010,7 @@ If also element is specified, only a rectangle for this one e of the specified item in the given column is added.

-
pathName dragimage cget option
+
pathName dragimage cget option
This command returns the current value of the dragimage option named option. @@ -943,13 +1018,13 @@ named option. dragimage configure widget command.

-
pathName dragimage clear
+
pathName dragimage clear
Removes all shapes (if there are any) from the dragimage. This command does not modify the dragimage offset.

-
pathName dragimage configure ?option? ?value? ?option value ...?
+
pathName dragimage configure ?option? ?value? ?option value ...?
This command is similar to the configure widget command except that it modifies the dragimage options @@ -975,7 +1050,7 @@ Specifies a boolean value which determines whether the dragimage should currently be visible.
-
pathName dragimage offset ?x y?
+
pathName dragimage offset ?x y?
Returns a list containing the x and y offsets of the dragimage, if no additional arguments are specified. @@ -986,7 +1061,7 @@ sets the dragimage offset to the given coordinates x and -
pathName element option ?element? ?arg arg ...?
+
pathName element option ?element? ?arg arg ...?
This command is used to manipulate elements (see ELEMENTS below). The exact behavior of the command depends on the option argument @@ -995,7 +1070,7 @@ The following forms of the command are supported:

-
pathName element cget element option
+
pathName element cget element option
This command returns the current value of the option named option associated with the element given by element. @@ -1003,7 +1078,7 @@ associated with the element given by element. element configure widget command.

-
pathName element configure element ?option? ?value? ?option value ...?
+
pathName element configure element ?option? ?value? ?option value ...?
This command is similar to the configure widget command except that it modifies options associated with the element given by element @@ -1021,7 +1096,7 @@ in this case the command returns an empty string. See ELEMENTS below for details on the options available for elements.

-
pathName element create element type ?option value ...?
+
pathName element create element type ?option value ...?
Create a new elememt in pathName of type type with name element. @@ -1032,7 +1107,7 @@ on the syntax of this command. This command returns the name for the new element.

-
pathName element delete ?element ...?
+
pathName element delete ?element ...?
Deletes each of the named elements and returns an empty string. If an element is deleted while it is still configured @@ -1041,23 +1116,23 @@ by means of the style elements widget command, it is also removed from the element lists of these styles.

-
pathName element names
+
pathName element names
Returns a list containing the names of all existing elements.

-
pathName element type element
+
pathName element type element
Returns the type of the elements given by element, such as rect or text.
-
pathName expand ?-recurse? ?itemDesc ...?
+
pathName expand ?-recurse? ?itemDesc ...?
Use item expand instead.

-
pathName identify x y
+
pathName identify x y
Returns a list containing some diagnostics about what is displayed at the given windows coordinates x and y. @@ -1094,12 +1169,12 @@ if the x coordinate is to the right of the elements; nothing otherwise.

-
pathName index itemDesc
+
pathName index itemDesc
Deprecated. Use item id instead.

-
pathName item option ?arg ...?
+
pathName item option ?arg ...?
This command is used to manipulate items. The exact behavior of the command depends on the option argument @@ -1108,14 +1183,14 @@ The following forms of the command are supported:

-
pathName item ancestors itemDesc
+
pathName item ancestors itemDesc
Returns a list containing the numerical indexes of all ancestors of the item specified by itemDesc from its parent up to the root item.

-
pathName item bbox itemDesc ?column? ?element?
+
pathName item bbox itemDesc ?column? ?element?
Returns a list with four elements giving an approximate bounding box for the item described by itemDesc. @@ -1126,21 +1201,21 @@ the area of this element in column of the returned.

-
pathName item cget itemDesc option
+
pathName item cget itemDesc option
Returns the current value of the configuration option for the item specified by itemDesc whose name is option. Option may have any of the values accepted by the item create command when the item was created.

-
pathName item children itemDesc
+
pathName item children itemDesc
Returns a list containing the numerical indexes of all children of the item specified by itemDesc in the correct order from the first child to the last child.

-
pathName item collapse itemDesc ?-recurse?
+
pathName item collapse itemDesc ?-recurse?
Switches off the open state of the item(s) described by itemDesc. @@ -1160,7 +1235,7 @@ a <Collapse-before> event before the item state is change and a <Collapse-after> event after the item state was changed.

-
pathName item compare itemDesc1 op itemDesc2
+
pathName item compare itemDesc1 op itemDesc2
From both items described by the itemDescs the index is retrieved (as returned from the item order widget command). @@ -1171,7 +1246,7 @@ The return value of this command is 1 if the comparison evaluated to true, 0 otherwise.

-
pathName item complex itemDesc list ...
+
pathName item complex itemDesc list ...
Modifies the elements of the item described by itemDesc. For every column of the treectrl there may be specified one list, @@ -1183,7 +1258,7 @@ The corresponding value will overwrite the value of the eleme one column in this item.

-
pathName item configure itemDesc ?option? ?value? ?option value ...?
+
pathName item configure itemDesc ?option? ?value? ?option value ...?
If no option is specified, returns a list describing all of the available options for the item given by itemDesc (see Tk_ConfigureInfo for @@ -1197,7 +1272,7 @@ and values are the same as those permissible in the item create
-
pathName item count
+
pathName item count
Returns a decimal string giving the number of items created by the item create widget command which haven't been @@ -1205,7 +1280,7 @@ deleted by the item delete widget command, plus 1 for the eve root item.

-
pathName item create ?option value ...?
+
pathName item create ?option value ...?
Creates a new item and returns its unique identifier. The new item has the states open and enabled set by default. @@ -1238,7 +1313,7 @@ and b) each ancestor's -visible option is true
-
pathName item delete first ?last?
+
pathName item delete first ?last?
Deletes the specified item(s). First and last must be the string all or an itemDesc. @@ -1256,14 +1331,14 @@ There is no way to delete the root item of the treectrl widget; in all cases the specification of the root item is ignored.

-
pathName item dump itemDesc
+
pathName item dump itemDesc
Returns a list with six elements in the form index index indexVis indexVis neededHeight neededHeight.

-
pathName item element command itemDesc column element ?arg ...?
+
pathName item element command itemDesc column element ?arg ...?
This command is used to manipulate elements of the item. The exact behavior of the command depends on the command argument @@ -1272,7 +1347,7 @@ The following forms of the command are supported:

-
pathName item element actual itemDesc column element option
+
pathName item element actual itemDesc column element option
This command returns the current value of the configuration option named option associated with element inside column of the item described by @@ -1284,7 +1359,7 @@ was used. Otherwise the value of the configuration option of the underlying elem specified element (see ELEMENTS below)

-
pathName item element cget itemDesc column element option
+
pathName item element cget itemDesc column element option
This command returns the value of the option named option associated with element inside column of the item described by @@ -1293,7 +1368,7 @@ associated with element inside column of t specified element (see ELEMENTS below)

-
pathName item element configure itemDesc column element ?option? ?value? ?option value ...?
+
pathName item element configure itemDesc column element ?option? ?value? ?option value ...?
This command is similar to the configure widget command except that it modifies options associated with @@ -1312,7 +1387,7 @@ modifies the given option(s) to have the given value(s) in the in this case the command returns an empty string.
-
pathName item expand itemDesc ?-recurse?
+
pathName item expand itemDesc ?-recurse?
Switches on the open state of the item(s) described by itemDesc. If the item has descendants, they are now displayed. @@ -1331,7 +1406,7 @@ an <Expand-before> event before the item state is changed and an <Expand-after> event after the item state was changed.

-
pathName item firstchild parent ?child?
+
pathName item firstchild parent ?child?
If child is not specified, returns the numerical index of the first child of the item described by parent. @@ -1340,26 +1415,26 @@ that is not an ancestor of parent. Then it will become the new first child of parent.

-
pathName item id itemDesc
+
pathName item id itemDesc
This command resolves the item description itemDesc into a unique item identifier (see ITEM DESCRIPTION below). If the item described by itemDesc doesn't exist, this command returns an empty string.

-
pathName item isancestor itemDesc descendant
+
pathName item isancestor itemDesc descendant
Returns 1 if the item described by itemDesc is a direct or indirect parent of the item decribed by descendant, 0 otherwise.

-
pathName item isopen itemDesc
+
pathName item isopen itemDesc
Returns 1, if the item described by itemDesc has cuurently the state open switched on, 0 otherwise.

-
pathName item lastchild parent ?child?
+
pathName item lastchild parent ?child?
If child is not specified, returns the numerical index of the last child of the item described by parent. @@ -1368,7 +1443,7 @@ that is not an ancestor of parent. Then it will become the new last child of parent.

-
pathName item nextsibling sibling ?next?
+
pathName item nextsibling sibling ?next?
If next is not specified, returns the numerical index of the next sibling of the item described by sibling. @@ -1377,12 +1452,12 @@ that is not an ancestor of sibling. Then it will become the new next sibling of sibling.

-
pathName item numchildren itemDesc
+
pathName item numchildren itemDesc
Returns the number of children of the item described by itemDesc.

-
pathName item order itemDesc ?-visible?
+
pathName item order itemDesc ?-visible?
This command returns the position of the item itemDesc relative to its toplevel ancestor (usually the root item, unless the ancestor is an @@ -1393,13 +1468,13 @@ result of this command is the row the item falls in. If the optional argument is not visible.

-
pathName item parent itemDesc
+
pathName item parent itemDesc
Returns the numerical index of the parent of the item described by itemDesc.

-
pathName item prevsibling sibling ?prev?
+
pathName item prevsibling sibling ?prev?
If prev is not specified, returns the numerical index of the previous sibling of the item described by sibling. @@ -1408,19 +1483,19 @@ that is not an ancestor of sibling. Then it will become the new previous sibling of sibling.

-
pathName item remove itemDesc
+
pathName item remove itemDesc
Removes the item described by itemDesc from the children list of its father, so that it will become an orphan.

-
pathName item rnc itemDesc
+
pathName item rnc itemDesc
Returns a list of two integers, which corresponds to the row and column of the item described by itemDesc.

-
pathName item sort itemDesc ?option ...?
+
pathName item sort itemDesc ?option ...?
Sorts the children of the item described by itemDesc, and redisplays the tree with the items in the new order. @@ -1491,7 +1566,7 @@ Convert to integers and use integer comparison. Convert to floating-point values and use floating comparison. -
pathName item state command itemDesc ?arg ...?
+
pathName item state command itemDesc ?arg ...?
This command is used to manipulate the states of an item. The exact behavior of the command depends on the command argument @@ -1501,13 +1576,13 @@ The following forms of the command are supported:

-
pathName item state forcolumn itemDesc column ?stateDescList?
+
pathName item state forcolumn itemDesc column ?stateDescList?
Just like item state set but manipulates user-defined states for a single item column, not the item as a whole.

-
pathName item state get itemDesc ?stateName ...?
+
pathName item state get itemDesc ?stateName ...?
If no stateName is specified, returns a list containing the names of all (predefined and user defined) states @@ -1517,7 +1592,7 @@ If a stateName is specified, 0 otherwise.

-
pathName item state set itemDesc ?lastItem? ?stateDescList?
+
pathName item state set itemDesc ?lastItem? ?stateDescList?
Every element of stateDescList must describe a user defined state (see STATES below), @@ -1533,7 +1608,7 @@ then the state changes are made for all items of the treectrl widget.
-
pathName item style command itemDesc ?arg ...?
+
pathName item style command itemDesc ?arg ...?
This command is used to manipulate the styles of an item. The exact behavior of the command depends on the command argument @@ -1542,14 +1617,14 @@ The following forms of the command are supported:

-
pathName item style elements itemDesc column
+
pathName item style elements itemDesc column
A list is returned containing the currently defined elements of the style, which is set for the item described by itemDesc in column.

-
pathName item style map itemDesc column style map
+
pathName item style map itemDesc column style map
Like the item style set command, this command may be used to assign a style to a specific column of an item. Unlike item style set, this @@ -1562,7 +1637,7 @@ an element in the style specified by style. Both elementNew must be of the same type (bitmap, text etc).

-
pathName item style set itemDesc ?column? ?style? ?column style ...?
+
pathName item style set itemDesc ?column? ?style? ?column style ...?
If no column is specified, returns a list containing the names of the styles set for all columns of the item described by itemDesc. @@ -1574,7 +1649,7 @@ it must be column-style pairs; then the style(s) of item in column will be set to style.
-
pathName item text itemDesc column ?text? ?column text ...?
+
pathName item text itemDesc column ?text? ?column text ...?
If no text argument is specified, returns the text of the first text element in column for the item @@ -1587,7 +1662,7 @@ this command is provided as a convenience. Use the specific text element.

-
pathName item toggle itemDesc ?-recurse?
+
pathName item toggle itemDesc ?-recurse?
Changes the open state of the item(s) described by itemDesc. If the state is currently switched off, @@ -1600,7 +1675,7 @@ If -recurse is specified, the state of all descendants of -
pathName marquee option ?arg ...?
+
pathName marquee option ?arg ...?
This command is used to manipulate the marquee, a rectangular region of the treectrl widget @@ -1617,7 +1692,7 @@ The following forms of the command are supported:

-
pathName marquee anchor ?x y?
+
pathName marquee anchor ?x y?
Returns a list containing the x and y coordinates of the anchor, if no additional arguments are specified. @@ -1625,7 +1700,7 @@ If two coordinates are specified, sets the anchor to the given coordinates x and y.

-
pathName marquee cget option
+
pathName marquee cget option
This command returns the current value of the marquee option named option. @@ -1633,7 +1708,7 @@ named option. marquee configure widget command.

-
pathName marquee configure ?option? ?value? ?option value ...?
+
pathName marquee configure ?option? ?value? ?option value ...?
This command is similar to the configure widget command except that it modifies the marquee options @@ -1660,7 +1735,7 @@ whether the dotted line surrounding the region of the marquee should currently be visible.
-
pathName marquee coords ?x1 y1 x2 y2?
+
pathName marquee coords ?x1 y1 x2 y2?
Returns a list containing the x and y coordinates of the anchor followed by the x and y coordinates of the corner, @@ -1670,7 +1745,7 @@ sets the anchor to the given coordinates x1 and x2 and y2.

-
pathName marquee corner ?x y?
+
pathName marquee corner ?x y?
Returns a list containing the x and y coordinates of the corner, if no additional arguments are specified. @@ -1678,7 +1753,7 @@ If two coordinates are specified, sets the corner to the given coordinates x and y.

-
pathName marquee identify
+
pathName marquee identify
Returns a list with information about the items inside the marquee. The list has as elements a list itself @@ -1692,7 +1767,7 @@ if there are any. -
pathName notify option ?arg ...?
+
pathName notify option ?arg ...?
Many Tk widgets communicate with the outside world via -command callbacks and/or virtual events. For example, the Text widget @@ -1708,7 +1783,7 @@ The following forms of the command are supported:

-
pathName notify bind ?object? ?pattern? ?+??script?
+
pathName notify bind ?object? ?pattern? ?+??script?
This command associates Tcl scripts with events generated by a treectrl widget. @@ -1737,7 +1812,7 @@ for a window; otherwise it may be an arbitrary string. Unlike the regular that window is destroyed.

-
pathName notify configure object pattern ?option? ?value? ?option value ...?
+
pathName notify configure object pattern ?option? ?value? ?option value ...?
This command sets and retrieves options for bindings created by the notify bind command. @@ -1762,7 +1837,7 @@ a binding script will not be evaluated when the corresponding event is generated.
-
pathName notify detailnames eventName
+
pathName notify detailnames eventName
Returns a list containing the names of all details, which are installed for the event with the name eventName @@ -1770,14 +1845,14 @@ by means of the notify install widget command or by the treectrl widget itself.

-
pathName notify eventnames
+
pathName notify eventnames
Returns a list containing the names of all events, which are installed by means of the notify install widget command or by the treectrl widget itself.

-
pathName notify generate pattern ?charMap? ?percentsCommand?
+
pathName notify generate pattern ?charMap? ?percentsCommand?
This command causes the treectrl widget to generate an event. This command is typically used to generate dynamic events created by the notify install @@ -1803,7 +1878,7 @@ command is available, then all %-substitution is done using charM See notify install for a description of percentsCommand.

-
pathName notify install pattern ?percentsCommand?
+
pathName notify install pattern ?percentsCommand?
This command installs a new event or detail specified by pattern. Events created by this command are called dynamic, @@ -1838,19 +1913,19 @@ by itself. or an error if the event is not dynamic.

-
pathName notify install detail eventName detail ?percentsCommand?
+
pathName notify install detail eventName detail ?percentsCommand?
This command is for backward compatibility only. Use notify install with a pattern of <eventName-detail> instead.

-
pathName notify install event eventName ?percentsCommand?
+
pathName notify install event eventName ?percentsCommand?
This command is for backward compatibility only. Use notify install with a pattern of <eventName> instead.

-
pathName notify linkage pattern
+
pathName notify linkage pattern
Returns a string indicating whether the specified event or detail is created @@ -1858,43 +1933,43 @@ by means of the notify install widget command (dynami or by the treectrl widget itself (static).

-
pathName notify linkage eventName ?detail?
+
pathName notify linkage eventName ?detail?
This form of this command is for backward compatibility only. Use notify linkage with a pattern of <eventName> or <eventName-detail> instead.

-
pathName notify uninstall pattern
+
pathName notify uninstall pattern
If the event or detail specified by pattern is static (i.e. created by the treectrl widget itself), an error is generated. Otherwise the dynamic event or detail is removed.

-
pathName notify uninstall detail eventName detail
+
pathName notify uninstall detail eventName detail
This command is for backward compatibility only. Use notify uninstall with a pattern of <eventName-detail> instead.

-
pathName notify uninstall event eventName
+
pathName notify uninstall event eventName
This command is for backward compatibility only. Use notify uninstall with a pattern of <eventName> instead. -
pathName numcolumns
+
pathName numcolumns
Deprecated. Use the column count command instead.

-
pathName numitems
+
pathName numitems
Deprecated. Use the item count command instead.

-
pathName orphans
+
pathName orphans
Returns a list containing the numerical ids of all items which has no parent item. @@ -1903,7 +1978,7 @@ and can later become an orphan again by means of the item remove widget command.

-
pathName range first last
+
pathName range first last
First and last must be an itemDesc. Returns a list containing the numerical ids of all items @@ -1912,7 +1987,7 @@ The order between first and last doesn't m and the result is always ordered by the increasing index of the items.

-
pathName state option ?stateName?
+
pathName state option ?stateName?
This command is used to manipulate the list of user defined states, see section STATES below. @@ -1922,13 +1997,13 @@ The following forms of the command are supported:

-
pathName state define stateName
+
pathName state define stateName
Defines a new state with the name stateName, which must not be the name of a predefined or already user defined state.

-
pathName state linkage stateName
+
pathName state linkage stateName
Returns a string indicating whether the specified state is user defined @@ -1936,18 +2011,18 @@ by means of the state define widget command (dynamic< or predefined by the treectrl widget itself (static).

-
pathName state names
+
pathName state names
Returns a list containing the names of all user defined states.

-
pathName state undefine ?stateName ...?
+
pathName state undefine ?stateName ...?
Every stateName must be the name of a user defined state. Removes this state from the list of user defined states.
-
pathName see itemDesc
+
pathName see itemDesc
Adjust the view in the treectrl so that the item described by itemDesc is visible. @@ -1957,14 +2032,14 @@ and the corresponding <Scroll-x> and/or <Scrol events are generated.

-
pathName selection option arg
+
pathName selection option arg
This command is used to adjust the selection within a treectrl. It has several forms, depending on option:

-
pathName selection add first ?last?
+
pathName selection add first ?last?
First and last (if specified) must be the string all or an itemDesc. @@ -1976,7 +2051,7 @@ all items of the treectrl widget are added to the selection instead. A <Selection> event is generated.

-
pathName selection anchor ?itemDesc?
+
pathName selection anchor ?itemDesc?
If itemDesc is specified, the selection anchor is set to the described item. @@ -1987,7 +2062,7 @@ This command doesn't modify the selection state of any item. Returns the numerical id of the selection anchor item.

-
pathName selection clear ?first? ?last?
+
pathName selection clear ?first? ?last?
First and last (if specified) must be the string all or an itemDesc. @@ -2000,13 +2075,13 @@ the selection is completely cleared instead. A <Selection> event is generated.

-
pathName selection count
+
pathName selection count
Returns an integer indicating the number of items in the treectrl that are currently selected.

-
pathName selection get
+
pathName selection get
Returns a list containing the numerical ids of all of the items in the treectrl that are currently selected. @@ -2014,13 +2089,13 @@ If there are no items selected in the treectrl then an empty string is returned.

-
pathName selection includes itemDesc
+
pathName selection includes itemDesc
Returns 1 if the item indicated by itemDesc is currently selected, 0 if it isn't.

-
pathName selection modify select deselect
+
pathName selection modify select deselect
Both arguments select and deselect must be the string all or a possibly empty list of itemDescs. @@ -2033,7 +2108,7 @@ it is added to the selection. A <Selection> event is generated.
-
pathName style option ?element? ?arg arg ...?
+
pathName style option ?element? ?arg arg ...?
This command is used to manipulate styles, which could be considered as a geometry manager for the elements of one item. @@ -2043,7 +2118,7 @@ The following forms of the command are supported:

-
pathName style cget style option
+
pathName style cget style option
This command returns the current value of the option named option associated with the style given by style. @@ -2051,7 +2126,7 @@ associated with the style given by style. style configure widget command.

-
pathName style configure style ?option? ?value? ?option value ...?
+
pathName style configure style ?option? ?value? ?option value ...?
This command is similar to the configure widget command except that it modifies options associated with the style given by style @@ -2080,7 +2155,7 @@ Must be either horizontal (the default) or vertical or an abbreviation of one of these.
-
pathName style create style ?option value ...?
+
pathName style create style ?option value ...?
Create a new style in pathName with name style. After style there may be any number of option-value @@ -2091,7 +2166,7 @@ configuration. Returns the name of the new style.

-
pathName style delete ?style ...?
+
pathName style delete ?style ...?
Deletes each of the named styles and returns an empty string. If a style is deleted while it is still used to display @@ -2099,7 +2174,7 @@ one or more items, it is also removed from the style list of these items.

-
pathName style elements style ?elementList?
+
pathName style elements style ?elementList?
Specifies the elements which should be layed out by this style. Each element of elementList must be the name of an element @@ -2114,7 +2189,7 @@ If the elementList argument is not specified, a list is retur containing the currently defined elements of style.

-
pathName style layout style element ?option? ?value? ?option value ...?
+
pathName style layout style element ?option? ?value? ?option value ...?
This command is similar to the configure widget command except that it modifies options used by style for laying out element @@ -2191,17 +2266,17 @@ inside the space of this element. -
pathName style names
+
pathName style names
Returns a list containing the names of all existing styles. -
pathName toggle ?-recurse? ?itemDesc ...?
+
pathName toggle ?-recurse? ?itemDesc ...?
Use item toggle instead.

-
pathName xview ?args?
+
pathName xview ?args?
This command is used to query and change the horizontal position of the information displayed in the treectrl's window. @@ -2209,7 +2284,7 @@ It can take any of the following forms:

-
pathName xview
+
pathName xview
Returns a list containing two elements. Each element is a real fraction between 0 and 1; together they describe @@ -2222,7 +2297,7 @@ These are the same values passed to scrollbars via the -xscrollcommand
-
pathName xview moveto fraction
+
pathName xview moveto fraction
Adjusts the view in the window so that fraction of the total width of the tree is off-screen to the left. @@ -2230,7 +2305,7 @@ total width of the tree is off-screen to the left. A <Scroll-x> event is generated.

-
pathName xview scroll number what
+
pathName xview scroll number what
This command shifts the view in the window left or right according to number and what. @@ -2248,7 +2323,7 @@ becomes visible. A <Scroll-x> event is generated.
-
pathName yview ?args?
+
pathName yview ?args?
This command is used to query and change the vertical position of the information displayed in the treectrl's window. @@ -2256,7 +2331,7 @@ It can take any of the following forms:

-
pathName yview
+
pathName yview
Returns a list containing two elements. Each element is a real fraction between 0 and 1; together they describe @@ -2267,7 +2342,7 @@ These are the same values passed to scrollbars via the -yscrollcommand
-
pathName yview moveto fraction
+
pathName yview moveto fraction
Adjusts the view in the window so that fraction of the tree's area is off-screen to the top. @@ -2275,7 +2350,7 @@ area is off-screen to the top. A <Scroll-y> event is generated.

-
pathName yview scroll number what
+
pathName yview scroll number what
This command adjusts the view in the window up or down according to number and what. @@ -3192,7 +3267,65 @@ how the selection changed.

In addition to the pre-defined static events such as <ActiveItem> and <Selection>, new dynamic events can be created by using the -notify install command. The default bindings provide an example +notify install command. + +

+The following events may be generated by the library scripts: + +

+ +
<ColumnDrag-begin>
+
<ColumnDrag-receive>
+
<ColumnDrag-end>
+Generated whenever the user drag-and-drops a column header. The library scripts +do not actually move a dragged column. You must bind to the receive event to +move the column. See EXAMPLES. +

+
+
%C
The column that was dragged +

+
%b
The column to move the dragged column before +
+ +
<Drag-begin>
+
<Drag-receive>
+
<Drag-end>
+Generated whenever the user drag-and-drops a file into a directory. This +event is generated by the filelist-bindings.tcl library code, which is not +used by default. See the "Explorer" demos. +

+
+
%I
The item that the user dropped the dragged items on. +

+
%l
(lowercase L) The list of dragged items. +
+ +
<Edit-accept>
+The filelist-bindings.tcl code will display a text-editing window if the user +clicks on a selected file/folder name. See the "Explorer" demos. +

+
+
%I
The item containing the edited text element +

+
%C
The column containing the edited text element +

+
%E
The name of the edited text element +

+
%t
The edited text +
+ +
<Header-invoke>
+Generated whenever the user clicks and releases the left mouse button +in a column header if the column's -button option is true. You can bind a +script to this event to sort the list. +

+
+
%C
The column whose header was clicked +
+ +
+ +The library scripts provide an example of using a dynamic event called <Header-invoke>, which is generated when the mouse button is released over a column header.

 
@@ -3331,6 +3464,16 @@ $T selection add "root firstchild nextsibling child 10"
 

+Move a column that the user drag-and-dropped: +

 
+$T column dragconfigure -enable yes
+$T notify install <ColumnDrag-receive>
+$T notify bind MyTag <ColumnDrag-receive> {
+	%T column move %C %b
+}
+

+ +

SEE ALSO

diff --git a/doc/treectrl.man b/doc/treectrl.man index dc7eb5d..3b1a168 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.17 2005/05/22 19:00:30 treectrl Exp $} + $Id: treectrl.man,v 1.18 2005/05/23 21:32:49 treectrl Exp $} ][manpage_begin treectrl n 2.0] [moddesc {Tk Commands}] [titledesc {Create and manipulate hierarchical multicolumn widgets}] @@ -114,6 +114,13 @@ Specifies the width of the outline and the plus or minus sign of the button to the left of an item in any of the forms acceptable to [fun Tk_GetPixels]. +[tkoption_def -columnprefix columnPrefix ColumnPrefix] +Specifies an ascii string that changes the way column ids are reported and +processed. If this option is a non-empty string, the usual integer value +of a column id is prefixed with the given string. This can aid debugging +but it is important your code doesn't assume column ids are integers if you +use it. + [tkoption_def -columnproxy columnProxy ColumnProxy] If this option specifies a non empty value, it should be a screen distance @@ -166,6 +173,13 @@ The default is 0, which means that every item has the height requested by the arrangement of elements in each column. Items are never shorter than the maximum height of a button. +[tkoption_def -itemprefix itemPrefix ItemPrefix] +Specifies an ascii string that changes the way item ids are reported and +processed. If this option is a non-empty string, the usual integer value +of an item id is prefixed with the given string. This can aid debugging +but it is important your code doesn't assume item ids are integers if you +use it. + [tkoption_def -linecolor lineColor LineColor] Specifies the color which should be used for drawing the connecting lines between related items. @@ -421,8 +435,51 @@ of the new column. Deletes the specified [arg column] from the treectrl widget. If [arg column] is the string [const all], all columns except the tail column are deleted. +[call [arg pathName] [cmd {column dragcget}] [arg option]] +[call [arg pathName] [cmd {column dragconfigure}] \ + [opt [arg option]] [opt [arg value]] [opt [arg {option value ...}]]] +The user can move a column within a treectrl by drag-and-drop. Feedback consists +of a semi-transparent photo image of the header of the column being dragged +and a 2-pixel-thick vertical line to indicate where the column may be dropped. +The drag image consists of a colored background rectangle plus the image and/or +text displayed in the column header. The 2-pixel-thick line will be drawn +over the left edge of the column before which the dragged column may be dropped. +[nl] + +The library scripts generate a event when the user has +successfully drag-and-drop'd a column. You will have to bind a script to this +event if you want to move the dragged column. +[nl] + +The following configuration options are supported: +[list_begin opt] +[opt_def [option -enable] [arg boolean]] +Controls whether the user is allowed to rearrange columns by drag-and-drop. + +[opt_def [option -imagealpha] [arg alpha]] +[arg Alpha] is an integer from 0 (invisible) to 255 (opaque) controlling the +transparency of the drag image. Any value outside this range is clipped. + +[opt_def [option -imagecolor] [arg background]] +[arg Background] is the color of the drag image background rectangle. + +[opt_def [option -imagecolumn] [arg column]] +[arg Column] specifies the column to create the drag image from. + +[opt_def [option -imageoffset] [arg offset]] +[arg Offset] is the horizontal screen distance the drag image is offset from its +starting position. + +[opt_def [option -indicatorcolor] [arg color]] +[arg Color] is the color of the 2-pixel-thick line. + +[opt_def [option -indicatorcolumn] [arg column]] +The 2-pixel-thick line will be drawn over the left edge of [arg column]. + +[list_end] + [call [arg pathName] [cmd {column index}] [arg column]] -Deprecated. Use [cmd {column id}] +Deprecated. Use [cmd {column id}] instead. [call [arg pathName] [cmd {column id}] [arg column]] This command resolves the column description [arg column] into a unique column @@ -2530,7 +2587,56 @@ how the selection changed. [section {DYNAMIC EVENTS}] In addition to the pre-defined static events such as and , new dynamic events can be created by using the -[cmd {notify install}] command. The default bindings provide an example +[cmd {notify install}] command. + +[para] +The following events may be generated by the library scripts: + +[list_begin definitions] + +[lst_item [const ]] +[lst_item [const ]] +[lst_item [const ]] +Generated whenever the user drag-and-drops a column header. The library scripts +do not actually move a dragged column. You must bind to the receive event to +move the column. See [sectref EXAMPLES]. +[list_begin opt] +[opt_def %C] The column that was dragged +[opt_def %b] The column to move the dragged column before +[list_end] + +[lst_item [const ]] +[lst_item [const ]] +[lst_item [const ]] +Generated whenever the user drag-and-drops a file into a directory. This +event is generated by the filelist-bindings.tcl library code, which is not +used by default. See the "Explorer" demos. +[list_begin opt] +[opt_def %I] The item that the user dropped the dragged items on. +[opt_def %l] (lowercase L) The list of dragged items. +[list_end] + +[lst_item [const ]] +The filelist-bindings.tcl code will display a text-editing window if the user +clicks on a selected file/folder name. See the "Explorer" demos. +[list_begin opt] +[opt_def %I] The item containing the edited text element +[opt_def %C] The column containing the edited text element +[opt_def %E] The name of the edited text element +[opt_def %t] The edited text +[list_end] + +[lst_item [const ]] +Generated whenever the user clicks and releases the left mouse button +in a column header if the column's -button option is true. You can bind a +script to this event to sort the list. +[list_begin opt] +[opt_def %C] The column whose header was clicked +[list_end] + +[list_end] + +The library scripts provide an example of using a dynamic event called , which is generated when the mouse button is released over a column header. [example_begin] @@ -2653,6 +2759,16 @@ Add the 10th child of the second child of the root item to the selection: $T selection add "root firstchild nextsibling child 10" [example_end] + +Move a column that the user drag-and-dropped: +[example_begin] +$T column dragconfigure -enable yes +$T notify install +$T notify bind MyTag { + %T column move %C %b +} +[example_end] + [see_also listbox(n) image(n) bitmap(n) bind(n) options(n)] [keywords tree widget] [manpage_end] diff --git a/doc/treectrl.n b/doc/treectrl.n index 2a3e80d..e7b5220 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.33 2005/05/22 19:00:30 treectrl Exp $ +'\" $Id: treectrl.n,v 1.34 2005/05/23 21:32:49 treectrl Exp $ .so man.macros .TH "treectrl" n 2.0 "Tk Commands" .BS @@ -43,6 +43,10 @@ package require \fBtreectrl 2.0\fR .sp \fIpathName\fR \fBcolumn delete\fR \fIcolumn\fR\fR .sp +\fIpathName\fR \fBcolumn dragcget\fR \fIoption\fR\fR +.sp +\fIpathName\fR \fBcolumn dragconfigure\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?\fR +.sp \fIpathName\fR \fBcolumn index\fR \fIcolumn\fR\fR .sp \fIpathName\fR \fBcolumn id\fR \fIcolumn\fR\fR @@ -455,6 +459,19 @@ in any of the forms acceptable to \fBTk_GetPixels\fR. .LP .nf .ta 6c +Command-Line Switch: \fB-columnprefix\fR +Database Name: \fBcolumnPrefix\fR +Database Class: \fBColumnPrefix\fR +.fi +.IP +Specifies an ascii string that changes the way column ids are reported and +processed. If this option is a non-empty string, the usual integer value +of a column id is prefixed with the given string. This can aid debugging +but it is important your code doesn't assume column ids are integers if you +use it. +.LP +.nf +.ta 6c Command-Line Switch: \fB-columnproxy\fR Database Name: \fBcolumnProxy\fR Database Class: \fBColumnProxy\fR @@ -543,6 +560,19 @@ in each column. Items are never shorter than the maximum height of a button. .LP .nf .ta 6c +Command-Line Switch: \fB-itemprefix\fR +Database Name: \fBitemPrefix\fR +Database Class: \fBItemPrefix\fR +.fi +.IP +Specifies an ascii string that changes the way item ids are reported and +processed. If this option is a non-empty string, the usual integer value +of an item id is prefixed with the given string. This can aid debugging +but it is important your code doesn't assume item ids are integers if you +use it. +.LP +.nf +.ta 6c Command-Line Switch: \fB-linecolor\fR Database Name: \fBlineColor\fR Database Class: \fBLineColor\fR @@ -906,8 +936,49 @@ of the new column. Deletes the specified \fIcolumn\fR from the treectrl widget. If \fIcolumn\fR is the string \fBall\fR, all columns except the tail column are deleted. .TP +\fIpathName\fR \fBcolumn dragcget\fR \fIoption\fR\fR +.TP +\fIpathName\fR \fBcolumn dragconfigure\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?\fR +The user can move a column within a treectrl by drag-and-drop. Feedback consists +of a semi-transparent photo image of the header of the column being dragged +and a 2-pixel-thick vertical line to indicate where the column may be dropped. +The drag image consists of a colored background rectangle plus the image and/or +text displayed in the column header. The 2-pixel-thick line will be drawn +over the left edge of the column before which the dragged column may be dropped. +.sp +The library scripts generate a event when the user has +successfully drag-and-drop'd a column. You will have to bind a script to this +event if you want to move the dragged column. +.sp +The following configuration options are supported: +.RS +.TP +\fB\fB-enable\fR\fR \fIboolean\fR +Controls whether the user is allowed to rearrange columns by drag-and-drop. +.TP +\fB\fB-imagealpha\fR\fR \fIalpha\fR +\fIAlpha\fR is an integer from 0 (invisible) to 255 (opaque) controlling the +transparency of the drag image. Any value outside this range is clipped. +.TP +\fB\fB-imagecolor\fR\fR \fIbackground\fR +\fIBackground\fR is the color of the drag image background rectangle. +.TP +\fB\fB-imagecolumn\fR\fR \fIcolumn\fR +\fIColumn\fR specifies the column to create the drag image from. +.TP +\fB\fB-imageoffset\fR\fR \fIoffset\fR +\fIOffset\fR is the horizontal screen distance the drag image is offset from its +starting position. +.TP +\fB\fB-indicatorcolor\fR\fR \fIcolor\fR +\fIColor\fR is the color of the 2-pixel-thick line. +.TP +\fB\fB-indicatorcolumn\fR\fR \fIcolumn\fR +The 2-pixel-thick line will be drawn over the left edge of \fIcolumn\fR. +.RE +.TP \fIpathName\fR \fBcolumn index\fR \fIcolumn\fR\fR -Deprecated. Use \fBcolumn id\fR +Deprecated. Use \fBcolumn id\fR instead. .TP \fIpathName\fR \fBcolumn id\fR \fIcolumn\fR\fR This command resolves the column description \fIcolumn\fR into a unique column @@ -2914,7 +2985,63 @@ how the selection changed. .SH "DYNAMIC EVENTS" In addition to the pre-defined static events such as and , new dynamic events can be created by using the -\fBnotify install\fR command. The default bindings provide an example +\fBnotify install\fR command. +.PP +The following events may be generated by the library scripts: +.TP +\fB\fR +.TP +\fB\fR +.TP +\fB\fR +Generated whenever the user drag-and-drops a column header. The library scripts +do not actually move a dragged column. You must bind to the receive event to +move the column. See \fBEXAMPLES\fR. +.RS +.TP +\fB%C\fR The column that was dragged +.TP +\fB%b\fR The column to move the dragged column before +.RE +.TP +\fB\fR +.TP +\fB\fR +.TP +\fB\fR +Generated whenever the user drag-and-drops a file into a directory. This +event is generated by the filelist-bindings.tcl library code, which is not +used by default. See the "Explorer" demos. +.RS +.TP +\fB%I\fR The item that the user dropped the dragged items on. +.TP +\fB%l\fR (lowercase L) The list of dragged items. +.RE +.TP +\fB\fR +The filelist-bindings.tcl code will display a text-editing window if the user +clicks on a selected file/folder name. See the "Explorer" demos. +.RS +.TP +\fB%I\fR The item containing the edited text element +.TP +\fB%C\fR The column containing the edited text element +.TP +\fB%E\fR The name of the edited text element +.TP +\fB%t\fR The edited text +.RE +.TP +\fB\fR +Generated whenever the user clicks and releases the left mouse button +in a column header if the column's -button option is true. You can bind a +script to this event to sort the list. +.RS +.TP +\fB%C\fR The column whose header was clicked +.RE +The library scripts provide an example of using a dynamic event called , which is generated when the mouse button is released over a column header. .nf @@ -3025,6 +3152,14 @@ Add the 10th child of the second child of the root item to the selection: .nf $T selection add "root firstchild nextsibling child 10" .fi +Move a column that the user drag-and-dropped: +.nf +$T column dragconfigure -enable yes +$T notify install +$T notify bind MyTag { + %T column move %C %b +} +.fi .SH "SEE ALSO" bind(n), bitmap(n), image(n), listbox(n), options(n) .SH "KEYWORDS" -- cgit v0.12