Changeset 6207115 in tol for tolbase/lib/toltk/tolinspe__wtree2.tcl
- Timestamp:
- Nov 3, 2016, 8:59:28 AM (10 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- e0578ae
- Parents:
- 7a3f24e
- File:
-
- 1 edited
-
tolbase/lib/toltk/tolinspe__wtree2.tcl (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tolbase/lib/toltk/tolinspe__wtree2.tcl
r7a3f24e r6207115 3 3 proc ::TolInspector::ClearConsoleObj { } { 4 4 #///////////////////////////////////////////////////////////////////////////// 5 variable ht_tree 6 variable data 7 8 set idx_con [$ht_tree index root-console] 9 $ht_tree entry delete $idx_con 0 end 10 11 #Quitamos del spool todos los objetos que provengan de la consola 12 foreach _obj $data(pool,objects) { 13 array set obj $_obj 14 if {[string equal $obj(origin) "root-console"]} { 15 set idx [lsearch $data(pool,objects) $_obj] 16 set data(pool,objects) [lreplace $data(pool,objects) $idx $idx] 17 } 18 } 19 UpdatePoolObj 20 #Finalmente limpiamos el stack de la consola de tol 5 variable wt_tree 6 7 foreach it [$wt_tree item children "root-console"] { 8 $wt_tree item delete $it 9 } 10 #Limpiamos el stack de la consola de tol 21 11 ::tol::console stack release 22 12 } 23 13 24 14 #///////////////////////////////////////////////////////////////////////////// 25 proc ::TolInspector::ClearConsoleObjSel { ht} {15 proc ::TolInspector::ClearConsoleObjSel {wt} { 26 16 #///////////////////////////////////////////////////////////////////////////// 27 17 variable vars_selected 28 variable data29 18 30 19 foreach var $vars_selected { 31 set name [$ ht entry cget $var -label]20 set name [$wt item text $var [WiName 0]] 32 21 #puts "name=$name" 33 #Quitamos del spool todos los objetos que provengan de la consola 34 foreach _obj $data(pool,objects) { 35 array set obj $_obj 36 #puts "_obj=$_obj" 37 if {[string equal $obj(origin) "root-console"] && [string equal $obj(objName) $name]} { 38 set idx [lsearch $data(pool,objects) $_obj] 39 set data(pool,objects) [lreplace $data(pool,objects) $idx $idx] 40 } 41 } 42 UpdatePoolObj 43 #Finalmente quitamos el objeto de la consola de tol 22 #Quitamos el objeto de la consola de tol 44 23 ::tol::console stack release $name 45 24 } … … 50 29 proc ::TolInspector::UpdateFileRoot { } { 51 30 #///////////////////////////////////////////////////////////////////////////// 52 variable ht_tree31 variable wt_tree 53 32 set open 0 54 set idx_file [$ ht_tree index root-files]55 if { [$ ht_tree entryisopen $idx_file] } {56 $ ht_tree close $idx_file33 set idx_file [$wt_tree item id "root-files"] 34 if { [$wt_tree item isopen $idx_file] } { 35 $wt_tree collapse $idx_file 57 36 set open 1 58 37 } 59 if { [$ht_tree index focus] == $idx_file } { 38 #@! if { [$wt_tree index focus] == $idx_file } 39 if { [$wt_tree item state get $idx_file focus] } { 60 40 SelectObject 61 41 } 62 42 if $open { 63 $ ht_tree open$idx_file43 $wt_tree expand $idx_file 64 44 } 65 45 } … … 68 48 proc ::TolInspector::UpdateConsoleObj { } { 69 49 #///////////////////////////////////////////////////////////////////////////// 70 variable ht_tree 71 72 set idx_con [$ht_tree index root-console] 73 if { [$ht_tree entry isopen $idx_con] } { 74 $ht_tree close $idx_con 75 } 76 $ht_tree selection anchor root-console 77 $ht_tree selection mark root-console 50 variable wt_tree 51 52 set idx_con [$wt_tree item id "root-console"] 53 if { [$wt_tree item isopen $idx_con] } { 54 $wt_tree collapse $idx_con 55 } 56 #@! $ht_tree selection anchor root-console 57 #@! $ht_tree selection mark root-console 58 $wt_tree selection clear 59 $wt_tree selection add $idx_con 78 60 #Tolcon_Trace "Abierto el nodo root-console" 79 if { [$ ht_tree index focus] == $idx_con} {61 if { [$wt_tree item state get $idx_con focus] } { 80 62 SelectObject 81 63 } 82 64 } 83 84 #/////////////////////////////////////////////////////////////////////////////85 proc ::TolInspector::UpdatePoolObj { } {86 #/////////////////////////////////////////////////////////////////////////////87 variable ht_tree88 89 set idx_pool [$ht_tree index root-pool]90 if { [$ht_tree entry isopen $idx_pool] } {91 $ht_tree close $idx_pool92 }93 if { [$ht_tree index focus] == $idx_pool } {94 SelectObject95 }96 }97 98 65 99 66 #///////////////////////////////////////////////////////////////////////////// … … 111 78 variable vars_selected 112 79 variable options_selected 113 variable ht_vars 114 variable ht_tree 115 variable item_data 116 variable data 117 118 variable tolset 119 variable tolindex 80 variable wt_vars 81 variable wt_tree 120 82 121 83 #User functions to contextual menu … … 128 90 $data_menu($it) delete 0 end 129 91 } 130 set InRootConsole [string equal [lindex [$ht_tree get -full anchor] end] "root-console"] 131 set InRootPool [string equal [lindex [$ht_tree get -full anchor] end] "root-pool"] 132 set InRootFiles [string equal [lindex [$ht_tree get -full anchor] end] "root-files"] 133 #puts "PostVariable: InRootConsole,InRootPool,InRootFiles = $InRootConsole,$InRootPool,$InRootFiles" 134 set node_act [$ht_vars index current] 92 93 set parent [$wt_tree selection get 0] 94 set parent_tolReference [$wt_tree item text $parent [WiTolReference 1]] 95 96 set InRootConsole [string equal $parent_tolReference "Console"] 97 set InRootFiles [string equal $parent_tolReference "File"] 98 set InRootGrammars [string equal $parent_tolReference "Grammar"] 99 100 #puts "PostVariable: InRootConsole,InRootFiles = $InRootConsole,$InRootFiles" 101 #@! set node_act [$ht_vars index current] 102 set node_act [$wt_vars selection get end] ;# current 135 103 if { [string length $node_act] } { 136 set vars_selected [$ht_vars curselection] 104 #@! set vars_selected [$ht_vars curselection] 105 set vars_selected [$wt_vars selection get 0 end] ;# curselection 137 106 if { [lsearch $vars_selected $node_act] >= 0 } { 138 107 foreach var $vars_selected { 139 array set aryData [$ht_vars entry cget $var -data]140 #puts "PostVariable: aryData = [array get aryData]"141 set itemid $aryData(Index)142 set path $aryData(Path)143 set grammar [lindex $item_data($itemid) 2]144 set objName [$ht_vars entry cget $var -label]108 set itemid [$wt_vars item text $var [WiIndex 0]] 109 set path [$wt_vars item text $var [WiPath 0]] 110 set grammar [$wt_vars item text $var [WiGrammar 0]] 111 set objName [$wt_vars item text $var [WiName 0]] 112 set object [$wt_vars item text $var [WiTolReference 0]] 113 145 114 #puts "OBJECT=$objName, PATH=$path" 146 if { $InRootPool } { 147 set object $data(pool,variables,$itemid) 148 } else { 149 if {[llength $aryData(Reference)]} { 150 #set object [lindex $aryData(Reference) 0] 151 set object [lrange $aryData(Reference) 0 end] 152 } else { 153 if { [string length $tolset] } { 154 #set object [concat [list File $tolset] $tolindex $itemid] 155 set object [concat $tolset $tolindex $itemid] 156 #puts "tolset = $tolset" 157 } else { 158 if [llength $objName] { 159 set object [list $grammar $objName] 160 } else { 161 set object $objName 162 } 163 } 164 } 165 } 115 166 116 lappend all_objects $object 167 #puts "PostVariable: OBJECT=$object OBJNAME=$objName TOLSET=$tolset PATH=$path GRAMMAR=$grammar"168 117 switch -- $grammar { 169 118 Code - … … 220 169 VMatrix - 221 170 Matrix { 222 $data_menu(main) add cascade -label [mc "Export matrix"] \171 $data_menu(main) add cascade -label [mc "Export matrix"] \ 223 172 -menu $data_menu(Matrix,Export) 224 173 if {[llength $options_selected($grammar)] == 1} { … … 238 187 -menu $data_menu(Matrix,Draw) 239 188 foreach objInfo $options_selected(Matrix) { 240 $data_menu(Matrix,Table) add command -label [lindex $objInfo 1] \189 $data_menu(Matrix,Table) add command -label [lindex $objInfo 1] \ 241 190 -command [list ::TolInspector::TableMatrix [lindex $objInfo 0]] 242 $data_menu(Matrix,Export,BDT) add command -label [lindex $objInfo 1] \191 $data_menu(Matrix,Export,BDT) add command -label [lindex $objInfo 1] \ 243 192 -command [list ::TolInspector::ExportBDTMatrix [lindex $objInfo 0]] 244 193 $data_menu(Matrix,Draw) add command -label [lindex $objInfo 1] \ … … 260 209 set lblSerie "series" 261 210 } 262 $data_menu(main) add command -label [mc "Draw $lblSerie"] \211 $data_menu(main) add command -label [mc "Draw $lblSerie"] \ 263 212 -command ::TolInspector::DrawSerie 264 $data_menu(main) add command -label [mc "Table $lblSerie"] \213 $data_menu(main) add command -label [mc "Table $lblSerie"] \ 265 214 -command ::TolInspector::TableSerie 266 215 if {[llength $options_selected(Serie)] == 1} { … … 276 225 -menu $data_menu(Serie,TableAutocor) 277 226 foreach objInfo $options_selected(Serie) { 278 $data_menu(Serie,DrawAutocor) add command -label [lindex $objInfo 1] \227 $data_menu(Serie,DrawAutocor) add command -label [lindex $objInfo 1] \ 279 228 -command [list ::TolInspector::DrawAutocorSerie [lindex $objInfo 0]] 280 $data_menu(Serie,TableAutocor) add command -label [lindex $objInfo 1] \229 $data_menu(Serie,TableAutocor) add command -label [lindex $objInfo 1] \ 281 230 -command [list ::TolInspector::TableAutocorSerie [lindex $objInfo 0]] 282 231 } 283 232 } 284 $data_menu(main) add command -label [mc "Table statistics"] \233 $data_menu(main) add command -label [mc "Table statistics"] \ 285 234 -command ::TolInspector::TableStatisticsSerie 286 235 } … … 474 423 # Store selection in oza 475 424 476 if { $InRootPool } { 477 $data_menu(main) add command -label [mc "Remove from spool"] \ 478 -command [list ::TolInspector::RemoveFromSpool $ht_vars] 479 } else { 480 $data_menu(main) add command -label [mc "Add to spool"] \ 481 -command [list ::TolInspector::AddToSpool $ht_vars [lindex [$ht_tree get -full anchor] 1]] 482 } 483 $data_menu(main) add command -label [mc "To Eval window"] \ 484 -command [list ::TolInspector::AddToEvalWindow $ht_vars] 425 $data_menu(main) add command -label [mc "Add to Console"] \ 426 -command [list ::TolInspector::AddToConsole $wt_vars] 427 $data_menu(main) add command -label [mc "Write into Eval"] \ 428 -command [list ::TolInspector::AddToEvalWindow $wt_vars] 485 429 $data_menu(main) add separator 486 430 if { $InRootConsole} { 487 431 $data_menu(main) add command -label [mc "Decompile"] \ 488 -command [list ::TolInspector::ClearConsoleObjSel $ ht_vars]432 -command [list ::TolInspector::ClearConsoleObjSel $wt_vars] 489 433 $data_menu(main) add separator 490 434 } 491 435 $data_menu(main) add command -label [mc "Select all"] \ 492 -command [list ::TolInspector::SelectAll $ ht_vars]436 -command [list ::TolInspector::SelectAll $wt_vars] 493 437 $data_menu(main) add command -label [mc "Toggle selection"] \ 494 -command [list ::TolInspector::ToggleSelection $ ht_vars]438 -command [list ::TolInspector::ToggleSelection $wt_vars] 495 439 tk_popup $data_menu(main) $x $y 496 440 } ;#end del if … … 512 456 variable data_menu 513 457 variable vars_selected 514 variable ht_funcs 515 variable ht_tree 516 variable item_data 517 variable data 518 519 variable tolset 520 variable tolindex 458 variable wt_funcs 459 variable wt_tree 521 460 522 461 array unset options_selected … … 525 464 } 526 465 527 set InRootPool [string equal [lindex [$ht_tree get -full anchor] end] "root-pool"] 528 set node_act [$ht_funcs index current] 466 set node_act [$wt_funcs selection get 0] ;# current 529 467 if { [string length $node_act] } { 530 set vars_selected [$ ht_funcs curselection]468 set vars_selected [$wt_funcs selection get 0 end] ;# curselection 531 469 if { [lsearch $vars_selected $node_act] >= 0 } { 532 470 foreach var $vars_selected { 533 array set aryData [$ht_funcs entry cget $var -data] 534 set itemid $aryData(Index) 535 set path $aryData(Path) 536 set grammar [lindex $item_data($itemid) 2] 537 set objName [$ht_funcs entry cget $var -label] 538 539 if { $InRootPool } { 540 set object $data(pool,variables,$itemid) 541 } else { 542 if { [string length $tolset] } { 543 set object [concat [list $tolset] $tolindex $itemid] 544 } else { 545 set object $objName 546 } 547 } 548 # La única gramática seleccionable en ht_funcs es Code 471 set itemid [$wt_funcs item text $var [WiIndex 0]] 472 set path [$wt_funcs item text $var [WiPath 0]] 473 set grammar [$wt_funcs item text $var [WiGrammar 0]] 474 set objName [$wt_funcs item text $var [WiName 0]] 475 set object [$wt_funcs item text $var [WiTolReference 0]] 476 # La única gramática seleccionable en wt_funcs es Code 549 477 lappend code_selected [list $object $objName $path] 550 478 } … … 564 492 } 565 493 } 566 567 if { $InRootPool } { 568 $data_menu(main) add command -label [mc "Remove from spool"] \ 569 -command [list ::TolInspector::RemoveFromSpool $ht_funcs] 570 } else { 571 $data_menu(main) add command -label [mc "Add to spool"] \ 572 -command [list ::TolInspector::AddToSpool $ht_funcs [lindex [$ht_tree get -full anchor] 1]] 573 } 574 $data_menu(main) add command -label [mc "To Eval window"] \ 575 -command [list ::TolInspector::AddToEvalWindow $ht_funcs] 494 $data_menu(main) add command -label [mc "Write into Eval"] \ 495 -command [list ::TolInspector::AddToEvalWindow $wt_funcs] 576 496 $data_menu(main) add separator 577 497 $data_menu(main) add command -label [mc "Select all"] \ 578 -command [list ::TolInspector::SelectAll $ ht_funcs]498 -command [list ::TolInspector::SelectAll $wt_funcs] 579 499 $data_menu(main) add command -label [mc "Toggle selection"] \ 580 -command [list ::TolInspector::ToggleSelection $ ht_funcs]500 -command [list ::TolInspector::ToggleSelection $wt_funcs] 581 501 tk_popup $data_menu(main) $x $y 582 502 } … … 597 517 variable data_menu 598 518 variable vars_selected 599 variable ht_tree 600 variable item_data 601 variable data 602 variable tolset 603 variable tolindex 604 variable item_id 519 variable wt_tree 520 variable arguments 521 605 522 #puts "ht_tree: $ht_tree" 606 523 #No terminado todavía … … 612 529 $data_menu($it) delete 0 end 613 530 } 614 set InRootPool [string equal [lindex [$ht_tree get -full anchor] end-1] "root-pool"] 615 #puts "InRootPool: $InRootPool" 616 # InRootFiles has a value 1 if node is a File 617 set InRootFiles [string equal [lindex [$ht_tree get -full anchor] end-1] "root-files"] 618 #puts "InRootFiles: $InRootFiles" 531 532 #@!! revisar!! el uso de selection y node_act 533 set selection [$wt_tree selection get 0] 534 if { ![string length $selection] } { return } 535 536 set tolReference [$wt_tree item text $selection [WiTolReference 1]] 537 if { [llength $tolReference] == 2 } { 538 set InRootFiles [string equal [lindex $tolReference 0] "File"] 539 } else { 540 set InRootFiles 0 541 } 542 619 543 # index of the selected node 620 set node_act [$ ht_tree index current]544 set node_act [$wt_tree selection get 0] ;# current 621 545 #puts "node_act: $node_act" 622 546 if { [string length $node_act] } { 623 set vars_selected [$ ht_tree curselection]547 set vars_selected [$wt_tree selection get 0 end] ;# curselection 624 548 #puts "vars_selected: $vars_selected" 625 549 if { [lsearch $vars_selected $node_act] >= 0 } { ;# Not root node 626 set index [$ht_tree index anchor] 627 #puts "index: $index" 628 if { $index } { 629 set info_node [split [lindex [$ht_tree get -full $index] end] "-"] 630 #puts "info_node: $info_node" 631 set node_type [lindex $info_node 0] 632 #puts "node_type: $node_type" 633 set node_name [lindex $info_node 1] 634 #puts "node_name: $node_name" 635 } else { ;# root node 636 set node_type root 637 set node_name root 638 } 639 # if user selects a root or a grammar doesn't nothing 640 switch -regexp $node_type { 641 root - 642 grammar { return } 643 } 550 #@! set index [$ht_tree index anchor] 551 set index [$wt_tree selection get 0] 552 553 if { $index == 0 } return 554 # if user selects a root or a grammar doesn't nothing 555 set tolReference [$wt_tree item text $index [WiTolReference 1]] 556 if { [llength $tolReference] == 1 } return 557 644 558 # label of object showed in the tree 645 set objName [$ht_tree entry cget $index -label] 646 #puts "objName: $objName" 647 set object $objName 648 559 set objName [$wt_tree item text [WiName 1]] 560 set object [$wt_tree item text [WiTolReference 1]] 561 649 562 if {$InRootFiles} { 650 array set aryData [$ht_tree entry cget $index -data] 651 if [info exist aryData(FileName)] { 652 set objName $aryData(FileName) 653 } 654 } 655 #puts "2objName: $objName" 656 if { $InRootPool } { 657 #puts "es InRootPool $item_id" 658 set itemid $item_id 659 #set object $data(pool,variables,$itemid) 660 set object $data(pool,reference,$node_type) 661 } else { 662 #puts "NO InRootPool" 663 if { [string length $tolset] } { 664 set object [concat [list $tolset] $tolindex] 665 } else { 666 set object $objName 667 } 668 } 669 #puts "object = $objName '[$ht_tree entry cget $index -data]'" 670 #Tolcon_Trace "***********************************" {red} 671 #Tolcon_Trace "index=$index, node_type=$node_type, node_name=$node_name" {red} 672 #Tolcon_Trace "tolset=$tolset, tolindex=$tolindex, aryData= [$ht_tree entry cget $index -data]" {red} 673 #Tolcon_Trace "object=$object, label=$objName" {red} 674 #Tolcon_Trace "***********************************" {red} 675 676 # 563 set objName [$wt_tree item text $index [WiPath 1]] 564 } 677 565 # TICKET: #1438 678 566 # Por que se pregunta aqui por los objetos de consola? 679 #680 567 set stackList [::tol::console stack list] 681 568 #puts "stackList: $stackList" 682 569 set stackValue {} 683 570 foreach stackItem $stackList { 684 #puts "stackItem: $stackItem"685 #puts "lindex $stackValue 1: [lindex $stackValue 1]"686 #puts "objName: $objName"687 571 if {[lindex $stackItem 1] eq $objName} { 688 572 set stackValue $stackItem … … 693 577 set grammar [lindex $stackValue 0] 694 578 #puts "grammar: $grammar" 695 #set full_data $item_data($index) ;# {value} {desc} {grammar}696 #set grammar [lindex $full_data 2]697 579 698 580 #foreach fun [::tol::info functions $grammar] { … … 744 626 } 745 627 746 #///////////////////////////////////////////////////////////////////////////// 747 # Procedures asociated with tol inspector popup menu 748 #///////////////////////////////////////////////////////////////////////////// 749 750 #///////////////////////////////////////////////////////////////////////////// 751 proc ::TolInspector::RemoveFromSpool {ht} { 752 # 753 # PURPOSE: Removes from spool all selected objects 754 # 628 629 #///////////////////////////////////////////////////////////////////////////// 630 proc ::TolInspector::AddToConsole {wt} { 755 631 #///////////////////////////////////////////////////////////////////////////// 756 632 variable vars_selected 757 variable item_data758 variable tolset759 variable tolindex760 variable data761 633 762 634 foreach var $vars_selected { 763 array set aryData [$ht entry cget $var -data] 764 set itemid $aryData(Index) 765 set path $aryData(Path) 766 set reference $aryData(Reference) 767 set grammar [lindex $item_data($itemid) 2] 768 769 set objName [$ht entry cget $var -label] 770 771 set _objpool [list "grammar" $grammar "objName" $objName "reference" $reference "path" $path] 772 if {$grammar eq "Code"} { 773 set graApply [lindex $aryData(Content) 0] 774 lappend _objpool "graApply" $graApply 775 } 776 #Tolcon_Trace "OBJPOOL on REMOVE: $_objpool" 777 778 # Buscamos el objeto (identificador: referencia) 779 array set objpool $_objpool 780 foreach _obj $data(pool,objects) { 781 array set obj $_obj 782 #Tolcon_Trace "obj(reference)=$obj(reference), objpool(reference)=$objpool(reference)" 783 if {[string equal $obj(reference) $objpool(reference)]} { 784 if {$obj(grammar) eq "Code"} { 785 if {[string equal $obj(graApply) $objpool(graApply)]} { 786 set idx [lsearch $data(pool,objects) $_obj] 787 #Tolcon_Trace "El obj a quitar tiene idx=$idx" 788 set data(pool,objects) [lreplace $data(pool,objects) $idx $idx] 789 } 790 } else { 791 set idx [lsearch $data(pool,objects) $_obj] 792 #Tolcon_Trace "El obj a quitar tiene idx=$idx" 793 set data(pool,objects) [lreplace $data(pool,objects) $idx $idx] 794 } 795 } 796 } 797 } 798 #Tolcon_Trace "P.O. after REMOVE: $data(pool,objects)" 799 UpdatePoolObj 800 } 801 802 #///////////////////////////////////////////////////////////////////////////// 803 proc ::TolInspector::AddToSpool {ht origin} { 804 #///////////////////////////////////////////////////////////////////////////// 805 variable vars_selected 806 variable item_data 807 variable tolset 808 variable tolindex 809 variable data 810 811 foreach var $vars_selected { 812 array set aryData [$ht entry cget $var -data] 813 set itemid $aryData(Index) 814 set path $aryData(Path) 815 set grammar [lindex $item_data($itemid) 2] 816 set objName [$ht entry cget $var -label] 817 #puts "AddToSpool: Reference=$aryData(Reference) tolset=$tolset grammar=$grammar" 818 if {[llength $aryData(Reference)]} { 819 set reference $aryData(Reference) 820 } else { 821 if { [string length $tolset] } { 822 #set object [concat [list $tolset] $tolindex $itemid] 823 #set object [concat [list File $tolset] $tolindex $itemid] 824 set object [concat $tolset $tolindex $itemid] 825 #puts "AddToSpool: object=$object" 826 set reference [::tol::info reference $object] 827 } else { 828 if {$grammar eq "Set"} { 829 #puts "AddToSpool: origin=$origin" 830 set reference [::tol::info reference [list Set $objName]] 831 #Tolcon_Trace "reference de ::tol::info reference [list $objName]" 832 } else { 833 if [catch {set reference [::tol::info reference [list $grammar $objName]]}] { 834 set reference $objName 835 #Tolcon_Trace "reference NO SE QUE PONER" 836 } 837 #Tolcon_Trace "reference de ::tol::info reference $grammar $objName" 838 } 839 } 840 } 841 set _objpool [list "origin" $origin "grammar" $grammar "objName" $objName "reference" $reference "path" $path] 842 if {$grammar eq "Code"} { 843 set graApply [lindex $aryData(Content) 0] 844 lappend _objpool "graApply" $graApply 845 } 846 #Tolcon_Trace "***************" 847 #Tolcon_Trace "OBJPOOL on ADD:" 848 #Tolcon_Trace "***************" 849 #foreach {key value} $_objpool { 850 # Tolcon_Trace " $key=$value" 851 #} 852 set inserted 0 853 # Si la referencia es igual, el objeto es el mismo (salvo para obj de tipo Code) 854 array set objpool $_objpool 855 foreach _obj $data(pool,objects) { 856 array set obj $_obj 857 if {[string equal $obj(reference) $objpool(reference)]} { 858 #Si es de la gramatica Code miro a ver la gramatica sobre la que se aplica 859 if {$objpool(grammar) eq "Code"} { 860 if {[string equal $obj(graApply) $objpool(graApply)]} { 861 set inserted 1 862 } 863 } else { 864 set inserted 1 865 } 866 } 867 } 868 if {!$inserted} { 869 lappend data(pool,objects) $_objpool 870 #puts "AddToSpool: P.O. after ADD: $data(pool,objects)" 871 } else { 872 #puts "$_objpool ALREADY IN SPOOL" 873 } 874 } 875 876 } 877 878 #///////////////////////////////////////////////////////////////////////////// 879 proc ::TolInspector::AddToEvalWindow {ht} { 880 # 881 # PURPOSE: Adds names of selected objects (vars or functions) in treeview ht 882 # to eval window 883 # 884 #///////////////////////////////////////////////////////////////////////////// 885 variable ht_vars 635 set reference [$wt item text $var [WiTolReference 0]] 636 #Tolcon_Trace "GetObjectFromAddress(\"[::tol::info address $reference]\")" 637 ::tol::console eval "GetObjectFromAddress(\"[::tol::info address $reference]\")" 638 } 639 UpdateConsoleObj 640 } 641 642 #///////////////////////////////////////////////////////////////////////////// 643 proc ::TolInspector::AddToEvalWindow {wt} { 644 # 645 # PURPOSE: Adds names of selected objects (vars or functions) in wtree wt to eval window 646 # 647 #///////////////////////////////////////////////////////////////////////////// 886 648 variable vars_selected 887 649 888 650 set names "" 889 651 foreach var $vars_selected { 890 lappend names [$ ht entry cget $var -label]652 lappend names [$wt item text $var [WiName 0]] 891 653 } 892 654 ::TolConsole::ToEvalWindow [ListToStr $names] … … 894 656 895 657 #///////////////////////////////////////////////////////////////////////////// 896 proc ::TolInspector::SelectAll { ht} {897 # 898 # PURPOSE: Selects all nodes of a given treeview658 proc ::TolInspector::SelectAll {wt} { 659 # 660 # PURPOSE: Selects all nodes of a given wtree 899 661 # 900 662 # PARAMETERS: 901 # ht -> treeview's path 902 # 903 #///////////////////////////////////////////////////////////////////////////// 904 set found [$ht find] 905 if {[llength $found] > 1} { 906 $ht selection set [lindex $found 1] [lindex $found end] 907 } 908 } 909 910 #///////////////////////////////////////////////////////////////////////////// 911 proc ::TolInspector::ToggleSelection {ht} { 912 # 913 # PURPOSE: Toggles selection of nodes of a given treeview 663 # wt -> wtree's object 664 # 665 #///////////////////////////////////////////////////////////////////////////// 666 #set found [$ht find] 667 #if {[llength $found] > 1} { 668 # $ht selection set [lindex $found 1] [lindex $found end] 669 #} 670 $wt selection add 0 end 671 } 672 673 #///////////////////////////////////////////////////////////////////////////// 674 proc ::TolInspector::ToggleSelection {wt} { 675 # 676 # PURPOSE: Toggles selection of nodes of a given wtree 914 677 # 915 678 # PARAMETERS: 916 # ht -> treeview's path 917 # 918 #///////////////////////////////////////////////////////////////////////////// 919 set found [$ht find] 920 if {[llength $found] > 1} { 921 $ht selection toggle [lindex $found 1] [lindex $found end] 922 } 923 } 679 # wt -> wtree's object 680 # 681 #///////////////////////////////////////////////////////////////////////////// 682 #set found [$ht find] 683 #if {[llength $found] > 1} { 684 # $ht selection toggle [lindex $found 1] [lindex $found end] 685 #} 686 set sel [$wt selection get 0 end] 687 $wt selection add 0 end 688 $wt selection modify {} $sel 689 } 690 691 #///////////////////////////////////////////////////////////////////////////// 692 proc ::TolInspector::SelectionExpand { } { 693 #///////////////////////////////////////////////////////////////////////////// 694 variable wt_vars 695 set node [$wt_vars selection get 0] 696 if {$node == ""} { 697 ::TolInspector::SelectionCollapse 698 } else { 699 $wt_vars expand $node 700 } 701 } 702 703 #///////////////////////////////////////////////////////////////////////////// 704 proc ::TolInspector::SelectionCollapse { } { 705 #///////////////////////////////////////////////////////////////////////////// 706 variable wt_tree 707 set node [$wt_tree selection get 0] 708 if {$node eq 0} {} else { 709 set parent [$wt_tree item parent $node] 710 $wt_tree collapse $node 711 $wt_tree selection clear 712 $wt_tree selection add $parent 713 } 714 }
Note: See TracChangeset
for help on using the changeset viewer.
