author | Claus Gittinger <cg@exept.de> |
Fri, 27 Jun 1997 11:56:45 +0200 | |
changeset 1254 | c9e604f03e6a |
parent 1236 | 529f36ae3217 |
child 1280 | 460131bb2a9a |
permissions | -rw-r--r-- |
0 | 1 |
" |
4 | 2 |
COPYRIGHT (c) 1991 by Claus Gittinger |
59 | 3 |
All Rights Reserved |
0 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
Toggle subclass:#CheckToggle |
|
375
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
14 |
instanceVariableNames:'' |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
15 |
classVariableNames:'DefaultCheckForm DefaultCheckColor DefaultActiveFGColor |
265 | 16 |
DefaultActiveBGColor DefaultFGColor DefaultBGColor |
1123 | 17 |
DefaultActiveLevel DefaultPassiveLevel DefaultBorderWidth |
18 |
LabelOverMargin' |
|
375
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
19 |
poolDictionaries:'' |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
20 |
category:'Views-Interactors' |
0 | 21 |
! |
22 |
||
899 | 23 |
!CheckToggle class methodsFor:'documentation'! |
38 | 24 |
|
25 |
copyright |
|
26 |
" |
|
27 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
59 | 28 |
All Rights Reserved |
0 | 29 |
|
38 | 30 |
This software is furnished under a license and may be used |
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
! |
|
0 | 38 |
|
38 | 39 |
documentation |
40 |
" |
|
41 |
CheckButtons are like Toggles in toggling their state when pressed. |
|
42 |
However, they show an ok-marker if on; nothing if off. |
|
118 | 43 |
CheckButtons are mostly used as part of a checkBox (since normally, |
147 | 44 |
you want to have some label along the check) and often grouped for |
45 |
many-in-many or one-in-many setups. |
|
130 | 46 |
|
585 | 47 |
[StyleSheet values:] |
130 | 48 |
|
585 | 49 |
checkToggleCheckColor <Color> color to draw check-image with. |
50 |
defaults to value of #buttonActiveForegroundColor. |
|
130 | 51 |
|
585 | 52 |
checkToggleActiveBackgroundColor background color to draw active checki-image with |
53 |
checkToggleForegroundColor foreground color to use if off |
|
54 |
checkToggleBackgroundColor background color to use if off |
|
130 | 55 |
|
585 | 56 |
checkToggleBitmapFile <String> name of bitmap file for check-image |
130 | 57 |
|
585 | 58 |
checkToggleStyle <Symbol> default checkForm style. |
59 |
used if above is nil or file not readable |
|
60 |
can be #cross or #check; defaults to #check |
|
130 | 61 |
|
585 | 62 |
checkToggleAvtiveLevel <Number> active level - defaults to value of #buttonPassiveLevel |
63 |
checkTogglePassiveLevel <Number> active level - defaults to value of #buttonPassiveLevel |
|
64 |
checkToggleBorderWidth <Number> borderWidth - defaults buttons default |
|
130 | 65 |
|
139 | 66 |
(if not set in the styleSheet, Toggle values are taken) |
67 |
||
130 | 68 |
See examples. |
69 |
||
585 | 70 |
[author:] |
71 |
Claus Gittinger |
|
72 |
||
73 |
[see also:] |
|
593 | 74 |
CheckBox RadioButton RadioButtonGroup Toggle Button |
75 |
Dialog |
|
76 |
ValueHolder TriggerValue |
|
77 |
Block |
|
118 | 78 |
" |
79 |
! |
|
80 |
||
81 |
examples |
|
82 |
" |
|
83 |
checkToggle alone: |
|
593 | 84 |
[exBegin] |
85 |
|top check| |
|
118 | 86 |
|
593 | 87 |
top := StandardSystemView new. |
88 |
top extent:100@100. |
|
118 | 89 |
|
593 | 90 |
check := CheckToggle in:top. |
91 |
check origin:10@10. |
|
118 | 92 |
|
593 | 93 |
top open |
94 |
[exEnd] |
|
118 | 95 |
|
96 |
||
97 |
give it an action: |
|
593 | 98 |
[exBegin] |
99 |
|top check| |
|
118 | 100 |
|
593 | 101 |
top := StandardSystemView new. |
102 |
top extent:100@100. |
|
118 | 103 |
|
593 | 104 |
check := CheckToggle in:top. |
105 |
check origin:10@10. |
|
655 | 106 |
check action:[:value | Transcript showCR:'changed to: ' , value printString]. |
118 | 107 |
|
593 | 108 |
top open |
109 |
[exEnd] |
|
110 |
||
118 | 111 |
|
112 |
give it a model: |
|
593 | 113 |
[exBegin] |
114 |
|top check model| |
|
118 | 115 |
|
593 | 116 |
model := false asValue. |
118 | 117 |
|
593 | 118 |
top := StandardSystemView new. |
119 |
top extent:100@100. |
|
118 | 120 |
|
593 | 121 |
check := CheckToggle in:top. |
122 |
check origin:10@10. |
|
123 |
check model:model. |
|
118 | 124 |
|
593 | 125 |
top openModal. |
118 | 126 |
|
655 | 127 |
Transcript showCR:'value after closing box: ' , model value printString |
593 | 128 |
[exEnd] |
129 |
||
118 | 130 |
|
131 |
multiple checks on a single model (with different change selectors): |
|
132 |
(using a checkBox here, for the demonstration ...) |
|
147 | 133 |
(this is a typical many-in-many setup) |
593 | 134 |
[exBegin] |
135 |
|top model panel ext1 ext2 |
|
136 |
readFlag writeFlag executeFlag| |
|
118 | 137 |
|
593 | 138 |
readFlag := writeFlag := true. |
139 |
executeFlag := false. |
|
118 | 140 |
|
593 | 141 |
model := Plug new. |
142 |
model respondTo:#read with:[readFlag]. |
|
143 |
model respondTo:#write with:[writeFlag]. |
|
144 |
model respondTo:#execute with:[executeFlag]. |
|
145 |
model respondTo:#read: with:[:val | readFlag := val]. |
|
146 |
model respondTo:#write: with:[:val | writeFlag := val]. |
|
147 |
model respondTo:#execute: with:[:val | executeFlag := val]. |
|
148 |
||
149 |
top := StandardSystemView new. |
|
150 |
top extent:200@200. |
|
151 |
top label:'File permissions:'. |
|
118 | 152 |
|
593 | 153 |
panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top. |
154 |
panel horizontalLayout:#leftSpace. |
|
118 | 155 |
|
593 | 156 |
#(read write execute) do:[:sym | |
157 |
|check| |
|
118 | 158 |
|
593 | 159 |
check := CheckBox in:panel. |
160 |
check label:sym. |
|
161 |
check model:model; aspect:sym; changeMessage:(sym , ':') asSymbol. |
|
162 |
]. |
|
118 | 163 |
|
593 | 164 |
top openModal. |
118 | 165 |
|
655 | 166 |
Transcript showCR:'settings after closing box:'. |
167 |
Transcript showCR:' read -> ' , readFlag printString. |
|
168 |
Transcript showCR:' write -> ' , writeFlag printString. |
|
169 |
Transcript showCR:' execute -> ' , executeFlag printString. |
|
593 | 170 |
[exEnd] |
130 | 171 |
|
172 |
||
593 | 173 |
checkToggles in a group - now, they have RadioButton behavior. |
147 | 174 |
(this is a typical one-in-many setup) |
593 | 175 |
[exBegin] |
176 |
|top panel check1 check2 check3 grp| |
|
130 | 177 |
|
593 | 178 |
top := StandardSystemView new. |
179 |
top extent:200@300. |
|
130 | 180 |
|
593 | 181 |
panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top. |
130 | 182 |
|
593 | 183 |
check1 := CheckToggle in:panel. |
184 |
check2 := CheckToggle in:panel. |
|
185 |
check3 := CheckToggle in:panel. |
|
130 | 186 |
|
593 | 187 |
grp := RadioButtonGroup new. |
188 |
grp add:check1. |
|
189 |
grp add:check2. |
|
190 |
grp add:check3. |
|
130 | 191 |
|
593 | 192 |
top open |
193 |
[exEnd] |
|
146 | 194 |
|
195 |
||
196 |
Channel operation |
|
197 |
----------------- |
|
198 |
||
199 |
enabling other toggles via a toggle |
|
593 | 200 |
[exBegin] |
201 |
|top panel t enableChannel| |
|
146 | 202 |
|
593 | 203 |
top := StandardSystemView new. |
204 |
top extent:(400 @ 200). |
|
146 | 205 |
|
593 | 206 |
panel := HorizontalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top. |
146 | 207 |
|
593 | 208 |
enableChannel := false asValue. |
146 | 209 |
|
593 | 210 |
1 to:10 do:[:i | |
211 |
t := CheckToggle in:panel. |
|
212 |
t enableChannel:enableChannel. |
|
213 |
]. |
|
146 | 214 |
|
593 | 215 |
t := Toggle in:panel. |
216 |
t activeLogo:'enabled'; passiveLogo:'disabled'. |
|
217 |
t pressChannel:enableChannel. |
|
146 | 218 |
|
593 | 219 |
top open |
220 |
[exEnd] |
|
38 | 221 |
" |
222 |
! ! |
|
0 | 223 |
|
899 | 224 |
!CheckToggle class methodsFor:'defaults'! |
0 | 225 |
|
205 | 226 |
checkFormOn:aDevice |
227 |
"return the form used when checkToggle is turned on. |
|
228 |
Provided as public entry, to allow other views |
|
229 |
to share the same check-image." |
|
230 |
||
231 |
^ DefaultCheckForm on:aDevice. |
|
232 |
! |
|
233 |
||
1236 | 234 |
checkImageForStyle:aStyleSymbol |
235 |
"helper & public access to useful checkToggle images" |
|
236 |
||
237 |
|bits| |
|
238 |
||
239 |
aStyleSymbol == #cross ifTrue:[ |
|
240 |
bits := #[2r10000000 2r00000001 |
|
241 |
2r01000000 2r00000010 |
|
242 |
2r00100000 2r00000100 |
|
243 |
2r00010000 2r00001000 |
|
244 |
2r00001000 2r00010000 |
|
245 |
2r00000100 2r00100000 |
|
246 |
2r00000010 2r01000000 |
|
247 |
2r00000001 2r10000000 |
|
248 |
2r00000001 2r10000000 |
|
249 |
2r00000010 2r01000000 |
|
250 |
2r00000100 2r00100000 |
|
251 |
2r00001000 2r00010000 |
|
252 |
2r00010000 2r00001000 |
|
253 |
2r00100000 2r00000100 |
|
254 |
2r01000000 2r00000010 |
|
255 |
2r10000000 2r00000001] |
|
256 |
] ifFalse:[ |
|
257 |
aStyleSymbol == #borderedCross ifTrue:[ |
|
258 |
bits := #[2r11111111 2r11111111 |
|
259 |
2r11000000 2r00000011 |
|
260 |
2r10100000 2r00000101 |
|
261 |
2r10010000 2r00001001 |
|
262 |
2r10001000 2r00010001 |
|
263 |
2r10000100 2r00100001 |
|
264 |
2r10000010 2r01000001 |
|
265 |
2r10000001 2r10000001 |
|
266 |
2r10000001 2r10000001 |
|
267 |
2r10000010 2r01000001 |
|
268 |
2r10000100 2r00100001 |
|
269 |
2r10001000 2r00010001 |
|
270 |
2r10010000 2r00001001 |
|
271 |
2r10100000 2r00000101 |
|
272 |
2r11000000 2r00000011 |
|
273 |
2r11111111 2r11111111] |
|
274 |
] ifFalse:[ |
|
275 |
aStyleSymbol == #fatcross ifTrue:[ |
|
276 |
bits := #[2r11000000 2r00000011 |
|
277 |
2r11100000 2r00000111 |
|
278 |
2r01110000 2r00001110 |
|
279 |
2r00111000 2r00011100 |
|
280 |
2r00011100 2r00111000 |
|
281 |
2r00001110 2r01110000 |
|
282 |
2r00000111 2r11100000 |
|
283 |
2r00000011 2r11000000 |
|
284 |
2r00000011 2r11000000 |
|
285 |
2r00000111 2r11100000 |
|
286 |
2r00001110 2r01110000 |
|
287 |
2r00011100 2r00111000 |
|
288 |
2r00111000 2r00011100 |
|
289 |
2r01110000 2r00001110 |
|
290 |
2r11100000 2r00000111 |
|
291 |
2r11000000 2r00000011] |
|
292 |
] ifFalse:[ |
|
293 |
aStyleSymbol == #borderedFatcross ifTrue:[ |
|
294 |
bits := #[2r11111111 2r11111111 |
|
295 |
2r11100000 2r00000111 |
|
296 |
2r11110000 2r00001111 |
|
297 |
2r10111000 2r00011101 |
|
298 |
2r10011100 2r00111001 |
|
299 |
2r10001110 2r01110001 |
|
300 |
2r10000111 2r11100001 |
|
301 |
2r10000011 2r11000001 |
|
302 |
2r10000011 2r11000001 |
|
303 |
2r10000111 2r11100001 |
|
304 |
2r10001110 2r01110001 |
|
305 |
2r10011100 2r00111001 |
|
306 |
2r10111000 2r00011101 |
|
307 |
2r11110000 2r00001111 |
|
308 |
2r11100000 2r00000111 |
|
309 |
2r11111111 2r11111111] |
|
310 |
] ifFalse:[ |
|
311 |
aStyleSymbol == #border ifTrue:[ |
|
312 |
bits := #[2r11111111 2r11111111 |
|
313 |
2r10000000 2r00000001 |
|
314 |
2r10000000 2r00000001 |
|
315 |
2r10000000 2r00000001 |
|
316 |
2r10000000 2r00000001 |
|
317 |
2r10000000 2r00000001 |
|
318 |
2r10000000 2r00000001 |
|
319 |
2r10000000 2r00000001 |
|
320 |
2r10000000 2r00000001 |
|
321 |
2r10000000 2r00000001 |
|
322 |
2r10000000 2r00000001 |
|
323 |
2r10000000 2r00000001 |
|
324 |
2r10000000 2r00000001 |
|
325 |
2r10000000 2r00000001 |
|
326 |
2r10000000 2r00000001 |
|
327 |
2r11111111 2r11111111] |
|
328 |
] ifFalse:[ |
|
329 |
bits := #[2r00000000 2r00000000 |
|
330 |
2r00000000 2r00000010 |
|
331 |
2r00000000 2r00000010 |
|
332 |
2r00000000 2r00000100 |
|
333 |
2r00000000 2r00000100 |
|
334 |
2r00000000 2r00001000 |
|
335 |
2r00000000 2r00001000 |
|
336 |
2r00000000 2r00010000 |
|
337 |
2r01000000 2r00110000 |
|
338 |
2r00100000 2r01100000 |
|
339 |
2r00011000 2r01100000 |
|
340 |
2r00001110 2r11000000 |
|
341 |
2r00000111 2r11000000 |
|
342 |
2r00000011 2r10000000 |
|
343 |
2r00000001 2r10000000 |
|
344 |
2r00000000 2r00000000] |
|
345 |
] |
|
346 |
] |
|
347 |
] |
|
348 |
] |
|
349 |
]. |
|
350 |
^ Form width:16 height:16 fromArray:bits on:Display |
|
351 |
||
352 |
" |
|
353 |
self checkImageForStyle:#cross |
|
354 |
self checkImageForStyle:#fatcross |
|
355 |
self checkImageForStyle:#borderedCross |
|
356 |
self checkImageForStyle:#borderedFatcross |
|
357 |
" |
|
358 |
||
359 |
"Modified: 7.3.1997 / 21:15:13 / cg" |
|
360 |
! |
|
361 |
||
128 | 362 |
updateStyleCache |
440
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
375
diff
changeset
|
363 |
"extract values from the styleSheet and cache them in class variables" |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
375
diff
changeset
|
364 |
|
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
375
diff
changeset
|
365 |
<resource: #style (#checkToggleCheckColor |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
375
diff
changeset
|
366 |
#checkToggleBackgroundColor #checkToggleForegroundColor |
836 | 367 |
#checkToggleActiveBackgroundColor #checkToggleActiveForegroundColor |
440
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
375
diff
changeset
|
368 |
#checkToggleActiveLevel #checkTogglePassiveLevel |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
375
diff
changeset
|
369 |
#checkToggleBorderWidth |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
375
diff
changeset
|
370 |
#checkToggleBitmapFile |
1123 | 371 |
#checkToggleLabelOverMargin |
440
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
375
diff
changeset
|
372 |
#checkToggleStyle)> |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
375
diff
changeset
|
373 |
|
375
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
374 |
|checkFileName bits checkStyle| |
0 | 375 |
|
130 | 376 |
DefaultCheckColor := StyleSheet colorAt:'checkToggleCheckColor'. |
139 | 377 |
DefaultFGColor := StyleSheet colorAt:'checkToggleForegroundColor'. |
130 | 378 |
DefaultBGColor := StyleSheet colorAt:'checkToggleBackgroundColor'. |
139 | 379 |
DefaultActiveFGColor := StyleSheet colorAt:'checkToggleActiveForegroundColor'. |
130 | 380 |
DefaultActiveBGColor := StyleSheet colorAt:'checkToggleActiveBackgroundColor'. |
381 |
DefaultActiveLevel := StyleSheet at:'checkToggleActiveLevel'. |
|
382 |
DefaultPassiveLevel := StyleSheet at:'checkTogglePassiveLevel'. |
|
383 |
DefaultBorderWidth := StyleSheet at:'checkToggleBorderWidth'. |
|
1123 | 384 |
LabelOverMargin := StyleSheet at:'checkToggleLabelOverMargin' default:false. |
130 | 385 |
|
136 | 386 |
DefaultCheckForm := nil. |
128 | 387 |
checkFileName := StyleSheet at:'checkToggleBitmapFile' default:'CheckOn.xbm'. |
388 |
checkFileName notNil ifTrue:[ |
|
899 | 389 |
DefaultCheckForm := Image fromFile:checkFileName |
390 |
resolution:100 |
|
391 |
on:Display. |
|
392 |
DefaultCheckForm isNil ifTrue:[ |
|
393 |
DefaultCheckForm := Image fromFile:'bitmaps/' , checkFileName |
|
394 |
resolution:100 |
|
395 |
on:Display. |
|
396 |
] |
|
130 | 397 |
]. |
398 |
DefaultCheckForm isNil ifTrue:[ |
|
375
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
399 |
checkStyle := StyleSheet at:'checkToggleStyle' default:#check. |
1236 | 400 |
DefaultCheckForm := self checkImageForStyle:checkStyle |
128 | 401 |
] |
440
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
375
diff
changeset
|
402 |
|
1001 | 403 |
" |
404 |
self updateStyleCache |
|
405 |
" |
|
1123 | 406 |
|
407 |
"Modified: 7.3.1997 / 21:15:13 / cg" |
|
0 | 408 |
! ! |
409 |
||
410 |
!CheckToggle methodsFor:'initialization'! |
|
411 |
||
18 | 412 |
initStyle |
967 | 413 |
"setup viewStyle specifics" |
414 |
||
18 | 415 |
super initStyle. |
416 |
||
128 | 417 |
onLevel := offLevel. |
130 | 418 |
DefaultActiveLevel notNil ifTrue:[onLevel := DefaultActiveLevel]. |
136 | 419 |
DefaultPassiveLevel notNil ifTrue:[offLevel := DefaultPassiveLevel]. |
130 | 420 |
|
128 | 421 |
activeLogo := DefaultCheckForm on:device. |
422 |
passiveLogo := nil. |
|
423 |
||
139 | 424 |
DefaultActiveFGColor notNil ifTrue:[self activeForegroundColor:DefaultActiveFGColor]. |
130 | 425 |
DefaultCheckColor notNil ifTrue:[self activeForegroundColor:DefaultCheckColor]. |
426 |
DefaultActiveBGColor notNil ifTrue:[self activeBackgroundColor:DefaultActiveBGColor]. |
|
139 | 427 |
DefaultFGColor notNil ifTrue:[self foregroundColor:DefaultFGColor]. |
130 | 428 |
DefaultBGColor notNil ifTrue:[self backgroundColor:DefaultBGColor]. |
429 |
||
128 | 430 |
showLamp := false. |
130 | 431 |
|
432 |
DefaultBorderWidth notNil ifTrue:[self borderWidth:DefaultBorderWidth]. |
|
433 |
||
434 |
offLevel ~~ level ifTrue:[self level:offLevel]. |
|
967 | 435 |
|
436 |
"Modified: 22.1.1997 / 11:57:05 / cg" |
|
205 | 437 |
! |
438 |
||
439 |
initialize |
|
440 |
super initialize. |
|
441 |
passiveLogo := nil. |
|
1023 | 442 |
self label:activeLogo "/ to let me compute some defaultExtent |
443 |
||
444 |
"Modified: 18.2.1997 / 14:03:39 / cg" |
|
0 | 445 |
! ! |
446 |
||
1123 | 447 |
!CheckToggle methodsFor:'queries'! |
448 |
||
449 |
preferredExtent |
|
450 |
"/ If I have an explicit preferredExtent .. |
|
451 |
||
452 |
|pref| |
|
453 |
||
454 |
preferredExtent notNil ifTrue:[ |
|
455 |
^ preferredExtent |
|
456 |
]. |
|
457 |
||
458 |
pref := super preferredExtent. |
|
459 |
LabelOverMargin ifTrue:[ |
|
460 |
pref := pref - (margin*2) |
|
461 |
]. |
|
462 |
||
463 |
^ pref |
|
464 |
||
465 |
"Modified: 7.3.1997 / 17:52:53 / cg" |
|
466 |
! ! |
|
467 |
||
0 | 468 |
!CheckToggle methodsFor:'redrawing'! |
469 |
||
133 | 470 |
drawWith:fg and:bg |
265 | 471 |
controller pressed ifTrue:[ |
1169
982c3fd58d67
better highlighting on enter/leave
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
472 |
logo := activeLogo. |
0 | 473 |
] ifFalse:[ |
1169
982c3fd58d67
better highlighting on enter/leave
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
474 |
logo := passiveLogo. |
133 | 475 |
]. |
1171 | 476 |
|
477 |
(controller entered |
|
478 |
and:[enteredBgColor notNil]) ifTrue:[ |
|
1169
982c3fd58d67
better highlighting on enter/leave
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
479 |
super drawWith:fg and:enteredBgColor |
982c3fd58d67
better highlighting on enter/leave
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
480 |
] ifFalse:[ |
982c3fd58d67
better highlighting on enter/leave
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
481 |
super drawWith:fg and:bgColor "/ bg |
982c3fd58d67
better highlighting on enter/leave
Claus Gittinger <cg@exept.de>
parents:
1154
diff
changeset
|
482 |
] |
164 | 483 |
|
484 |
"Modified: 22.9.1995 / 15:45:02 / claus" |
|
1171 | 485 |
"Modified: 1.4.1997 / 13:35:48 / cg" |
1123 | 486 |
! |
487 |
||
488 |
edgeDrawn:which |
|
1154 | 489 |
"redraw my logo if it overlaps the edge" |
490 |
||
1123 | 491 |
LabelOverMargin ifTrue:[ |
492 |
(logo notNil and:[logo isImageOrForm]) ifTrue:[ |
|
493 |
self paint:fgColor on:bgColor. |
|
494 |
self clippingRectangle:nil. |
|
495 |
self displayForm:logo x:labelOriginX y:labelOriginY. |
|
496 |
self clippingRectangle:innerClipRect |
|
497 |
] |
|
498 |
]. |
|
499 |
||
1154 | 500 |
"Modified: 22.3.1997 / 18:23:50 / cg" |
0 | 501 |
! ! |
205 | 502 |
|
899 | 503 |
!CheckToggle class methodsFor:'documentation'! |
205 | 504 |
|
505 |
version |
|
1236 | 506 |
^ '$Header: /cvs/stx/stx/libwidg/CheckToggle.st,v 1.36 1997-06-04 11:26:13 ca Exp $' |
205 | 507 |
! ! |