author | Claus Gittinger <cg@exept.de> |
Fri, 29 May 1998 15:38:18 +0200 | |
changeset 903 | 77a51b230754 |
parent 851 | f7e436fe29ee |
child 1138 | 14dc9f6791d2 |
permissions | -rw-r--r-- |
44 | 1 |
" |
2 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
49 | 3 |
All Rights Reserved |
44 | 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 |
||
14 |
HorizontalPanelView subclass:#CheckBox |
|
112
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
15 |
instanceVariableNames:'toggleView labelView labelForegroundColor |
817 | 16 |
disabledLabelForegroundColor foregroundChannel backgroundChannel' |
320
bf5e928d027a
option to place the toggle at the right.
Claus Gittinger <cg@exept.de>
parents:
318
diff
changeset
|
17 |
classVariableNames:'DefaultLabelForegroundColor DefaultDisabledLabelForegroundColor |
bf5e928d027a
option to place the toggle at the right.
Claus Gittinger <cg@exept.de>
parents:
318
diff
changeset
|
18 |
CheckToggleLeft' |
112
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
19 |
poolDictionaries:'' |
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
20 |
category:'Views-Interactors' |
44 | 21 |
! |
22 |
||
273
01541272ce8d
resource spec updated; cache device form
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
23 |
!CheckBox class methodsFor:'documentation'! |
44 | 24 |
|
100 | 25 |
copyright |
26 |
" |
|
27 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
28 |
All Rights Reserved |
|
29 |
||
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 |
||
44 | 38 |
! |
39 |
||
40 |
documentation |
|
41 |
" |
|
313 | 42 |
CheckBoxes consist of a checkToggle and a label; |
43 |
if used without a model, its action block is evaluated |
|
44 |
when toggled (see Toggle for more information). |
|
45 |
Otherwise, a valueHolder on a boolean is the preferred model |
|
46 |
(other models are possible - this may required different aspect |
|
47 |
and/or changeMessage settings; make certain to set those before |
|
48 |
a model is assigned, since the toggle fetches the value when |
|
49 |
a new model is assigned.) |
|
155 | 50 |
|
51 |
[author:] |
|
313 | 52 |
Claus Gittinger |
155 | 53 |
|
54 |
[see also:] |
|
313 | 55 |
Button CheckToggle |
56 |
DialogBox |
|
57 |
ValueHolder |
|
44 | 58 |
" |
59 |
! |
|
60 |
||
61 |
examples |
|
62 |
" |
|
188 | 63 |
no-op checkBox without a label: |
313 | 64 |
[exBegin] |
188 | 65 |
|b| |
66 |
||
67 |
b := CheckBox new. |
|
68 |
b open |
|
313 | 69 |
[exEnd] |
188 | 70 |
|
71 |
||
44 | 72 |
no-op checkBox: |
313 | 73 |
[exBegin] |
44 | 74 |
|b| |
75 |
||
76 |
b := CheckBox new. |
|
77 |
b label:'foo'. |
|
78 |
b open |
|
313 | 79 |
[exEnd] |
80 |
||
81 |
||
82 |
combined instance creation & label setup: |
|
83 |
[exBegin] |
|
84 |
|b| |
|
85 |
||
86 |
b := CheckBox label:'foo'. |
|
87 |
b open |
|
88 |
[exEnd] |
|
44 | 89 |
|
90 |
||
56 | 91 |
no-op checkBox, disabled: |
313 | 92 |
[exBegin] |
56 | 93 |
|b| |
94 |
||
313 | 95 |
b := CheckBox label:'foo'. |
56 | 96 |
b disable. |
97 |
b open |
|
313 | 98 |
[exEnd] |
56 | 99 |
|
100 |
||
101 |
changing colors |
|
102 |
(a demo only: it is no good style to fight the styleSheet): |
|
313 | 103 |
[exBegin] |
44 | 104 |
|panel b| |
105 |
||
106 |
panel := VerticalPanelView new. |
|
107 |
||
313 | 108 |
b := CheckBox label:'foo' in:panel. |
44 | 109 |
|
313 | 110 |
b := CheckBox label:'bar' in:panel. |
44 | 111 |
b labelView foregroundColor:Color red. |
112 |
||
313 | 113 |
b := CheckBox label:'baz' in:panel. |
44 | 114 |
b toggleView activeForegroundColor:Color blue. |
115 |
||
116 |
panel open |
|
313 | 117 |
[exEnd] |
44 | 118 |
|
119 |
||
120 |
using action-blocks: |
|
313 | 121 |
[exBegin] |
49 | 122 |
|b| |
44 | 123 |
|
313 | 124 |
b := CheckBox label:'check'. |
184 | 125 |
b action:[:value | Transcript show:'set to: '; showCR:value]. |
44 | 126 |
b open. |
313 | 127 |
[exEnd] |
44 | 128 |
|
129 |
||
49 | 130 |
with a model (default ST-80 behavior, sending #value: to the model): |
131 |
(see changing value in the inspector) |
|
313 | 132 |
[exBegin] |
133 |
|b model| |
|
134 |
||
135 |
model := ValueHolder newBoolean. |
|
136 |
||
137 |
b := CheckBox label:'check'. |
|
138 |
b model:model. |
|
139 |
b open. |
|
140 |
model inspect. |
|
141 |
[exEnd] |
|
142 |
||
143 |
||
144 |
combined instance creation & model setup: |
|
145 |
[exBegin] |
|
49 | 146 |
|b model| |
147 |
||
148 |
model := ValueHolder newBoolean. |
|
149 |
||
313 | 150 |
b := CheckBox label:'check' model:model . |
49 | 151 |
b open. |
152 |
model inspect. |
|
313 | 153 |
[exEnd] |
49 | 154 |
|
56 | 155 |
|
313 | 156 |
with a model and different aspect & changeSelector |
157 |
setting the aspect to nil suppresses fetching the value from the model. |
|
49 | 158 |
(using a plug here, for demonstration only): |
313 | 159 |
[exBegin] |
44 | 160 |
|b model| |
161 |
||
162 |
model := Plug new. |
|
184 | 163 |
model respondTo:#changeCheck: with:[:arg | Transcript showCR:'change to ' , arg printString]. |
313 | 164 |
model respondTo:#value with:[false]. |
44 | 165 |
|
313 | 166 |
b := CheckBox label:'check'. |
167 |
b aspectMessage:nil; model:model; changeMessage:#changeCheck:. |
|
44 | 168 |
b open. |
313 | 169 |
[exEnd] |
44 | 170 |
|
56 | 171 |
|
313 | 172 |
with an enableChannel |
173 |
[exBegin] |
|
115
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
174 |
|b enaToggle enaHolder| |
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
175 |
|
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
176 |
enaHolder := true asValue. |
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
177 |
|
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
178 |
enaToggle := Toggle label:'enable'. |
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
179 |
enaToggle model:enaHolder. |
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
180 |
enaToggle open. |
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
181 |
|
313 | 182 |
b := CheckBox label:'check'. |
184 | 183 |
b action:[:value | Transcript show:'set to: '; showCR:value]. |
115
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
184 |
b enableChannel:enaHolder. |
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
185 |
b open. |
313 | 186 |
[exEnd] |
115
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
187 |
|
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
188 |
|
56 | 189 |
with models, one checkBox disabling the others: |
313 | 190 |
[exBegin] |
56 | 191 |
|dialog translator enableChannel val1 val2 val3 eBox box1 box2 box3| |
192 |
||
193 |
translator := Plug new. |
|
194 |
translator respondTo:#enableDisable |
|
313 | 195 |
with:[ |
196 |
enableChannel value |
|
197 |
ifTrue:[ |
|
198 |
box1 enable. |
|
199 |
box2 enable. |
|
200 |
box3 enable. |
|
201 |
] |
|
202 |
ifFalse:[ |
|
203 |
box1 disable. |
|
204 |
box2 disable. |
|
205 |
box3 disable. |
|
206 |
] |
|
207 |
]. |
|
56 | 208 |
|
209 |
enableChannel := true asValue. |
|
210 |
enableChannel onChangeSend:#enableDisable to:translator. |
|
211 |
val1 := true asValue. |
|
212 |
val2 := false asValue. |
|
213 |
val3 := true asValue. |
|
214 |
||
215 |
dialog := Dialog new. |
|
216 |
dialog addCheckBox:'enable' on:enableChannel. |
|
217 |
dialog addVerticalSpace. |
|
218 |
dialog leftIndent:30. |
|
219 |
box1 := dialog addCheckBox:'value1' on:val1. |
|
220 |
dialog addVerticalSpace. |
|
221 |
box2 := dialog addCheckBox:'value2' on:val2. |
|
222 |
dialog addVerticalSpace. |
|
223 |
box3 := dialog addCheckBox:'value3' on:val3. |
|
224 |
dialog addVerticalSpace. |
|
225 |
dialog addOkButton. |
|
226 |
||
227 |
dialog open. |
|
313 | 228 |
[exEnd] |
56 | 229 |
|
230 |
||
49 | 231 |
multiple checkBoxes on a single model (using different aspects) |
313 | 232 |
[exBegin] |
79 | 233 |
|top panel b model value1 value2| |
49 | 234 |
|
235 |
value1 := true. |
|
236 |
value2 := false. |
|
237 |
model := Plug new. |
|
238 |
model respondTo:#value1 with:[value1]. |
|
239 |
model respondTo:#value1: with:[:val | value1 := val]. |
|
240 |
model respondTo:#value2 with:[value2]. |
|
241 |
model respondTo:#value2: with:[:val | value2 := val]. |
|
242 |
||
243 |
top := DialogBox new. |
|
244 |
top extent:200@300. |
|
245 |
||
246 |
panel := VerticalPanelView new. |
|
247 |
||
248 |
b := CheckBox in:panel. |
|
249 |
b label:'check1'. |
|
313 | 250 |
b aspect:#value1; model:model; changeMessage:#value1:. |
49 | 251 |
|
252 |
b := CheckBox in:panel. |
|
253 |
b label:'check2'. |
|
313 | 254 |
b aspect:#value2; model:model; changeMessage:#value2:. |
49 | 255 |
|
256 |
top addComponent:panel. |
|
257 |
top addAbortButton; addOkButton. |
|
258 |
top openModal. |
|
259 |
||
79 | 260 |
top accepted ifTrue:[ |
313 | 261 |
Transcript show:'value1: '; showCR:model value1. |
262 |
Transcript show:'value2: '; showCR:model value2. |
|
49 | 263 |
] |
313 | 264 |
[exEnd] |
44 | 265 |
" |
266 |
! ! |
|
267 |
||
273
01541272ce8d
resource spec updated; cache device form
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
268 |
!CheckBox class methodsFor:'instance creation'! |
62 | 269 |
|
76 | 270 |
label:aStringOrImage model:aModel |
271 |
"create & return a new checkBox, on aModel (typically a ValueHolder), |
|
272 |
with aStringOrImage as label." |
|
273 |
||
313 | 274 |
^ (self model:aModel) label:aStringOrImage |
76 | 275 |
|
276 |
"Created: 17.9.1995 / 14:20:58 / claus" |
|
313 | 277 |
"Modified: 28.2.1997 / 19:23:59 / cg" |
56 | 278 |
! ! |
279 |
||
273
01541272ce8d
resource spec updated; cache device form
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
280 |
!CheckBox class methodsFor:'defaults'! |
112
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
281 |
|
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
282 |
updateStyleCache |
134
049f033265f9
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
119
diff
changeset
|
283 |
"extract values from the styleSheet and cache them in class variables" |
049f033265f9
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
119
diff
changeset
|
284 |
|
566 | 285 |
<resource: #style (#'checkBox.labelForegroundColor' |
286 |
#'checkBox.disabledLabelForegroundColor' |
|
287 |
#'checkBox.toggleLeft')> |
|
134
049f033265f9
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
119
diff
changeset
|
288 |
|
830 | 289 |
DefaultFont := StyleSheet fontAt:'label.font'. |
290 |
DefaultLabelForegroundColor := StyleSheet colorAt:'checkBox.labelForegroundColor'. |
|
566 | 291 |
DefaultDisabledLabelForegroundColor := StyleSheet colorAt:'checkBox.disabledLabelForegroundColor'. |
830 | 292 |
CheckToggleLeft := StyleSheet at:'checkBox.toggleLeft' default:true |
112
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
293 |
|
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
294 |
" |
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
295 |
self updateStyleCache |
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
296 |
" |
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
297 |
|
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
298 |
"Created: 14.12.1995 / 14:47:22 / cg" |
566 | 299 |
"Modified: 20.10.1997 / 13:51:30 / cg" |
112
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
300 |
! ! |
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
301 |
|
100 | 302 |
!CheckBox methodsFor:'accessing-behavior'! |
303 |
||
304 |
action:aBlock |
|
155 | 305 |
"set the actionBlock; forwarded to the toggle" |
100 | 306 |
|
307 |
toggleView action:aBlock |
|
155 | 308 |
|
309 |
"Modified: 25.4.1996 / 16:31:19 / cg" |
|
100 | 310 |
! |
311 |
||
312 |
disable |
|
155 | 313 |
"disable the checkBox; forwarded to toggle & change labels color" |
100 | 314 |
|
112
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
315 |
|clr| |
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
316 |
|
100 | 317 |
toggleView disable. |
817 | 318 |
|
112
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
319 |
clr := disabledLabelForegroundColor. |
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
320 |
clr isNil ifTrue:[ clr := toggleView disabledForegroundColor ]. |
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
321 |
labelView foregroundColor:clr. |
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
322 |
|
155 | 323 |
"Modified: 25.4.1996 / 16:31:31 / cg" |
100 | 324 |
! |
325 |
||
326 |
enable |
|
155 | 327 |
"enable the checkBox; forwarded to toggle & change labels color" |
100 | 328 |
|
112
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
329 |
|clr| |
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
330 |
|
100 | 331 |
toggleView enable. |
817 | 332 |
|
112
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
333 |
clr := labelForegroundColor. |
817 | 334 |
clr isNil ifTrue:[ clr := labelView foregroundColor ]. |
335 |
labelView foregroundColor:clr. |
|
112
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
336 |
|
155 | 337 |
"Modified: 25.4.1996 / 16:31:40 / cg" |
100 | 338 |
! |
78 | 339 |
|
299 | 340 |
enabled |
341 |
"return true, if the checkBox is enabled. |
|
342 |
forwarded to toggle" |
|
343 |
||
344 |
^ toggleView enabled. |
|
345 |
! |
|
346 |
||
100 | 347 |
pressAction:aBlock |
155 | 348 |
"set the pressAction; forwarded to the toggle" |
349 |
||
100 | 350 |
toggleView pressAction:aBlock. |
351 |
||
352 |
"Created: 22.9.1995 / 15:54:04 / claus" |
|
155 | 353 |
"Modified: 25.4.1996 / 16:31:52 / cg" |
100 | 354 |
! |
355 |
||
356 |
releaseAction:aBlock |
|
155 | 357 |
"set the releaseAction; forwarded to the toggle" |
358 |
||
100 | 359 |
toggleView releaseAction:aBlock. |
360 |
||
361 |
"Created: 22.9.1995 / 15:54:11 / claus" |
|
155 | 362 |
"Modified: 25.4.1996 / 16:32:00 / cg" |
78 | 363 |
! ! |
364 |
||
115
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
365 |
!CheckBox methodsFor:'accessing-channels'! |
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
366 |
|
817 | 367 |
backgroundChannel |
368 |
||
369 |
^labelView backgroundChannel |
|
370 |
! |
|
371 |
||
372 |
backgroundChannel:aChannel |
|
373 |
||
374 |
labelView backgroundChannel: (backgroundChannel := aChannel). |
|
375 |
aChannel onChangeSend:#value to: [self enableStateChanged] |
|
376 |
! |
|
377 |
||
164 | 378 |
enableChannel |
379 |
"return a valueHolder for enable/disable" |
|
380 |
||
381 |
^ toggleView enableChannel |
|
382 |
||
383 |
"Created: 30.4.1996 / 15:11:13 / cg" |
|
384 |
! |
|
385 |
||
115
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
386 |
enableChannel:aChannel |
155 | 387 |
"set the enableChannel" |
388 |
||
119
913df6ba1ccc
immediately change fg color when enableChannel is set
Claus Gittinger <cg@exept.de>
parents:
115
diff
changeset
|
389 |
|wasEnabled| |
913df6ba1ccc
immediately change fg color when enableChannel is set
Claus Gittinger <cg@exept.de>
parents:
115
diff
changeset
|
390 |
|
913df6ba1ccc
immediately change fg color when enableChannel is set
Claus Gittinger <cg@exept.de>
parents:
115
diff
changeset
|
391 |
wasEnabled := toggleView enabled. |
115
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
392 |
toggleView enableChannel:aChannel. |
817 | 393 |
aChannel onChangeSend:#value to: [self enableStateChanged]. |
394 |
||
119
913df6ba1ccc
immediately change fg color when enableChannel is set
Claus Gittinger <cg@exept.de>
parents:
115
diff
changeset
|
395 |
aChannel value ~~ wasEnabled ifTrue:[ |
817 | 396 |
self enableStateChanged |
119
913df6ba1ccc
immediately change fg color when enableChannel is set
Claus Gittinger <cg@exept.de>
parents:
115
diff
changeset
|
397 |
] |
817 | 398 |
! |
115
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
399 |
|
817 | 400 |
foregroundChannel |
401 |
||
402 |
^labelView foregroundChannel |
|
403 |
! |
|
404 |
||
405 |
foregroundChannel:aChannel |
|
406 |
||
407 |
labelView foregroundChannel: (foregroundChannel := aChannel). |
|
408 |
aChannel onChangeSend:#value to: [self enableStateChanged] |
|
409 |
||
410 |
! |
|
411 |
||
412 |
labelChannel |
|
413 |
||
414 |
^labelView labelChannel |
|
415 |
! |
|
416 |
||
417 |
labelChannel:aChannel |
|
418 |
||
419 |
labelView labelChannel: aChannel |
|
420 |
||
421 |
! ! |
|
422 |
||
423 |
!CheckBox methodsFor:'accessing-colors'! |
|
424 |
||
851 | 425 |
backgroundColor |
426 |
"get backgroundColor of the label view" |
|
427 |
||
428 |
^labelView backgroundColor |
|
429 |
! |
|
430 |
||
817 | 431 |
backgroundColor: backgroundColor |
851 | 432 |
"set backgroundColor only for the label view" |
817 | 433 |
|
903
77a51b230754
viewBackground setting must change mine too
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
434 |
labelView backgroundColor: backgroundColor. |
817 | 435 |
! |
436 |
||
851 | 437 |
foregroundColor |
438 |
"get foregroundColor of the label view" |
|
439 |
||
440 |
^labelView foregroundColor |
|
441 |
! |
|
442 |
||
817 | 443 |
foregroundColor: foregroundColor |
851 | 444 |
"set foregroundColor only for the label view" |
817 | 445 |
|
446 |
labelView foregroundColor: (labelForegroundColor := foregroundColor). |
|
447 |
foregroundChannel notNil ifTrue: [foregroundChannel value: foregroundColor] |
|
903
77a51b230754
viewBackground setting must change mine too
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
448 |
! |
77a51b230754
viewBackground setting must change mine too
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
449 |
|
77a51b230754
viewBackground setting must change mine too
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
450 |
viewBackground: backgroundColor |
77a51b230754
viewBackground setting must change mine too
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
451 |
"set backgroundColor" |
77a51b230754
viewBackground setting must change mine too
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
452 |
|
77a51b230754
viewBackground setting must change mine too
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
453 |
labelView backgroundColor: backgroundColor. |
77a51b230754
viewBackground setting must change mine too
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
454 |
super viewBackground: backgroundColor |
817 | 455 |
! ! |
456 |
||
457 |
!CheckBox methodsFor:'accessing-components'! |
|
458 |
||
459 |
labelView |
|
460 |
"return the labelView; allows manipulation of the |
|
461 |
labels attributes (colors etc.)" |
|
462 |
||
463 |
^ labelView |
|
464 |
! |
|
465 |
||
466 |
toggleView |
|
467 |
"return the toggleView; allows manipulation of the |
|
468 |
toggles attributes (colors etc.)" |
|
469 |
||
470 |
^ toggleView |
|
115
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
471 |
! ! |
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
472 |
|
56 | 473 |
!CheckBox methodsFor:'accessing-look'! |
44 | 474 |
|
100 | 475 |
activeLogo:anImageOrString |
155 | 476 |
"set the activeLogo; forwarded to the toggle" |
477 |
||
100 | 478 |
toggleView activeLogo:anImageOrString |
56 | 479 |
|
100 | 480 |
"Created: 22.9.1995 / 15:44:08 / claus" |
155 | 481 |
"Modified: 25.4.1996 / 16:32:50 / cg" |
100 | 482 |
! |
483 |
||
114 | 484 |
disabledLabelForegroundColor |
185 | 485 |
"set the disabledLabelForegroundColor; forwarded to the toggle" |
486 |
||
114 | 487 |
disabledLabelForegroundColor isNil ifTrue:[ ^ toggleView disabledForegroundColor ]. |
488 |
^ disabledLabelForegroundColor |
|
489 |
||
490 |
"Created: 16.12.1995 / 19:47:45 / cg" |
|
185 | 491 |
"Modified: 22.5.1996 / 13:16:55 / cg" |
114 | 492 |
! |
493 |
||
100 | 494 |
font |
185 | 495 |
"return the font. Forward from label" |
100 | 496 |
|
497 |
^ labelView font |
|
185 | 498 |
|
499 |
"Modified: 22.5.1996 / 13:17:07 / cg" |
|
49 | 500 |
! |
44 | 501 |
|
56 | 502 |
font:aFont |
185 | 503 |
"set the font. Forward to the label & resize myself. |
504 |
CAVEAT: with the addition of Text objects, |
|
268 | 505 |
this method is going to be obsoleted by a textStyle |
506 |
method, which allows specific control over |
|
507 |
normalFont/boldFont/italicFont parameters." |
|
55 | 508 |
|
56 | 509 |
labelView font:aFont. |
510 |
labelView forceResize. |
|
79 | 511 |
self layoutChanged. |
512 |
self resize. |
|
185 | 513 |
|
514 |
"Modified: 22.5.1996 / 13:17:28 / cg" |
|
49 | 515 |
! |
516 |
||
56 | 517 |
label |
155 | 518 |
"return the labels logo" |
56 | 519 |
|
520 |
^ labelView label |
|
155 | 521 |
|
522 |
"Modified: 25.4.1996 / 16:33:08 / cg" |
|
79 | 523 |
! |
524 |
||
100 | 525 |
label:aString |
155 | 526 |
"set the logo; forward to label & resize" |
79 | 527 |
|
100 | 528 |
labelView label:aString. |
529 |
labelView forceResize. |
|
530 |
self layoutChanged. |
|
531 |
self resize. |
|
155 | 532 |
|
533 |
"Modified: 25.4.1996 / 16:33:14 / cg" |
|
79 | 534 |
! |
535 |
||
114 | 536 |
labelForegroundColor |
155 | 537 |
"return the labels foregroundColor" |
538 |
||
817 | 539 |
labelForegroundColor isNil ifTrue:[ ^ labelView foregroundColor ]. |
114 | 540 |
^ labelForegroundColor |
541 |
||
542 |
"Created: 16.12.1995 / 19:47:20 / cg" |
|
155 | 543 |
"Modified: 25.4.1996 / 16:33:26 / cg" |
114 | 544 |
! |
545 |
||
79 | 546 |
passiveLogo:anImageOrString |
155 | 547 |
"set the passiveLogo; forwarded to the toggle" |
548 |
||
79 | 549 |
toggleView passiveLogo:anImageOrString |
550 |
||
551 |
"Created: 22.9.1995 / 15:44:14 / claus" |
|
155 | 552 |
"Modified: 25.4.1996 / 16:33:41 / cg" |
56 | 553 |
! ! |
554 |
||
100 | 555 |
!CheckBox methodsFor:'accessing-mvc'! |
63 | 556 |
|
100 | 557 |
aspectMessage:aspectSymbol |
155 | 558 |
"set the aspectMessage; forward to label & toggle" |
100 | 559 |
|
313 | 560 |
labelView aspectMessage:aspectSymbol. "/ in case the label updates its logo from the model |
100 | 561 |
toggleView aspectMessage:aspectSymbol |
155 | 562 |
|
313 | 563 |
"Modified: 28.2.1997 / 19:50:53 / cg" |
100 | 564 |
! |
63 | 565 |
|
100 | 566 |
changeMessage:aChangeSelector |
155 | 567 |
"set the changeMessage; forward to toggle" |
100 | 568 |
|
569 |
toggleView changeMessage:aChangeSelector |
|
155 | 570 |
|
571 |
"Modified: 25.4.1996 / 16:33:55 / cg" |
|
100 | 572 |
! |
573 |
||
574 |
model:aModel |
|
155 | 575 |
"set the model; forward to label & toggle" |
100 | 576 |
|
577 |
labelView model:aModel. |
|
578 |
toggleView model:aModel |
|
155 | 579 |
|
580 |
"Modified: 25.4.1996 / 16:34:00 / cg" |
|
63 | 581 |
! ! |
582 |
||
100 | 583 |
!CheckBox methodsFor:'accessing-state'! |
55 | 584 |
|
100 | 585 |
isOn |
155 | 586 |
"return true, if the check is on; false otherwise" |
587 |
||
100 | 588 |
^ toggleView isOn |
155 | 589 |
|
590 |
"Modified: 25.4.1996 / 16:34:15 / cg" |
|
159 | 591 |
! |
592 |
||
593 |
turnOff |
|
594 |
"turn the check off; forwarded to the toggle" |
|
595 |
||
596 |
toggleView turnOff |
|
597 |
||
598 |
"Modified: 25.4.1996 / 16:32:14 / cg" |
|
599 |
! |
|
600 |
||
601 |
turnOn |
|
602 |
"turn the check on; forwarded to the toggle" |
|
603 |
||
604 |
toggleView turnOn |
|
605 |
||
606 |
"Modified: 25.4.1996 / 16:32:21 / cg" |
|
44 | 607 |
! ! |
608 |
||
115
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
609 |
!CheckBox methodsFor:'change & update'! |
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
610 |
|
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
611 |
enableStateChanged |
318 | 612 |
"handle changes on the enableChannel, change labels color." |
155 | 613 |
|
119
913df6ba1ccc
immediately change fg color when enableChannel is set
Claus Gittinger <cg@exept.de>
parents:
115
diff
changeset
|
614 |
|clr| |
913df6ba1ccc
immediately change fg color when enableChannel is set
Claus Gittinger <cg@exept.de>
parents:
115
diff
changeset
|
615 |
|
820 | 616 |
self enabled |
817 | 617 |
ifTrue: |
820 | 618 |
[ |
619 |
(foregroundChannel notNil and: [foregroundChannel value notNil]) |
|
620 |
ifTrue: [labelView foregroundChannel: foregroundChannel] |
|
621 |
ifFalse: [labelView foregroundColor: labelForegroundColor ? Color black]. |
|
817 | 622 |
labelForegroundColor := labelView foregroundColor |
623 |
] |
|
624 |
ifFalse: |
|
625 |
[ |
|
626 |
labelView foregroundChannel: nil |
|
627 |
]. |
|
628 |
||
115
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
629 |
toggleView enabled ifTrue:[ |
817 | 630 |
clr := self labelForegroundColor. |
115
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
631 |
] ifFalse:[ |
318 | 632 |
clr := self disabledLabelForegroundColor |
817 | 633 |
]. |
634 |
labelView foregroundColor:clr. |
|
115
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
635 |
|
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
636 |
! ! |
0147e9d06caa
added support for enableChannel
Claus Gittinger <cg@exept.de>
parents:
114
diff
changeset
|
637 |
|
209
448124e85ccd
keyboard delegation made explicit, for space only
Claus Gittinger <cg@exept.de>
parents:
192
diff
changeset
|
638 |
!CheckBox methodsFor:'event handling'! |
448124e85ccd
keyboard delegation made explicit, for space only
Claus Gittinger <cg@exept.de>
parents:
192
diff
changeset
|
639 |
|
341 | 640 |
invalidate |
484 | 641 |
super invalidate. |
341 | 642 |
toggleView invalidate. |
643 |
labelView invalidate |
|
644 |
||
645 |
"Created: 1.4.1997 / 13:22:09 / cg" |
|
484 | 646 |
"Modified: 6.8.1997 / 18:20:12 / cg" |
341 | 647 |
! |
648 |
||
209
448124e85ccd
keyboard delegation made explicit, for space only
Claus Gittinger <cg@exept.de>
parents:
192
diff
changeset
|
649 |
keyPress:aKey x:x y:y |
448124e85ccd
keyboard delegation made explicit, for space only
Claus Gittinger <cg@exept.de>
parents:
192
diff
changeset
|
650 |
aKey == Character space ifTrue:[ |
268 | 651 |
self hasFocus ifTrue:[ |
652 |
^ toggleView toggle |
|
653 |
] |
|
209
448124e85ccd
keyboard delegation made explicit, for space only
Claus Gittinger <cg@exept.de>
parents:
192
diff
changeset
|
654 |
]. |
448124e85ccd
keyboard delegation made explicit, for space only
Claus Gittinger <cg@exept.de>
parents:
192
diff
changeset
|
655 |
super keyPress:aKey x:x y:y |
448124e85ccd
keyboard delegation made explicit, for space only
Claus Gittinger <cg@exept.de>
parents:
192
diff
changeset
|
656 |
|
448124e85ccd
keyboard delegation made explicit, for space only
Claus Gittinger <cg@exept.de>
parents:
192
diff
changeset
|
657 |
"Created: 10.7.1996 / 11:24:16 / cg" |
448124e85ccd
keyboard delegation made explicit, for space only
Claus Gittinger <cg@exept.de>
parents:
192
diff
changeset
|
658 |
"Modified: 10.7.1996 / 11:54:52 / cg" |
448124e85ccd
keyboard delegation made explicit, for space only
Claus Gittinger <cg@exept.de>
parents:
192
diff
changeset
|
659 |
! ! |
448124e85ccd
keyboard delegation made explicit, for space only
Claus Gittinger <cg@exept.de>
parents:
192
diff
changeset
|
660 |
|
44 | 661 |
!CheckBox methodsFor:'initialization'! |
662 |
||
218
9b155a06f6e6
handle input to my label (allow clicking on it)
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
663 |
defaultControllerClass |
9b155a06f6e6
handle input to my label (allow clicking on it)
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
664 |
^ ToggleController |
9b155a06f6e6
handle input to my label (allow clicking on it)
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
665 |
|
9b155a06f6e6
handle input to my label (allow clicking on it)
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
666 |
"Created: 18.7.1996 / 11:57:01 / cg" |
9b155a06f6e6
handle input to my label (allow clicking on it)
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
667 |
! |
9b155a06f6e6
handle input to my label (allow clicking on it)
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
668 |
|
757 | 669 |
destroy |
670 |
"release dependencies" |
|
671 |
||
672 |
|channel| |
|
673 |
||
674 |
toggleView notNil ifTrue:[ |
|
675 |
(channel := toggleView enableChannel) notNil ifTrue:[ |
|
676 |
channel retractInterestsFor:self |
|
677 |
] |
|
678 |
]. |
|
679 |
super destroy |
|
680 |
||
681 |
! |
|
682 |
||
112
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
683 |
initStyle |
284 | 684 |
"setup viewStyle specifics" |
685 |
||
112
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
686 |
super initStyle. |
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
687 |
|
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
688 |
DefaultLabelForegroundColor notNil ifTrue:[ |
284 | 689 |
labelForegroundColor := DefaultLabelForegroundColor on:device. |
112
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
690 |
]. |
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
691 |
DefaultDisabledLabelForegroundColor notNil ifTrue:[ |
284 | 692 |
disabledLabelForegroundColor := DefaultDisabledLabelForegroundColor on:device. |
112
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
693 |
]. |
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
694 |
|
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
695 |
"Created: 14.12.1995 / 14:50:03 / cg" |
284 | 696 |
"Modified: 22.1.1997 / 11:57:03 / cg" |
817 | 697 |
|
112
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
698 |
! |
bb2cb6c553d2
allow labels colors to be set from styleSheet
Claus Gittinger <cg@exept.de>
parents:
100
diff
changeset
|
699 |
|
44 | 700 |
initialize |
273
01541272ce8d
resource spec updated; cache device form
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
701 |
<resource: #style (#name)> |
01541272ce8d
resource spec updated; cache device form
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
702 |
|
56 | 703 |
super initialize. |
44 | 704 |
|
56 | 705 |
borderWidth := 0. |
44 | 706 |
|
49 | 707 |
hLayout := #fixLeftSpace. |
44 | 708 |
vLayout := #center. |
709 |
||
320
bf5e928d027a
option to place the toggle at the right.
Claus Gittinger <cg@exept.de>
parents:
318
diff
changeset
|
710 |
CheckToggleLeft ~~ false ifTrue:[ |
bf5e928d027a
option to place the toggle at the right.
Claus Gittinger <cg@exept.de>
parents:
318
diff
changeset
|
711 |
"/ toggle first ... |
bf5e928d027a
option to place the toggle at the right.
Claus Gittinger <cg@exept.de>
parents:
318
diff
changeset
|
712 |
toggleView := CheckToggle in:self. |
bf5e928d027a
option to place the toggle at the right.
Claus Gittinger <cg@exept.de>
parents:
318
diff
changeset
|
713 |
]. |
44 | 714 |
|
715 |
labelView := Label in:self. |
|
282 | 716 |
"/ a kludge |
188 | 717 |
styleSheet name ~~ #motif ifTrue:[ |
273
01541272ce8d
resource spec updated; cache device form
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
718 |
labelView label:'check'; borderWidth:0. |
188 | 719 |
]. |
44 | 720 |
labelView forceResize. |
721 |
labelView adjust:#left. |
|
246 | 722 |
self initialHeight:labelView preferredExtent y + ViewSpacing. |
55 | 723 |
|
320
bf5e928d027a
option to place the toggle at the right.
Claus Gittinger <cg@exept.de>
parents:
318
diff
changeset
|
724 |
CheckToggleLeft == false ifTrue:[ |
bf5e928d027a
option to place the toggle at the right.
Claus Gittinger <cg@exept.de>
parents:
318
diff
changeset
|
725 |
"/ toggle last ... |
bf5e928d027a
option to place the toggle at the right.
Claus Gittinger <cg@exept.de>
parents:
318
diff
changeset
|
726 |
toggleView := CheckToggle in:self. |
bf5e928d027a
option to place the toggle at the right.
Claus Gittinger <cg@exept.de>
parents:
318
diff
changeset
|
727 |
]. |
bf5e928d027a
option to place the toggle at the right.
Claus Gittinger <cg@exept.de>
parents:
318
diff
changeset
|
728 |
|
527 | 729 |
(StyleSheet at:'checkBoxStyle' default:StyleSheet name) == #motif ifTrue:[ |
730 |
toggleView activeLogo:nil. |
|
731 |
toggleView passiveLogo:nil. |
|
732 |
toggleView activeLevel:-2. |
|
733 |
toggleView passiveLevel:2. |
|
734 |
toggleView extent:10@10. |
|
735 |
toggleView sizeFixed:true. |
|
736 |
]. |
|
737 |
||
317
0f8f00dc025a
both components have the same controller
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
738 |
"/ my controller handles both components |
218
9b155a06f6e6
handle input to my label (allow clicking on it)
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
739 |
labelView setController:controller. |
317
0f8f00dc025a
both components have the same controller
Claus Gittinger <cg@exept.de>
parents:
313
diff
changeset
|
740 |
toggleView setController:controller. |
218
9b155a06f6e6
handle input to my label (allow clicking on it)
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
741 |
|
579
ba6e90f651d8
pass down background changes to my components
Claus Gittinger <cg@exept.de>
parents:
566
diff
changeset
|
742 |
"/ the label can be clicked as well |
ba6e90f651d8
pass down background changes to my components
Claus Gittinger <cg@exept.de>
parents:
566
diff
changeset
|
743 |
labelView cursor:Cursor hand. |
ba6e90f651d8
pass down background changes to my components
Claus Gittinger <cg@exept.de>
parents:
566
diff
changeset
|
744 |
self cursor:Cursor hand. |
ba6e90f651d8
pass down background changes to my components
Claus Gittinger <cg@exept.de>
parents:
566
diff
changeset
|
745 |
|
56 | 746 |
" |
747 |
all of my input goes to the toggle |
|
209
448124e85ccd
keyboard delegation made explicit, for space only
Claus Gittinger <cg@exept.de>
parents:
192
diff
changeset
|
748 |
disabled - normally there is already an outer delegate |
56 | 749 |
" |
209
448124e85ccd
keyboard delegation made explicit, for space only
Claus Gittinger <cg@exept.de>
parents:
192
diff
changeset
|
750 |
"/ self delegate:(KeyboardForwarder toView:toggleView). |
44 | 751 |
|
752 |
" |
|
753 |
|b| |
|
754 |
||
755 |
b := CheckBox new. |
|
756 |
b label:'foo'. |
|
757 |
b open |
|
758 |
" |
|
188 | 759 |
|
579
ba6e90f651d8
pass down background changes to my components
Claus Gittinger <cg@exept.de>
parents:
566
diff
changeset
|
760 |
"Modified: / 26.10.1997 / 18:38:15 / cg" |
44 | 761 |
! ! |
100 | 762 |
|
763 |
!CheckBox methodsFor:'private'! |
|
764 |
||
765 |
sendChangeMessageWith:aValue |
|
766 |
"redefined to have mimic changes being sent from the toggle |
|
767 |
instead of myself" |
|
768 |
||
769 |
toggleView sendChangeMessageWith:aValue |
|
770 |
! ! |
|
771 |
||
772 |
!CheckBox methodsFor:'queries'! |
|
773 |
||
774 |
preferredExtent |
|
155 | 775 |
"compute & return the boxes preferredExtent from the components' sizes" |
153 | 776 |
|
100 | 777 |
|prefCheck prefLabel bw2| |
778 |
||
223 | 779 |
"/ If I have an explicit preferredExtent .. |
780 |
||
192
e060e80f8e24
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
188
diff
changeset
|
781 |
preferredExtent notNil ifTrue:[ |
268 | 782 |
^ preferredExtent |
192
e060e80f8e24
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
188
diff
changeset
|
783 |
]. |
e060e80f8e24
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
188
diff
changeset
|
784 |
|
213
9c8f9be0956d
care for a nil LabelView when computing the preferredExtent
Claus Gittinger <cg@exept.de>
parents:
209
diff
changeset
|
785 |
(labelView isNil or:[labelView label isEmpty]) ifTrue:[ |
268 | 786 |
^ super preferredExtent |
188 | 787 |
]. |
153 | 788 |
^ super preferredExtent + (10@0). |
789 |
||
100 | 790 |
"/ prefCheck := toggleView preferredExtent. |
791 |
"/ prefLabel := labelView preferredExtent. |
|
792 |
"/ bw2 := borderWidth * 2. |
|
793 |
"/ ^ (prefCheck x + prefLabel x + (3 * ViewSpacing)) @ ((prefCheck y max:prefLabel y) + bw2 + 2) |
|
153 | 794 |
|
223 | 795 |
"Modified: 19.7.1996 / 20:43:47 / cg" |
100 | 796 |
! ! |
797 |
||
382
ea14fe927a8b
preps for native window support
Claus Gittinger <cg@exept.de>
parents:
341
diff
changeset
|
798 |
!CheckBox methodsFor:'queries - internal'! |
ea14fe927a8b
preps for native window support
Claus Gittinger <cg@exept.de>
parents:
341
diff
changeset
|
799 |
|
ea14fe927a8b
preps for native window support
Claus Gittinger <cg@exept.de>
parents:
341
diff
changeset
|
800 |
nativeWindowType |
ea14fe927a8b
preps for native window support
Claus Gittinger <cg@exept.de>
parents:
341
diff
changeset
|
801 |
"return a symbol describing my native window type |
ea14fe927a8b
preps for native window support
Claus Gittinger <cg@exept.de>
parents:
341
diff
changeset
|
802 |
(may be used internally by the device as a native window creation hint)" |
ea14fe927a8b
preps for native window support
Claus Gittinger <cg@exept.de>
parents:
341
diff
changeset
|
803 |
|
ea14fe927a8b
preps for native window support
Claus Gittinger <cg@exept.de>
parents:
341
diff
changeset
|
804 |
^ #CheckBox |
ea14fe927a8b
preps for native window support
Claus Gittinger <cg@exept.de>
parents:
341
diff
changeset
|
805 |
|
ea14fe927a8b
preps for native window support
Claus Gittinger <cg@exept.de>
parents:
341
diff
changeset
|
806 |
"Created: 2.5.1997 / 14:41:00 / cg" |
ea14fe927a8b
preps for native window support
Claus Gittinger <cg@exept.de>
parents:
341
diff
changeset
|
807 |
! ! |
ea14fe927a8b
preps for native window support
Claus Gittinger <cg@exept.de>
parents:
341
diff
changeset
|
808 |
|
273
01541272ce8d
resource spec updated; cache device form
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
809 |
!CheckBox class methodsFor:'documentation'! |
100 | 810 |
|
811 |
version |
|
903
77a51b230754
viewBackground setting must change mine too
Claus Gittinger <cg@exept.de>
parents:
851
diff
changeset
|
812 |
^ '$Header: /cvs/stx/stx/libwidg2/CheckBox.st,v 1.55 1998-05-29 13:38:18 cg Exp $' |
100 | 813 |
! ! |