Ignore:
Timestamp:
Nov 24, 2016, 11:58:38 AM (10 years ago)
Author:
Pedro Gea <pgea@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
f738c05
Parents:
6dc91d2
Message:

Refs #1933
Se revisan los binds respecto a wtree y su treectrl.
Se quitan los métodos específicos para la creación de columnas e inserción de nodos que quedaban en tolinspe.
Se añade un update del nodo de paquetes para que se actualice ante un "require".
Se revisan los métodos de botón derecho para que aparezcan sólo sobre los objetos seleccionados.
Se añade un método a wtree para gestionar el color de todas las columnas de un nodo.
Se añaden las columnas al root de wtree.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tolbase/lib/toltk/tolinspe__main.tcl

    r6dc91d2 rcc64b09  
    2121      %W yview scroll %d units
    2222    }]
    23     #@! REVISAR
    2423    bind TreeView <$but> $comm
    2524  }
    2625} else {
    27   #@! REVISAR
    2826  bind TreeView <MouseWheel> {
    2927    %W yview scroll [expr int(-1*%D/36)] units
    … …  
    218216  # packing the panedwindowmain
    219217  pack $pwMain -fill both -expand yes
    220 
    221   # esto es para evitar que aparezca el icono open cuando
    222   # relleno estando el mouse sobre ht_*
    223   #@! Por revisar
    224   #@! $ht_vars  bind Entry <Enter>  ""
    225   #@! $ht_vars  bind Entry <Leave>  ""
    226   #@! $ht_funcs bind Entry <Enter>  ""
    227   #@! $ht_funcs bind Entry <Leave>  ""
    228218}
    229219
    … …  
    248238    -highlightbackground gray75 -highlightcolor black \
    249239    -highlightthickness 0 -font $toltk_options(fonts,Label) \
    250     -columns [::TolInspector::LNodeDef] ]
     240    -columns [list \
     241    [list {image text} -label Name -tags Name] \
     242    [list text -label Index -tags Index] \
     243    [list text -label Grammar -tags Grammar] \
     244    [list text -label Reference -tags Reference]
     245  ]]
    251246   
    252247  # configuration of the left tree
    … …  
    260255  # creation of the root node "Tol Objects"
    261256  set img [::Bitmap::get Objects]
    262   #@ Se pone el style a mano, no sé la manera natural de hacer esto con wtree
    263   $wt_tree item style set root Name [$wt_tree column cget Name -itemstyle]
    264257  $wt_tree item text root Name [mc "Tol Objects"]
    265258  $wt_tree item image root Name $img
    266259
    267260  # creation of the node father "Grammars"
    268   set img [::Bitmap::get Grammars] 
    269   set wt_row [::TolInspector::LNode "" Root $img [mc "Grammars"] "Grammar"]
    270   $wt_tree insert $wt_row -at child -relative root -tags "root-grammars"
     261  set node [$wt_tree item create -parent root -button 1 -open 0 -tags "root-grammars"]
     262  $wt_tree item image $node Name [::Bitmap::get Grammars]
     263  $wt_tree item text $node Index "" Grammar "Root" Name [mc "Grammars"] Reference "Grammar" 
    271264  # Inserts in the node of grammars a node by each grammar that exists in Tol
    272265  InsertGrammars
    273266
    274267  # creation of the node father "Packages"
    275   set img [::Bitmap::get "package"] 
    276   set wt_row [::TolInspector::LNode "" Root $img [mc "Packages"] "Package"]   
    277   $wt_tree insert $wt_row -at child -relative root -tags "root-packages" -button yes
     268  set node [$wt_tree item create -parent root -button 1 -open 0 -tags "root-packages"]
     269  $wt_tree item image $node Name [::Bitmap::get "package"]
     270  $wt_tree item text $node Index "" Grammar "Root" Name [mc "Packages"] Reference "Package" 
    278271
    279272  # creation of the node father "Included Files"
    280   set img [::Bitmap::get "Files"]
    281   set wt_row [::TolInspector::LNode "" Root $img [mc "Included Files"] "File"]   
    282   $wt_tree insert $wt_row -at child -relative root -tags "root-files" -button yes
     273  set node [$wt_tree item create -parent root -button 1 -open 0 -tags "root-files"]
     274  $wt_tree item image $node Name [::Bitmap::get "Files"]
     275  $wt_tree item text $node Index "" Grammar "Root" Name [mc "Included Files"] Reference "File" 
    283276     
    284   # creation of the node father "Console Objects" 
    285   set img [::Bitmap::get "Console"]
    286   set wt_row [::TolInspector::LNode "" Root $img [mc "Console Objects"] "Console"] 
    287   $wt_tree insert $wt_row -at child -relative root -tags "root-console" -button yes
    288      
     277  # creation of the node father "Console Objects"
     278  set node [$wt_tree item create -parent root -button 1 -open 0 -tags "root-console"]
     279  $wt_tree item image $node Name [::Bitmap::get "Console"]
     280  $wt_tree item text $node Index "" Grammar "Root" Name [mc "Console Objects"] Reference "Console"
     281
     282 
    289283  # associates the tree to scrolled window
    290284  $sw1 setwidget $wt_tree
    … …  
    294288 
    295289  # bind the focus on tree
    296   bind ${wt_tree}.frameTree.t <Button-1> "::focus $wt_tree"
     290  bind $wt_tree <Button-1> "::focus $wt_tree"
    297291 
    298292  # expand/collapse (and fill/unfill) a node with a double clic
    299   bind ${wt_tree}.frameTree.t <Double-1> "::TolInspector::ToggleItem %x %y"
     293  bind $wt_tree <Double-1> "::TolInspector::ToggleItem %x %y"
    300294}
    301295
    … …  
    333327    -highlightbackground gray75 -highlightcolor black \
    334328    -highlightthickness 0 -font $toltk_options(fonts,Label) \
    335     -columns [::TolInspector::RNodeDef] ]
     329    -columns [list \
     330    [list text -label Index -tags Index] \
     331    [list text -label Grammar -tags Grammar] \
     332    [list {image text} -label Name -tags Name] \
     333    [list text -label Content -tags Content] \
     334    [list text -label Description -tags Description] \
     335    [list text -label Path -tags Path] \
     336    [list text -label Reference -tags Reference] \
     337  ]]
    336338  # configuration of the tree of variables
    337339  $wt_vars column configure Grammar -visible no
    … …  
    340342  $wt_vars notify bind $wt_vars <Expand-before> "::TolInspector::OpenVariable %I"
    341343  $wt_vars notify bind $wt_vars <Selection> "::TolInspector::SelectItem $wt_vars"
    342   #@! el bind debería poder hacerse directamente sobre el wtree
    343   bind ${wt_vars}.frameTree.t <Button-1> "::focus $wt_vars"   
    344   bind ${wt_vars}.frameTree.t <Double-1> "::TolInspector::SelectionExpand"
     344  bind $wt_vars <Button-1> "::focus $wt_vars"   
     345  bind $wt_vars <Double-1> "::TolInspector::SelectionExpand"
    345346 
    346347  # Creation of the right TREE RIGHT with FUNCTIONS
    … …  
    349350    -highlightbackground gray75 -highlightcolor black \
    350351    -highlightthickness 0 -font $toltk_options(fonts,Label) \
    351     -columns [::TolInspector::RNodeDef] ]
     352    -columns [list \
     353    [list text -label Index -tags Index] \
     354    [list text -label Grammar -tags Grammar] \
     355    [list {image text} -label Name -tags Name] \
     356    [list text -label Content -tags Content] \
     357    [list text -label Description -tags Description] \
     358    [list text -label Path -tags Path] \
     359    [list text -label Reference -tags Reference] \
     360  ]]
    352361  # configuration of the tree of functions
    353362  $wt_funcs column configure Grammar -visible no
    … …  
    355364  $wt_funcs column configure all -itembackground ""     
    356365  $wt_funcs notify bind $wt_funcs <Selection> "::TolInspector::SelectItem $wt_funcs"     
    357   bind ${wt_funcs}.frameTree.t <Button-1> "::focus $wt_funcs"     
     366  bind $wt_funcs <Button-1> "::focus $wt_funcs"     
    358367 
    359368  # associates the trees to scrolled windows
    … …  
    368377  pack $tab2.sw22 -fill both -expand yes   
    369378  pack $w_tabset -fill both -expand yes 
    370   #@! $w_tabset tab configure Variables\
    371   #@!        -command "::TolInspector::SelectItem $wt_vars"
    372   #@! $w_tabset tab configure Functions\
    373   #@!        -command "::TolInspector::SelectItem $wt_funcs"
    374379}
    375380
    … …  
    435440 
    436441  # composes the  menus for each one of the trees, depending the node that is selected
    437   bind ${wt_tree}.frameTree.t <Button-3> "::TolInspector::PostTree %X %Y"
    438   bind ${wt_vars}.frameTree.t <Button-3> "::TolInspector::PostVariable %X %Y"
    439   bind ${wt_funcs}.frameTree.t <Button-3> "::TolInspector::PostFunction %X %Y"
     442  bind $wt_tree <Button-3> "::TolInspector::PostTree %x %y %X %Y"
     443  bind $wt_vars <Button-3> "::TolInspector::PostVariable %x %y %X %Y"
     444  bind $wt_funcs <Button-3> "::TolInspector::PostFunction %x %y %X %Y"
    440445}
    441446
    … …  
    466471#
    467472#///////////////////////////////////////////////////////////////////////////// 
    468   #@! wtree destroy ??
     473  #@ Hay algo que destruir?
    469474  return
    470475}
    … …  
    814819      }
    815820    }
     821    ::TolInspector::UpdatePackageRoot
    816822    ::TolInspector::UpdateConsoleObj
    817823  }
Note: See TracChangeset for help on using the changeset viewer.