Changeset cc64b09 in tol for tolbase/lib/wtree/wtree.tcl
- Timestamp:
- Nov 24, 2016, 11:58:38 AM (10 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- f738c05
- Parents:
- 6dc91d2
- File:
-
- 1 edited
-
tolbase/lib/wtree/wtree.tcl (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tolbase/lib/wtree/wtree.tcl
r6dc91d2 rcc64b09 280 280 } 281 281 } 282 283 method item-identify {x y} { 284 $self identify 285 286 } 282 287 283 288 constructor { args } { … … 347 352 [ mymethod EditCallback accept %I %C %E %t ] 348 353 349 bind $tree <ButtonPress-1> [ mymethod OnButtonPress1 %x %y ] 350 bind $tree <Control-ButtonPress-1> { } 351 bind $tree <Shift-ButtonPress-1> { } 354 #@ El bind se hace con $self para poder ser modificado externamente 355 #@ Hay mas binds en _configure_bindings 356 bind $self <ButtonPress-1> [mymethod OnButtonPress1 %x %y] 357 bind $self <Control-ButtonPress-1> {} 358 bind $self <Shift-ButtonPress-1> {} 352 359 353 360 set height [font metrics [$tree cget -font] -linespace] … … 393 400 394 401 focus $tree 395 402 403 #@ Se antepone la configuración de $args para que el nodo root esté o no 404 #@ y se le pueda aplicar la configuración de columnas 405 $self configurelist $args 396 406 $self _configure_bindings 397 407 $self _conf-columns -columns $options(-columns) 398 408 $self _conf-contextmenu -contextmenu $options(-contextmenu) 399 $self configurelist $args 409 400 410 if { !$options(-filter) } { 401 411 grid remove $win.frameFilter … … 410 420 method CancelEdit { } { 411 421 ::TreeCtrl::EditClose $tree entry 0 0 422 } 423 424 method item-color { item color } { 425 set args {} 426 set first 1 427 foreach c [ $tree column list ] { 428 # extraigo el style asociado a la columna 429 set columnStyle [ $tree column cget $c -itemstyle ] 430 # extraigo los elementos del style 431 set styleElements [ $tree style elements $columnStyle ] 432 # busco si eTXT es uno de esos elementos 433 if { [ lsearch $styleElements "eTXT" ] != -1 } { 434 if { $first } { 435 set first 0 436 } else { 437 lappend args {,} 438 } 439 lappend args $c eTXT -fill $color 440 } 441 } 442 return [eval $self item element configure $item $args] 412 443 } 413 444 … … 425 456 # busco si eTXT es uno de esos elementos 426 457 if { [ lsearch $styleElements "eTXT" ] != -1 } { 427 # el root no tiene styles 458 # el root no tiene styles | #@ ya sí 428 459 catch { 429 460 append itemText [ $tree item element cget $item $c eTXT -text ] " " … … 649 680 method _configure_bindings { } { 650 681 651 bind $tree <Double-ButtonPress-1> "[mymethod DoubleButton1 %W %x %y] ; break"652 bind $tree <Return> "[mymethod KeyPressReturn %W] ; break"653 654 bind $ tree <ButtonPress-3> [ mymethod Button3 %W %x %y %X %Y]655 656 bind $ tree <Escape>"[mymethod KeyPressEscape] ; break"682 #@ El bind se hace con $self para poder ser modificado externamente 683 #@ Hay mas binds en el constructor 684 bind $self <Double-ButtonPress-1> "[mymethod DoubleButton1 %W %x %y] ; break" 685 bind $self <Return> "[mymethod KeyPressReturn %W] ; break" 686 bind $self <ButtonPress-3> [mymethod Button3 %W %x %y %X %Y] 687 bind $self <Escape> "[mymethod KeyPressEscape] ; break" 657 688 658 689 $tree notify bind $tree <Header-invoke> [mymethod SortbyColumn %W %C] … … 773 804 -image $opts(-image) \ 774 805 -itembackground "\#e0e8f0 {}" \ 775 -tags $opts(-tags) ]806 -tags $opts(-tags) -expand 1] 776 807 # " 777 808 set column_info($idx,ID) $colID … … 801 832 # asocio el style a la columna 802 833 $tree column configure $colID -itemstyle $s 834 835 #@ Se añaden las columnas al nodo root si está visible 836 if { [$tree cget -showroot] } { 837 $tree item style set root $colID $s 838 } 839 803 840 incr idx 804 841 }
Note: See TracChangeset
for help on using the changeset viewer.
