0
|
1 |
"
|
4
|
2 |
COPYRIGHT (c) 1991 by Claus Gittinger
|
0
|
3 |
All Rights Reserved
|
|
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
|
|
14 |
instanceVariableNames:'activeLogo'
|
18
|
15 |
classVariableNames:'DefaultCheckForm'
|
0
|
16 |
poolDictionaries:''
|
|
17 |
category:'Views-Interactors'
|
|
18 |
!
|
|
19 |
|
|
20 |
CheckToggle comment:'
|
4
|
21 |
COPYRIGHT (c) 1991 by Claus Gittinger
|
0
|
22 |
All Rights Reserved
|
|
23 |
|
38
|
24 |
$Header: /cvs/stx/stx/libwidg/CheckToggle.st,v 1.5 1994-08-07 13:21:08 claus Exp $
|
|
25 |
'!
|
|
26 |
|
|
27 |
!CheckToggle class methodsFor:'documentation'!
|
|
28 |
|
|
29 |
copyright
|
|
30 |
"
|
|
31 |
COPYRIGHT (c) 1991 by Claus Gittinger
|
|
32 |
All Rights Reserved
|
0
|
33 |
|
38
|
34 |
This software is furnished under a license and may be used
|
|
35 |
only in accordance with the terms of that license and with the
|
|
36 |
inclusion of the above copyright notice. This software may not
|
|
37 |
be provided or otherwise made available to, or used by, any
|
|
38 |
other person. No title to or ownership of the software is
|
|
39 |
hereby transferred.
|
|
40 |
"
|
|
41 |
!
|
0
|
42 |
|
38
|
43 |
version
|
|
44 |
"
|
|
45 |
$Header: /cvs/stx/stx/libwidg/CheckToggle.st,v 1.5 1994-08-07 13:21:08 claus Exp $
|
|
46 |
"
|
|
47 |
!
|
|
48 |
|
|
49 |
documentation
|
|
50 |
"
|
|
51 |
CheckButtons are like Toggles in toggling their state when pressed.
|
|
52 |
However, they show an ok-marker if on; nothing if off.
|
|
53 |
"
|
|
54 |
! !
|
0
|
55 |
|
|
56 |
!CheckToggle class methodsFor:'defaults'!
|
|
57 |
|
|
58 |
checkFormOn:aDevice
|
|
59 |
"answer the form used when checkToggle is turned on"
|
|
60 |
|
18
|
61 |
DefaultCheckForm isNil ifTrue:[
|
|
62 |
DefaultCheckForm := Form fromFile:'CheckOn.xbm'
|
0
|
63 |
resolution:100
|
|
64 |
on:aDevice
|
|
65 |
].
|
18
|
66 |
DefaultCheckForm isNil ifTrue:[
|
|
67 |
DefaultCheckForm :=
|
0
|
68 |
Form width:16 height:16 fromArray:#(2r00000000 2r00000000
|
|
69 |
2r00000000 2r00000010
|
|
70 |
2r00000000 2r00000010
|
|
71 |
2r00000000 2r00000100
|
|
72 |
2r00000000 2r00000100
|
|
73 |
2r00000000 2r00001000
|
|
74 |
2r00000000 2r00001000
|
|
75 |
2r00000000 2r00010000
|
|
76 |
2r01000000 2r00010000
|
|
77 |
2r00100000 2r00100000
|
|
78 |
2r00010000 2r00100000
|
|
79 |
2r00001000 2r01000000
|
|
80 |
2r00000100 2r01000000
|
|
81 |
2r00000010 2r10000000
|
|
82 |
2r00000001 2r10000000
|
|
83 |
2r00000000 2r00000000)
|
|
84 |
on:aDevice
|
|
85 |
].
|
18
|
86 |
^ DefaultCheckForm
|
0
|
87 |
! !
|
|
88 |
|
|
89 |
!CheckToggle methodsFor:'initialization'!
|
|
90 |
|
|
91 |
initialize
|
|
92 |
super initialize.
|
|
93 |
|
|
94 |
onLevel := offLevel.
|
|
95 |
activeLogo := self class checkFormOn:device.
|
|
96 |
self form:activeLogo
|
18
|
97 |
!
|
|
98 |
|
|
99 |
initStyle
|
|
100 |
super initStyle.
|
|
101 |
|
|
102 |
style == #iris ifTrue:[
|
|
103 |
self activeForegroundColor:Color red.
|
|
104 |
showLamp := false
|
|
105 |
]
|
0
|
106 |
! !
|
|
107 |
|
|
108 |
!CheckToggle methodsFor:'redrawing'!
|
|
109 |
|
|
110 |
redraw
|
|
111 |
pressed ifTrue:[
|
|
112 |
logo := activeLogo.
|
|
113 |
super redraw
|
|
114 |
] ifFalse:[
|
|
115 |
logo := nil.
|
|
116 |
super redraw
|
|
117 |
]
|
|
118 |
! !
|