ColorMenu.st
changeset 3412 edde712ea6ed
parent 3406 28d99375fcc7
child 3413 c7be2e00d9bc
equal deleted inserted replaced
3411:a7a58a10cdcd 3412:edde712ea6ed
   404         enabledChannel value:false
   404         enabledChannel value:false
   405     ] ifTrue:[
   405     ] ifTrue:[
   406         newColor := aColor.
   406         newColor := aColor.
   407         aColor isSymbol ifTrue:[
   407         aColor isSymbol ifTrue:[
   408             allowSymbolicColors ifTrue:[
   408             allowSymbolicColors ifTrue:[
   409                 label  := aColor "asText emphasis:(#backgroundColor->aColor)".
   409                 label  := aColor.
   410             ] ifFalse:[
   410             ] ifFalse:[
   411                 "our caller does not handle symbolic colors (UIPainter does) - convert"
   411                 "our caller does not handle symbolic colors (UIPainter does) - convert now.
   412                 newColor := Color perform:aColor ifNotUnderstood:[color "keep old"].
   412                  Be careful - for security reasons - do not perform arbitrary symbols here 
       
   413                 (could be #halt, #error)!!"
       
   414 
       
   415                 newColor := Color name:aColor ifIllegal:[color "keep old"].
   413             ].
   416             ].
   414         ] ifFalse:[
   417         ].
       
   418         newColor isSymbol ifFalse:[
       
   419             "show the selected color in the label"
   415             label  := Text string: '   ' emphasis:(#backgroundColor->newColor).
   420             label  := Text string: '   ' emphasis:(#backgroundColor->newColor).
   416         ].
   421         ].
   417         color := newColor.
   422         color := newColor.
   418         self disabledRedrawDo:[
   423         self disabledRedrawDo:[
   419             enabledChannel value:true.
   424             enabledChannel value:true.
   594 ! !
   599 ! !
   595 
   600 
   596 !ColorMenu class methodsFor:'documentation'!
   601 !ColorMenu class methodsFor:'documentation'!
   597 
   602 
   598 version
   603 version
   599     ^ '$Header: /cvs/stx/stx/libwidg2/ColorMenu.st,v 1.52 2008-05-19 16:44:02 cg Exp $'
   604     ^ '$Header: /cvs/stx/stx/libwidg2/ColorMenu.st,v 1.53 2008-05-27 11:17:11 stefan Exp $'
   600 ! !
   605 ! !