summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authortreectrl <treectrl>2006-12-02 21:42:59 (GMT)
committertreectrl <treectrl>2006-12-02 21:42:59 (GMT)
commitc785d9471a933b7dce6f6d5a6843182ff4b789f4 (patch)
treeaa6f002da43627fd92fe44d6e835812694ed0490 /demos
parentc0933cbb5e14ded41445b9e50d519a4c9a25ddbd (diff)
downloadtktreectrl-c785d9471a933b7dce6f6d5a6843182ff4b789f4.zip
tktreectrl-c785d9471a933b7dce6f6d5a6843182ff4b789f4.tar.gz
tktreectrl-c785d9471a933b7dce6f6d5a6843182ff4b789f4.tar.bz2
Added "Item Justify" popup to the right-click menu for column headers.
Diffstat (limited to 'demos')
-rw-r--r--demos/demo.tcl15
1 files changed, 14 insertions, 1 deletions
diff --git a/demos/demo.tcl b/demos/demo.tcl
index 8a4af86..4d75d85 100644
--- a/demos/demo.tcl
+++ b/demos/demo.tcl
@@ -1,6 +1,6 @@
#!/bin/wish84.exe
-# RCS: @(#) $Id: demo.tcl,v 1.57 2006/11/25 20:21:26 treectrl Exp $
+# RCS: @(#) $Id: demo.tcl,v 1.58 2006/12/02 21:42:59 treectrl Exp $
set VERSION 2.2
@@ -988,6 +988,17 @@ proc MakeHeaderPopup {T} {
$m add checkbutton -label "Expand" -variable Popup(expand) \
-command {$Popup(T) column configure $Popup(column) -expand $Popup(expand)}
+ set m2 [menu $m.mItemJustify -tearoff no]
+ $m add cascade -label "Item Justify" -menu $m2
+ $m2 add radiobutton -label "Left" -variable Popup(itemjustify) -value left \
+ -command {$Popup(T) column configure $Popup(column) -itemjustify left}
+ $m2 add radiobutton -label "Center" -variable Popup(itemjustify) -value center \
+ -command {$Popup(T) column configure $Popup(column) -itemjustify center}
+ $m2 add radiobutton -label "Right" -variable Popup(itemjustify) -value right \
+ -command {$Popup(T) column configure $Popup(column) -itemjustify right}
+ $m2 add radiobutton -label "Unspecified" -variable Popup(itemjustify) -value none \
+ -command {$Popup(T) column configure $Popup(column) -itemjustify {}}
+
set m2 [menu $m.mJustify -tearoff no]
$m add cascade -label Justify -menu $m2
$m2 add radiobutton -label "Left" -variable Popup(justify) -value left \
@@ -1044,6 +1055,8 @@ proc ShowPopup {T x y X Y} {
set Popup(expand) [$T column cget $Popup(column) -expand]
set Popup(resize) [$T column cget $Popup(column) -resize]
set Popup(squeeze) [$T column cget $Popup(column) -squeeze]
+ set Popup(itemjustify) [$T column cget $Popup(column) -itemjustify]
+ if {$Popup(itemjustify) eq ""} { set Popup(itemjustify) none }
set Popup(justify) [$T column cget $Popup(column) -justify]
set Popup(lock) [$T column cget $Popup(column) -lock]
set Popup(treecolumn) [expr {[$T column id tree] eq $Popup(column)}]