- Timestamp:
- Nov 17, 2016, 12:45:40 PM (10 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 88e6fd7
- Parents:
- 606ed76
- Location:
- tolbase/lib/toltk
- Files:
-
- 3 edited
-
tolinspe__main.tcl (modified) (3 diffs)
-
tolinspe__wtree1.tcl (modified) (13 diffs)
-
tolinspe__wtree2.tcl (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tolbase/lib/toltk/tolinspe__main.tcl
r606ed76 rceea866 261 261 set img [::Bitmap::get Objects] 262 262 #@ Se pone el style a mano, no sé la manera natural de hacer esto con wtree 263 $wt_tree item style set root [LiName] [$wt_tree column cget [LiName]-itemstyle]264 $wt_tree item text root [LiName][mc "Tol Objects"]265 $wt_tree item image root [LiName]$img263 $wt_tree item style set root Name [$wt_tree column cget Name -itemstyle] 264 $wt_tree item text root Name [mc "Tol Objects"] 265 $wt_tree item image root Name $img 266 266 267 267 # creation of the node father "Grammars" … … 335 335 -columns [::TolInspector::RNodeDef] ] 336 336 # configuration of the tree of variables 337 $wt_vars column configure [RiGrammar]-visible no338 $wt_vars column configure [RiReference]-visible no337 $wt_vars column configure Grammar -visible no 338 $wt_vars column configure Reference -visible no 339 339 $wt_vars column configure all -itembackground "" 340 340 $wt_vars notify bind $wt_vars <Expand-before> "::TolInspector::OpenVariable %I" … … 351 351 -columns [::TolInspector::RNodeDef] ] 352 352 # configuration of the tree of functions 353 $wt_funcs column configure [RiGrammar]-visible no354 $wt_funcs column configure [RiReference]-visible no353 $wt_funcs column configure Grammar -visible no 354 $wt_funcs column configure Reference -visible no 355 355 $wt_funcs column configure all -itembackground "" 356 356 $wt_funcs notify bind $wt_funcs <Selection> "::TolInspector::SelectItem $wt_funcs" -
tolbase/lib/toltk/tolinspe__wtree1.tcl
r606ed76 rceea866 4 4 #///////////////////////////////////////////////////////////////////////////// 5 5 return [list \ 6 [list {image text} -label Name ] \7 [list text -label Index ] \8 [list text -label Grammar ] \9 [list text -label Reference ]6 [list {image text} -label Name -tags Name] \ 7 [list text -label Index -tags Index] \ 8 [list text -label Grammar -tags Grammar] \ 9 [list text -label Reference -tags Reference] 10 10 ] 11 11 } … … 22 22 } 23 23 24 proc ::TolInspector::LiName { } { return 0 }25 proc ::TolInspector::LiIndex { } { return 1 }26 proc ::TolInspector::LiGrammar { } { return 2 }27 proc ::TolInspector::LiReference { } { return 3 }28 29 24 #///////////////////////////////////////////////////////////////////////////// 30 25 proc ::TolInspector::RNodeDef { } { 31 26 #///////////////////////////////////////////////////////////////////////////// 32 27 return [list \ 33 [list text -label Index ] \34 [list text -label Grammar ] \35 [list {image text} -label Name ] \36 [list text -label Content ] \37 [list text -label Description ] \38 [list text -label Path ] \39 [list text -label Reference ] \28 [list text -label Index -tags Index] \ 29 [list text -label Grammar -tags Grammar] \ 30 [list {image text} -label Name -tags Name] \ 31 [list text -label Content -tags Content] \ 32 [list text -label Description -tags Description] \ 33 [list text -label Path -tags Path] \ 34 [list text -label Reference -tags Reference] \ 40 35 ] 41 36 } 42 43 #/////////////////////////////////////////////////////////////////////////////44 proc ::TolInspector::RNode {index grammar icon name content description path reference} {45 #/////////////////////////////////////////////////////////////////////////////46 return [list \47 [list $index] \48 [list $grammar] \49 [list $icon $name] \50 [list $content] \51 [list $description] \52 [list $path] \53 [list $reference] \54 ]55 }56 57 proc ::TolInspector::RiIndex { } { return 0 }58 proc ::TolInspector::RiGrammar { } { return 1 }59 proc ::TolInspector::RiName { } { return 2 }60 proc ::TolInspector::RiContent { } { return 3 }61 proc ::TolInspector::RiDescription { } { return 4 }62 proc ::TolInspector::RiPath { } { return 5 }63 proc ::TolInspector::RiReference { } { return 6 }64 37 65 38 #///////////////////////////////////////////////////////////////////////////// … … 191 164 #? } 192 165 193 #@ ::TolInspector::RNode index grammar 194 #@ icon name content description path reference 195 #@! set wt_row [::TolInspector::RNode $arguments(index) $grammar \ 196 $icon_grammar $name $data3 $brief_desc $path $tolref] 197 #@! set idx [$wt insert $wt_row -at child -relative root] 198 #@! Las lÃneas anteriores parecen lentas y se sustituyen por las siguientes: 166 #@ No se usa el método insert de wtree porque es más lento 199 167 set idx [$wt item create -button 1 -open 0] 200 $wt item element configure $idx \ 201 [RiIndex] eTXT -text $arguments(index) , \ 202 [RiGrammar] eTXT -text $grammar , \ 203 [RiName] eIMG -image $icon_grammar + eTXT -text $name , \ 204 [RiContent] eTXT -text $data3 , \ 205 [RiDescription] eTXT -text $brief_desc , \ 206 [RiPath] eTXT -text $path , \ 207 [RiReference] eTXT -text $tolref 168 $wt item image $idx Name $icon_grammar 169 $wt item text $idx Index $arguments(index) Grammar $grammar \ 170 Name $name Content $data3 Description $brief_desc Path $path Reference $tolref 171 208 172 $wt item lastchild root $idx 209 173 174 #@WTREE a mejorar allà 210 175 $wt item element configure $idx \ 211 [RiIndex]eTXT -fill $fcolor , \212 [RiName]eTXT -fill $fcolor , \213 [RiContent]eTXT -fill $fcolor , \214 [RiDescription]eTXT -fill $fcolor , \215 [RiPath] eTXT -fill $fcolor176 Index eTXT -fill $fcolor , \ 177 Name eTXT -fill $fcolor , \ 178 Content eTXT -fill $fcolor , \ 179 Description eTXT -fill $fcolor , \ 180 Path eTXT -fill $fcolor 216 181 217 182 incr arguments(index) … … 264 229 #@ + parent_node es usado por InsertSubset para saber dónde insertar 265 230 set arguments(parent_node) $node 266 set tolReference [$wt_tree item text $node [LiReference]]231 set tolReference [$wt_tree item text $node Reference] 267 232 268 233 if { [llength $tolReference] == 1 } { … … 281 246 #@ + parent_grammar es usado por InsertSubset para abrir o no un nodo 282 247 #@ + parent_tolref es usado por InsertSubset para determinar tolref 283 set arguments(parent_grammar) [$wt_tree item text $node [LiGrammar]]248 set arguments(parent_grammar) [$wt_tree item text $node Grammar] 284 249 set arguments(parent_tolref) $tolReference 285 250 ::tol::forallchild $tolReference ::TolInspector::InsertSubset … … 453 418 #puts [list InsertSubset, indices {lindex $args 5} = $indices] 454 419 455 #noaun set obj_ref [lappend [$wt_tree item text $parent_node [LiReference]$indices] ]420 #noaun set obj_ref [lappend [$wt_tree item text $parent_node Reference $indices] ] 456 421 #noaun Tolcon_Trace "Inserto un nodo nuevo. $obj_ref" 457 422 set index [lindex $indices end] 458 set tolRefe [eval list [$wt_tree item text $parent_node [LiReference]] $index]423 set tolRefe [eval list [$wt_tree item text $parent_node Reference] $index] 459 424 set wt_row [::TolInspector::LNode $index $grammar $icon $label $tolRefe] 460 425 … … 466 431 467 432 set idnew [ $wt_tree insert $wt_row -at end -relative $parent_node -button $has_button] 468 $wt_tree item element configure $idnew [LiName]eTXT -fill $fcolor433 $wt_tree item element configure $idnew Name eTXT -fill $fcolor 469 434 } 470 435 } msg … … 491 456 } 492 457 493 set tolReference [$wt_tree item text $node [LiReference]]458 set tolReference [$wt_tree item text $node Reference] 494 459 495 460 Busy … … 517 482 #@ Argumentos pasados por atributo 518 483 #@ + parent_grammar es usado por InsertItem para saber si es NameBlock 519 set arguments(parent_grammar) [$wt_tree item text $node [LiGrammar]]484 set arguments(parent_grammar) [$wt_tree item text $node Grammar] 520 485 SelectSet $tolReference 521 486 } … … 660 625 set selAnchor [$wt_tree selection get 0] 661 626 662 set grammar [$wt_tree item text $selAnchor [LiName]]627 set grammar [$wt_tree item text $selAnchor Name ] 663 628 if { [string compare $grammar "Anything"] } { 664 629 #@ Por aquà si no es Anything … … 758 723 if { ![string length $node] } { return } 759 724 set treeParent [$wt_tree selection get 0] 760 set treeParent_tolRef [$wt_tree item text $treeParent [LiReference]]725 set treeParent_tolRef [$wt_tree item text $treeParent Reference] 761 726 set treeNode -1 762 727 if { [llength $treeParent_tolRef] > 1 } { 763 set grammar [$wt_vars item text $node [RiGrammar]]728 set grammar [$wt_vars item text $node Grammar] 764 729 if {$grammar eq "Set" || $grammar eq "NameBlock"} { 765 730 $wt_tree item expand $treeParent 766 731 #@ Se localiza el nodo seleccionado en el árbol (wt_tree) 767 set index [$wt_vars item text $node [RiIndex]]732 set index [$wt_vars item text $node Index] 768 733 foreach node_i [$wt_tree item children $treeParent] { 769 set index_i [$wt_tree item text $node_i [LiIndex]]734 set index_i [$wt_tree item text $node_i Index] 770 735 if { [string equal $index $index_i] } { 771 736 set treeNode $node_i … … 814 779 if { [string length $entry] } { 815 780 # almost one entry of wt_* selected 816 set name [$wt item text $entry [RiName]] ;# name of item817 set itemid [$wt item text $entry [RiIndex]] ;# id of item818 set path [$wt item text $entry [RiPath]] ;# path of file of item819 set objRef [$wt item text $entry [RiReference]] ;# info of item820 set value [$wt item text $entry [RiContent]]781 set name [$wt item text $entry Name] ;# name of item 782 set itemid [$wt item text $entry Index] ;# id of item 783 set path [$wt item text $entry Path] ;# path of file of item 784 set objRef [$wt item text $entry Reference] ;# info of item 785 set value [$wt item text $entry Content] 821 786 if { [string equal \"\n\" $value] } { 822 787 # hasn't value … … 825 790 set value [string trim $value] 826 791 } 827 set desc [$wt item text $entry [RiDescription]]828 set grammar [$wt item text $entry [RiGrammar]]829 set icon [$wt item image $entry [RiName]]792 set desc [$wt item text $entry Description] 793 set grammar [$wt item text $entry Grammar] 794 set icon [$wt item image $entry Name] 830 795 #(pgea) lista de argumentos que recibe ::TolConsole::OnInfo 831 796 set args [list $icon $grammar $name $value $path $desc $objRef] -
tolbase/lib/toltk/tolinspe__wtree2.tcl
r606ed76 rceea866 18 18 19 19 foreach var $vars_selected { 20 set name [$wt item text $var [RiName]]20 set name [$wt item text $var Name] 21 21 #puts "name=$name" 22 22 #Quitamos el objeto de la consola de tol … … 93 93 94 94 set parent [$wt_tree selection get 0] 95 set parent_tolReference [$wt_tree item text $parent [LiReference]]95 set parent_tolReference [$wt_tree item text $parent Reference] 96 96 97 97 set InRootConsole [string equal $parent_tolReference "Console"] … … 107 107 if { [lsearch $vars_selected $node_act] >= 0 } { 108 108 foreach var $vars_selected { 109 set itemid [$wt_vars item text $var [RiIndex]]110 set path [$wt_vars item text $var [RiPath]]111 set grammar [$wt_vars item text $var [RiGrammar]]112 set objName [$wt_vars item text $var [RiName]]113 set object [$wt_vars item text $var [RiReference]]109 set itemid [$wt_vars item text $var Index] 110 set path [$wt_vars item text $var Path] 111 set grammar [$wt_vars item text $var Grammar] 112 set objName [$wt_vars item text $var Name] 113 set object [$wt_vars item text $var Reference] 114 114 115 115 #puts "OBJECT=$objName, PATH=$path" … … 470 470 if { [lsearch $vars_selected $node_act] >= 0 } { 471 471 foreach var $vars_selected { 472 set itemid [$wt_funcs item text $var [RiIndex]]473 set path [$wt_funcs item text $var [RiPath]]474 set grammar [$wt_funcs item text $var [RiGrammar]]475 set objName [$wt_funcs item text $var [RiName]]476 set object [$wt_funcs item text $var [RiReference]]472 set itemid [$wt_funcs item text $var Index] 473 set path [$wt_funcs item text $var Path] 474 set grammar [$wt_funcs item text $var Grammar] 475 set objName [$wt_funcs item text $var Name] 476 set object [$wt_funcs item text $var Reference] 477 477 # La única gramática seleccionable en wt_funcs es Code 478 478 lappend code_selected [list $object $objName $path] … … 535 535 if { ![string length $selection] } { return } 536 536 537 set tolReference [$wt_tree item text $selection [LiReference]]537 set tolReference [$wt_tree item text $selection Reference] 538 538 if { [llength $tolReference] == 2 } { 539 539 set InRootFiles [string equal [lindex $tolReference 0] "File"] … … 554 554 if { $index == 0 } return 555 555 # if user selects a root or a grammar doesn't nothing 556 set tolReference [$wt_tree item text $index [LiReference]]556 set tolReference [$wt_tree item text $index Reference] 557 557 if { [llength $tolReference] == 1 } return 558 558 559 559 # label of object showed in the tree 560 set objName [$wt_tree item text [LiName]]561 set object [$wt_tree item text [LiReference]]560 set objName [$wt_tree item text Name] 561 set object [$wt_tree item text Reference] 562 562 563 563 if {$InRootFiles} { … … 634 634 635 635 foreach var $vars_selected { 636 set reference [$wt item text $var [RiReference]]636 set reference [$wt item text $var Reference] 637 637 #Tolcon_Trace "GetObjectFromAddress(\"[::tol::info address $reference]\")" 638 638 ::tol::console eval "GetObjectFromAddress(\"[::tol::info address $reference]\")" … … 651 651 set names "" 652 652 foreach var $vars_selected { 653 lappend names [$wt item text $var [RiName]]653 lappend names [$wt item text $var Name] 654 654 } 655 655 ::TolConsole::ToEvalWindow [ListToStr $names]
Note: See TracChangeset
for help on using the changeset viewer.
