Changeset 33b09bc in tol for tolbase/lib/toltk/tolinspe.tcl
- Timestamp:
- Jul 3, 2010, 8:58:14 PM (16 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- a939dea
- Parents:
- 9797b96
- File:
-
- 1 edited
-
tolbase/lib/toltk/tolinspe.tcl (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tolbase/lib/toltk/tolinspe.tcl
r9797b96 r33b09bc 365 365 $ht_tree entry configure root -label [mc "Tol Objects"]\ 366 366 -icons [list $img $img] 367 367 368 # creation of the node father "Grammars" 368 369 set img [::Bitmap::get Grammars] … … 373 374 # Inserts in the node of grammars a node by each grammar that exists in Tol 374 375 InsertGrammars 376 377 # creation of the node father "Packages" 378 set img [::Bitmap::get "package"] 379 set blt_idx [$blt_tree insert root -label "root-packages"\ 380 -tags "root-packages"] 381 $ht_tree entry configure $blt_idx -label [mc "Packages"]\ 382 -icons [list $img $img] -button yes 383 375 384 # creation of the node father "Included Files" 376 385 set img [::Bitmap::get "Files"] … … 823 832 } 824 833 834 # este proc debe pasar a ser un getContainerReference 835 # 836 proc ::TolInspector::getPackageReference { treePath } { 837 variable ht_tree 838 839 catch { 840 set typeContainer "NameBlock" 841 set order [ lindex [ split [ lindex $treePath 2 ] "-" ] end ] 842 incr order -1 843 #puts "path,2 = [ lindex $treePath 2 ]" 844 #puts "order = $order" 845 set idx [ $ht_tree entry children "root-packages" $order $order ] 846 set nameContainer [ $ht_tree entry cget $idx -label ] 847 #puts "en root-package:" 848 #puts "\torder=$order" 849 #puts "\tidx=$idx" 850 #puts "\nameContainer=$nameContainer" 851 set container [ list $typeContainer $nameContainer ] 852 if { [ llength $treePath ] > 3 } { 853 foreach c [ lrange $treePath 3 end-1 ] { 854 set orderItem [ lindex [ split $c "-" ] end ] 855 lappend container $orderItem 856 } 857 set tolindex [ lindex [ split [ lindex $treePath end ] "-" ] end ] 858 } else { 859 set tolindex [ list ] 860 } 861 } msg 862 #puts "::TolInspector::getPackageReference: $msg" 863 return [ list $container $tolindex ] 864 } 865 825 866 #///////////////////////////////////////////////////////////////////////////// 826 867 proc ::TolInspector::OpenObject { index } { … … 842 883 #puts "OpenObject: index=$index" 843 884 set path [$ht_tree get -full $index] 885 #puts "path = $path" 844 886 if { $index } { 845 887 set parent1 [lindex $path 1] 846 if { [set isfile [string equal $parent1 "root-files"]] || 888 if { [set ispackage [string equal $parent1 "root-packages"]] || 889 [set isfile [string equal $parent1 "root-files"]] || 847 890 [set isconsole [string equal $parent1 "root-console"]] || 848 891 [string equal $parent1 "root-pool"] } { … … 850 893 #puts "lpath = $lpath" 851 894 if { $lpath == 2 } { 852 if { $isfile } { 895 if { $ispackage } { 896 InsertPackages 897 } elseif { $isfile } { 853 898 InsertFiles 854 899 } elseif { $isconsole } { … … 863 908 set node_prefix [lindex $leaf_info 0] 864 909 set _tolset $tolset 865 if { [string equal $parent1 "root-pool"] } { 910 if { $parent1 eq "root-packages" } { 911 foreach {tolset tolindex} [ getPackageReference $path ] break 912 } elseif { [string equal $parent1 "root-pool"] } { 866 913 #Tolcon_Trace "OpenObject. tolset=$tolset" 867 914 set tolset $data(pool,reference,[lindex $leaf_info 0]) … … 916 963 917 964 #///////////////////////////////////////////////////////////////////////////// 965 proc ::TolInspector::InsertPackages {} { 966 # 967 # PURPOSE: Inserts a node in ht_tree (left ::blt::treeview) for each TOL 968 # packages 969 # 970 #///////////////////////////////////////////////////////////////////////////// 971 variable ht_tree 972 #upvar \#0 ::TolTk::Images Images 973 974 set order 1 975 foreach pkg [::tol::info packages] { 976 # takes an icon with the same name that the grammar 977 set img [ ::Bitmap::get NameBlock ] 978 $ht_tree insert -at "root-packages" end package-$order -label $pkg\ 979 -icons [list $img $img] -button yes 980 incr order 981 } 982 } 983 984 #///////////////////////////////////////////////////////////////////////////// 918 985 proc ::TolInspector::InsertGrammars {} { 919 986 # … … 1096 1163 variable blt_tree 1097 1164 variable gra_parent 1098 1165 catch { 1099 1166 #puts "InsertSubset, args=$args" 1100 1167 set grammar [lindex $args 0] … … 1141 1208 -icons [list $icon $icon] -foreground $fcolor 1142 1209 } 1210 } msg 1211 #puts "InsertSubSet: $msg" 1143 1212 } 1144 1213 … … 1266 1335 ClearHiertables 1267 1336 1337 set path [ $ht_tree get -full $index ] 1268 1338 set tolset "" 1269 1339 if { $index } { 1270 1340 #puts "SelectObject index = $index" 1271 #puts "SelectObject: full = [$ht_tree get -full $index]"1272 set info_node [split [lindex [$ht_tree get -full $index]end] "-"] ;# ojo si el path tiene -1341 #puts "SelectObject: full = $path" 1342 set info_node [split [lindex $path end] "-"] ;# ojo si el path tiene - 1273 1343 set node_type [lindex $info_node 0] 1274 1344 set node_name [lindex $info_node 1] … … 1280 1350 1281 1351 Busy 1282 #puts "SelectObject: node_type = $node_type "1352 #puts "SelectObject: node_type = $node_type, node_name = $node_name" 1283 1353 switch -regexp $node_type { 1284 1354 root { … … 1290 1360 #$w_tabset tab configure Functions -state disabled 1291 1361 } 1362 package { 1363 puts "implementa el llenado del panel derecho" 1364 } 1292 1365 files { 1293 1366 SelectFileRoot … … 1307 1380 set node_prefix $node_type 1308 1381 #puts "SelectObject: node_prefix = $node_prefix" 1309 if {[regexp -- "pool" $node_type]} { 1382 if { $node_type eq "package" } { 1383 foreach {tolset tolindex} [ getPackageReference $path ] break 1384 } elseif {[regexp -- "pool" $node_type]} { 1310 1385 set tolset $data(pool,reference,[lindex $node_type 0]) 1311 1386 #puts "SelectObject: Spool: tolset=$tolset, info_node=$info_node" … … 1318 1393 #lappend tolindex [lindex $info_node end] 1319 1394 set tolindex [lrange $info_node 1 end] 1320 if {[lindex $tolset 0] eq "Console"} {1321 set tolset [lindex $tolset 0]1322 } else {1323 set tolset [lrange $tolset 0 1]1324 }1395 if {[lindex $tolset 0] eq "Console"} { 1396 set tolset [lindex $tolset 0] 1397 } else { 1398 set tolset [lrange $tolset 0 1] 1399 } 1325 1400 } 1326 1401 } elseif {[regexp -- "console(.+)" $node_type --> idx_con]} { 1327 #puts "SelectObject: Console: tolset=$tolset info_node=$info_node idx_con=$idx_con"1402 #puts "SelectObject: Console: tolset=$tolset info_node=$info_node idx_con=$idx_con" 1328 1403 set tolset "Console" 1329 1404 #set idx [$ht_tree find -name $node_type] … … 1601 1676 if { $index } { 1602 1677 set parent1 [lindex $path 1] 1603 if { [string equal $parent1 "root-files"] || 1604 [string equal $parent1 "root-console"] || 1605 [string equal $parent1 "root-pool"] } { 1678 if { [string equal $parent1 "root-packages"] || 1679 [string equal $parent1 "root-files"] || 1680 [string equal $parent1 "root-console"] || 1681 [string equal $parent1 "root-pool"] } { 1606 1682 $ht_tree entry delete $index 0 end 1607 1683 }
Note: See TracChangeset
for help on using the changeset viewer.
