ChckTggle.st
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--
added style resource directive
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     1
"
4
88eb91574867 *** empty log message ***
claus
parents: 2
diff changeset
     2
 COPYRIGHT (c) 1991 by Claus Gittinger
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
     3
	      All Rights Reserved
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     4
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    11
"
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    12
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    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
76336839475b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    16
		DefaultActiveBGColor DefaultFGColor DefaultBGColor
76336839475b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
    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
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    20
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    21
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 18
diff changeset
    22
!CheckToggle class methodsFor:'documentation'!
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 18
diff changeset
    23
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 18
diff changeset
    24
copyright
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 18
diff changeset
    25
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 18
diff changeset
    26
 COPYRIGHT (c) 1991 by Claus Gittinger
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
    27
	      All Rights Reserved
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    28
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 18
diff changeset
    29
 This software is furnished under a license and may be used
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 18
diff changeset
    30
 only in accordance with the terms of that license and with the
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 18
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 18
diff changeset
    32
 be provided or otherwise made available to, or used by, any
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 18
diff changeset
    33
 other person.  No title to or ownership of the software is
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 18
diff changeset
    34
 hereby transferred.
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 18
diff changeset
    35
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 18
diff changeset
    36
!
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    37
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 18
diff changeset
    38
documentation
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 18
diff changeset
    39
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 18
diff changeset
    40
    CheckButtons are like Toggles in toggling their state when pressed.
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 18
diff changeset
    41
    However, they show an ok-marker if on; nothing if off.
118
claus
parents: 77
diff changeset
    42
    CheckButtons are mostly used as part of a checkBox (since normally,
147
claus
parents: 146
diff changeset
    43
    you want to have some label along the check) and often grouped for
claus
parents: 146
diff changeset
    44
    many-in-many or one-in-many setups.
130
claus
parents: 128
diff changeset
    45
claus
parents: 128
diff changeset
    46
    StyleSheet values:
claus
parents: 128
diff changeset
    47
claus
parents: 128
diff changeset
    48
	checkToggleCheckColor   <Color>         color to draw check-image with.
claus
parents: 128
diff changeset
    49
						defaults to value of #buttonActiveForegroundColor.
claus
parents: 128
diff changeset
    50
139
claus
parents: 136
diff changeset
    51
	checkToggleActiveBackgroundColor        background color to draw active checki-image with
claus
parents: 136
diff changeset
    52
	checkToggleForegroundColor              foreground color to use if off
claus
parents: 136
diff changeset
    53
	checkToggleBackgroundColor              background color to use if off
130
claus
parents: 128
diff changeset
    54
claus
parents: 128
diff changeset
    55
	checkToggleBitmapFile   <String>        name of bitmap file for check-image
claus
parents: 128
diff changeset
    56
claus
parents: 128
diff changeset
    57
	checkToggleStyle        <Symbol>        default checkForm style.
claus
parents: 128
diff changeset
    58
						used if above is nil or file not readable
claus
parents: 128
diff changeset
    59
						can be #cross or #check; defaults to #check 
claus
parents: 128
diff changeset
    60
claus
parents: 128
diff changeset
    61
	checkToggleAvtiveLevel  <Number>        active level - defaults to value of #buttonPassiveLevel
claus
parents: 128
diff changeset
    62
	checkTogglePassiveLevel <Number>        active level - defaults to value of #buttonPassiveLevel
claus
parents: 128
diff changeset
    63
	checkToggleBorderWidth  <Number>        borderWidth - defaults buttons default
claus
parents: 128
diff changeset
    64
139
claus
parents: 136
diff changeset
    65
    (if not set in the styleSheet, Toggle values are taken)
claus
parents: 136
diff changeset
    66
130
claus
parents: 128
diff changeset
    67
    See examples.
claus
parents: 128
diff changeset
    68
147
claus
parents: 146
diff changeset
    69
    See also: CheckBox  RadioButton  RadioButtonGroup Toggle Button
118
claus
parents: 77
diff changeset
    70
"
claus
parents: 77
diff changeset
    71
!
claus
parents: 77
diff changeset
    72
claus
parents: 77
diff changeset
    73
examples 
claus
parents: 77
diff changeset
    74
"
claus
parents: 77
diff changeset
    75
    checkToggle alone:
claus
parents: 77
diff changeset
    76
claus
parents: 77
diff changeset
    77
	|top check|
claus
parents: 77
diff changeset
    78
claus
parents: 77
diff changeset
    79
	top := StandardSystemView new.
claus
parents: 77
diff changeset
    80
	top extent:100@100.
claus
parents: 77
diff changeset
    81
claus
parents: 77
diff changeset
    82
	check := CheckToggle in:top.
claus
parents: 77
diff changeset
    83
	check origin:10@10.
claus
parents: 77
diff changeset
    84
claus
parents: 77
diff changeset
    85
	top open
claus
parents: 77
diff changeset
    86
claus
parents: 77
diff changeset
    87
    give it an action:
claus
parents: 77
diff changeset
    88
claus
parents: 77
diff changeset
    89
	|top check|
claus
parents: 77
diff changeset
    90
claus
parents: 77
diff changeset
    91
	top := StandardSystemView new.
claus
parents: 77
diff changeset
    92
	top extent:100@100.
claus
parents: 77
diff changeset
    93
claus
parents: 77
diff changeset
    94
	check := CheckToggle in:top.
claus
parents: 77
diff changeset
    95
	check origin:10@10.
claus
parents: 77
diff changeset
    96
	check action:[:value | Transcript showCr:'changed to: ' , value printString].
claus
parents: 77
diff changeset
    97
claus
parents: 77
diff changeset
    98
	top open
claus
parents: 77
diff changeset
    99
claus
parents: 77
diff changeset
   100
    give it a model:
claus
parents: 77
diff changeset
   101
claus
parents: 77
diff changeset
   102
	|top check model|
claus
parents: 77
diff changeset
   103
claus
parents: 77
diff changeset
   104
	model := false asValue.
claus
parents: 77
diff changeset
   105
claus
parents: 77
diff changeset
   106
	top := StandardSystemView new.
claus
parents: 77
diff changeset
   107
	top extent:100@100.
claus
parents: 77
diff changeset
   108
claus
parents: 77
diff changeset
   109
	check := CheckToggle in:top.
claus
parents: 77
diff changeset
   110
	check origin:10@10.
claus
parents: 77
diff changeset
   111
	check model:model.
claus
parents: 77
diff changeset
   112
claus
parents: 77
diff changeset
   113
	top openModal.
claus
parents: 77
diff changeset
   114
claus
parents: 77
diff changeset
   115
	Transcript showCr:'value after closing box: ' , model value printString
claus
parents: 77
diff changeset
   116
claus
parents: 77
diff changeset
   117
    multiple checks on a single model (with different change selectors):
claus
parents: 77
diff changeset
   118
    (using a checkBox here, for the demonstration ...)
147
claus
parents: 146
diff changeset
   119
    (this is a typical many-in-many setup)
118
claus
parents: 77
diff changeset
   120
claus
parents: 77
diff changeset
   121
	|top model panel ext1 ext2
claus
parents: 77
diff changeset
   122
	 readFlag writeFlag executeFlag|
claus
parents: 77
diff changeset
   123
claus
parents: 77
diff changeset
   124
	readFlag := writeFlag := true.
claus
parents: 77
diff changeset
   125
	executeFlag := false.
claus
parents: 77
diff changeset
   126
claus
parents: 77
diff changeset
   127
	model := Plug new.
claus
parents: 77
diff changeset
   128
	model respondTo:#read with:[readFlag].
claus
parents: 77
diff changeset
   129
	model respondTo:#write with:[writeFlag].
claus
parents: 77
diff changeset
   130
	model respondTo:#execute with:[executeFlag].
claus
parents: 77
diff changeset
   131
	model respondTo:#read: with:[:val | readFlag := val].
claus
parents: 77
diff changeset
   132
	model respondTo:#write: with:[:val | writeFlag := val].
claus
parents: 77
diff changeset
   133
	model respondTo:#execute: with:[:val | executeFlag := val].
claus
parents: 77
diff changeset
   134
claus
parents: 77
diff changeset
   135
	top := StandardSystemView new.
claus
parents: 77
diff changeset
   136
	top extent:200@200.
claus
parents: 77
diff changeset
   137
	top label:'File permissions:'.
claus
parents: 77
diff changeset
   138
claus
parents: 77
diff changeset
   139
	panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
claus
parents: 77
diff changeset
   140
claus
parents: 77
diff changeset
   141
	#(read write execute) do:[:sym |
claus
parents: 77
diff changeset
   142
	    |check|
claus
parents: 77
diff changeset
   143
claus
parents: 77
diff changeset
   144
	    check := CheckBox in:panel.
claus
parents: 77
diff changeset
   145
	    check label:sym.
147
claus
parents: 146
diff changeset
   146
	    check model:model; aspect:sym; changeMessage:(sym , ':') asSymbol.
118
claus
parents: 77
diff changeset
   147
	].
claus
parents: 77
diff changeset
   148
claus
parents: 77
diff changeset
   149
	top openModal.
claus
parents: 77
diff changeset
   150
claus
parents: 77
diff changeset
   151
	Transcript showCr:'settings after closing box:'.
claus
parents: 77
diff changeset
   152
	Transcript showCr:'  read -> ' , readFlag printString.
claus
parents: 77
diff changeset
   153
	Transcript showCr:'  write -> ' , writeFlag printString.
claus
parents: 77
diff changeset
   154
	Transcript showCr:'  execute -> ' , executeFlag printString.
130
claus
parents: 128
diff changeset
   155
claus
parents: 128
diff changeset
   156
claus
parents: 128
diff changeset
   157
    checkToggles in a group
147
claus
parents: 146
diff changeset
   158
    (this is a typical one-in-many setup)
130
claus
parents: 128
diff changeset
   159
claus
parents: 128
diff changeset
   160
	|top panel check1 check2 check3 grp|
claus
parents: 128
diff changeset
   161
claus
parents: 128
diff changeset
   162
	top := StandardSystemView new.
claus
parents: 128
diff changeset
   163
	top extent:200@300.
claus
parents: 128
diff changeset
   164
claus
parents: 128
diff changeset
   165
	panel := VerticalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
claus
parents: 128
diff changeset
   166
claus
parents: 128
diff changeset
   167
	check1 := CheckToggle in:panel.
claus
parents: 128
diff changeset
   168
	check2 := CheckToggle in:panel.
claus
parents: 128
diff changeset
   169
	check3 := CheckToggle in:panel.
claus
parents: 128
diff changeset
   170
claus
parents: 128
diff changeset
   171
	grp := RadioButtonGroup new.
claus
parents: 128
diff changeset
   172
	grp add:check1.
claus
parents: 128
diff changeset
   173
	grp add:check2.
claus
parents: 128
diff changeset
   174
	grp add:check3.
claus
parents: 128
diff changeset
   175
claus
parents: 128
diff changeset
   176
	top open
146
claus
parents: 139
diff changeset
   177
claus
parents: 139
diff changeset
   178
claus
parents: 139
diff changeset
   179
     Channel operation 
claus
parents: 139
diff changeset
   180
     -----------------
claus
parents: 139
diff changeset
   181
claus
parents: 139
diff changeset
   182
       enabling other toggles via a toggle
claus
parents: 139
diff changeset
   183
claus
parents: 139
diff changeset
   184
	|top panel t enableChannel|
claus
parents: 139
diff changeset
   185
claus
parents: 139
diff changeset
   186
	top := StandardSystemView new.
claus
parents: 139
diff changeset
   187
	top extent:(400 @ 200).
claus
parents: 139
diff changeset
   188
claus
parents: 139
diff changeset
   189
	panel := HorizontalPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
claus
parents: 139
diff changeset
   190
claus
parents: 139
diff changeset
   191
	enableChannel := false asValue.
claus
parents: 139
diff changeset
   192
claus
parents: 139
diff changeset
   193
	1 to:10 do:[:i |
claus
parents: 139
diff changeset
   194
	    t := CheckToggle in:panel.
claus
parents: 139
diff changeset
   195
	    t enableChannel:enableChannel.
claus
parents: 139
diff changeset
   196
	].
claus
parents: 139
diff changeset
   197
claus
parents: 139
diff changeset
   198
	t := Toggle in:panel.
147
claus
parents: 146
diff changeset
   199
	t activeLogo:'enabled'; passiveLogo:'disabled'.
146
claus
parents: 139
diff changeset
   200
	t controller pressChannel:enableChannel.
claus
parents: 139
diff changeset
   201
claus
parents: 139
diff changeset
   202
	top open
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 18
diff changeset
   203
"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 18
diff changeset
   204
! !
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   205
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   206
!CheckToggle class methodsFor:'defaults'!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   207
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   208
checkFormOn:aDevice
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   209
    "return the form used when checkToggle is turned on.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   210
     Provided as public entry, to allow other views
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   211
     to share the same check-image."
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   212
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   213
    ^ DefaultCheckForm on:aDevice.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   214
!
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   215
128
claus
parents: 127
diff changeset
   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
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   228
130
claus
parents: 128
diff changeset
   229
    DefaultCheckColor := StyleSheet colorAt:'checkToggleCheckColor'.
139
claus
parents: 136
diff changeset
   230
    DefaultFGColor := StyleSheet colorAt:'checkToggleForegroundColor'.
130
claus
parents: 128
diff changeset
   231
    DefaultBGColor := StyleSheet colorAt:'checkToggleBackgroundColor'.
139
claus
parents: 136
diff changeset
   232
    DefaultActiveFGColor := StyleSheet colorAt:'checkToggleActiveForegroundColor'.
130
claus
parents: 128
diff changeset
   233
    DefaultActiveBGColor := StyleSheet colorAt:'checkToggleActiveBackgroundColor'.
claus
parents: 128
diff changeset
   234
    DefaultActiveLevel := StyleSheet at:'checkToggleActiveLevel'.
claus
parents: 128
diff changeset
   235
    DefaultPassiveLevel := StyleSheet at:'checkTogglePassiveLevel'.
claus
parents: 128
diff changeset
   236
    DefaultBorderWidth := StyleSheet at:'checkToggleBorderWidth'.
claus
parents: 128
diff changeset
   237
136
claus
parents: 133
diff changeset
   238
    DefaultCheckForm := nil.
128
claus
parents: 127
diff changeset
   239
    checkFileName := StyleSheet at:'checkToggleBitmapFile' default:'CheckOn.xbm'.
claus
parents: 127
diff changeset
   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
claus
parents: 128
diff changeset
   244
    ].
claus
parents: 128
diff changeset
   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
claus
parents: 127
diff changeset
   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
claus
parents: 127
diff changeset
   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
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   306
! !
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   307
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   308
!CheckToggle methodsFor:'initialization'!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   309
18
66bf62e27141 *** empty log message ***
claus
parents: 4
diff changeset
   310
initStyle
66bf62e27141 *** empty log message ***
claus
parents: 4
diff changeset
   311
    super initStyle.
66bf62e27141 *** empty log message ***
claus
parents: 4
diff changeset
   312
128
claus
parents: 127
diff changeset
   313
    onLevel := offLevel.
130
claus
parents: 128
diff changeset
   314
    DefaultActiveLevel notNil ifTrue:[onLevel := DefaultActiveLevel].
136
claus
parents: 133
diff changeset
   315
    DefaultPassiveLevel notNil ifTrue:[offLevel := DefaultPassiveLevel].
130
claus
parents: 128
diff changeset
   316
128
claus
parents: 127
diff changeset
   317
    activeLogo := DefaultCheckForm on:device.
claus
parents: 127
diff changeset
   318
    passiveLogo := nil.
claus
parents: 127
diff changeset
   319
139
claus
parents: 136
diff changeset
   320
    DefaultActiveFGColor notNil ifTrue:[self activeForegroundColor:DefaultActiveFGColor].
130
claus
parents: 128
diff changeset
   321
    DefaultCheckColor notNil ifTrue:[self activeForegroundColor:DefaultCheckColor].
claus
parents: 128
diff changeset
   322
    DefaultActiveBGColor notNil ifTrue:[self activeBackgroundColor:DefaultActiveBGColor].
139
claus
parents: 136
diff changeset
   323
    DefaultFGColor notNil ifTrue:[self foregroundColor:DefaultFGColor].
130
claus
parents: 128
diff changeset
   324
    DefaultBGColor notNil ifTrue:[self backgroundColor:DefaultBGColor].
claus
parents: 128
diff changeset
   325
128
claus
parents: 127
diff changeset
   326
    showLamp := false.
130
claus
parents: 128
diff changeset
   327
claus
parents: 128
diff changeset
   328
    DefaultBorderWidth notNil ifTrue:[self borderWidth:DefaultBorderWidth].
claus
parents: 128
diff changeset
   329
claus
parents: 128
diff changeset
   330
    offLevel ~~ level ifTrue:[self level:offLevel].
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   331
!
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   332
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   333
initialize
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   334
    super initialize.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   335
    passiveLogo := nil.
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   336
    self form:activeLogo "/ to let me compute some defaultExtent
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   337
! !
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   338
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   339
!CheckToggle methodsFor:'redrawing'!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   340
133
claus
parents: 132
diff changeset
   341
drawWith:fg and:bg
265
76336839475b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 205
diff changeset
   342
    controller pressed ifTrue:[
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   343
	logo := activeLogo.
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   344
    ] ifFalse:[
164
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   345
	logo := passiveLogo.
133
claus
parents: 132
diff changeset
   346
    ].
claus
parents: 132
diff changeset
   347
    super drawWith:fg and:bg
164
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   348
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   349
    "Modified: 22.9.1995 / 15:45:02 / claus"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   350
! !
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   351
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   352
!CheckToggle class methodsFor:'documentation'!
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   353
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   354
version
440
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 375
diff changeset
   355
    ^ '$Header: /cvs/stx/stx/libwidg/Attic/ChckTggle.st,v 1.23 1996-03-01 12:58:15 cg Exp $'
205
6814c0bf8df8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   356
! !