From 57144e2bfb02605656bca16e178ce18b91f97eb4 Mon Sep 17 00:00:00 2001 From: treectrl Date: Mon, 12 Nov 2007 04:15:52 +0000 Subject: Added -columntagexpr and -itemtagexpr options. [Patch 1684169] Documented use of double-quoted tag names in tag expressions. --- doc/treectrl.html | 37 +++++++++++++++++++++++++++++++++++-- doc/treectrl.man | 27 ++++++++++++++++++++++++++- doc/treectrl.n | 45 ++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 105 insertions(+), 4 deletions(-) diff --git a/doc/treectrl.html b/doc/treectrl.html index bee1e6f..bc441d5 100644 --- a/doc/treectrl.html +++ b/doc/treectrl.html @@ -1,10 +1,10 @@ - treectrl - Tk Commands - @@ -394,6 +394,14 @@ be after resizing. For realtime, the column's size is changed w the user is dragging the right edge of the column.

+
Command-Line Switch: -columntagexpr
+Database Name: columnTagExpr
+Database Class: ColumnTagExpr
+
+Specifies a boolean that enables or disables tag expressions in column +descriptions. See ITEM AND COLUMN TAGS. + +

Command-Line Switch: -defaultstyle
Database Name: defaultStyle
Database Class: DefaultStyle
@@ -464,6 +472,14 @@ but it is important your code doesn't assume item ids are integers if you use it.

+
Command-Line Switch: -itemtagexpr
+Database Name: itemTagExpr
+Database Class: ItemTagExpr
+
+Specifies a boolean that enables or disables tag expressions in item +descriptions. See ITEM AND COLUMN TAGS. + +

Command-Line Switch: -itemwidth
Database Name: itemWidth
Database Class: ItemWidth
@@ -763,6 +779,23 @@ or equivalently: .t item id "tag {a ^ b}"

will return the unique ids of any items with either "a" or "b" tags, but not both. +

+Within a tag expression a tag name may be enclosed in double quotes to avoid special +processing of the operator characters. For example: +

 
+.t item id {tag {"a&&b"||c}}
+

+will return the unique ids of any items with either "a&&b" or "c" tags; in this +example the && is not treated as an operator. A double-quote may be escaped within +a quoted tag name using a backslash '\'. +

+Tag operators may be bypassed completely by setting the -columntagexpr and +-itemtagexpr options. This can be useful if your application has column +or item tags containing arbitrary text. +

 
+.t configure -itemtagexpr false
+.t item delete "tag a&&b"
+

WIDGET COMMAND

diff --git a/doc/treectrl.man b/doc/treectrl.man index a1ce326..71a66b1 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.51 2007/10/23 23:04:33 treectrl Exp $} + $Id: treectrl.man,v 1.52 2007/11/12 04:15:52 treectrl Exp $} ][manpage_begin treectrl n 2.2.3] [moddesc {Tk Commands}] [titledesc {Create and manipulate hierarchical multicolumn widgets}] @@ -144,6 +144,10 @@ vertical line is drawn representing where the right edge of the column will be after resizing. For [const realtime], the column's size is changed while the user is dragging the right edge of the column. +[tkoption_def -columntagexpr columnTagExpr ColumnTagExpr] +Specifies a boolean that enables or disables tag expressions in column +descriptions. See [sectref {ITEM AND COLUMN TAGS}]. + [tkoption_def -defaultstyle defaultStyle DefaultStyle] This option is deprecated; use the column option [option -itemstyle] instead. Specifies a list of styles, one per column, to apply to each item created by @@ -190,6 +194,10 @@ 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 -itemtagexpr itemTagExpr ItemTagExpr] +Specifies a boolean that enables or disables tag expressions in item +descriptions. See [sectref {ITEM AND COLUMN TAGS}]. + [tkoption_def -itemwidth itemWidth ItemWidth] Specifies a fixed width for every item in any of the forms acceptable to [fun Tk_GetPixels]. If more than one column is visible, then this option has no effect. @@ -393,6 +401,23 @@ or equivalently: .t item id "tag {a ^ b}" [example_end] will return the unique ids of any items with either "a" or "b" tags, but not both. +[para] +Within a tag expression a tag name may be enclosed in double quotes to avoid special +processing of the operator characters. For example: +[example_begin] +.t item id {tag {"a&&b"||c}} +[example_end] +will return the unique ids of any items with either "a&&b" or "c" tags; in this +example the && is not treated as an operator. A double-quote may be escaped within +a quoted tag name using a backslash '\'. +[para] +Tag operators may be bypassed completely by setting the [option -columntagexpr] and +[option -itemtagexpr] options. This can be useful if your application has column +or item tags containing arbitrary text. +[example_begin] +.t configure -itemtagexpr false +.t item delete "tag a&&b" +[example_end] [section {WIDGET COMMAND}] The [cmd treectrl] command creates a new Tcl command whose diff --git a/doc/treectrl.n b/doc/treectrl.n index 932421f..9724c28 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.68 2007/10/23 23:04:33 treectrl Exp $ +'\" $Id: treectrl.n,v 1.69 2007/11/12 04:15:52 treectrl Exp $ .so man.macros .TH "treectrl" n 2.2.3 treectrl "Tk Commands" .BS @@ -565,6 +565,17 @@ the user is dragging the right edge of the column. .LP .nf .ta 6c +Command-Line Switch: \fB-columntagexpr\fR +Database Name: \fBcolumnTagExpr\fR +Database Class: \fBColumnTagExpr\fR + +.fi +.IP +Specifies a boolean that enables or disables tag expressions in column +descriptions. See \fBITEM AND COLUMN TAGS\fR. +.LP +.nf +.ta 6c Command-Line Switch: \fB-defaultstyle\fR Database Name: \fBdefaultStyle\fR Database Class: \fBDefaultStyle\fR @@ -653,6 +664,17 @@ use it. .LP .nf .ta 6c +Command-Line Switch: \fB-itemtagexpr\fR +Database Name: \fBitemTagExpr\fR +Database Class: \fBItemTagExpr\fR + +.fi +.IP +Specifies a boolean that enables or disables tag expressions in item +descriptions. See \fBITEM AND COLUMN TAGS\fR. +.LP +.nf +.ta 6c Command-Line Switch: \fB-itemwidth\fR Database Name: \fBitemWidth\fR Database Class: \fBItemWidth\fR @@ -1020,6 +1042,27 @@ or equivalently: .fi will return the unique ids of any items with either "a" or "b" tags, but not both. +.PP +Within a tag expression a tag name may be enclosed in double quotes to avoid special +processing of the operator characters. For example: +.nf + +.t item id {tag {"a&&b"||c}} + +.fi +will return the unique ids of any items with either "a&&b" or "c" tags; in this +example the && is not treated as an operator. A double-quote may be escaped within +a quoted tag name using a backslash '\\'. +.PP +Tag operators may be bypassed completely by setting the \fB-columntagexpr\fR and +\fB-itemtagexpr\fR options. This can be useful if your application has column +or item tags containing arbitrary text. +.nf + +.t configure -itemtagexpr false +.t item delete "tag a&&b" + +.fi .SH "WIDGET COMMAND" The \fBtreectrl\fR command creates a new Tcl command whose name is the same as the path name of the treectrl's window. -- cgit v0.12