Changeset 0731938 in tol
- Timestamp:
- Nov 4, 2016, 11:04:56 AM (10 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- e933fd6
- Parents:
- e0578ae
- Location:
- tolbase/lib/toltk
- Files:
-
- 4 edited
-
tclIndex (modified) (2 diffs)
-
tolinspe__main.tcl (modified) (5 diffs)
-
tolinspe__wtree1.tcl (modified) (15 diffs)
-
tolinspe__wtree2.tcl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tolbase/lib/toltk/tclIndex
re0578ae r0731938 362 362 set auto_index(::TolInspector::SelectGrammar) [list source [file join $dir tolinspe__wtree1.tcl]] 363 363 set auto_index(::TolInspector::SelectSet) [list source [file join $dir tolinspe__wtree1.tcl]] 364 set auto_index(::TolInspector::GetParentGrammar) [list source [file join $dir tolinspe__main.tcl]]365 364 set auto_index(::TolInspector::OpenVariable) [list source [file join $dir tolinspe__wtree1.tcl]] 366 365 set auto_index(::TolInspector::SelectItem) [list source [file join $dir tolinspe__wtree1.tcl]] … … 398 397 set auto_index(::TolInspector::SelectionExpand) [list source [file join $dir tolinspe__wtree2.tcl]] 399 398 set auto_index(::TolInspector::SelectionCollapse) [list source [file join $dir tolinspe__wtree2.tcl]] 399 set auto_index(::TolInspector::ToggleItem) [list source [file join $dir tolinspe__wtree2.tcl]] 400 400 set auto_index(::TolInspector::DrawSet) [list source [file join $dir tolinspe__draw.tcl]] 401 401 set auto_index(::TolInspector::DrawMatrix) [list source [file join $dir tolinspe__draw.tcl]] -
tolbase/lib/toltk/tolinspe__main.tcl
re0578ae r0731938 297 297 298 298 # expand/collapse (and fill/unfill) a node with a double clic 299 bind ${wt_tree}.frameTree.t <Double-1> " $wt_tree item toggle \[ $wt_tree selection get 0 \]"299 bind ${wt_tree}.frameTree.t <Double-1> "::TolInspector::ToggleItem %x %y" 300 300 } 301 301 … … 314 314 variable wt_funcs 315 315 316 # creates the tabset to display the variables & functions 317 #set w_tabset [::blt::tabset $paneRight.ts -relief flat\ 318 -bd 0 -outerpad 0 -tier 2 -slant none -textside top \ 319 -highlightthickness 0 -side left -rotate 90] 320 set w_tabset [::blt::tabset $paneRight.ts -relief flat\ 321 -bd 0 -outerpad 0 -tier 2 -slant right -textside right \ 322 -highlightthickness 0] 316 # creates the tabset to display the variables & functions 317 set w_tabset [NoteBook $paneRight.nb -tabbevelsize 8 -tabpady {2 6} \ 318 -font $toltk_options(fonts,Label)] 319 320 # inserts in the tabset the tabs of functions and variables 321 $w_tabset insert 0 Variables -text [mc Variables] -image [::Bitmap::get Variables] -background \#d9d9d9 322 $w_tabset insert 1 Functions -text [mc Functions] -image [::Bitmap::get Functions] -background \#d9d9d9 323 $w_tabset raise Variables 324 323 325 # creates the scrolled windows for each one of the tabs 324 set sw21 [ScrolledWindow $w_tabset.sw12 -scrollbar none] 325 set sw22 [ScrolledWindow $w_tabset.sw22 -scrollbar none] 326 327 # inserts in the tabset the tabs of functions and variables 328 $w_tabset insert end \ 329 Variables -text [mc Variables] -selectbackground \#d9d9d9 -bg gray75 \ 330 -image [::Bitmap::get Variables] -pady 0\ 331 Functions -text [mc Functions] -selectbackground \#d9d9d9 -bg gray75 \ 332 -image [::Bitmap::get Functions] -pady 0 326 set tab1 [$w_tabset getframe Variables] 327 set tab2 [$w_tabset getframe Functions] 328 set sw21 [ScrolledWindow $tab1.sw12 -scrollbar none] 329 set sw22 [ScrolledWindow $tab2.sw22 -scrollbar none] 333 330 334 331 # Creation of the right TREE RIGHT with VARIABLES … … 345 342 $wt_vars notify bind $wt_vars <Selection> "::TolInspector::SelectItem $wt_vars" 346 343 #@! el bind deberÃa poder hacerse directamente sobre el wtree 347 bind ${wt_vars}.frameTree.t <Button-1> "::focus $wt_vars"344 bind ${wt_vars}.frameTree.t <Button-1> "::focus $wt_vars" 348 345 bind ${wt_vars}.frameTree.t <Double-1> "::TolInspector::SelectionExpand" 349 346 … … 365 362 $sw22 setwidget $wt_funcs 366 363 # configure the tabs 367 $ w_tabset tab configure Variables -window $sw21 -fill both -padx 0368 $ w_tabset tab configure Functions -window $sw22 -fill both -padx 0364 $tab1 configure -borderwidth 2 -background \#d9d9d9 365 $tab2 configure -borderwidth 2 -background \#d9d9d9 369 366 370 367 # packing the tabset 371 pack $w_tabset -fill both -expand yes 372 $w_tabset tab configure Variables\ 373 -command "::TolInspector::SelectItem $wt_vars" 374 $w_tabset tab configure Functions\ 375 -command "::TolInspector::SelectItem $wt_funcs" 368 pack $tab1.sw12 -fill both -expand yes 369 pack $tab2.sw22 -fill both -expand yes 370 pack $w_tabset -fill both -expand yes 371 #@! $w_tabset tab configure Variables\ 372 #@! -command "::TolInspector::SelectItem $wt_vars" 373 #@! $w_tabset tab configure Functions\ 374 #@! -command "::TolInspector::SelectItem $wt_funcs" 376 375 } 377 376 … … 569 568 #>> proc ::TolInspector::SelectGrammar 570 569 #>> proc ::TolInspector::SelectSet 571 572 #/////////////////////////////////////////////////////////////////////////////573 proc ::TolInspector::GetParentGrammar { set_ref } {574 #/////////////////////////////////////////////////////////////////////////////575 set root [ lindex $set_ref 0 ]576 set L [ llength $set_ref ]577 if { ( $root eq "File" && $L <= 2 ) } {578 set root579 } else {580 lindex [ tol::info var $set_ref ] 0581 }582 }583 570 584 571 #>> [tolinspe_wtree1.tcl] -
tolbase/lib/toltk/tolinspe__wtree1.tcl
re0578ae r0731938 125 125 126 126 set parent_grammar $arguments(parent_grammar) 127 127 128 128 #@ Si la llamada a InsertChild viene de SelectSet el argumento tolref 129 129 #@ no está definido y se crea a partir de parent_tolref … … 183 183 #? } 184 184 #? } 185 186 #@ ::TolInspector:: LNode index grammar185 186 #@ ::TolInspector::RNode index grammar 187 187 #@ 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 192 203 $wt item element configure $idx \ 193 204 [RiIndex] eTXT -fill $fcolor , \ … … 196 207 [RiDescription] eTXT -fill $fcolor , \ 197 208 [RiPath] eTXT -fill $fcolor 198 209 199 210 incr arguments(index) 200 211 } … … 211 222 variable OnSelectItem 212 223 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 219 229 #@ToDo $wt_vars column configure Index -hide no 220 230 #@ToDo $wt_funcs column configure Index -hide no 221 231 222 $w_tabset tab configure Variables -text [mc Variables] -state normal223 $w_tabset tabconfigure Functions -state normal232 $w_tabset itemconfigure Variables -text [mc Variables] -state normal 233 $w_tabset itemconfigure Functions -state normal 224 234 225 235 if { [string length $OnSelectItem] } { … … 264 274 #@ + parent_grammar es usado por InsertSubset para abrir o no un nodo 265 275 #@ + 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]] 267 277 set arguments(parent_tolref) $tolReference 268 278 ::tol::forallchild $tolReference ::TolInspector::InsertSubset … … 399 409 set parent_grammar $arguments(parent_grammar) 400 410 #@ para obtener el icono de las instancias 401 set parent_tolref $arguments(parent_tolref) 411 set parent_tolref $arguments(parent_tolref) 402 412 403 413 #@# Tolcon_Trace "InsertSubset $args" … … 464 474 variable wt_tree 465 475 variable arguments 466 476 467 477 set node [$wt_tree selection get 0] 468 478 if { ![string length $node] } return 469 479 if { $node == 0 } { 470 480 ClearHiertables 481 #@D $w_tabset itemconfigure Variables -state disabled 482 #@D $w_tabset itemconfigure Functions -state disabled 471 483 return 472 484 } … … 478 490 #@ Aquà llegan los nodos raÃz y las gramáticas 479 491 #@ Argumentos pasados por atributo 480 #@ + parent_grammar es usado por InsertItem para determinar el color de sus miembros si es NameBlock492 #@ + parent_grammar es usado por InsertItem para saber si es NameBlock 481 493 set arguments(parent_grammar) "" 482 494 switch $tolReference { … … 484 496 File SelectFileRoot 485 497 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 } 487 503 } 488 504 } elseif { [lindex $tolReference 0] == "Grammar" } { 489 505 #@ Argumentos pasados por atributo 490 #@ + parent_grammar es usado por InsertItem para determinar el color de sus miembros si es NameBlock506 #@ + parent_grammar es usado por InsertItem para saber si es NameBlock 491 507 set arguments(parent_grammar) "" 492 508 SelectGrammar 493 509 } 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]] 494 513 SelectSet $tolReference 495 514 } … … 513 532 514 533 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 516 537 517 538 #@=> tiene que incrementarse automáticamente es el contador del foreach … … 543 564 544 565 ClearHiertables 545 $w_tabset tabconfigure Variables -text [mc Files]546 # $w_tabset tab configure Functions -state disabled547 $w_tabset select 0 ;# Variables566 $w_tabset itemconfigure Variables -text [mc Files] 567 $w_tabset raise Variables 568 #@D $w_tabset itemconfigure Functions -state disabled 548 569 549 570 #@=> tiene que incrementarse automáticamente es el contador del foreach … … 568 589 # 569 590 #///////////////////////////////////////////////////////////////////////////// 570 variable w_tabset571 591 variable wt_tree 572 592 variable arguments … … 577 597 578 598 ClearHiertables 599 579 600 #(pgea) se quita la linea que oculta la columna del indice y que 580 601 #(pgea) el procedimimento anterior ClearHiertables muestra 581 602 # $ht_vars column configure Index -hide yes 582 # $w_tabset tab configure Functions -state disabled583 603 584 604 foreach co [::tol::console stack list] { 605 Tolcon_Trace "co $co" 585 606 #puts "SelectConsoleRoot: co = $co" 586 607 set gra [lindex $co 0] … … 662 683 } 663 684 } 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 666 687 } 667 688 foreach fun [::tol::info functions $grammar] { … … 689 710 690 711 #@ 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 693 713 #@ + tolref indica a InsertItem que se ha de obtener desde parent_tolref 694 714 #@ + parent_tolref es usado por InsertItem para encontrar tolref 695 715 set arguments(index) 1 696 set arguments(parent_grammar) [GetParentGrammar $tolReference]697 716 set arguments(tolref) "" 698 set arguments(parent_tolref) $tolReference 717 set arguments(parent_tolref) $tolReference 699 718 ::tol::forallchild $tolReference ::TolInspector::InsertChild 700 719 } -
tolbase/lib/toltk/tolinspe__wtree2.tcl
re0578ae r0731938 58 58 $wt_tree selection clear 59 59 $wt_tree selection add $idx_con 60 60 61 #Tolcon_Trace "Abierto el nodo root-console" 61 62 if { [$wt_tree item state get $idx_con focus] } { … … 664 665 # 665 666 #///////////////////////////////////////////////////////////////////////////// 666 #set found [$ht find]667 #if {[llength $found] > 1} {668 # $ht selection set [lindex $found 1] [lindex $found end]669 #}670 667 $wt selection add 0 end 671 668 } … … 680 677 # 681 678 #///////////////////////////////////////////////////////////////////////////// 682 #set found [$ht find]683 #if {[llength $found] > 1} {684 # $ht selection toggle [lindex $found 1] [lindex $found end]685 #}686 679 set sel [$wt selection get 0 end] 687 680 $wt selection add 0 end … … 713 706 } 714 707 } 708 709 #///////////////////////////////////////////////////////////////////////////// 710 proc ::TolInspector::ToggleItem { x y } { 711 #///////////////////////////////////////////////////////////////////////////// 712 variable wt_tree 713 714 set lstxy [$wt_tree identify $x $y] 715 if { [llength $lstxy] } { 716 if { [lindex $lstxy 0] == "item" } { 717 $wt_tree item toggle [lindex $lstxy 1] 718 } 719 } 720 }
Note: See TracChangeset
for help on using the changeset viewer.
