equal
deleted
inserted
replaced
505 "Modified: / 3.11.1997 / 02:22:02 / cg" |
505 "Modified: / 3.11.1997 / 02:22:02 / cg" |
506 ! ! |
506 ! ! |
507 |
507 |
508 !Toggle methodsFor:'private'! |
508 !Toggle methodsFor:'private'! |
509 |
509 |
510 asBoolean:aModelValue |
|
511 ^ aModelValue |
|
512 ! |
|
513 |
|
514 computeLabelOrigin |
510 computeLabelOrigin |
515 "compute the origin of the form/text. |
511 "compute the origin of the form/text. |
516 redefined to move label to the right if there is a lamp." |
512 redefined to move label to the right if there is a lamp." |
517 |
513 |
518 super computeLabelOrigin. |
514 super computeLabelOrigin. |
545 aspectMsg == #value ifTrue:[ |
541 aspectMsg == #value ifTrue:[ |
546 val := model value "/ faster call |
542 val := model value "/ faster call |
547 ] ifFalse:[ |
543 ] ifFalse:[ |
548 val := model perform:aspectMsg withOptionalArgument:self. |
544 val := model perform:aspectMsg withOptionalArgument:self. |
549 ]. |
545 ]. |
550 (self asBoolean:val) == true ifTrue:[ "allowing nil - treat as false" |
546 val asBoolean ifTrue:[ "allowing nil - treat as false" |
551 self turnOn |
547 self turnOn |
552 ] ifFalse:[ |
548 ] ifFalse:[ |
553 self turnOff |
549 self turnOff |
554 ]. |
550 ]. |
555 ]. |
551 ]. |
642 ! ! |
638 ! ! |
643 |
639 |
644 !Toggle class methodsFor:'documentation'! |
640 !Toggle class methodsFor:'documentation'! |
645 |
641 |
646 version |
642 version |
647 ^ '$Header: /cvs/stx/stx/libwidg/Toggle.st,v 1.50 2004-04-07 12:52:44 werner Exp $' |
643 ^ '$Header: /cvs/stx/stx/libwidg/Toggle.st,v 1.51 2004-04-07 12:59:26 werner Exp $' |
648 ! ! |
644 ! ! |