--- a/CheckBox.st Thu Nov 23 19:15:36 1995 +0100
+++ b/CheckBox.st Thu Nov 23 19:18:39 1995 +0100
@@ -11,8 +11,6 @@
"
-'From Smalltalk/X, Version:2.10.5 on 8-may-1995 at 3:48:28 am'!
-
HorizontalPanelView subclass:#CheckBox
instanceVariableNames:'toggleView labelView'
classVariableNames:''
@@ -22,8 +20,19 @@
!CheckBox class methodsFor:'documentation'!
-version
- ^ '$Header: /cvs/stx/stx/libwidg2/CheckBox.st,v 1.13 1995-11-11 16:28:52 cg Exp $'
+copyright
+"
+ COPYRIGHT (c) 1995 by Claus Gittinger
+ All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice. This software may not
+ be provided or otherwise made available to, or used by, any
+ other person. No title to or ownership of the software is
+ hereby transferred.
+"
+
!
documentation
@@ -191,31 +200,10 @@
Transcript show:'value2: '; showCr:model value2.
]
"
-!
-
-copyright
-"
- COPYRIGHT (c) 1995 by Claus Gittinger
- All Rights Reserved
-
- This software is furnished under a license and may be used
- only in accordance with the terms of that license and with the
- inclusion of the above copyright notice. This software may not
- be provided or otherwise made available to, or used by, any
- other person. No title to or ownership of the software is
- hereby transferred.
-"
-
! !
!CheckBox class methodsFor:'instance creation'!
-model:aModel
- "create & return a new checkBox, on aModel (typically a ValueHolder)"
-
- ^ self new model:aModel
-!
-
label:aStringOrImage model:aModel
"create & return a new checkBox, on aModel (typically a ValueHolder),
with aStringOrImage as label."
@@ -223,74 +211,12 @@
^ (self new model:aModel) label:aStringOrImage
"Created: 17.9.1995 / 14:20:58 / claus"
-! !
-
-!CheckBox methodsFor:'accessing-mvc'!
-
-changeMessage:aChangeSelector
- "forward to toggle"
-
- toggleView changeMessage:aChangeSelector
-!
-
-aspectMessage:aspectSymbol
- "forward to label & toggle"
-
- labelView aspectMessage:aspectSymbol.
- toggleView aspectMessage:aspectSymbol
!
model:aModel
- "forward to label & toggle"
-
- labelView model:aModel.
- toggleView model:aModel
-! !
-
-!CheckBox methodsFor:'accessing-behavior'!
-
-action:aBlock
- "forward to toggle"
-
- toggleView action:aBlock
-!
-
-pressAction:aBlock
- toggleView pressAction:aBlock.
-
- "Created: 22.9.1995 / 15:54:04 / claus"
-!
-
-releaseAction:aBlock
- toggleView releaseAction:aBlock.
+ "create & return a new checkBox, on aModel (typically a ValueHolder)"
- "Created: 22.9.1995 / 15:54:11 / claus"
-!
-
-enable
- "forward to toggle & change labels color"
-
- toggleView enable.
- labelView foregroundColor:(toggleView foregroundColor).
-!
-
-disable
- "forward to toggle & change labels color"
-
- toggleView disable.
- labelView foregroundColor:(toggleView disabledForegroundColor).
-!
-
-turnOff
- "forward to toggle"
-
- toggleView turnOff
-!
-
-turnOn
- "forward to toggle"
-
- toggleView turnOn
+ ^ self new model:aModel
! !
!CheckBox methodsFor:'accessing'!
@@ -309,21 +235,64 @@
^ toggleView
! !
-!CheckBox methodsFor:'accessing-state'!
+!CheckBox methodsFor:'accessing-behavior'!
+
+action:aBlock
+ "forward to toggle"
+
+ toggleView action:aBlock
+!
+
+disable
+ "forward to toggle & change labels color"
+
+ toggleView disable.
+ labelView foregroundColor:(toggleView disabledForegroundColor).
+!
+
+enable
+ "forward to toggle & change labels color"
+
+ toggleView enable.
+ labelView foregroundColor:(toggleView foregroundColor).
+!
-isOn
- ^ toggleView isOn
+pressAction:aBlock
+ toggleView pressAction:aBlock.
+
+ "Created: 22.9.1995 / 15:54:04 / claus"
+!
+
+releaseAction:aBlock
+ toggleView releaseAction:aBlock.
+
+ "Created: 22.9.1995 / 15:54:11 / claus"
+!
+
+turnOff
+ "forward to toggle"
+
+ toggleView turnOff
+!
+
+turnOn
+ "forward to toggle"
+
+ toggleView turnOn
! !
!CheckBox methodsFor:'accessing-look'!
-label:aString
- "forward to label & resize"
+activeLogo:anImageOrString
+ toggleView activeLogo:anImageOrString
- labelView label:aString.
- labelView forceResize.
- self layoutChanged.
- self resize.
+ "Created: 22.9.1995 / 15:44:08 / claus"
+!
+
+font
+ "forward from label"
+
+ ^ labelView font
!
font:aFont
@@ -335,22 +304,19 @@
self resize.
!
-font
- "forward from label"
-
- ^ labelView font
-!
-
label
"forward from label"
^ labelView label
!
-activeLogo:anImageOrString
- toggleView activeLogo:anImageOrString
+label:aString
+ "forward to label & resize"
- "Created: 22.9.1995 / 15:44:08 / claus"
+ labelView label:aString.
+ labelView forceResize.
+ self layoutChanged.
+ self resize.
!
passiveLogo:anImageOrString
@@ -359,25 +325,32 @@
"Created: 22.9.1995 / 15:44:14 / claus"
! !
-!CheckBox methodsFor:'queries'!
+!CheckBox methodsFor:'accessing-mvc'!
-preferredExtent
- |prefCheck prefLabel bw2|
+aspectMessage:aspectSymbol
+ "forward to label & toggle"
+
+ labelView aspectMessage:aspectSymbol.
+ toggleView aspectMessage:aspectSymbol
+!
-^ super preferredExtent + (10@0).
-"/ prefCheck := toggleView preferredExtent.
-"/ prefLabel := labelView preferredExtent.
-"/ bw2 := borderWidth * 2.
-"/ ^ (prefCheck x + prefLabel x + (3 * ViewSpacing)) @ ((prefCheck y max:prefLabel y) + bw2 + 2)
+changeMessage:aChangeSelector
+ "forward to toggle"
+
+ toggleView changeMessage:aChangeSelector
+!
+
+model:aModel
+ "forward to label & toggle"
+
+ labelView model:aModel.
+ toggleView model:aModel
! !
-!CheckBox methodsFor:'private'!
+!CheckBox methodsFor:'accessing-state'!
-sendChangeMessageWith:aValue
- "redefined to have mimic changes being sent from the toggle
- instead of myself"
-
- toggleView sendChangeMessageWith:aValue
+isOn
+ ^ toggleView isOn
! !
!CheckBox methodsFor:'initialization'!
@@ -411,3 +384,30 @@
b open
"
! !
+
+!CheckBox methodsFor:'private'!
+
+sendChangeMessageWith:aValue
+ "redefined to have mimic changes being sent from the toggle
+ instead of myself"
+
+ toggleView sendChangeMessageWith:aValue
+! !
+
+!CheckBox methodsFor:'queries'!
+
+preferredExtent
+ |prefCheck prefLabel bw2|
+
+^ super preferredExtent + (10@0).
+"/ prefCheck := toggleView preferredExtent.
+"/ prefLabel := labelView preferredExtent.
+"/ bw2 := borderWidth * 2.
+"/ ^ (prefCheck x + prefLabel x + (3 * ViewSpacing)) @ ((prefCheck y max:prefLabel y) + bw2 + 2)
+! !
+
+!CheckBox class methodsFor:'documentation'!
+
+version
+ ^ '$Header: /cvs/stx/stx/libwidg2/CheckBox.st,v 1.14 1995-11-23 18:17:40 cg Exp $'
+! !