Changeset e3362cc in tol for tolbase/lib/toltk
- Timestamp:
- Jul 23, 2010, 8:35:19 PM (16 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 7adc51c
- Parents:
- 3844cff
- Location:
- tolbase/lib/toltk
- Files:
-
- 3 edited
-
ImageManager.tcl (modified) (3 diffs)
-
tclIndex (modified) (1 diff)
-
tolinspe.tcl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tolbase/lib/toltk/ImageManager.tcl
r3844cff re3362cc 1 package require BWidget 2 1 3 namespace eval ::ImageManager { 2 4 } … … 17 19 } 18 20 19 proc ::ImageManager::getIconFor Class { className} {20 set rvar "__getIconFor Class__"21 set tolExpr [ string map [ list % N $className%RV $rvar ] {21 proc ::ImageManager::getIconForInstance { objAddress } { 22 set rvar "__getIconForInstance__" 23 set tolExpr [ string map [ list %A $objAddress %RV $rvar ] { 22 24 Text %RV = { 23 Real test = ObjectExist( "Code", "GuiTools::ImageManager::getIconForClass" ); 24 Text imageName = If( test, 25 GuiTools::ImageManager::getIconForClass( "%N" ), 26 "" ); 25 Real test = ObjectExist( "Code", "GuiTools::ImageManager::getIconForInstance" ); 26 // obtengo el nombre del imagen 27 Text imageName = If( test, { 28 NameBlock obj = GetObjectFromAddress( "%A" ); 29 Text GuiTools::ImageManager::getIconForInstance( obj ) 30 }, "" ); 31 // obtengo el id del recurso que es el id de la imagen Tk 27 32 Text GuiTools::ImageManager::getImageResourceId( imageName ) 28 33 } … … 32 37 set value [ string trim [ lindex $info 2 ] \" ] 33 38 tol::console stack release $rvar 34 return $value39 return [ expr {$value eq "" ? [::Bitmap::get "NameBlock"] : $value} ] 35 40 } -
tolbase/lib/toltk/tclIndex
r3844cff re3362cc 170 170 set auto_index(::funcSearch::SearchWord) [list source [file join $dir fusearch.tcl]] 171 171 set auto_index(::ImageManager::getImageResourceId) [list source [file join $dir ImageManager.tcl]] 172 set auto_index(::ImageManager::getIconFor Class) [list source [file join $dir ImageManager.tcl]]172 set auto_index(::ImageManager::getIconForInstance) [list source [file join $dir ImageManager.tcl]] 173 173 set auto_index(::MatrixTable::Create) [list source [file join $dir mattable.tcl]] 174 174 set auto_index(::MatrixTable::Fill) [list source [file join $dir mattable.tcl]] -
tolbase/lib/toltk/tolinspe.tcl
r3844cff re3362cc 796 796 set objRef $knownReference 797 797 } 798 set classOf [ Tol_ClassOfFromReference $objRef ] 799 set iconClass [ ::ImageManager::getIconForClass $classOf ] 800 set icon_grammar \ 801 [ expr {$iconClass eq "" ? [::Bitmap::get "NameBlock"] : $iconClass} ] 798 set objAddress [ tol::info address $objRef ] 799 set icon_grammar [ ::ImageManager::getIconForInstance $objAddress ] 802 800 } 803 801 } else { … … 1062 1060 } else { 1063 1061 set objRef [ list "Console" $index ] 1064 set classOf [ Tol_ClassOfFromReference $objRef ] 1065 set iconClass [ ::ImageManager::getIconForClass $classOf ] 1066 set icon \ 1067 [ expr {$iconClass eq "" ? [::Bitmap::get "NameBlock"] : $iconClass} ] 1062 set objAddress [ tol::info address $objRef ] 1063 set icon [ ::ImageManager::getIconForInstance $objAddress ] 1068 1064 } 1069 1065 set name [lindex $co 1] … … 1124 1120 } else { 1125 1121 puts "en pool = $obj(reference)" 1126 set classOf [ Tol_ClassOfFromReference $obj(reference) ] 1127 set iconClass [ ::ImageManager::getIconForClass $classOf ] 1128 set icon \ 1129 [ expr {$iconClass eq "" ? [::Bitmap::get "NameBlock"] : $iconClass} ] 1122 set objAddress [ tol::info address $objRef ] 1123 set icon [ ::ImageManager::getIconForInstance $objAddress ] 1130 1124 } 1131 1125 … … 1190 1184 set grammar [lindex $args 0] 1191 1185 if {$grammar eq "Set" || $grammar eq "NameBlock"} { 1192 puts "InsertSubset, args=$args"1186 #puts "InsertSubset, args=$args" 1193 1187 if { $gra_parent eq "NameBlock" } { 1194 1188 array set info_member [ FilterNameBlockMember [ lindex $args 1 ] ] … … 1214 1208 set objRef $iterSet 1215 1209 lappend objRef [ lindex $idx end ] 1216 puts "objRef = $objRef" 1217 set classOf [ Tol_ClassOfFromReference $objRef ] 1218 set iconClass [ ::ImageManager::getIconForClass $classOf ] 1219 set icon \ 1220 [ expr {$iconClass eq "" ? [::Bitmap::get "NameBlock"] : $iconClass} ] 1210 set objAddress [ tol::info address $objRef ] 1211 set icon [ ::ImageManager::getIconForInstance $objAddress ] 1221 1212 } 1222 1213 # Tail por si es un fichero. PodrÃa hacerse configurable por el usuario
Note: See TracChangeset
for help on using the changeset viewer.
