From 70d0d3be91f655f8ae97ec29b70c2a415acc39e9 Mon Sep 17 00:00:00 2001 From: treectrl Date: Mon, 21 Jul 2008 18:49:31 +0000 Subject: Added option -showrootchildbuttons. Bumped version to 2.2.7. --- configure | 2 +- configure.ac | 4 +- demos/demo.tcl | 15 +- doc/What's New in TkTreeCtrl.html | 2227 +++---------------------------------- doc/treectrl.html | 13 +- doc/treectrl.man | 12 +- doc/treectrl.n | 14 +- generic/tkTreeCtrl.c | 23 +- generic/tkTreeCtrl.h | 7 +- generic/tkTreeItem.c | 31 +- shellicon/configure | 2 +- shellicon/configure.ac | 4 +- 12 files changed, 215 insertions(+), 2139 deletions(-) diff --git a/configure b/configure index 20f54b3..c2710b2 100644 --- a/configure +++ b/configure @@ -1782,7 +1782,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -PACKAGE_PATCHLEVEL=2.2.6 +PACKAGE_PATCHLEVEL=2.2.7 cat >>confdefs.h <<_ACEOF #define PACKAGE_PATCHLEVEL "$PACKAGE_PATCHLEVEL" diff --git a/configure.ac b/configure.ac index 82a8ca6..98c7698 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tcl installation dnl to configure the system for the local environment. # -# RCS: @(#) $Id: configure.ac,v 1.26 2008/02/29 21:14:31 treectrl Exp $ +# RCS: @(#) $Id: configure.ac,v 1.27 2008/07/21 18:49:31 treectrl Exp $ #----------------------------------------------------------------------- # Sample configure.in for Tcl Extensions. @@ -20,7 +20,7 @@ dnl to configure the system for the local environment. #----------------------------------------------------------------------- AC_INIT([treectrl], [2.2]) -AC_SUBST([PACKAGE_PATCHLEVEL], [2.2.6]) +AC_SUBST([PACKAGE_PATCHLEVEL], [2.2.7]) AC_DEFINE_UNQUOTED(PACKAGE_PATCHLEVEL, "$PACKAGE_PATCHLEVEL") TEA_INIT([3.5]) diff --git a/demos/demo.tcl b/demos/demo.tcl index 8138b29..f5cd9ac 100644 --- a/demos/demo.tcl +++ b/demos/demo.tcl @@ -1,8 +1,8 @@ #!/bin/wish84.exe -# RCS: @(#) $Id: demo.tcl,v 1.68 2008/02/29 21:14:32 treectrl Exp $ +# RCS: @(#) $Id: demo.tcl,v 1.69 2008/07/21 18:49:32 treectrl Exp $ -set VERSION 2.2.6 +set VERSION 2.2.7 package require Tk 8.4 @@ -999,12 +999,14 @@ proc MakeListPopup {T} { -command {$Popup(T) configure -showheader $Popup(showheader)} $m2 add checkbutton -label "Lines" -variable Popup(showlines) \ -command {$Popup(T) configure -showlines $Popup(showlines)} - $m2 add checkbutton -label "Root Lines" -variable Popup(showrootlines) \ - -command {$Popup(T) configure -showrootlines $Popup(showrootlines)} $m2 add checkbutton -label "Root" -variable Popup(showroot) \ -command {$Popup(T) configure -showroot $Popup(showroot)} $m2 add checkbutton -label "Root Button" -variable Popup(showrootbutton) \ -command {$Popup(T) configure -showrootbutton $Popup(showrootbutton)} + $m2 add checkbutton -label "Root Child Buttons" -variable Popup(showrootchildbuttons) \ + -command {$Popup(T) configure -showrootchildbuttons $Popup(showrootchildbuttons)} + $m2 add checkbutton -label "Root Child Lines" -variable Popup(showrootlines) \ + -command {$Popup(T) configure -showrootlines $Popup(showrootlines)} $m add cascade -label Show -menu $m2 set m2 [menu $m.mSpan -tearoff no] @@ -1154,9 +1156,10 @@ proc ShowPopup {T x y X Y} { set Popup(showbuttons) [$T cget -showbuttons] set Popup(showheader) [$T cget -showheader] set Popup(showlines) [$T cget -showlines] - set Popup(showrootlines) [$T cget -showrootlines] set Popup(showroot) [$T cget -showroot] set Popup(showrootbutton) [$T cget -showrootbutton] + set Popup(showrootchildbuttons) [$T cget -showrootchildbuttons] + set Popup(showrootlines) [$T cget -showrootlines] set m $menu.mVisible $m delete 0 end foreach C [$T column list] { @@ -1512,7 +1515,7 @@ proc DemoClear {} { -yscrollincrement 0 -itemheight 0 -showheader yes \ -background white -scrollmargin 0 -xscrolldelay 50 -yscrolldelay 50 \ -buttonbitmap "" -buttonimage "" -backgroundmode row \ - -indent 19 -backgroundimage "" \ + -indent 19 -backgroundimage "" -showrootchildbuttons yes \ -showrootlines yes -minitemheight 0 -borderwidth [expr {$::tileFull ? 0 : 6}] \ -highlightthickness [expr {$::tileFull ? 0 : 3}] -usetheme yes -cursor {} \ -itemwidth 0 -itemwidthequal no -itemwidthmultiple 0 \ diff --git a/doc/What's New in TkTreeCtrl.html b/doc/What's New in TkTreeCtrl.html index 5a90444..16edd63 100644 --- a/doc/What's New in TkTreeCtrl.html +++ b/doc/What's New in TkTreeCtrl.html @@ -1,47 +1,141 @@ - + - - + - - - What's New in TkTreeCtrl + + +

What's New in TkTreeCtrl 2.2.7

+ + +

TreeCtrl Configuration Options

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NewComment
-showrootchildbuttonsSimilar to -showrootlines, +this boolean option controls the display of expand/collapse buttons +next to child items of the root item.
+ + +
+ + +

Indentation change/fix

+ + +
Previously with -showroot=0, -showbuttons=0, and -showrootlines=0 +there was still an extra level of indentation displayed to the left of +the root's children. The only way to remove all indentation +from the +root's children was to set -showlines=0 +as well.  This is no longer the case and now behaves +as expected. With the new -showrootchildbuttons +option it is now possible to remove all indentation from the root's +children without affecting the display of buttons/lines on deeper items.
+ +

Library Script Changes

+ +

treectrl.tcl:

+ + + +

Bug Fixes

+ + + +

What's New in TkTreeCtrl 2.2.6

+ +

Bug Fixes

+ + + +

What's New in TkTreeCtrl 2.2.5

-Issues regarding the incompatibility of 8.4 built TkTreeCtrl working in 8.5 -were resolved. The Mac OS X API issues noted for 2.2.4 remain (they +Issues regarding the incompatibility of 8.4 built TkTreeCtrl working in +8.5 +were resolved. The Mac OS X API issues noted for 2.2.4 remain (they relate to difficult to reconcile core drawing changes).

-A Windows DLL manifest is now embedded to address native theme drawing issues. +A Windows DLL manifest is now embedded to address native theme drawing +issues.

@@ -49,13 +143,12 @@ A Windows DLL manifest is now embedded to address native theme drawing issues.

What's New in TkTreeCtrl 2.2.4

- -

NOTE regarding Tk version compatibility

-Under Mac OSX some internal changes to Tk 8.4.15 and Tk 8.4.17 result in +Under Mac OSX some internal changes to Tk 8.4.15 and Tk 8.4.17 result +in incompatibilities:

@@ -63,66 +156,48 @@ incompatibilities: -

TreeCtrl Configuration Options

- - - - - - - - - - - - - - - - - - - - - - - -
NewComment
-columntagexpr
- - -itemtagexpr
These boolean options can be used to turn off tag expressions in column descriptions and item descriptions.  When the value of these options is false the @@ -132,238 +207,156 @@ descriptions. This is useful for applications which may have arbitrary tags applied to columns or items.
-
- -

Bug Fixes

- - - -

Misc Changes

- - - -

Demo Changes

- - - -

What's New in TkTreeCtrl 2.2.3

- -

Build Changes

- - - -

Bug Fixes

- - - -

What's New in TkTreeCtrl 2.2.2

- -

Column Configuration Options

- - - - - - - - - - - - - - - - - - - - - - - -
NewComment
-itemjustifyThis option allows item styles to be justified separately from the image/text in the column header. If the value of this @@ -372,108 +365,68 @@ according to the -justify option of the column.
- -

Item Configuration Options

- - - - - - - - - - - - - - - - - - - - - - - -
Usage ChangedHow it changed
-buttonThe value of this option can now be the word auto (or any abbreviation) in which case a button is drawn only when the item has at least one child item with its item option -visible set to true.
- -

Style Layout Changes

- - - -

Item Descriptions

- - - -
.t item id "root child end-1" ; # get the second-to-last child of the root item
- -
- -

Bug Fixes

- - - -

What's New in TkTreeCtrl 2.2.1

- -

Bug Fixes

- - - -

What's New in TkTreeCtrl 2.2

- -

TreeCtrl Configuration Options

- - - - - - - - - - - - - - - - - - - - - - - -
DeprecatedWhat to use instead
-defaultstyleThe -itemstyle option of a column.
- -

TreeCtrl Command

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Arguments/Result ChangedWhat changed
contentboxThe return value is an empty string if the content area is totally obscurred by column headers, borders, and/or locked columns. Typically this will only happen if the window is too small.
selection getAccepts 2 optional arguments to allow in-place lindex and lrange queries of the selection. For example:
- - - -
.t selection get 0       ; # the first selected item
.t selection get end     ; # the last selected item
.t selection get 1 end-1 ; # every selected item except the first and last
- -
NewComment
bboxReturns the bounding box of different areas of the window. For example:
- - - -
.t bbox
- - will return the bounds of the window, and:
- - - -
.t bbox header
- - will return the bounds of the column headers, and:
- - - -
.t bbox content
- - will return the same result as the [contentbox] command, and:
- - - -
.t bbox left
.t bbox right
- - will return the bounds of the left-locked and right-locked columns.
- -

Column Configuration Options

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Renamed
- -
New name
-tag-tags
NewComment
-lockThis option allows columns to stick to the left or right edge of the window. Locked columns can scroll vertically but not horizontally. Valid values for this option are none (the default), left or right.
-itemstyleSpecifies the name of a style to set in this column for newly-created items. This option replaces the treectrl option -defaultstyle.
-uniformThese two options operate the same as the grid geometry manager options of the same name. For example:
- - - -
.t column configure 0 -uniform a
.t column configure 1 -uniform a
- - will give columns 0 and 1 the same requested width, whichever is the larger of the two columns. And:
- - - -
.t column configure 0 -uniform a -weight 2
.t column configure 1 -uniform a
- - will give column 0 twice the maximum of the requested widths of columns 0 and 1. And:
- - - -
.t column configure 0 -expand yes -weight 2
.t column configure 1 -expand yes
- - will give column 0 twice the extra space as column 1.
-weight
- -

Column Command

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Arguments/Result ChangedWhat changed
column countTakes an optional column-description argument; the result is the number of columns that match the column description. For example:
- - - -
.t column count visible
- - will return the number of columns whose -visible option is true, and:
- - - -
.t column count {tag a^b}
- - will return the number of columns with either tag "a" or "b", but not both.
NewComment
column tag addColumns can have a list of tag names. Previously only a single tag was allowed. The tail column no longer has the word "tail" as a tag, but it is still referred to by the word "tail" in column descriptions.
column tag expr
column tag names
column tag remove
- -

Item Configuration Options

- - - - - - - - - - - - - - - - - - - - - - - -
NewComment
-tagsTags are textual labels applied to items to group them. Tags do not affect the appearance or behaviour of items. Tags can be used in @@ -1333,429 +958,255 @@ item descriptions to operate on multiple items. More information can be found in the man page.
- -

Item Command

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Arguments/Result ChangedWhat changed
item countTakes an optional item-description argument; the result is the number of items that match the item description. For example:
- - - -
.t item count visible
- - will return the number of items that are displayed (i.e., those whose ancestors are all expanded, -visible options are true, etc), and:
- - - -
.t item count {tag a^b}
- - will return the number of items with either tag "a" or "b", but not both.
item createNew option -tags specifies an initial list of tags for created items.
item idReturns a list of item ids if the item description matches multiple items. For example:
- - - -
.t item id all
- - will return a list of ids for all items, and:
- - - -
.t item id "$item children"
- - will return the ids of every child of an item.
NewComment
item descendantsReturns the ids of the children, grandchildren, etc of an item.
item enabledGets and sets the enabled state for items. All items are enabled when first created. Disabled items cannot be selected, and are ignored by the default key-navigation and mouse bindings.
item tag addAdd tags to items. For example:
- - - -
.t item tag add all {a b c}
- - will add tags "a", "b" and "c" to every item.
- -
item tag exprEvaluate a tag expression against items. For example:
- - - -
.t item tag expr $item a
- - returns 1 if an item has tag "a". Also:
- - - -
.t item tag expr $item a||b
- - returns 1 if  an item has tag "a" or "b".
item tag namesReturn a list of tag names assigned to items. For example:
- - - -
.t item tag names $item
- - returns the tag list for an item, and:
- - - -
.t item tag names all
- - returns every tag assigned to any item.
item tag removeRemove tags from items. For example:
- - - -
.t item tag remove all {b c}
- - will remove tags "b" and "c" from any items that have them.
- -

Text Element

- - The new option -underline draws an underline under a single character of the displayed text.
- -

Window Element

- - Window elements can now be properly clipped so they don't draw over the column header, borders, or outside the bounds of the item columns they occupy. This is accomplished by making the window you want @@ -1764,23 +1215,15 @@ window element to TRUE. So if your program displays a canvas widget in a window element, you would change this code:
- -
set canvas [canvas .t.canvas ...]
.t item element configure $item $column myElement -window $canvas
- - to this:
- -
set frame [frame .t.clip -borderwidth 0]
set canvas [canvas $frame.canvas ...]
.t item element configure $item $column myElement -window $frame -clip yes
- - The -clip option tells the window element to manage the geometry of both the -window widget (i.e, @@ -1791,261 +1234,165 @@ demos.

Item Descriptions

- - New keywords were added to allow multiple items to be specified by an item description:
- - - - New modifiers were added to match multiple items: - - New qualifiers were added to refine which items are matched:
- - - -
.t item id "all depth 2" ; # find all items that are children of the root's children
.t item id "depth 2" ; # ditto
- -
- - - -
- - The keyword all may now be followed by a list of qualifiers. For example:
- -
.t item id "all !visible state myState" ; # find every item that is not displayed with user-defined state "myState"
- - A list of qualifiers may be used as the first part of an item description. This gives the same result as  "all" followed by the qualifiers. For example:
- -
.t item id "!visible state myState" ; # same as the previous example
- -
- -

Column Descriptions

- - New keywords list and range can be used to match multiple columns.
- - New qualifiers state, tag, !tail and !visible can be used to restrict which columns are specified.
- - The keyword all may be followed by a list of qualifiers.
- - A list of qualifiers may used as the first part of a column description. This gives the same result as  "all" followed by the @@ -2053,8 +1400,6 @@ qualifiers.

Multi-item and multi-column commands

- - Many commands can now operate on multiple items and/or columns by using the improved item descriptions and column descriptions mentioned above. For example: @@ -2062,64 +1407,42 @@ For example:
.t column configure "range 1 10" -tags {a b c}
.t column delete "tag a"
.t column id "tag {a || b}"
.t item configure "depth 1" -button yes
.t item count visible
.t item element configure "root children" all elem1 -text "Hello"
.t item id "visible"
.t item image all all image1
.t item style map "tag {a && !b}" "tag c" style2 {style1.elem1 style2.elem2}
.t item style set all all style1
.t item state forcolumn all all state1
.t item state set "tag current" ~mouseover
.t item remove "state selected"
.t item span "range 1 10" "range 10 last" 2
.t item text "root children" all "Hello"
- - - -

Demo Changes

- - - -

Misc Changes

- - - -

Bug Fixes

- - - -

What's New in TkTreeCtrl 2.1.1

- -

Column Command

- - - - - - - - - - - - - - - - - - - - - - - -
Arguments/Result ChangedWhat changed
column delete
- -
Added an optional second argument allowing a range of columns to be deleted.
- -

Bug Fixes

- - - -

Other Changes

- - - -

Demo Changes

- - - -

What's New in TkTreeCtrl 2.1

- - This version should be backwards compatible with 2.0, except for a few obscure changes.
- -

TreeCtrl Configuration Options

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NewComment
-itemwidth
- -
-itemwidthequalDeprecates the column -widthhack option.
-itemwidthmultipleDeprecates the column -stepwidth option.
- -

Column Configuration Options

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DeprecatedWhat to use instead
-stepwidthtreectrl's -itemwidthmultiple option
-widthhacktreectrl's -itemwidthequal option
- -

Element Command

- - - - - - - - - - - - - - - - - - - - - - - -
NewComment
element perstateLike [item element perstate].
- -

Item Configuration Options

- - - - - - - - - - - - - - - - - - - - - - - -
NewComment
-heightOverrides the treectrl's -itemheight option
- -

Item Command

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DeprecatedWhat to use instead
item element actualitem element perstate
item complexitem element configure
Behaviour ChangedWhat changed
item bboxNo longer returns an error if no style had been assigned to the column.
item state forcolumnNo longer returns an error if no style had been assigned to the column.
item style setDoes nothing when replacing a style with the same style. Previously the old style was freed before assigning the new style, losing the element config info if the old and new styles were the same.
- - Potential incompatibility
Arguments/Result ChangedWhat changed
item createAdded options: -count -height, -nextsibling, -open, -parent, -prevsibling, and -returnid. Multiple items may be created with one call using the -count option.
item element configureMultiple elements in multiple columns may be configured with a single call. Use '+' to separate elements, and ',' to separate columns. See the docs.
item style setWhen no column is specified, returns a list of one style name per column. Previously, the list would have less values than the number @@ -2991,90 +1992,56 @@ of columns if no styles had ever been assigned to the rightmost column(s).
- - Potential incompatibility
item textWhen no column is specified, returns a list of one string per column.
NewComment
item imagePartner to the [item text] command.
item element perstateNot really new, just renamed from [item element actual] to better describe what it does. Accepts a new optional argument which @@ -3082,254 +2049,156 @@ specifies the state to use when determining the value of the per-state option.
- -
- - The following options no longer return a default value if the per-state option itself does not have a value specified:
- - - -
    - -
  • bitmap -foreground, -background
  • - -
  • border -relief
  • - -
  • text -fill, -font
  • - - - -
- - Potential incompatibility
item spanA style may now be displayed over multiple adjacent columns.
- -
- -

Notify Command

- - - - - - - - - - - - - - - - - - - - - - - -
NewComment
notify unbind
- -
Let's you unbind all scripts from an object with one call.
- -

Style Layout Changes

- - - -
    - -
  1. If a -detach element had a fixed width larger than the other elements.
  2. - -
  3. If an element had -iexpand x specified as well as -maxwidth, leaving some space available.
  4. - -
- -

Element Changes

- - - -

Event Changes

- - - -

Other Changes

- - - -

Demo Changes

- - - -

What's New in TkTreeCtrl 2.0

- -

TreeCtrl Configuration Options

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ReplacedWhat to use instead
-openbuttonimage-buttonimage
-closedbuttonimage-buttonimage
-openbuttonbitmap-buttonbitmap
-closedbuttonbitmap-buttonbitmap
Usage ChangedHow it changed
-backgroundmodeThe values "index" and "visindex" are deprecated. The value "order" should be used instead of "index", and @@ -3569,23 +2354,15 @@ agreement with the new "item order" command which replaces the "item index" command.
-treecolumnThis used to be any integer value which may or may not have corresponded to an actual column. Now the value must be a valid column @@ -3593,1451 +2370,873 @@ description, or an empty string to indicate no column should display buttons/lines.
New
-backgroundimage
-columnprefix
-columnresizemode
-itemprefix
-minitemheight
-usetheme
- -

TreeCtrl Commands

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DeprecatedWhat to use instead
compareitem compare
indexitem id
numcolumnscolumn count
numitemsitem count
rangeitem range
- -

Column Configuration Options

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + - + + - + + - -
RemovedWhat to use instead
-relief
- -
-state
-sunken-state
Renamed
- -
New name
-arrowpad-arrowpadx
Usage ChangedHow it changed
-backgroundThis is now a per-state option. See COLUMNS in the help file for valid state names.
New
- -
-arrowbitmap
- -
-arrowimage
-arrowpady
-maxwidth
-resize
-state
-state-textlines
-textlines
- -

Column Command

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DeprecatedWhat to use instead
column indexcolumn id
Arguments/Result ChangedWhat changed
column configure
- -
A column description of "all" is allowed if at least one option-value pair is given.
- -
column createThe result is a unique identifier. Previously the result was an index in the list of columns.
column deleteA column description of "all" is allowed.
NewComment
column compare
column countreplaces "numcolumns"
column dragconfigure
column dragcget
column idreplaces "column index"
column list
column order
- -

Item Command

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
RemovedWhat to use instead
item indexitem order
NewComment
item comparereplaces "compare"
item countreplaces "numitems"
item idreplaces "index"
item orderreplaces "item index"
item rangereplaces "range"
- -

Notify Command

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Arguments/Result ChangedWhat changed
notify generate
- -
Added optional percentsCommand argument
notify installOld syntax (supported but deprecated):
- - - -
notify install event eventName
- - - -
notify install detail eventName detail
- - New syntax:
- - - -
notify install <eventName>
- - - -
notify install <eventName-detail>
- -
notify linkageOld syntax (supported but deprecated):
- - - -
- -
notify linkage eventName
- - - -
notify linkage eventName detail
- -
- - New syntax:
- - - -
- -
notify linkage <eventName>
- - - -
notify linkage <eventName-detail>
- -
- -
notify uninstallsee notify install above
- -

Style Layout Options

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Usage ChangedHow it changed
-iexpandTwo new flags "x' and "y" are allowed. Previously, only the -ipadx and -ipady padding could be expanded by this option. The new xy @@ -5045,257 +3244,155 @@ flags expand the display area of the element, not the padding. To update your code, you will probably want to change this:
- - - -
- -
$T style layout $S $E -iexpand we
- -
- - to this:
- - - -
- -
$T style layout $S $E -iexpand x
- -
- - Keep in mind that -union elements are not affected by -iexpand xy, since the size of a -union element is determined by the elements it surrounds.
New
- -
-height
-maxheight
-maxwidth
-minheight
-minwidth
-sticky
-width
- -

Element Changes

- - - -

Event Changes

- - - -

Library Script Changes

- -

filelist-bindings.tcl:

- - - -

treectrl.tcl:

- - - -

Other Changes

- - - -

Demo Changes

- - - - diff --git a/doc/treectrl.html b/doc/treectrl.html index 1de14ed..884eda8 100644 --- a/doc/treectrl.html +++ b/doc/treectrl.html @@ -1,10 +1,10 @@ - treectrl - Tk Commands - @@ -636,6 +636,15 @@ root item. The default value is false. The item option -button determines whether the root item has a button.

+
Command-Line Switch: -showrootchildbuttons
+Database Name: showRootChildButtons
+Database Class: ShowRootChildButtons
+
+Specifies a boolean value that determines whether this widget +should draw the expand/collapse buttons next to children of the root item. +The default value is true. + +

Command-Line Switch: -showrootlines
Database Name: showRootLines
Database Class: ShowRootLines
diff --git a/doc/treectrl.man b/doc/treectrl.man index 76e3d14..fdc4be4 100644 --- a/doc/treectrl.man +++ b/doc/treectrl.man @@ -3,11 +3,12 @@ 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.55 2008/02/29 21:14:33 treectrl Exp $} -][manpage_begin treectrl n 2.2.6] + $Id: treectrl.man,v 1.56 2008/07/21 18:49:34 treectrl Exp $} +] +[manpage_begin treectrl n 2.2.7] [moddesc {Tk Commands}] [titledesc {Create and manipulate hierarchical multicolumn widgets}] -[require treectrl 2.2.6] +[require treectrl 2.2.7] [description] [list_begin definitions] @@ -294,6 +295,11 @@ 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 -showrootchildbuttons showRootChildButtons ShowRootChildButtons] +Specifies a boolean value that determines whether this widget +should draw the expand/collapse buttons next to children of the root item. +The default value is true. + [tkoption_def -showrootlines showRootLines ShowRootLines] Specifies a boolean value that determines whether this widget should draw the connecting lines between children of the root item. diff --git a/doc/treectrl.n b/doc/treectrl.n index 4672c3f..7ac3da6 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.72 2008/02/29 21:14:33 treectrl Exp $ +'\" $Id: treectrl.n,v 1.73 2008/07/21 18:49:34 treectrl Exp $ .so man.macros .TH "treectrl" n 2.2.6 treectrl "Tk Commands" .BS @@ -876,6 +876,18 @@ The item option \fB-button\fR determines whether the root item has a button. .LP .nf .ta 6c +Command-Line Switch: \fB-showrootchildbuttons\fR +Database Name: \fBshowRootChildButtons\fR +Database Class: \fBShowRootChildButtons\fR + +.fi +.IP +Specifies a boolean value that determines whether this widget +should draw the expand/collapse buttons next to children of the root item. +The default value is true. +.LP +.nf +.ta 6c Command-Line Switch: \fB-showrootlines\fR Database Name: \fBshowRootLines\fR Database Class: \fBShowRootLines\fR diff --git a/generic/tkTreeCtrl.c b/generic/tkTreeCtrl.c index adbc543..26d8eb0 100644 --- a/generic/tkTreeCtrl.c +++ b/generic/tkTreeCtrl.c @@ -7,7 +7,7 @@ * Copyright (c) 2002-2003 Christian Krone * Copyright (c) 2003-2005 ActiveState, a division of Sophos * - * RCS: @(#) $Id: tkTreeCtrl.c,v 1.107 2008/01/22 01:03:02 treectrl Exp $ + * RCS: @(#) $Id: tkTreeCtrl.c,v 1.108 2008/07/21 18:49:32 treectrl Exp $ */ #include "tkTreeCtrl.h" @@ -236,6 +236,9 @@ static Tk_OptionSpec optionSpecs[] = { {TK_OPTION_BOOLEAN, "-showrootbutton", "showRootButton", "ShowRootButton", "0", -1, Tk_Offset(TreeCtrl, showRootButton), 0, (ClientData) NULL, TREE_CONF_RELAYOUT}, + {TK_OPTION_BOOLEAN, "-showrootchildbuttons", "showRootChildButtons", + "ShowRootChildButtons", "1", -1, Tk_Offset(TreeCtrl, showRootChildButtons), + 0, (ClientData) NULL, TREE_CONF_RELAYOUT}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", DEF_LISTBOX_TAKE_FOCUS, -1, Tk_Offset(TreeCtrl, takeFocus), TK_OPTION_NULL_OK, 0, 0}, @@ -905,12 +908,18 @@ static int TreeWidgetCmd( sprintf(buf, "item %s%d", tree->itemPrefix, TreeItem_GetID(tree, item)); /* TreeItem_ToObj() */ depth = TreeItem_GetDepth(tree, item); - if (tree->showRoot || tree->showButtons || tree->showLines) - depth++; - if (tree->showRoot && tree->showButtons && tree->showRootButton) - depth++; if (item == tree->root) depth = (tree->showButtons && tree->showRootButton) ? 1 : 0; + else if (tree->showRoot) + { + depth++; + if (tree->showButtons && tree->showRootButton) + depth++; + } + else if (tree->showButtons && tree->showRootChildButtons) + depth += 1; + else if (tree->showLines && tree->showRootLines) + depth += 1; lock = (hit == TREE_AREA_LEFT) ? COLUMN_LOCK_LEFT : (hit == TREE_AREA_RIGHT) ? COLUMN_LOCK_RIGHT : @@ -3229,11 +3238,11 @@ A_YviewCmd( break; } - /* Don't scroll too far left */ + /* Don't scroll too far up */ if (index < 0) index = 0; - /* Don't scroll too far right */ + /* Don't scroll too far down */ if (index > indexMax) index = indexMax; diff --git a/generic/tkTreeCtrl.h b/generic/tkTreeCtrl.h index 97f4ca6..cbca317 100644 --- a/generic/tkTreeCtrl.h +++ b/generic/tkTreeCtrl.h @@ -7,7 +7,7 @@ * Copyright (c) 2002-2003 Christian Krone * Copyright (c) 2003 ActiveState Corporation * - * RCS: @(#) $Id: tkTreeCtrl.h,v 1.94 2008/03/12 19:12:47 treectrl Exp $ + * RCS: @(#) $Id: tkTreeCtrl.h,v 1.95 2008/07/21 18:49:32 treectrl Exp $ */ #include "tkPort.h" @@ -124,6 +124,9 @@ typedef struct TreePtrList TreePtrList; typedef TreePtrList TreeItemList; typedef TreePtrList TreeColumnList; struct TreePtrList { +#ifdef TREECTRL_DEBUG + char magic[4]; +#endif TreeCtrl *tree; ClientData *pointers; /* NULL-terminated list of pointers. */ int count; /* Number of items. */ @@ -202,6 +205,8 @@ struct TreeCtrl int showRoot; /* boolean: Draw the unique root item */ int showRootButton; /* boolean: Draw expand/collapse button for * root item */ + int showRootChildButtons; /* boolean: Draw expand/collapse buttons for + * children of the root item */ int showHeader; /* boolean: show column titles */ Tcl_Obj *indentObj; /* pixels: offset of child relative to * parent */ diff --git a/generic/tkTreeItem.c b/generic/tkTreeItem.c index 8f9b0a7..32e9e72 100644 --- a/generic/tkTreeItem.c +++ b/generic/tkTreeItem.c @@ -5,7 +5,7 @@ * * Copyright (c) 2002-2008 Tim Baker * - * RCS: @(#) $Id: tkTreeItem.c,v 1.105 2008/02/29 20:49:22 treectrl Exp $ + * RCS: @(#) $Id: tkTreeItem.c,v 1.106 2008/07/21 18:49:33 treectrl Exp $ */ #include "tkTreeCtrl.h" @@ -946,7 +946,8 @@ TreeItem_UndefineState( * * Determine whether an item should have a button displayed next to * it. This considers the value of the item option -button as well - * as the treectrl options -showbuttons and -showrootbutton. + * as the treectrl options -showbuttons, -showrootchildbuttons and + * -showrootbutton. * * Results: * None. @@ -965,6 +966,8 @@ TreeItem_HasButton( { if (!tree->showButtons || (IS_ROOT(item) && !tree->showRootButton)) return 0; + if (item->parent == tree->root && !tree->showRootChildButtons) + return 0; if (item->flags & ITEM_FLAG_BUTTON) return 1; if (item->flags & ITEM_FLAG_BUTTON_AUTO) { @@ -3610,19 +3613,27 @@ int TreeItem_Indent( TreeItem item /* Item token. */ ) { - int indent; + int depth; if (IS_ROOT(item)) - return (tree->showRoot && tree->showButtons && tree->showRootButton) ? tree->useIndent : 0; + return (tree->showRoot && tree->showButtons && tree->showRootButton) + ? tree->useIndent : 0; Tree_UpdateItemIndex(tree); - indent = tree->useIndent * item->depth; - if (tree->showRoot || tree->showButtons || tree->showLines) - indent += tree->useIndent; - if (tree->showRoot && tree->showButtons && tree->showRootButton) - indent += tree->useIndent; - return indent; + depth = item->depth; + if (tree->showRoot) + { + depth += 1; + if (tree->showButtons && tree->showRootButton) + depth += 1; + } + else if (tree->showButtons && tree->showRootChildButtons) + depth += 1; + else if (tree->showLines && tree->showRootLines) + depth += 1; + + return tree->useIndent * depth; } /* diff --git a/shellicon/configure b/shellicon/configure index ba7fa18..dc519ab 100644 --- a/shellicon/configure +++ b/shellicon/configure @@ -1772,7 +1772,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -PACKAGE_PATCHLEVEL=2.2.6 +PACKAGE_PATCHLEVEL=2.2.7 cat >>confdefs.h <<_ACEOF #define PACKAGE_PATCHLEVEL "$PACKAGE_PATCHLEVEL" diff --git a/shellicon/configure.ac b/shellicon/configure.ac index 4bc5f55..740fd7c 100644 --- a/shellicon/configure.ac +++ b/shellicon/configure.ac @@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tcl installation dnl to configure the system for the local environment. # -# RCS: @(#) $Id: configure.ac,v 1.5 2008/02/29 21:14:32 treectrl Exp $ +# RCS: @(#) $Id: configure.ac,v 1.6 2008/07/21 18:49:32 treectrl Exp $ #----------------------------------------------------------------------- # Sample configure.in for Tcl Extensions. @@ -20,7 +20,7 @@ dnl to configure the system for the local environment. #----------------------------------------------------------------------- AC_INIT([shellicon], [2.2]) -AC_SUBST([PACKAGE_PATCHLEVEL], [2.2.6]) +AC_SUBST([PACKAGE_PATCHLEVEL], [2.2.7]) AC_DEFINE_UNQUOTED(PACKAGE_PATCHLEVEL, "$PACKAGE_PATCHLEVEL") TEA_INIT([3.5]) -- cgit v0.12