- Timestamp:
- Nov 17, 2016, 12:57:30 PM (10 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- b23291d
- Parents:
- f861956
- Location:
- tolbase/lib
- Files:
-
- 2 edited
-
byswidget/blistboxplus/blistboxplus.tcl (modified) (56 diffs)
-
wtree/wtree.tcl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tolbase/lib/byswidget/blistboxplus/blistboxplus.tcl
rf861956 r23399d1 6 6 7 7 package require byscommon 8 package require BLT9 8 package require bfunctions 10 9 package require bfieldsdialog … … 61 60 62 61 option -readonly 0 62 option -selectmode extended 63 63 option -keypress true 64 64 option -colkeypress "" … … 102 102 103 103 if {0} { 104 install _listbox using ::blt::treeview $win.lb -hideroot yes \ 104 return 105 #@T install _listbox using ::blt::treeview $win.lb -hideroot yes \ 105 106 -activeicons "" -icons {} -selectmode multiple \ 106 107 -selectbackground grey -selectforeground white \ … … 108 109 -nofocusselectbackground grey -font {Arial 9} -flat yes 109 110 } else { 110 set _listbox [::blt::treeview $win.lb -hideroot yes \ 111 set _listbox [::wtree $win.lb -table 0 -filter no \ 112 -background white -showroot 0 -selectmode extended -showheader 1 \ 113 -highlightbackground gray75 -highlightcolor black \ 114 -highlightthickness 0 -font {Arial 9} \ 115 -columns [::TolInspector::LNodeDef] ] 116 #@T set _listbox [::blt::treeview $win.lb -hideroot yes \ 111 117 -activeicons "" -icons {} -selectmode multiple \ 112 118 -selectbackground grey -selectforeground white \ … … 127 133 bindtags $_listbox [linsert [bindtags $_listbox] 2 $win] 128 134 129 $_listbox style configure text -bg white 130 131 $_listbox column configure treeView -bg white 135 #@T! $_listbox style configure text -bg white 136 #@T! to do 137 138 #@T! $_listbox column configure treeView -bg white 139 #@T! to do 132 140 133 141 $self configure -readonly [from args -readonly] … … 137 145 $self configurelist $args 138 146 139 $_listbox configure -xscrollcommand "$xbar set" 140 $_listbox configure -yscrollcommand "$ybar set" 147 #@T! $_listbox configure -xscrollcommand "$xbar set" 148 #@T! $_listbox configure -yscrollcommand "$ybar set" 149 #@T! to do 141 150 if { $options(-parent) eq "" } { 142 151 $self configure -parent [winfo parent $win] … … 144 153 145 154 # bind 146 $_listbox bind all <KeyPress> +[list $self _OnKeyPress %A] 155 #@T! $_listbox bind all <KeyPress> +[list $self _OnKeyPress %A] 156 #@T! to do 147 157 148 158 $self configure -nomenu [from args -nomenu] … … 176 186 catch [list $self _WriteIni ] 177 187 } 178 188 179 189 #/////////////////////////////////////////////////////////////////////////// 180 190 # … … 183 193 #/////////////////////////////////////////////////////////////////////////// 184 194 185 onconfigure -cols { lst } { 186 set options(-cols) $lst 187 foreach col [$self column names] { 188 $_listbox column delete $col 189 } 190 foreach col $options(-cols) { 191 $_listbox column insert end $col -justify left 192 $_listbox column configure $col -command "$self _SortByColumn [list $col]" \ 193 -titleborderwidth 1 194 } 195 if { $options(-icon) == "" } { 196 $_listbox column configure "BLT TreeView $_listbox" -hide 1 197 } else { 198 $_lisbox column configure "BLT TreeView $_listbox" -hide 0 199 } 195 onconfigure -cols { lst } { 196 set options(-cols) $lst 197 #@T! foreach col [$self column names] { 198 #@T! $_listbox column delete $col 199 #@T! } 200 $_listbox column delete all 201 #@T! foreach col $options(-cols) { 202 #@T! $_listbox column insert end $col -justify left 203 #@T! $_listbox column configure $col -command "$self _SortByColumn [list $col]" -titleborderwidth 1 204 #@T! } 205 206 set lstx [list [list image -label Icon -tags Icon] ] 207 foreach col $lst { 208 set colx [list text -label $col -tags $col] 209 lappend lstx $colx 210 } 211 Tolcon_Trace "lstx $lstx" 212 $_listbox configure -columns $lstx 213 214 if { $options(-icon) == "" } { 215 #@T! $_listbox column configure "BLT TreeView $_listbox" -hide 1 216 $_listbox column configure Icon -visible 0 217 } else { 218 #@T! $_listbox column configure "BLT TreeView $_listbox" -hide 0 219 $_listbox column configure Icon -visible 1 220 } 221 222 #@T adds 223 $_listbox column configure first -expand yes -weight 1 224 $_listbox column configure all -itembackground "" 200 225 } 201 226 … … 204 229 foreach col [$self column names] { 205 230 if { "-1" eq [lsearch $options(-hiddencols) $col] } { 206 $_listbox column configure $col -hide 0 231 #@T! $_listbox column configure $col -hide 0 232 $_listbox column configure $col -visible 1 207 233 } else { 208 $_listbox column configure $col -hide 1 234 #@T! $_listbox column configure $col -hide 1 235 $_listbox column configure $col -visible 0 209 236 } 210 237 } … … 220 247 set options(-icon) $icon 221 248 if { $icon != "" } { 222 $_listbox column configure "BLT TreeView $_listbox" -min 16 -max 16 \ 223 -hide 0 -titleborderwidth 1 224 $_listbox configure -icons [list [Bitmap::get $icon] [Bitmap::get $icon]] 249 #@T! $_listbox column configure "BLT TreeView $_listbox" -min 16 -max 16 \ 250 #@T! -hide 0 -titleborderwidth 1 251 #@T! $_listbox configure -icons [list [Bitmap::get $icon] [Bitmap::get $icon]] 252 $_listbox column configure Icon -minwidth 16 -maxwidth 16 -visible 1 ;# -titleborderwidth 1 253 225 254 } else { 226 $_listbox column configure "BLT TreeView $_listbox" -hide 1 255 #@T! $_listbox column configure "BLT TreeView $_listbox" -hide 1 256 $_listbox column configure Icon -visible 0 227 257 } 228 258 } … … 237 267 } 238 268 } 239 269 240 270 onconfigure -values { lst } { 241 271 $self clear … … 253 283 } 254 284 } 255 285 256 286 onconfigure -readonly { bool } { 257 287 if {!($created)} { … … 263 293 } 264 294 295 onconfigure -selectmode { mode } { 296 if { $mode eq "multiple" } { 297 set options(-selectmode) "extended" 298 } else { 299 set options(-selectmode) $mode 300 } 301 } 302 265 303 onconfigure -filtercols { lst } { 266 304 set cols [$self cget -cols] … … 280 318 } 281 319 } 282 320 283 321 #/////////////////////////////////////////////////////////////////////////// 284 322 method _CreateMenu {args} { … … 334 372 } 335 373 # bindings 336 $self bind all <Control-KeyRelease> +[list $self _OnControlKey $self %K %k] 337 $self bind all <Key-Delete> "lbDeleteSelection $self" 338 $self bind all <Key-Insert> "$self _OpenWR" 339 $self bind all <Shift-Up> "$self addPrevious" 340 $self bind all <Shift-Down> "$self addNext" 341 $self bind all <Up> "$self previous" 342 $self bind all <Down> "$self next" 343 $self bind all <Home> "$self first" 344 $self bind all <End> "$self last" 345 $self bind all <Shift-Home> "$self addAllPrevious" 346 $self bind all <Shift-End> "$self addAllNext" 347 $self bind all <Button-1> +[list focus -force %W] 348 } 349 350 374 #@T $self bind all <Control-KeyRelease> +[list $self _OnControlKey $self %K %k] 375 #@T $self bind all <Key-Delete> "lbDeleteSelection $self" 376 #@T $self bind all <Key-Insert> "$self _OpenWR" 377 #@T $self bind all <Shift-Up> "$self addPrevious" 378 #@T $self bind all <Shift-Down> "$self addNext" 379 #@T $self bind all <Up> "$self previous" 380 #@T $self bind all <Down> "$self next" 381 #@T $self bind all <Home> "$self first" 382 #@T $self bind all <End> "$self last" 383 #@T $self bind all <Shift-Home> "$self addAllPrevious" 384 #@T $self bind all <Shift-End> "$self addAllNext" 385 #@T $self bind all <Button-1> +[list focus -force %W] 386 387 bind $_listbox.frameTree.t <Control-KeyRelease> +[list $self _OnControlKey $self %K %k] 388 bind $_listbox.frameTree.t <Key-Delete> "lbDeleteSelection $self" 389 bind $_listbox.frameTree.t <Key-Insert> "$self _OpenWR" 390 bind $_listbox.frameTree.t <Shift-Up> "$self addPrevious" 391 bind $_listbox.frameTree.t <Shift-Down> "$self addNext" 392 bind $_listbox.frameTree.t <Up> "$self previous" 393 bind $_listbox.frameTree.t <Down> "$self next" 394 bind $_listbox.frameTree.t <Home> "$self first" 395 bind $_listbox.frameTree.t <End> "$self last" 396 bind $_listbox.frameTree.t <Shift-Home> "$self addAllPrevious" 397 bind $_listbox.frameTree.t <Shift-End> "$self addAllNext" 398 bind $_listbox.frameTree.t <Button-1> +[list focus -force %W] 399 } 400 401 #@////////////////////////////////////////////////////////////////////////// 402 method bind { args } { 403 # 404 # PURPOSE: modifies a particular case of bind 405 # 406 #/////////////////////////////////////////////////////////////////////////// 407 if { [lindex $args 1] eq "<Selection>" } { 408 #@T no se usa 409 return [eval $_listbox notify bind $args] 410 } else { 411 return [bind $_listbox.frameTree.t [lindex $args 1] [lindex $args 2]] 412 } 413 } 414 415 method curselection {} { 416 set cursel [$_listbox selection get] 417 if { [expr [llength $cursel] <= 1] } { return $cursel } 418 set curselx {} 419 foreach it $cursel { 420 lappend curselx [list $it [$_listbox item order $it]] 421 } 422 set curselxs [lsort -index end $curselx] 423 set cursels {} 424 foreach it $curselxs { 425 lappend cursels [lindex $it 0] 426 } 427 return $cursels 428 429 #set firstPos [$_listbox item order [lindex $cursel 0]] 430 #set lastPos [$_listbox item order [lindex $cursel end]] 431 #if { [expr $firstPos <= $lastPos] } { 432 # Tolcon_Trace "right!" 433 # foreach it $cursel { 434 # Tolcon_Trace "$it [$_listbox item order $it]" 435 # } 436 # return $cursel 437 #} else { 438 # Tolcon_Trace "reversed!" 439 # foreach it $cursel { 440 # Tolcon_Trace "$it [$_listbox item order $it]" 441 # } 442 # return [lreverse $cursel] 443 #} 444 } 445 351 446 #/////////////////////////////////////////////////////////////////////////// 352 447 method getMenu { } { … … 360 455 return $menu 361 456 } 362 363 457 364 458 #/////////////////////////////////////////////////////////////////////////// … … 379 473 } 380 474 } 381 382 475 383 476 #/////////////////////////////////////////////////////////////////////////// … … 427 520 } 428 521 429 430 522 #///////////////////////////////////////////////////////////////////////////// 431 523 method _ToggleSelection {} { … … 439 531 } 440 532 441 442 533 #/////////////////////////////////////////////////////////////////////////// 443 534 method _SelectAll { } { … … 450 541 } 451 542 } 452 453 543 454 544 #///////////////////////////////////////////////////////////////////////////// … … 483 573 } 484 574 485 486 575 #///////////////////////////////////////////////////////////////////////////// 487 576 method _SaveToFile {se unSe {pref ""} {suf ""} {sep "\n"}} { … … 506 595 if { ![ catch { set fd [open $filNam w] } msgerr] } { 507 596 # text to save 508 set lst {}509 if { $se } {510 foreach i [$self selection get selected] {511 lappend lst [$self get $i]512 }513 }514 if { $unSe } {515 foreach i [$self selection get unselected] {516 lappend lst [$self get $i]517 }518 }519 set str [ListToStr $lst $sep $pref $suf]520 # write521 puts -nonewline $fd $str522 close $fd523 return 1597 set lst {} 598 if { $se } { 599 foreach i [$self selection get selected] { 600 lappend lst [$self get $i] 601 } 602 } 603 if { $unSe } { 604 foreach i [$self selection get unselected] { 605 lappend lst [$self get $i] 606 } 607 } 608 set str [ListToStr $lst $sep $pref $suf] 609 # write 610 puts -nonewline $fd $str 611 close $fd 612 return 1 524 613 } 525 614 error $msgerr … … 542 631 if { ![ catch { set fd [open $filNam r] } msgerr] } { 543 632 while { [gets $fd line ] >= 0} { 544 Tolcon_Trace "adding $line"633 Tolcon_Trace "adding $line" 545 634 $self add $line 546 635 } … … 561 650 #/////////////////////////////////////////////////////////////////////////// 562 651 563 set numofel [$self size]564 set lst [list]565 set fulllst [$self get]566 567 foreach i $fulllst {568 lappend lst [$self get $i ]652 set numofel [$self size] 653 set lst [list] 654 set fulllst [$self get] 655 656 foreach i $fulllst { 657 lappend lst [$self get $i ] 569 658 } 570 659 # lst: contains a list of values 571 set coln 0572 set cols [$self cget -cols]573 set hidcols [$self cget -hiddencols]574 for { set j 0 } { $j < [llength $cols] } { incr j } {575 if {[lindex $cols $j] eq $col} {576 set coln $j577 }578 }660 set coln 0 661 set cols [$self cget -cols] 662 set hidcols [$self cget -hiddencols] 663 for { set j 0 } { $j < [llength $cols] } { incr j } { 664 if {[lindex $cols $j] eq $col} { 665 set coln $j 666 } 667 } 579 668 # coln: contains the index of the column to be ordered 580 set lst [lsort -index $coln $lst]581 $self clear669 set lst [lsort -index $coln $lst] 670 $self clear 582 671 for { set i 0 } { $i < $numofel } { incr i } { 583 set el [lindex $lst $i ] 584 $self insert end $el 585 } 586 587 } 588 672 set el [lindex $lst $i ] 673 $self insert end $el 674 } 675 676 } 589 677 590 678 #/////////////////////////////////////////////////////////////////////////// … … 602 690 } 603 691 } 604 605 692 606 693 #////////////////////////////////////////////////////////////////////////// … … 633 720 $dialog draw 634 721 } 635 636 722 637 723 #/////////////////////////////////////////////////////////////////////////// 638 724 proc _Filter { elem father } { … … 647 733 eval $father filter $elem 648 734 } 649 650 735 651 736 #////////////////////////////////////////////////////////////////////////// … … 660 745 -parent $self -orientation $options(-orientation) \ 661 746 -fields $options(-filtercols) -procedure [codename _Filter] \ 662 -buttons { info apply accept cancel } \747 -buttons { info apply accept cancel } \ 663 748 -titles $options(-titles)] 664 749 $dialog configure -info \ … … 703 788 $dialog draw 704 789 } 705 790 706 791 #/////////////////////////////////////////////////////////////////////////// 707 792 method _WriteIni { } { … … 748 833 } 749 834 750 751 835 #/////////////////////////////////////////////////////////////////////////// 752 836 method selection { args } { … … 759 843 #/////////////////////////////////////////////////////////////////////////// 760 844 if { [lindex $args 0] eq "get" } { 761 if { [lindex $args 1] eq "unselected" } {762 set result {}763 set selected [$self curselection]764 foreach i [$self get] {765 if { "-1" eq [lsearch $selected $i] } {766 lappend result $i767 }768 }769 return $result770 } else {771 return [eval $_listbox curselection]772 }773 }774 845 if { [lindex $args 1] eq "unselected" } { 846 set result {} 847 set selected [$self curselection] 848 foreach i [$self get] { 849 if { "-1" eq [lsearch $selected $i] } { 850 lappend result $i 851 } 852 } 853 return $result 854 } else { 855 #@T! return [eval $_listbox curselection] 856 return [$self curselection] 857 } 858 } 775 859 eval $_listbox selection $args 776 860 } 777 778 861 779 862 #/////////////////////////////////////////////////////////////////////////// … … 787 870 # 788 871 #/////////////////////////////////////////////////////////////////////////// 872 Tolcon_Trace "insert pos: $pos args: $args" 789 873 if { [lindex $args 0] eq "cols" } { 790 874 set cols [lindex $args 1] … … 796 880 switch [llength $cols] { 797 881 1 { 798 # mas de una columna882 # una sola columna 799 883 foreach dats $args { 800 884 set datos [list [lindex $cols 0] $dats] 801 $_listbox insert $pos $currentId -data $datos 885 #@T! $_listbox insert $pos $currentId -data $datos 886 set node [$_listbox item create -parent root -button 0 -open 0] 887 eval $_listbox item text $node $datos 888 if { $options(-icon) != "" } { 889 $_listbox item image $node [Bitmap::get $options(-icon)] 890 } 802 891 incr currentId 803 892 } … … 810 899 foreach col $cols { 811 900 lappend datos $col [lindex $dats $i] 812 incr i 901 incr i 902 } 903 #@T! $_listbox insert $pos $currentId -data $datos 904 set node [$_listbox item create -parent root -button 0 -open 0] ;# -parent $pos 905 eval $_listbox item text $node $datos 906 if { $options(-icon) != "" } { 907 $_listbox item image $node [Bitmap::get $options(-icon)] 813 908 } 814 $_listbox insert $pos $currentId -data $datos815 909 incr currentId 816 910 } … … 818 912 } 819 913 } 820 821 914 822 915 #/////////////////////////////////////////////////////////////////////////// … … 832 925 eval $self insert end $args 833 926 } 834 835 927 836 928 #/////////////////////////////////////////////////////////////////////////// … … 845 937 #/////////////////////////////////////////////////////////////////////////// 846 938 if { "-1" eq [lsearch $args 0] } { 847 eval $_listbox delete $args 939 #@T! eval $_listbox delete $args 940 eval $_listbox item delete $args 848 941 } else { 849 942 puts "Root node can't be deleted" 850 943 } 851 944 } 852 853 945 854 946 #/////////////////////////////////////////////////////////////////////////// 855 947 method getlb {} { … … 860 952 return $_listbox 861 953 } 862 863 954 864 955 #/////////////////////////////////////////////////////////////////////////// … … 872 963 # 873 964 #/////////////////////////////////////////////////////////////////////////// 874 if { $ids eq "" } { return [lrange [$self find] 1 end] } 965 Tolcon_Trace "get ids: $ids cols: $cols" 966 if { $ids eq "" } { 967 #@T! return [lrange [$self find] 1 end] 968 set items [$_listbox item children root] 969 Tolcon_Trace "items $items" 970 return $items ;#?? 971 } 875 972 876 973 set result {} 877 878 if { "$cols" eq "" } {879 set cols [$self column names]880 }974 975 if { "$cols" eq "" } { 976 set cols [$self column names] 977 } 881 978 882 979 foreach id $ids { … … 884 981 set elem {} 885 982 886 set data [$_listbox entry cget $id -data] 887 983 #@T! set data [$_listbox entry cget $id -data] 984 #@T! foreach col $cols { 985 #@T! set inx [lsearch $data $col] 986 #@T! if { "-1" ne $inx } { 987 #@T! incr inx 988 #@T! lappend elem [lindex $data $inx] 989 #@T! } 990 #@T! } 991 888 992 foreach col $cols { 889 set inx [lsearch $data $col] 890 if { "-1" ne $inx } { 891 incr inx 892 lappend elem [lindex $data $inx] 893 } 993 lappend elem [$_listbox item text $id $col] 894 994 } 895 995 896 996 lappend result $elem 897 997 } 898 if { [llength $ids] eq 1 } { return [lindex $result 0] } 998 999 if { [llength $ids] eq 1 } { 1000 Tolcon_Trace "get result: $result" 1001 Tolcon_Trace "get result0: [lindex $result 0]" 1002 return [lindex $result 0] 1003 } 1004 Tolcon_Trace "get result: $result" 899 1005 return $result 900 1006 } 901 902 1007 903 1008 #/////////////////////////////////////////////////////////////////////////// … … 912 1017 # 913 1018 #/////////////////////////////////////////////////////////////////////////// 1019 Tolcon_Trace "set id: $id data: $data cols: $cols" 914 1020 if { "$cols" eq "" } { 915 1021 set cols [$self column names] … … 922 1028 incr i 923 1029 } 924 return [$_listbox entry configure $id -data $datos]925 }926 1030 #@T! return [$_listbox entry configure $id -data $datos] 1031 return [eval $_listbox item text $id $datos] 1032 } 927 1033 928 1034 #/////////////////////////////////////////////////////////////////////////// … … 946 1052 return [lindex $all 0] 947 1053 } 948 949 1054 950 1055 #/////////////////////////////////////////////////////////////////////////// 951 1056 method last {} { … … 968 1073 return [lindex $all [expr [llength $all] - 1]] 969 1074 } 970 971 1075 972 1076 #/////////////////////////////////////////////////////////////////////////// … … 996 1100 } 997 1101 } 998 999 1102 1000 1103 #/////////////////////////////////////////////////////////////////////////// … … 1024 1127 } 1025 1128 1026 1027 1129 #/////////////////////////////////////////////////////////////////////////// 1028 1130 method previous {} { … … 1054 1156 } 1055 1157 } 1056 1057 1158 1058 1159 #/////////////////////////////////////////////////////////////////////////// … … 1085 1186 } 1086 1187 } 1087 1088 1188 1089 1189 #/////////////////////////////////////////////////////////////////////////// … … 1115 1215 } 1116 1216 } 1117 1118 1217 1119 1218 #/////////////////////////////////////////////////////////////////////////// … … 1142 1241 } 1143 1242 } 1144 1145 1243 1146 1244 #/////////////////////////////////////////////////////////////////////////// … … 1156 1254 } 1157 1255 1158 1159 1256 #/////////////////////////////////////////////////////////////////////////// 1160 1257 method size {} { … … 1166 1263 } 1167 1264 1168 1169 1265 #/////////////////////////////////////////////////////////////////////////// 1170 1266 method column { args } { … … 1173 1269 # 1174 1270 #/////////////////////////////////////////////////////////////////////////// 1271 #@T! if { [lindex $args 0] eq "names" } { 1272 #@T! return [lrange [$_listbox column names] 1 end] 1273 #@T! } 1274 #@T! return [eval $_listbox column $args] 1175 1275 if { [lindex $args 0] eq "names" } { 1176 return [lrange [$_listbox column names] 1 end] 1177 } 1178 return [eval $_listbox column $args] 1179 } 1180 1276 set names {} 1277 foreach col [lrange [$_listbox column list] 1 end] { 1278 lappend names [$_listbox column tag names $col] 1279 } 1280 return $names 1281 } 1282 return [eval $_listbox column id $args] 1283 } 1181 1284 1182 1285 #/////////////////////////////////////////////////////////////////////////// … … 1233 1336 -icons [list [Bitmap::get $icon] [Bitmap::get $icon]] 1234 1337 } 1235 1338 1236 1339 # delegacion de metodos y opciones 1237 1340 delegate method * to _listbox … … 1321 1424 .top.f1.f.blb clear 1322 1425 .top.f1.f.blb insert end {1 2 3 4} {one two three four} \ 1323 {uno dos tres cuatro} {k kk kkk kkkk} {0 0 0 0} {@ # $ %}1426 {uno dos tres cuatro} {k kk kkk kkkk} {0 0 0 0} {@ # $ %} 1324 1427 } 1325 1428 1326 1429 proc toggleSelectModeCmd {} { 1327 1430 if { [.top.f1.f.blb cget -selectmode] eq "multiple" } { 1328 .top.f1.f.blb configure -selectmode single1431 .top.f1.f.blb configure -selectmode single 1329 1432 } else { 1330 .top.f1.f.blb configure -selectmode multiple1433 .top.f1.f.blb configure -selectmode multiple 1331 1434 } 1332 1435 } -
tolbase/lib/wtree/wtree.tcl
rf861956 r23399d1 718 718 # orden en que se describen los elementos de la columna. 719 719 # 720 720 721 method _conf-columns { _ columnsSpec } { 721 722 if { $columnsSpec eq "" } { … … 826 827 } 827 828 829 method find { {first first} {last last} } { 830 if { [string match "-*" $first] } { 831 error "no flags allowed!" 832 } else { 833 return [$tree item range $first $last] 834 } 835 } 836 837 method selection { args } { 838 if { [lindex $args 0] eq "set" } { 839 Tolcon_Trace "selection $args" 840 switch [llength $args] { 841 1 { $tree selection clear all } 842 2 { $tree selection modify [lindex $args 1] all } 843 3 { $tree selection modify [$tree item range [lindex $args 1] [lindex $args 2]] all } 844 default { 845 error "invalid number of arguments" 846 } 847 } 848 } elseif { [lindex $args 0] eq "clearall" } { 849 $tree selection clear all 850 } { 851 eval $tree selection $args 852 } 853 } 854 855 method index { args } { 856 error "invalid method index" 857 } 858 859 method move { item how dest } { 860 Tolcon_Trace "item: $item how: $how dest: $dest" 861 if { $item eq $dest } { return } 862 switch $how { 863 into { 864 $tree item lastchild $dest $item 865 } 866 after { 867 if { $dest eq "" } { 868 $tree item prevsibling $item [$tree item nextsibling $item] 869 } else { 870 $tree item nextsibling $dest $item 871 #$tree item prevsibling $item $dest 872 } 873 } 874 before { 875 if { $dest eq "" } { 876 $tree item nextsibling $item [$tree item prevsibling $item] 877 } else { 878 $tree item prevsibling $dest $item 879 #$tree item nextsibling $item $dest 880 } 881 } 882 default { 883 error "invalid argument 'how', should be: into (child), before or after" 884 } 885 } 886 } 887 828 888 method insert { data args } { 829 889 array set insopt {
Note: See TracChangeset
for help on using the changeset viewer.
