summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authortreectrl <treectrl>2006-10-14 21:19:53 (GMT)
committertreectrl <treectrl>2006-10-14 21:19:53 (GMT)
commitb3397722a2f81f202020aabf01206bd96a99948f (patch)
tree2ff1e236f6557ae0c82bd37f8e831cc66e3f9c87 /demos
parentfa86b7c5283c56f320d03929b44d988099e50763 (diff)
downloadtktreectrl-b3397722a2f81f202020aabf01206bd96a99948f.zip
tktreectrl-b3397722a2f81f202020aabf01206bd96a99948f.tar.gz
tktreectrl-b3397722a2f81f202020aabf01206bd96a99948f.tar.bz2
Remove rowlabels.
Diffstat (limited to 'demos')
-rw-r--r--demos/demo.tcl18
-rw-r--r--demos/rowlabels.tcl148
2 files changed, 2 insertions, 164 deletions
diff --git a/demos/demo.tcl b/demos/demo.tcl
index 3fd545f..47a09bf 100644
--- a/demos/demo.tcl
+++ b/demos/demo.tcl
@@ -1,6 +1,6 @@
#!/bin/wish84.exe
-# RCS: @(#) $Id: demo.tcl,v 1.47 2006/10/14 20:23:28 treectrl Exp $
+# RCS: @(#) $Id: demo.tcl,v 1.48 2006/10/14 21:20:08 treectrl Exp $
set VERSION 2.1.1
@@ -175,7 +175,6 @@ foreach file {
outlook-folders
outlook-newgroup
random
- rowlabels
span
textvariable
www-options
@@ -791,15 +790,11 @@ proc MakeListPopup {T} {
-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 "Row Labels" -variable Popup(showrowlabels) \
- -command {$Popup(T) configure -showrowlabels $Popup(showrowlabels)}
$m add cascade -label Show -menu $m2
set m2 [menu $m.mSpan -tearoff no]
$m add cascade -label Span -menu $m2
- $m add checkbutton -label "Row Label Resize" -variable Popup(rowlabelresize) \
- -command {$Popup(T) configure -rowlabelresize $Popup(rowlabelresize)}
$m add checkbutton -label "Use Theme" -variable Popup(usetheme) \
-command {$Popup(T) configure -usetheme $Popup(usetheme)}
@@ -931,7 +926,6 @@ proc ShowPopup {T x y X Y} {
set Popup(showrootlines) [$T cget -showrootlines]
set Popup(showroot) [$T cget -showroot]
set Popup(showrootbutton) [$T cget -showrootbutton]
- set Popup(showrowlabels) [$T cget -showrowlabels]
set m $menu.mVisible
$m delete 0 end
foreach C [$T column list] {
@@ -957,7 +951,6 @@ proc ShowPopup {T x y X Y} {
$m add command -label "no item column" -state disabled
}
- set Popup(rowlabelresize) [$T cget -rowlabelresize]
set Popup(usetheme) [$T cget -usetheme]
tk_popup $menu $X $Y
return
@@ -1009,7 +1002,6 @@ proc InitDemoList {} {
"Big List" DemoBigList biglist.tcl \
"Column Spanning" DemoSpan span.tcl \
"My Computer" DemoMyComputer mycomputer.tcl \
- "Row Labels" DemoRowLabels rowlabels.tcl \
"Column Locking" DemoColumnLock column-lock.tcl
] {
set item [$t item create]
@@ -1251,10 +1243,6 @@ proc DemoClear {} {
# Delete columns in demo list
$T column delete all
- # Delete row labels in demo list
-catch {
- $T rowlabel delete all
-}
# Delete all styles in demo list
eval $T style delete [$T style names]
@@ -1280,9 +1268,7 @@ catch {
-highlightthickness 3 -usetheme yes -cursor {} \
-itemwidth 0 -itemwidthequal no -itemwidthmultiple 0 \
-font [.f4.t cget -font]
-catch {
- $T configure -showrowlabels no
-}
+
# Undo "column configure all" in a demo
$T column configure tail -background \
[lindex [$T column configure tail -background] 3]
diff --git a/demos/rowlabels.tcl b/demos/rowlabels.tcl
deleted file mode 100644
index 8c8f8b6..0000000
--- a/demos/rowlabels.tcl
+++ /dev/null
@@ -1,148 +0,0 @@
-# RCS: @(#) $Id: rowlabels.tcl,v 1.2 2006/10/11 01:37:59 treectrl Exp $
-
-proc DemoRowLabels {} {
-
- global RowLabel
-
- set T .f2.f1.t
-
- #
- # Configure the treectrl widget
- #
-
- $T configure \
- -showbuttons no \
- -showlines no \
- -showroot no \
- -xscrollincrement 40 \
- -showrowlabels yes
-
- #
- # Create columns
- #
-
- for {set i 0} {$i < 100} {incr i} {
- $T column create -text "C$i" -tags C$i -width 40 -justify center
- }
-
- $T state define mouseover
-
- #
- # Create row labels
- #
-
- $T element create label1.bg rect -fill {gray80 mouseover gray {}}
- $T element create label1.text text
- $T style create label1 -orient horizontal
- $T style elements label1 {label1.bg label1.text}
- $T style layout label1 label1.bg -detach yes -iexpand xy
- $T style layout label1 label1.text -expand wns -padx 2
-
- for {set i 0} {$i < 10} {incr i} {
- $T rowlabel create -tags R$i -style label1
- $T rowlabel text R$i "R$i"
- }
-
- $T element create label2.bd border -background $::SystemButtonFace \
- -relief raised -thickness 2 -filled yes
- $T element create label2.text text
- $T style create label2 -orient horizontal
- $T style elements label2 {label2.bd label2.text}
- $T style layout label2 label2.bd -detach yes -iexpand xy
- $T style layout label2 label2.text -expand news -padx 2 -pady 2
-
- for {set i 10} {$i < 20} {incr i} {
- $T rowlabel create -tag R$i -style label2
- $T rowlabel text R$i "R$i"
- }
-
- $T element create label3.div rect -fill black -height 2
- $T element create label3.text text
- $T style create label3 -orient horizontal
- $T style elements label3 {label3.div label3.text}
- $T style layout label3 label3.div -detach yes -expand n -iexpand x
- $T style layout label3 label3.text -expand ws -padx 2 -pady 2
-
- for {set i 20} {$i < 30} {incr i} {
- $T rowlabel create -tag R$i -style label3
- $T rowlabel text R$i "R$i"
- }
-
- $T element create label4.rect rect -fill {#e0e8f0 mouseover}
- $T element create label4.text text
- $T element create label4.w window -clip yes
- $T style create label4 -orient vertical
- $T style elements label4 {label4.rect label4.text label4.w}
- $T style layout label4 label4.rect -detach yes -iexpand xy
- $T style layout label4 label4.text -expand we -padx 2 -pady 2
- $T style layout label4 label4.w -iexpand x -padx 2 -pady {0 2}
-
- for {set i 30} {$i < 40} {incr i} {
- $T rowlabel create -tag R$i -style label4
- $T rowlabel element configure R$i label4.text -textvariable ::DemoRowLabels(R$i)
- set clip [frame $T.clip$i -borderwidth 0]
- $::entryCmd $clip.e -width 4 -textvariable ::DemoRowLabels(R$i)
- $T rowlabel element configure R$i label4.w -window $clip
- set ::DemoRowLabels(R$i) "R$i"
- }
-
- #
- # Create elements
- #
-
- $T element create eRect rect -outline gray -outlinewidth 1 -open wn
-
- #
- # Create styles using the elements
- #
-
- $T style create s1 -orient horizontal
- $T style elements s1 eRect
- $T style layout s1 eRect -detach yes -iexpand xy
-
- #
- # Create items and assign styles
- #
-
- set ids [$T item create -count 40 -parent root]
- foreach C [$T column list] {
- $T item style set [list list $ids] $C s1
- }
-
- bind DemoRowLabels <Button1-Motion> {
- # no-op
- }
- bind DemoRowLabels <Motion> {
- RowLabelMotion %W %x %y
- }
-
- set RowLabel(prev) ""
- bindtags $T [list $T DemoRowLabels TreeCtrl [winfo toplevel $T] all]
-
- return
-}
-
-proc RowLabelMotion {w x y} {
- global RowLabel
- set id [$w identify $x $y]
- if {$id eq ""} {
- } elseif {[lindex $id 0] eq "header"} {
- } elseif {[lindex $id 0] eq "item"} {
- } elseif {[lindex $id 0] eq "rowlabel"} {
- set row [lindex $id 1]
- if {$row ne $RowLabel(prev)} {
- if {$RowLabel(prev) ne ""} {
- $w rowlabel state set $RowLabel(prev) !mouseover
- }
- $w rowlabel state set $row mouseover
- set RowLabel(prev) $row
- }
- return
- }
- if {$RowLabel(prev) ne ""} {
- $w rowlabel state set $RowLabel(prev) !mouseover
- set RowLabel(prev) ""
- }
- return
-}
-