diff -r 000000000000 -r e6a541c1c0eb ChckTggle.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ChckTggle.st Fri Jul 16 11:44:44 1993 +0200 @@ -0,0 +1,87 @@ +" + COPYRIGHT (c) 1991-92 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. +" + +Toggle subclass:#CheckToggle + instanceVariableNames:'activeLogo' + classVariableNames:'defaultCheckForm' + poolDictionaries:'' + category:'Views-Interactors' +! + +CheckToggle comment:' + +COPYRIGHT (c) 1991-92 by Claus Gittinger + All Rights Reserved + +CheckButtons like Toggles do something when pressed/released; +but show an ok-marker if on; nothing if off + +@(#)ChckTggle.st 3.2 92/09/07 + +written spring 92 by claus +'! + +!CheckToggle class methodsFor:'defaults'! + +checkFormOn:aDevice + "answer the form used when checkToggle is turned on" + + defaultCheckForm isNil ifTrue:[ + defaultCheckForm := Form fromFile:'CheckOn.xbm' + resolution:100 + on:aDevice + ]. + defaultCheckForm isNil ifTrue:[ + defaultCheckForm := + Form width:16 height:16 fromArray:#(2r00000000 2r00000000 + 2r00000000 2r00000010 + 2r00000000 2r00000010 + 2r00000000 2r00000100 + 2r00000000 2r00000100 + 2r00000000 2r00001000 + 2r00000000 2r00001000 + 2r00000000 2r00010000 + 2r01000000 2r00010000 + 2r00100000 2r00100000 + 2r00010000 2r00100000 + 2r00001000 2r01000000 + 2r00000100 2r01000000 + 2r00000010 2r10000000 + 2r00000001 2r10000000 + 2r00000000 2r00000000) + on:aDevice + ]. + ^ defaultCheckForm +! ! + +!CheckToggle methodsFor:'initialization'! + +initialize + super initialize. + + onLevel := offLevel. + activeLogo := self class checkFormOn:device. + self form:activeLogo +! ! + +!CheckToggle methodsFor:'redrawing'! + +redraw + pressed ifTrue:[ + logo := activeLogo. + super redraw + ] ifFalse:[ + logo := nil. + super redraw + ] +! ! +