Ignore:
Timestamp:
Nov 4, 2016, 11:04:56 AM (10 years ago)
Author:
Pedro Gea <pgea@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
e933fd6
Parents:
e0578ae
Message:

Refs #1933

  • Se corrige la acción del doble clic sobre un nodo, para evitar errores cuando no está seleccionado.
  • Se utiliza la columna gramática para obtenerla cuando hace falta.
  • Se obvia (temporalmente) el insert de wtree por lento, se insertándose directamente sobre treectrl.
  • Se corrige ClearHiertables para evitar que se intenten seleccionar nodos mientras se borran.
  • Se sustituye el tabset de BLT por el NoteBook de BWidget. Se dejan sin efecto la desactivación de las pestañas (véanse los comentarios #@D)

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

File:
1 edited

Legend:

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

    re0578ae r0731938  
    125125
    126126  set parent_grammar $arguments(parent_grammar) 
    127 
     127 
    128128  #@ Si la llamada a InsertChild viene de SelectSet el argumento tolref
    129129  #@ no está definido y se crea a partir de parent_tolref
    … …  
    183183  #?   }
    184184  #? }
    185    
    186   #@ ::TolInspector::LNode index grammar
     185 
     186  #@ ::TolInspector::RNode index grammar
    187187  #@   icon name content description path reference
    188   set wt_row [::TolInspector::RNode $arguments(index) $grammar \
    189     $icon_grammar $name $data3 $brief_desc $path $tolref]
    190  
    191   set idx [$wt insert $wt_row -at child -relative root]
     188  #@! set wt_row [::TolInspector::RNode $arguments(index) $grammar \
     189    $icon_grammar $name $data3 $brief_desc $path $tolref] 
     190  #@! set idx [$wt insert $wt_row -at child -relative root]
     191  #@! Las líneas anteriores parecen lentas y se sustituyen por las siguientes:
     192  set idx [$wt item create -button 1]
     193  $wt item element configure $idx \
     194    [RiIndex] eTXT -text $arguments(index) , \
     195    [RiGrammar] eTXT -text $grammar , \
     196    [RiName] eIMG -image $icon_grammar + eTXT -text $name , \
     197    [RiContent] eTXT -text $data3 , \
     198    [RiDescription] eTXT -text $brief_desc , \
     199    [RiPath] eTXT -text $path , \
     200    [RiReference] eTXT -text $tolref
     201  $wt item lastchild root $idx 
     202 
    192203  $wt item element configure $idx \
    193204    [RiIndex] eTXT -fill $fcolor , \
    … …  
    196207    [RiDescription] eTXT -fill $fcolor , \
    197208    [RiPath] eTXT -fill $fcolor
    198  
     209
    199210  incr arguments(index)
    200211}
    … …  
    211222  variable OnSelectItem
    212223
    213   foreach it [$wt_vars item children root] {
    214     $wt_vars item delete $it
    215   }
    216   foreach it [$wt_funcs item children root] {
    217     $wt_funcs item delete $it
    218   } 
     224  $wt_vars selection clear
     225  $wt_vars item delete all
     226  $wt_funcs selection clear
     227  $wt_funcs item delete all
     228
    219229  #@ToDo $wt_vars  column configure Index -hide no
    220230  #@ToDo $wt_funcs column configure Index -hide no
    221231 
    222   $w_tabset tab configure Variables -text [mc Variables] -state normal
    223   $w_tabset tab configure Functions -state normal
     232  $w_tabset itemconfigure Variables -text [mc Variables] -state normal
     233  $w_tabset itemconfigure Functions -state normal
    224234
    225235  if { [string length $OnSelectItem] } {
    … …  
    264274    #@  + parent_grammar es usado por InsertSubset para abrir o no un nodo
    265275    #@  + parent_tolref es usado por InsertSubset para determinar tolref
    266     set arguments(parent_grammar) [GetParentGrammar $tolReference]     
     276    set arguments(parent_grammar) [$wt_tree item text $node [LiGrammar]]
    267277    set arguments(parent_tolref) $tolReference
    268278    ::tol::forallchild $tolReference ::TolInspector::InsertSubset
    … …  
    399409  set parent_grammar $arguments(parent_grammar)
    400410  #@ para obtener el icono de las instancias
    401   set parent_tolref $arguments(parent_tolref) 
     411  set parent_tolref $arguments(parent_tolref)
    402412 
    403413#@# Tolcon_Trace "InsertSubset $args"   
    … …  
    464474  variable wt_tree
    465475  variable arguments
    466 
     476 
    467477  set node [$wt_tree selection get 0]
    468478  if { ![string length $node] } return
    469479  if { $node == 0 } {
    470480    ClearHiertables
     481    #@D $w_tabset itemconfigure Variables -state disabled
     482    #@D $w_tabset itemconfigure Functions -state disabled   
    471483    return
    472484  }
    … …  
    478490    #@ Aquí llegan los nodos raíz y las gramáticas
    479491    #@ Argumentos pasados por atributo
    480     #@  + parent_grammar es usado por InsertItem para determinar el color de sus miembros si es NameBlock     
     492    #@  + parent_grammar es usado por InsertItem para saber si es NameBlock 
    481493    set arguments(parent_grammar) ""
    482494    switch $tolReference {
    … …  
    484496      File    SelectFileRoot
    485497      Console SelectConsoleRoot
    486       default ClearHiertables
     498      default {
     499        ClearHiertables
     500        #@D $w_tabset itemconfigure Variables -state disabled
     501        #@D $w_tabset itemconfigure Functions -state disabled
     502      }
    487503    }
    488504  } elseif { [lindex $tolReference 0] == "Grammar" } {
    489505    #@ Argumentos pasados por atributo
    490     #@  + parent_grammar es usado por InsertItem para determinar el color de sus miembros si es NameBlock 
     506    #@  + parent_grammar es usado por InsertItem para saber si es NameBlock
    491507    set arguments(parent_grammar) ""
    492508    SelectGrammar
    493509  } else {
     510    #@ Argumentos pasados por atributo
     511    #@  + parent_grammar es usado por InsertItem para saber si es NameBlock
     512    set arguments(parent_grammar) [$wt_tree item text $node [LiGrammar]]
    494513    SelectSet $tolReference
    495514  }
    … …  
    513532
    514533  ClearHiertables
    515   $w_tabset select 0 ;# Variables
     534  $w_tabset itemconfigure Variables -text [mc Packages] 
     535  $w_tabset raise Variables 
     536  #@D $w_tabset itemconfigure Functions -state disabled 
    516537 
    517538  #@=> tiene que incrementarse automáticamente es el contador del foreach 
    … …  
    543564
    544565  ClearHiertables
    545   $w_tabset tab configure Variables -text [mc Files]
    546   #  $w_tabset tab configure Functions -state disabled
    547   $w_tabset select 0 ;# Variables
     566  $w_tabset itemconfigure Variables -text [mc Files]
     567  $w_tabset raise Variables
     568  #@D $w_tabset itemconfigure Functions -state disabled
    548569 
    549570  #@=> tiene que incrementarse automáticamente es el contador del foreach 
    … …  
    568589#
    569590#/////////////////////////////////////////////////////////////////////////////
    570   variable w_tabset
    571591  variable wt_tree
    572592  variable arguments
    … …  
    577597
    578598  ClearHiertables
     599
    579600#(pgea) se quita la linea que oculta la columna del indice y que
    580601#(pgea) el procedimimento anterior ClearHiertables muestra
    581602#  $ht_vars column  configure Index -hide yes
    582 #  $w_tabset tab configure Functions -state disabled
    583603 
    584604  foreach co [::tol::console stack list] {
     605  Tolcon_Trace "co $co"
    585606    #puts "SelectConsoleRoot: co = $co"
    586607    set gra  [lindex $co 0]
    … …  
    662683    }
    663684  } else {
    664 #    $w_tabset tab configure Variables -state disabled
    665 #    $w_tabset select 1
     685    $w_tabset raise Functions 
     686    #@D $w_tabset itemconfigure Variables -state disabled
    666687  }
    667688  foreach fun  [::tol::info functions $grammar] {
    … …  
    689710 
    690711  #@ Argumentos pasados por atributo
    691   #@  + index es usado e incrementado por InsertItem     
    692   #@  + parent_grammar es usado por InsertItem para determinar el color de sus miembros si es NameBlock
     712  #@  + index es usado e incrementado por InsertItem
    693713  #@  + tolref indica a InsertItem que se ha de obtener desde parent_tolref
    694714  #@  + parent_tolref es usado por InsertItem para encontrar tolref 
    695715  set arguments(index) 1 
    696   set arguments(parent_grammar) [GetParentGrammar $tolReference]
    697716  set arguments(tolref) ""
    698   set arguments(parent_tolref) $tolReference  
     717  set arguments(parent_tolref) $tolReference
    699718  ::tol::forallchild $tolReference ::TolInspector::InsertChild
    700719}
Note: See TracChangeset for help on using the changeset viewer.