summaryrefslogtreecommitdiffstats
path: root/demos/demo.tcl
diff options
context:
space:
mode:
authortreectrl <treectrl>2006-12-07 03:52:02 (GMT)
committertreectrl <treectrl>2006-12-07 03:52:02 (GMT)
commit000b041d5c61cc3c00a58b32af186c60b79fbe44 (patch)
tree4c84c1760ac0cfeda00d4af9ab3bf0674a3cb28a /demos/demo.tcl
parent75b42e8776a030acc312d3b89876a2403d6b98d7 (diff)
downloadtktreectrl-000b041d5c61cc3c00a58b32af186c60b79fbe44.zip
tktreectrl-000b041d5c61cc3c00a58b32af186c60b79fbe44.tar.gz
tktreectrl-000b041d5c61cc3c00a58b32af186c60b79fbe44.tar.bz2
Tweak the "Span" submenu to consider the column option -lock.
Only delay displaying the styles in an item when the selection changes if the mouse button is pressed. Remove usage of the deprecated -defaultstyle option.
Diffstat (limited to 'demos/demo.tcl')
-rw-r--r--demos/demo.tcl20
1 files changed, 15 insertions, 5 deletions
diff --git a/demos/demo.tcl b/demos/demo.tcl
index f06f560..d20dae5 100644
--- a/demos/demo.tcl
+++ b/demos/demo.tcl
@@ -1,6 +1,6 @@
#!/bin/wish84.exe
-# RCS: @(#) $Id: demo.tcl,v 1.59 2006/12/04 00:15:40 treectrl Exp $
+# RCS: @(#) $Id: demo.tcl,v 1.60 2006/12/07 03:52:02 treectrl Exp $
set VERSION 2.2
@@ -1138,8 +1138,9 @@ proc ShowPopup {T x y X Y} {
if {[llength $id] >= 4 && [lindex $id 2] eq "column"} {
set item [lindex $id 1]
set column [lindex $id 3]
- for {set i 1} {$i <= [$T column count] - [$T column order $column]} {incr i} {
- set break [expr {!($i % 20)}]
+ set lock [$T column cget $column -lock]
+ for {set i 1} {$i <= [$T column order "last lock $lock"] - [$T column order $column] + 1} {incr i} {
+ set break [expr {!(($i - 1) % 20)}]
$m add radiobutton -label $i -command "$T item span $item $column $i" \
-variable Popup(span) -value $i -columnbreak $break
}
@@ -1407,7 +1408,12 @@ proc DisplayStylesInItem {item} {
# When one item is selected in the demo list, display the styles in that item.
# See DemoClear for why the tag "DontDelete" is used.
set DisplayStylesInItem(item) ""
+set MouseIsDown 0
+bind [DemoList] <ButtonPress-1> {
+ set MouseIsDown 1
+}
bind [DemoList] <ButtonRelease-1> {
+ set MouseIsDown 0
if {$DisplayStylesInItem(item) ne ""} {
DisplayStylesInItem $DisplayStylesInItem(item)
set DisplayStylesInItem(item) ""
@@ -1415,7 +1421,11 @@ bind [DemoList] <ButtonRelease-1> {
}
[DemoList] notify bind DontDelete <Selection> {
if {%c == 1} {
- set DisplayStylesInItem(item) [%T selection get 0]
+ if {$MouseIsDown} {
+ set DisplayStylesInItem(item) [%T selection get 0]
+ } else {
+ DisplayStylesInItem [%T selection get 0]
+ }
}
}
@@ -1468,7 +1478,7 @@ proc DemoClear {} {
-yscrollincrement 0 -itemheight 0 -showheader yes \
-background white -scrollmargin 0 -xscrolldelay 50 -yscrolldelay 50 \
-buttonbitmap "" -buttonimage "" -backgroundmode row \
- -indent 19 -defaultstyle {} -backgroundimage "" \
+ -indent 19 -backgroundimage "" \
-showrootlines yes -minitemheight 0 -borderwidth [expr {$::tileFull ? 0 : 6}] \
-highlightthickness [expr {$::tileFull ? 0 : 3}] -usetheme yes -cursor {} \
-itemwidth 0 -itemwidthequal no -itemwidthmultiple 0 \