Changeset 6dc91d2 in tol for tolbase/lib
- Timestamp:
- Nov 23, 2016, 12:06:20 PM (10 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- cc64b09
- Parents:
- ffeacdc
- Location:
- tolbase/lib
- Files:
-
- 5 edited
-
byswidget/blistboxplus/blistboxplus.tcl (modified) (19 diffs)
-
toltk/tolbase.tcl (modified) (1 diff)
-
toltk/tolinspe__wtree2.tcl (modified) (1 diff)
-
toltk/tolprj.tcl (modified) (3 diffs)
-
wtree/wtree.tcl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tolbase/lib/byswidget/blistboxplus/blistboxplus.tcl
rffeacdc r6dc91d2 77 77 option -iniconfig "" 78 78 79 #@O treeview options 80 option -exportselection false 81 option -linewidth 1 ;# unused 82 option -selectbackground "unused" 83 79 84 variable _listbox 80 85 variable menu … … 96 101 # 97 102 #/////////////////////////////////////////////////////////////////////////// 98 99 103 debug_init 100 104 101 105 debug_msg "install listbox ..." 102 106 103 if {0} { 104 return 107 if {1} { 105 108 #@T install _listbox using ::blt::treeview $win.lb -hideroot yes \ 106 109 -activeicons "" -icons {} -selectmode multiple \ … … 108 111 -highlightthickness 0 -borderwidth 1 -selectborderwidth 1 \ 109 112 -nofocusselectbackground grey -font {Arial 9} -flat yes 113 install _listbox using ::wtree $win.lb -table 0 -filter no \ 114 -background white -showroot 0 -selectmode extended -showheader 1 \ 115 -highlightbackground gray75 -highlightcolor black \ 116 -highlightthickness 0 -font {Arial 9} 110 117 } else { 111 118 set _listbox [::wtree $win.lb -table 0 -filter no \ 112 119 -background white -showroot 0 -selectmode extended -showheader 1 \ 113 120 -highlightbackground gray75 -highlightcolor black \ 114 -highlightthickness 0 -font {Arial 9} \ 115 -columns [::TolInspector::LNodeDef] ] 121 -highlightthickness 0 -font {Arial 9}] 116 122 #@T set _listbox [::blt::treeview $win.lb -hideroot yes \ 117 123 -activeicons "" -icons {} -selectmode multiple \ … … 125 131 126 132 install menu using menu $win.m -tearoff 0 127 install xbar using scrollbar $win.sbh -orient horizontal \133 #@!scroll install xbar using scrollbar $win.sbh -orient horizontal \ 128 134 -command "$win xview" 129 install ybar using scrollbar $win.sbv -orient vertical \135 #@!scroll install ybar using scrollbar $win.sbv -orient vertical \ 130 136 -command "$win yview" 131 137 132 138 #bindtags is modified to make possible to associate binds to self 133 bindtags $_listbox [linsert [bindtags $_listbox] 2 $win]139 $_listbox configure -bindtags [list $self Blistboxplus] 134 140 135 141 #@T! $_listbox style configure text -bg white … … 161 167 #pack 162 168 grid $_listbox -row 0 -column 0 -sticky news 163 grid $ybar -row 0 -column 1 -sticky ns164 grid $xbar -row 1 -column 0 -sticky ew169 #@!scroll grid $ybar -row 0 -column 1 -sticky ns 170 #@!scroll grid $xbar -row 1 -column 0 -sticky ew 165 171 grid columnconfigure $self 0 -weight 1 166 172 grid rowconfigure $self 0 -weight 1 167 173 168 ::autoscroll::autoscroll $ybar169 ::autoscroll::autoscroll $xbar174 #@!scroll ::autoscroll::autoscroll $ybar 175 #@!scroll ::autoscroll::autoscroll $xbar 170 176 debug_msg "voy a pillarte: antes de _ReadIni" 171 177 $self _ReadIni … … 206 212 set lstx [list [list image -label Icon -tags Icon] ] 207 213 foreach col $lst { 214 #set colx [list text -label [msgcat::mc $col] -tags $col] 208 215 set colx [list text -label $col -tags $col] 209 216 lappend lstx $colx 210 217 } 211 Tolcon_Trace "lstx $lstx"218 #@! Tolcon_Trace "lstx $lstx" 212 219 $_listbox configure -columns $lstx 213 220 … … 240 247 onconfigure -showtitles { bool } { 241 248 set options(-showtitles) $bool 242 $_listbox configure -showtitles $bool 243 $_listbox show 249 #@O $_listbox configure -showtitles $bool 250 $_listbox configure -showheader $bool 251 #@O! $_listbox show 244 252 } 245 253 … … 263 271 set cols [$self column names] 264 272 foreach col $cols { 265 $self column configure $col -title [mc [lindex $titles $c] ] 273 #@O $self column configure $col -title [mc [lindex $titles $c] ] 274 $_listbox column configure $col -text [mc [lindex $titles $c] ] 266 275 incr c 1 267 276 } … … 299 308 set options(-selectmode) $mode 300 309 } 310 $_listbox configure -selectmode $options(-selectmode) 301 311 } 302 312 … … 318 328 } 319 329 } 330 331 onconfigure -exportselection { bool } { 332 if { $bool } { 333 error "\[blistboxplus\] option -exportselection should be 'no'" 334 } 335 } 336 337 #/////////////////////////////////////////////////////////////////////////// 338 method show { args } { 339 #/////////////////////////////////////////////////////////////////////////// 340 error "\[blistboxplus\] method show unimplemented" 341 } 342 343 #/////////////////////////////////////////////////////////////////////////// 344 method hide { args } { 345 #/////////////////////////////////////////////////////////////////////////// 346 error "\[blistboxplus\] method hide unimplemented" 347 } 348 349 #/////////////////////////////////////////////////////////////////////////// 350 method sort { args } { 351 #/////////////////////////////////////////////////////////////////////////// 352 if { [lindex $args 1] eq "configure" } { 353 if { [lindex $args 2] eq "-column" } { 354 return [$self _SortByColumn [lindex $args 3]] 355 } else { 356 return 357 } 358 } elseif { [lindex $args 1] eq "auto" } { 359 #@O! Nothing to do ?? 360 return 361 } else { 362 return 363 } 364 } 320 365 321 366 #/////////////////////////////////////////////////////////////////////////// … … 371 416 -command "$self _LoadFromFile" 372 417 } 373 # bindings 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] 418 # bindings 419 bind $_listbox <Control-KeyRelease> +[list $self _OnControlKey $self %K %k] 420 bind $_listbox <Key-Delete> "lbDeleteSelection $self" 421 bind $_listbox <Key-Insert> "$self _OpenWR" 422 bind $_listbox <Shift-Up> "$self addPrevious" 423 bind $_listbox <Shift-Down> "$self addNext" 424 bind $_listbox <Up> "$self previous" 425 bind $_listbox <Down> "$self next" 426 bind $_listbox <Home> "$self first" 427 bind $_listbox <End> "$self last" 428 bind $_listbox <Shift-Home> "$self addAllPrevious" 429 bind $_listbox <Shift-End> "$self addAllNext" 430 bind $_listbox <Button-1> +[list focus -force %W] 399 431 } 400 432 … … 631 663 if { ![ catch { set fd [open $filNam r] } msgerr] } { 632 664 while { [gets $fd line ] >= 0} { 633 Tolcon_Trace "adding $line"634 665 $self add $line 635 666 } … … 650 681 #/////////////////////////////////////////////////////////////////////////// 651 682 683 #@O! 684 return [$_listbox SortbyColumn $_listbox $col] 685 652 686 set numofel [$self size] 653 687 set lst [list] … … 870 904 # 871 905 #/////////////////////////////////////////////////////////////////////////// 872 Tolcon_Trace "insert pos: $pos args: $args"873 906 if { [lindex $args 0] eq "cols" } { 874 907 set cols [lindex $args 1] … … 963 996 # 964 997 #/////////////////////////////////////////////////////////////////////////// 965 Tolcon_Trace "get ids: $ids cols: $cols"966 998 if { $ids eq "" } { 967 999 #@T! return [lrange [$self find] 1 end] … … 997 1029 } 998 1030 999 if { [llength $ids] eq 1 } { 1000 Tolcon_Trace "get result: $result" 1001 Tolcon_Trace "get result0: [lindex $result 0]" 1031 if { [llength $ids] eq 1 } { 1002 1032 return [lindex $result 0] 1003 1033 } … … 1017 1047 # 1018 1048 #/////////////////////////////////////////////////////////////////////////// 1019 Tolcon_Trace "set id: $id data: $data cols: $cols"1020 1049 if { "$cols" eq "" } { 1021 1050 set cols [$self column names] … … 1269 1298 # 1270 1299 #/////////////////////////////////////////////////////////////////////////// 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]1275 1300 if { [lindex $args 0] eq "names" } { 1276 1301 set names {} … … 1279 1304 } 1280 1305 return $names 1281 } 1282 return [eval $_listbox column id $args] 1306 } elseif { [lindex $args 0] eq "configure" } { 1307 return [eval $_listbox column $args] 1308 } else { 1309 return [eval $_listbox column id $args] 1310 } 1283 1311 } 1284 1312 -
tolbase/lib/toltk/tolbase.tcl
rffeacdc r6dc91d2 186 186 $tab2 configure -borderwidth 2 -background \#d9d9d9 187 187 $tab3 configure -borderwidth 2 -background \#d9d9d9 188 set sw2 [ScrolledWindow $tab2.sw - scrollbar none]189 set sw3 [ScrolledWindow $tab3.sw - scrollbar none]188 set sw2 [ScrolledWindow $tab2.sw -auto both] 189 set sw3 [ScrolledWindow $tab3.sw -auto both] 190 190 set widgets(tabset,info) $sw3 191 191 -
tolbase/lib/toltk/tolinspe__wtree2.tcl
rffeacdc r6dc91d2 558 558 559 559 # label of object showed in the tree 560 set objName [$wt_tree item text Name]561 set object [$wt_tree item text Reference]560 set objName [$wt_tree item text $index Name] 561 set object [$wt_tree item text $index Reference] 562 562 563 563 if {$InRootFiles} { -
tolbase/lib/toltk/tolprj.tcl
rffeacdc r6dc91d2 408 408 set tv [::wtree $f.sw.t -table 0 -filter no \ 409 409 -background white -showroot 1 -selectmode single -showheader 0 \ 410 -selectcommand "::TolProject::SelectProc $this" \ 410 411 -highlightbackground gray75 -highlightcolor black \ 411 412 -highlightthickness 0 -font $toltk_options(fonts,Label) \ … … 425 426 $tv column configure "range 1 end" -visible no 426 427 $tv column configure first -expand yes -weight 1 427 $tv column configure all -itembackground "" 428 $tv notify bind $tv <Selection> "::TolProject::SelectProc $this" 428 $tv column configure all -itembackground "" 429 429 430 430 $f.sw setwidget $f.sw.t … … 441 441 grid columnconfigure $f 0 -weight 1 442 442 443 444 bind $tv.frameTree.t <Control-KeyRelease> [list ::TolProject::OnControlKey $this %K %k] 445 446 bind $tv.frameTree.t <Button-1> "::focus $tv" 447 448 bind $tv.frameTree.t <Button-3> +[list ::TolProject::PostVariable $this %X %Y] 449 450 set prevBind [bind $tv.frameTree.t <Double-1>] 451 set newBind "[lrange $prevBind 0 [expr [llength $prevBind]-3]] ; mdidoc disableglobalraise ; ::TolProject::OpenNodeIfTerminal $this ; break" 452 #@ mdidoc disableglobalraise y break parece que cumplen el mismo cometido 453 bind $tv.frameTree.t <Double-1> $newBind 454 455 set prevBind [bind $tv.frameTree.t <KeyPress-Return>] 456 set newBind "[lrange $prevBind 0 [expr [llength $prevBind]-3]] ; ::TolProject::OpenNodeIfTerminal $this ; break" 457 bind $tv.frameTree.t <KeyPress-Return> $newBind 458 459 bind $tv.frameTree.t <KeyPress-space> +[list ::TolProject::NodeActiveAttributes $this] 460 bind $tv.frameTree.t <KeyPress-Delete> +[list ::TolProject::DeleteActiveNode $this] 461 bind $tv.frameTree.t <KeyPress-F9> "::TolProject::CompileActiveNode $this ; break" 462 bind $tv.frameTree.t <KeyPress-F8> "::TolProject::DecompileActiveNode $this ; break" 443 bind $tv <Control-KeyRelease> [list ::TolProject::OnControlKey $this %K %k] 444 bind $tv <Button-1> "::focus $tv" 445 bind $tv <Button-3> +[list ::TolProject::PostVariable $this %X %Y] 446 447 bind $tv <Double-1> "mdidoc disableglobalraise ; ::TolProject::OpenNodeIfTerminal $this" 448 bind $tv <KeyPress-Return> "::TolProject::OpenNodeIfTerminal $this" 449 450 bind $tv <KeyPress-space> +[list ::TolProject::NodeActiveAttributes $this] 451 bind $tv <KeyPress-Delete> +[list ::TolProject::DeleteActiveNode $this] 452 bind $tv <KeyPress-F9> "::TolProject::CompileActiveNode $this ; break" 453 bind $tv <KeyPress-F8> "::TolProject::DecompileActiveNode $this ; break" 463 454 464 455 set data(mainMenu) [menu $tv.m -tearoff 0] -
tolbase/lib/wtree/wtree.tcl
rffeacdc r6dc91d2 80 80 -default "" -configuremethod "_conf-columnfilter" 81 81 82 option -bindtags \ 83 -default "" -configuremethod "_conf-bindtags" 84 85 option -selectcommand \ 86 -default "" -configuremethod "_conf-selectcommand" 87 82 88 variable tree 83 89 variable vscrollbar … … 265 271 266 272 $t item sort root $order -column $column -dictionary 273 } 274 275 method focus { itemid } { 276 if { $itemid eq "" } { 277 $self item id active 278 } else { 279 $self activate $itemid 280 } 267 281 } 268 282 … … 314 328 -showrootbutton no -showbuttons yes -showlines yes \ 315 329 -scrollmargin 16 -xscrolldelay "500 50" -yscrolldelay "500 50" 330 331 bindtags $tree [linsert [bindtags $tree] 0 $win Wtree] 316 332 317 333 $tree notify install <<ItemSelected>> … … 702 718 } 703 719 } 720 721 method _conf-bindtags { _ addtags } { 722 set options(-bindtags) $addtags 723 bindtags $self [concat $addtags [bindtags $self]] 724 bindtags $tree [concat $addtags [bindtags $tree]] 725 } 726 727 method _conf-selectcommand { _ cmd } { 728 set options(-selectcommand) $cmd 729 if { $cmd eq "" } return 730 $self notify bind $self <Selection> $cmd 731 } 704 732 705 733 # … … 742 770 array set opts [ lrange $col_spec 1 end ] 743 771 set colID [ $tree column create \ 744 -text [ msgcat::mc $opts(-label) ]\772 -text $opts(-label) \ 745 773 -image $opts(-image) \ 746 774 -itembackground "\#e0e8f0 {}" \
Note: See TracChangeset
for help on using the changeset viewer.
