Changeset e3362cc in tol for tolbase/lib/toltk


Ignore:
Timestamp:
Jul 23, 2010, 8:35:19 PM (16 years ago)
Author:
Jorge Pérez <josp.jorge@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
7adc51c
Parents:
3844cff
Message:

fixes #945, ticket done & test updated, see also commit [2400], updating new functions in tclIndex

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@2401 be4846ae-f051-483a-831f-b64e7d08527f

Location:
tolbase/lib/toltk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tolbase/lib/toltk/ImageManager.tcl

    r3844cff re3362cc  
     1package require BWidget
     2
    13namespace eval ::ImageManager {
    24}
    … …  
    1719}
    1820
    19 proc ::ImageManager::getIconForClass { className } {
    20   set rvar "__getIconForClass__"
    21   set tolExpr [ string map [ list %N $className %RV $rvar ] {
     21proc ::ImageManager::getIconForInstance { objAddress } {
     22  set rvar "__getIconForInstance__"
     23  set tolExpr [ string map [ list %A $objAddress %RV $rvar ] {
    2224    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
    2732      Text GuiTools::ImageManager::getImageResourceId( imageName )
    2833    }
    … …  
    3237  set value [ string trim [ lindex $info 2 ] \" ]
    3338  tol::console stack release $rvar
    34   return $value
     39  return [ expr {$value eq "" ? [::Bitmap::get "NameBlock"] : $value} ]
    3540}
  • tolbase/lib/toltk/tclIndex

    r3844cff re3362cc  
    170170set auto_index(::funcSearch::SearchWord) [list source [file join $dir fusearch.tcl]]
    171171set auto_index(::ImageManager::getImageResourceId) [list source [file join $dir ImageManager.tcl]]
    172 set auto_index(::ImageManager::getIconForClass) [list source [file join $dir ImageManager.tcl]]
     172set auto_index(::ImageManager::getIconForInstance) [list source [file join $dir ImageManager.tcl]]
    173173set auto_index(::MatrixTable::Create) [list source [file join $dir mattable.tcl]]
    174174set auto_index(::MatrixTable::Fill) [list source [file join $dir mattable.tcl]]
  • tolbase/lib/toltk/tolinspe.tcl

    r3844cff re3362cc  
    796796        set objRef $knownReference
    797797      }
    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 ]
    802800    }
    803801  } else {
    … …  
    10621060      } else  {
    10631061        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 ]
    10681064      }
    10691065      set name [lindex $co 1]
    … …  
    11241120      } else  {
    11251121        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 ]
    11301124      }
    11311125
    … …  
    11901184  set grammar [lindex $args 0]
    11911185  if {$grammar eq "Set" || $grammar eq "NameBlock"} {
    1192     puts "InsertSubset, args=$args"
     1186    #puts "InsertSubset, args=$args"
    11931187    if { $gra_parent eq "NameBlock" } {
    11941188      array set info_member [ FilterNameBlockMember [ lindex $args 1 ] ]
    … …  
    12141208      set objRef $iterSet
    12151209      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 ]
    12211212    }
    12221213    # Tail por si es un fichero. Podría hacerse configurable por el usuario
Note: See TracChangeset for help on using the changeset viewer.