author | Claus Gittinger <cg@exept.de> |
Fri, 01 Mar 1996 14:02:46 +0100 | |
changeset 441 | e170bca66a78 |
parent 440 | 2beb33cb0146 |
child 585 | 8f395aba0173 |
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 |
17 |
DefaultActiveLevel DefaultPassiveLevel DefaultBorderWidth' |
|
375
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
18 |
poolDictionaries:'' |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
19 |
category:'Views-Interactors' |
0 | 20 |
! |
21 |
||
38 | 22 |
!CheckToggle class methodsFor:'documentation'! |
23 |
||
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
59 | 27 |
All Rights Reserved |
0 | 28 |
|
38 | 29 |
This software is furnished under a license and may be used |
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
0 | 37 |
|
38 | 38 |
documentation |
39 |
" |
|
40 |
CheckButtons are like Toggles in toggling their state when pressed. |
|
41 |
However, they show an ok-marker if on; nothing if off. |
|
118 | 42 |
CheckButtons are mostly used as part of a checkBox (since normally, |
147 | 43 |
you want to have some label along the check) and often grouped for |
44 |
many-in-many or one-in-many setups. |
|
130 | 45 |
|
46 |
StyleSheet values: |
|
47 |
||
48 |
checkToggleCheckColor <Color> color to draw check-image with. |
|
49 |
defaults to value of #buttonActiveForegroundColor. |
|
50 |
||
139 | 51 |
checkToggleActiveBackgroundColor background color to draw active checki-image with |
52 |
checkToggleForegroundColor foreground color to use if off |
|
53 |
checkToggleBackgroundColor background color to use if off |
|
130 | 54 |
|
55 |
checkToggleBitmapFile <String> name of bitmap file for check-image |
|
56 |
||
57 |
checkToggleStyle <Symbol> default checkForm style. |
|
58 |
used if above is nil or file not readable |
|
59 |
can be #cross or #check; defaults to #check |
|
60 |
||
61 |
checkToggleAvtiveLevel <Number> active level - defaults to value of #buttonPassiveLevel |
|
62 |
checkTogglePassiveLevel <Number> active level - defaults to value of #buttonPassiveLevel |
|
63 |
checkToggleBorderWidth <Number> borderWidth - defaults buttons default |
|
64 |
||
139 | 65 |
(if not set in the styleSheet, Toggle values are taken) |
66 |
||
130 | 67 |
See examples. |
68 |
||
147 | 69 |
See also: CheckBox RadioButton RadioButtonGroup Toggle Button |
118 | 70 |
" |
71 |
! |
|
72 |
||
73 |
examples |
|
74 |
" |
|
75 |
checkToggle alone: |
|
76 |
||
77 |
|top check| |
|
78 |
||
79 |
top := StandardSystemView new. |
|
80 |
top extent:100@100. |
|
81 |
||
82 |
check := CheckToggle in:top. |
|
83 |
check origin:10@10. |
|
84 |
||
85 |
top open |
|
86 |
||
87 |
give it an action: |
|
88 |
||
89 |
|top check| |
|
90 |
||
91 |
top := StandardSystemView new. |
|
92 |
top extent:100@100. |
|
93 |
||
94 |
check := CheckToggle in:top. |
|
95 |
check origin:10@10. |
|
96 |
check action:[:value | Transcript showCr:'changed to: ' , value printString]. |
|
97 |
||
98 |
top open |
|
99 |
||
100 |
give it a model: |
|
101 |
||
102 |
|top check model| |
|
103 |
||
104 |
model := false asValue. |
|
105 |
||
106 |
top := StandardSystemView new. |
|
107 |
top extent:100@100. |
|
108 |
||
109 |
check := CheckToggle in:top. |
|
110 |
check origin:10@10. |
|
111 |
check model:model. |
|
112 |
||
113 |
top openModal. |
|
114 |
||
115 |
Transcript showCr:'value after closing box: ' , model value printString |
|
116 |
||
117 |
multiple checks on a single model (with different change selectors): |
|
118 |
(using a checkBox here, for the demonstration ...) |
|
147 | 119 |
(this is a typical many-in-many setup) |
118 | 120 |
|
121 |
|top model panel ext1 ext2 |
|
122 |
readFlag writeFlag executeFlag| |
|
123 |
||
124 |
readFlag := writeFlag := true. |
|
125 |
executeFlag := false. |
|
126 |
||
127 |
model := Plug new. |
|
128 |
model respondTo:#read with:[readFlag]. |
|
129 |
model respondTo:#write with:[writeFlag]. |
|
130 |
model respondTo:#execute with:[executeFlag]. |
|
131 |
model respondTo:#read: with:[:val | readFlag := val]. |
|
132 |
model respondTo:#write: with:[:val | writeFlag := val]. |
|
133 |
model respondTo:#execute: with:[:val | executeFlag := val]. |
|
134 |
||
135 |
top := StandardSystemView new. |
|
136 |
top extent:200@200. |
|
137 |
top label:'File permissions:'. |
|
138 |
||
139 |
panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top. |
|
140 |
||
141 |
#(read write execute) do:[:sym | |
|
142 |
|check| |
|
143 |
||
144 |
check := CheckBox in:panel. |
|
145 |
check label:sym. |
|
147 | 146 |
check model:model; aspect:sym; changeMessage:(sym , ':') asSymbol. |
118 | 147 |
]. |
148 |
||
149 |
top openModal. |
|
150 |
||
151 |
Transcript showCr:'settings after closing box:'. |
|
152 |
Transcript showCr:' read -> ' , readFlag printString. |
|
153 |
Transcript showCr:' write -> ' , writeFlag printString. |
|
154 |
Transcript showCr:' execute -> ' , executeFlag printString. |
|
130 | 155 |
|
156 |
||
157 |
checkToggles in a group |
|
147 | 158 |
(this is a typical one-in-many setup) |
130 | 159 |
|
160 |
|top panel check1 check2 check3 grp| |
|
161 |
||
162 |
top := StandardSystemView new. |
|
163 |
top extent:200@300. |
|
164 |
||
165 |
panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top. |
|
166 |
||
167 |
check1 := CheckToggle in:panel. |
|
168 |
check2 := CheckToggle in:panel. |
|
169 |
check3 := CheckToggle in:panel. |
|
170 |
||
171 |
grp := RadioButtonGroup new. |
|
172 |
grp add:check1. |
|
173 |
grp add:check2. |
|
174 |
grp add:check3. |
|
175 |
||
176 |
top open |
|
146 | 177 |
|
178 |
||
179 |
Channel operation |
|
180 |
----------------- |
|
181 |
||
182 |
enabling other toggles via a toggle |
|
183 |
||
184 |
|top panel t enableChannel| |
|
185 |
||
186 |
top := StandardSystemView new. |
|
187 |
top extent:(400 @ 200). |
|
188 |
||
189 |
panel := HorizontalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top. |
|
190 |
||
191 |
enableChannel := false asValue. |
|
192 |
||
193 |
1 to:10 do:[:i | |
|
194 |
t := CheckToggle in:panel. |
|
195 |
t enableChannel:enableChannel. |
|
196 |
]. |
|
197 |
||
198 |
t := Toggle in:panel. |
|
147 | 199 |
t activeLogo:'enabled'; passiveLogo:'disabled'. |
146 | 200 |
t controller pressChannel:enableChannel. |
201 |
||
202 |
top open |
|
38 | 203 |
" |
204 |
! ! |
|
0 | 205 |
|
206 |
!CheckToggle class methodsFor:'defaults'! |
|
207 |
||
205 | 208 |
checkFormOn:aDevice |
209 |
"return the form used when checkToggle is turned on. |
|
210 |
Provided as public entry, to allow other views |
|
211 |
to share the same check-image." |
|
212 |
||
213 |
^ DefaultCheckForm on:aDevice. |
|
214 |
! |
|
215 |
||
128 | 216 |
updateStyleCache |
440
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
375
diff
changeset
|
217 |
"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
|
218 |
|
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
375
diff
changeset
|
219 |
<resource: #style (#checkToggleCheckColor |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
375
diff
changeset
|
220 |
#checkToggleBackgroundColor #checkToggleForegroundColor |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
375
diff
changeset
|
221 |
#checkToggleActiveBackgroundColor #checkTogglenActiveForegroundColor |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
375
diff
changeset
|
222 |
#checkToggleActiveLevel #checkTogglePassiveLevel |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
375
diff
changeset
|
223 |
#checkToggleBorderWidth |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
375
diff
changeset
|
224 |
#checkToggleBitmapFile |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
375
diff
changeset
|
225 |
#checkToggleStyle)> |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
375
diff
changeset
|
226 |
|
375
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
227 |
|checkFileName bits checkStyle| |
0 | 228 |
|
130 | 229 |
DefaultCheckColor := StyleSheet colorAt:'checkToggleCheckColor'. |
139 | 230 |
DefaultFGColor := StyleSheet colorAt:'checkToggleForegroundColor'. |
130 | 231 |
DefaultBGColor := StyleSheet colorAt:'checkToggleBackgroundColor'. |
139 | 232 |
DefaultActiveFGColor := StyleSheet colorAt:'checkToggleActiveForegroundColor'. |
130 | 233 |
DefaultActiveBGColor := StyleSheet colorAt:'checkToggleActiveBackgroundColor'. |
234 |
DefaultActiveLevel := StyleSheet at:'checkToggleActiveLevel'. |
|
235 |
DefaultPassiveLevel := StyleSheet at:'checkTogglePassiveLevel'. |
|
236 |
DefaultBorderWidth := StyleSheet at:'checkToggleBorderWidth'. |
|
237 |
||
136 | 238 |
DefaultCheckForm := nil. |
128 | 239 |
checkFileName := StyleSheet at:'checkToggleBitmapFile' default:'CheckOn.xbm'. |
240 |
checkFileName notNil ifTrue:[ |
|
375
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
241 |
DefaultCheckForm := Form fromFile:checkFileName |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
242 |
resolution:100 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
243 |
on:Display. |
130 | 244 |
]. |
245 |
DefaultCheckForm isNil ifTrue:[ |
|
375
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
246 |
checkStyle := StyleSheet at:'checkToggleStyle' default:#check. |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
247 |
checkStyle == #cross ifTrue:[ |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
248 |
bits := #[2r10000000 2r00000001 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
249 |
2r01000000 2r00000010 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
250 |
2r00100000 2r00000100 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
251 |
2r00010000 2r00001000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
252 |
2r00001000 2r00010000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
253 |
2r00000100 2r00100000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
254 |
2r00000010 2r01000000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
255 |
2r00000001 2r10000000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
256 |
2r00000001 2r10000000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
257 |
2r00000010 2r01000000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
258 |
2r00000100 2r00100000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
259 |
2r00001000 2r00010000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
260 |
2r00010000 2r00001000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
261 |
2r00100000 2r00000100 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
262 |
2r01000000 2r00000010 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
263 |
2r10000000 2r00000001] |
128 | 264 |
|
375
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
265 |
] ifFalse:[ |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
266 |
checkStyle == #fatcross ifTrue:[ |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
267 |
bits := #[2r11000000 2r00000011 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
268 |
2r11100000 2r00000111 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
269 |
2r01110000 2r00001110 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
270 |
2r00111000 2r00011100 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
271 |
2r00011100 2r00111000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
272 |
2r00001110 2r01110000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
273 |
2r00000111 2r11100000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
274 |
2r00000011 2r11000000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
275 |
2r00000011 2r11000000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
276 |
2r00000111 2r11100000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
277 |
2r00001110 2r01110000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
278 |
2r00011100 2r00111000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
279 |
2r00111000 2r00011100 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
280 |
2r01110000 2r00001110 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
281 |
2r11100000 2r00000111 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
282 |
2r11000000 2r00000011] |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
283 |
] ifFalse:[ |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
284 |
bits := #[2r00000000 2r00000000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
285 |
2r00000000 2r00000010 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
286 |
2r00000000 2r00000010 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
287 |
2r00000000 2r00000100 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
288 |
2r00000000 2r00000100 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
289 |
2r00000000 2r00001000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
290 |
2r00000000 2r00001000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
291 |
2r00000000 2r00010000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
292 |
2r01000000 2r00110000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
293 |
2r00100000 2r01100000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
294 |
2r00011000 2r01100000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
295 |
2r00001110 2r11000000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
296 |
2r00000111 2r11000000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
297 |
2r00000011 2r10000000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
298 |
2r00000001 2r10000000 |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
299 |
2r00000000 2r00000000] |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
300 |
] |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
301 |
]. |
6656f7e8ae20
added just another checkType: #fatcross
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
302 |
DefaultCheckForm := Form width:16 height:16 fromArray:bits on:Display |
128 | 303 |
] |
440
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
375
diff
changeset
|
304 |
|
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
375
diff
changeset
|
305 |
"Modified: 1.3.1996 / 13:45:45 / cg" |
0 | 306 |
! ! |
307 |
||
308 |
!CheckToggle methodsFor:'initialization'! |
|
309 |
||
18 | 310 |
initStyle |
311 |
super initStyle. |
|
312 |
||
128 | 313 |
onLevel := offLevel. |
130 | 314 |
DefaultActiveLevel notNil ifTrue:[onLevel := DefaultActiveLevel]. |
136 | 315 |
DefaultPassiveLevel notNil ifTrue:[offLevel := DefaultPassiveLevel]. |
130 | 316 |
|
128 | 317 |
activeLogo := DefaultCheckForm on:device. |
318 |
passiveLogo := nil. |
|
319 |
||
139 | 320 |
DefaultActiveFGColor notNil ifTrue:[self activeForegroundColor:DefaultActiveFGColor]. |
130 | 321 |
DefaultCheckColor notNil ifTrue:[self activeForegroundColor:DefaultCheckColor]. |
322 |
DefaultActiveBGColor notNil ifTrue:[self activeBackgroundColor:DefaultActiveBGColor]. |
|
139 | 323 |
DefaultFGColor notNil ifTrue:[self foregroundColor:DefaultFGColor]. |
130 | 324 |
DefaultBGColor notNil ifTrue:[self backgroundColor:DefaultBGColor]. |
325 |
||
128 | 326 |
showLamp := false. |
130 | 327 |
|
328 |
DefaultBorderWidth notNil ifTrue:[self borderWidth:DefaultBorderWidth]. |
|
329 |
||
330 |
offLevel ~~ level ifTrue:[self level:offLevel]. |
|
205 | 331 |
! |
332 |
||
333 |
initialize |
|
334 |
super initialize. |
|
335 |
passiveLogo := nil. |
|
336 |
self form:activeLogo "/ to let me compute some defaultExtent |
|
0 | 337 |
! ! |
338 |
||
339 |
!CheckToggle methodsFor:'redrawing'! |
|
340 |
||
133 | 341 |
drawWith:fg and:bg |
265 | 342 |
controller pressed ifTrue:[ |
59 | 343 |
logo := activeLogo. |
0 | 344 |
] ifFalse:[ |
164 | 345 |
logo := passiveLogo. |
133 | 346 |
]. |
347 |
super drawWith:fg and:bg |
|
164 | 348 |
|
349 |
"Modified: 22.9.1995 / 15:45:02 / claus" |
|
0 | 350 |
! ! |
205 | 351 |
|
352 |
!CheckToggle class methodsFor:'documentation'! |
|
353 |
||
354 |
version |
|
440
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
375
diff
changeset
|
355 |
^ '$Header: /cvs/stx/stx/libwidg/CheckToggle.st,v 1.23 1996-03-01 12:58:15 cg Exp $' |
205 | 356 |
! ! |