Changeset 6dc91d2 in tol for tolbase/lib/wtree/wtree.tcl


Ignore:
Timestamp:
Nov 23, 2016, 12:06:20 PM (10 years ago)
Author:
Pedro Gea <pgea@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
cc64b09
Parents:
ffeacdc
Message:

Refs #1933
Se incorporan las barras a la ventana de salida del inspector (tolbase.tcl).
Se corrige un bug con el botón derecho sobre el árbol del inspector (tolinspewtree2.tcl).
Se revisan los binds del editor de PRJs (tolprj.tcl) y se hace uso de la nueva opción de wtree: -selectcommand.
Se añade el método focus y dos opciones de configuración (selectcommand y bindtags) al wtree (wtree.tcl).

Se revisa listboxplus:

+ Se añaden algunas opciones auxiliares (para evitar errores)
+ Se suspenden las barras para que no salgan duplicadas (wtree ya las tiene)
+ Se redirigen los mecanismos de ordenación a los de wtree (véase _SortByColumn, por ejemplo).

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@7354 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tolbase/lib/wtree/wtree.tcl

    rffeacdc r6dc91d2  
    8080      -default "" -configuremethod "_conf-columnfilter"
    8181
     82  option -bindtags \
     83      -default "" -configuremethod "_conf-bindtags"     
     84
     85  option -selectcommand \
     86      -default "" -configuremethod "_conf-selectcommand"           
     87     
    8288  variable tree
    8389  variable vscrollbar
    … …  
    265271       
    266272        $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    }
    267281  }
    268282
    … …  
    314328        -showrootbutton no -showbuttons yes -showlines yes \
    315329        -scrollmargin 16 -xscrolldelay "500 50" -yscrolldelay "500 50"
     330   
     331    bindtags $tree [linsert [bindtags $tree] 0 $win Wtree]
    316332
    317333    $tree notify install <<ItemSelected>>
    … …  
    702718    }
    703719  }
     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  } 
    704732
    705733  #
    … …  
    742770      array set opts [ lrange $col_spec 1 end ]
    743771      set colID [ $tree column create \
    744                       -text [ msgcat::mc $opts(-label) ] \
     772                      -text $opts(-label) \
    745773                      -image $opts(-image) \
    746774                      -itembackground "\#e0e8f0 {}" \
Note: See TracChangeset for help on using the changeset viewer.