CheckBox.st
changeset 3287 0022d5b3949b
parent 2868 0050e38370ed
child 3317 25a5e8fc2c0d
equal deleted inserted replaced
3286:91e2e2399b81 3287:0022d5b3949b
     7  inclusion of the above copyright notice.   This software may not
     7  inclusion of the above copyright notice.   This software may not
     8  be provided or otherwise made available to, or used by, any
     8  be provided or otherwise made available to, or used by, any
     9  other person.  No title to or ownership of the software is
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 
       
    13 
       
    14 "{ Package: 'stx:libwidg2' }"
    12 "{ Package: 'stx:libwidg2' }"
    15 
    13 
    16 HorizontalPanelView subclass:#CheckBox
    14 HorizontalPanelView subclass:#CheckBox
    17 	instanceVariableNames:'toggleView labelView labelForegroundColor
    15 	instanceVariableNames:'toggleView labelView labelForegroundColor
    18 		disabledLabelForegroundColor disabledLabelEtchedForegroundColor
    16 		disabledLabelForegroundColor disabledLabelEtchedForegroundColor
   490 
   488 
   491 viewBackground: backgroundColor
   489 viewBackground: backgroundColor
   492     "set backgroundColor"
   490     "set backgroundColor"
   493 
   491 
   494     labelView backgroundColor: backgroundColor.
   492     labelView backgroundColor: backgroundColor.
   495     super viewBackground: backgroundColor
   493     super viewBackground: backgroundColor.
   496 ! !
   494 ! !
   497 
   495 
   498 !CheckBox methodsFor:'accessing-components'!
   496 !CheckBox methodsFor:'accessing-components'!
   499 
   497 
   500 labelView
   498 labelView
   743     "Modified: / 17.9.1998 / 14:19:22 / cg"
   741     "Modified: / 17.9.1998 / 14:19:22 / cg"
   744 ! !
   742 ! !
   745 
   743 
   746 !CheckBox methodsFor:'initialization & release'!
   744 !CheckBox methodsFor:'initialization & release'!
   747 
   745 
       
   746 defaultCheckToggleClass
       
   747     ^ CheckToggle
       
   748 !
       
   749 
   748 defaultControllerClass
   750 defaultControllerClass
   749     ^ ToggleController
   751     ^ ToggleController
   750 
   752 
   751     "Created: 18.7.1996 / 11:57:01 / cg"
   753     "Created: 18.7.1996 / 11:57:01 / cg"
   752 !
   754 !
   771 !
   773 !
   772 
   774 
   773 initialize
   775 initialize
   774     <resource: #style (#name)>
   776     <resource: #style (#name)>
   775 
   777 
       
   778     |checkToggleClass|
       
   779 
   776     super initialize.
   780     super initialize.
   777 
   781 
   778     borderWidth := 0.
   782     borderWidth := 0.
       
   783     checkToggleClass := self defaultCheckToggleClass.
   779 
   784 
   780     hLayout := #fixLeftSpace.
   785     hLayout := #fixLeftSpace.
   781     vLayout := #center.
   786     vLayout := #center.
   782 
   787 
   783     CheckToggleLeft ~~ false ifTrue:[
   788     CheckToggleLeft ~~ false ifTrue:[
   784         "/ toggle first ...
   789         "/ toggle first ...
   785         toggleView := CheckToggle in:self.
   790         toggleView := checkToggleClass in:self.
   786     ].
   791     ].
   787 
   792 
   788     labelView := CheckLabel in:self.
   793     labelView := CheckLabel in:self.
   789     "/ a kludge
   794     "/ a kludge
   790     styleSheet name ~~ #motif ifTrue:[
   795     styleSheet name ~~ #motif ifTrue:[
   794     labelView adjust:#left.
   799     labelView adjust:#left.
   795     self initialHeight:labelView preferredExtent y + ViewSpacing.
   800     self initialHeight:labelView preferredExtent y + ViewSpacing.
   796 
   801 
   797     CheckToggleLeft == false ifTrue:[
   802     CheckToggleLeft == false ifTrue:[
   798         "/ toggle last ...
   803         "/ toggle last ...
   799         toggleView := CheckToggle in:self.
   804         toggleView := checkToggleClass in:self.
   800     ].
   805     ].
   801 
   806 
   802     (StyleSheet at:'checkBoxStyle' default:StyleSheet name) == #motif ifTrue:[
   807     (StyleSheet at:'checkBoxStyle' default:StyleSheet name) == #motif ifTrue:[
   803         toggleView activeLogo:nil.
   808         toggleView activeLogo:nil.
   804         toggleView passiveLogo:nil.
   809         toggleView passiveLogo:nil.
   920 ! !
   925 ! !
   921 
   926 
   922 !CheckBox class methodsFor:'documentation'!
   927 !CheckBox class methodsFor:'documentation'!
   923 
   928 
   924 version
   929 version
   925     ^ '$Header: /cvs/stx/stx/libwidg2/CheckBox.st,v 1.75 2005-12-21 11:34:46 cg Exp $'
   930     ^ '$Header: /cvs/stx/stx/libwidg2/CheckBox.st,v 1.76 2007-11-28 14:43:10 ca Exp $'
   926 ! !
   931 ! !