Button.st
changeset 2609 c1f9be6ce48c
parent 2586 932f37c50f9f
child 2611 9108c4aa2b99
equal deleted inserted replaced
2608:10961d53b194 2609:c1f9be6ce48c
  2104 
  2104 
  2105 drawWith:fg and:bg
  2105 drawWith:fg and:bg
  2106     "redraw myself with fg/bg. Use super to draw the label, add
  2106     "redraw myself with fg/bg. Use super to draw the label, add
  2107      the return-arrow here."
  2107      the return-arrow here."
  2108 
  2108 
  2109     |x y sColor lColor etchFg|
  2109     |x y sColor lColor etchFg savLogo|
  2110 
  2110 
  2111     shown ifFalse:[^ self].
  2111     shown ifFalse:[^ self].
  2112 
  2112 
  2113     controller enabled ifFalse:[
  2113     controller enabled ifFalse:[
  2114         etchFg := disabledEtchedFgColor.
  2114         etchFg := disabledEtchedFgColor.
  2115     ].
  2115     ].
       
  2116 
       
  2117     savLogo := logo.
       
  2118     disabledLogo notNil ifTrue:[
       
  2119         controller enabled ifFalse:[
       
  2120             logo := disabledLogo.
       
  2121         ] ifTrue:[
       
  2122             controller active ifTrue:[
       
  2123                 logo := activeLogo
       
  2124             ] ifFalse:[
       
  2125                 logo := passiveLogo
       
  2126             ].
       
  2127         ].
       
  2128     ] ifFalse:[
       
  2129         controller active ifTrue:[
       
  2130             logo := activeLogo. Transcript showCR:Time now.
       
  2131         ] ifFalse:[
       
  2132             logo := passiveLogo
       
  2133         ].
       
  2134     ].
       
  2135     logo := savLogo.
  2116 
  2136 
  2117     self drawWith:fg and:bg clearInside:true etchedFg:etchFg.   "this draws the text/image"
  2137     self drawWith:fg and:bg clearInside:true etchedFg:etchFg.   "this draws the text/image"
  2118 
  2138 
  2119     (isReturnButton and:[shadowForm notNil]) ifTrue:[
  2139     (isReturnButton and:[shadowForm notNil]) ifTrue:[
  2120         y := (height - shadowForm height) // 2.
  2140         y := (height - shadowForm height) // 2.
  2171     |fg bg entered noFrame lvl isEnabled|
  2191     |fg bg entered noFrame lvl isEnabled|
  2172 
  2192 
  2173     shown ifFalse:[^ self].
  2193     shown ifFalse:[^ self].
  2174     isEnabled := controller enabled.
  2194     isEnabled := controller enabled.
  2175 
  2195 
  2176     disabledLogo notNil ifTrue:[
  2196 "/    disabledLogo notNil ifTrue:[
  2177         isEnabled ifFalse:[
  2197 "/        isEnabled ifFalse:[
  2178             logo := disabledLogo.
  2198 "/            logo := disabledLogo.
  2179         ] ifTrue:[
  2199 "/        ] ifTrue:[
  2180             controller active ifTrue:[
  2200 "/            controller active ifTrue:[
  2181                 logo := activeLogo
  2201 "/                logo := activeLogo
  2182             ] ifFalse:[
  2202 "/            ] ifFalse:[
  2183                 logo := passiveLogo
  2203 "/                logo := passiveLogo
  2184             ].
  2204 "/            ].
  2185         ].
  2205 "/        ].
  2186     ].
  2206 "/    ].
  2187 
  2207 
  2188     noFrame := true.
  2208     noFrame := true.
  2189     fg := fgColor.
  2209     fg := fgColor.
  2190     bg := bgColor.
  2210     bg := bgColor.
  2191     isEnabled ifFalse:[
  2211     isEnabled ifFalse:[
  2290 ! !
  2310 ! !
  2291 
  2311 
  2292 !Button class methodsFor:'documentation'!
  2312 !Button class methodsFor:'documentation'!
  2293 
  2313 
  2294 version
  2314 version
  2295     ^ '$Header: /cvs/stx/stx/libwidg/Button.st,v 1.123 2002-08-21 09:41:42 penk Exp $'
  2315     ^ '$Header: /cvs/stx/stx/libwidg/Button.st,v 1.124 2002-09-06 20:52:09 cg Exp $'
  2296 ! !
  2316 ! !