CheckBox.st
changeset 273 01541272ce8d
parent 268 978db6396b49
child 282 95209b20eaca
equal deleted inserted replaced
272:6c6466cd4ea1 273:01541272ce8d
    17 	classVariableNames:'DefaultLabelForegroundColor DefaultDisabledLabelForegroundColor'
    17 	classVariableNames:'DefaultLabelForegroundColor DefaultDisabledLabelForegroundColor'
    18 	poolDictionaries:''
    18 	poolDictionaries:''
    19 	category:'Views-Interactors'
    19 	category:'Views-Interactors'
    20 !
    20 !
    21 
    21 
    22 !CheckBox  class methodsFor:'documentation'!
    22 !CheckBox class methodsFor:'documentation'!
    23 
    23 
    24 copyright
    24 copyright
    25 "
    25 "
    26  COPYRIGHT (c) 1995 by Claus Gittinger
    26  COPYRIGHT (c) 1995 by Claus Gittinger
    27 	      All Rights Reserved
    27 	      All Rights Reserved
   244      ]
   244      ]
   245 									[exEnd]
   245 									[exEnd]
   246 "
   246 "
   247 ! !
   247 ! !
   248 
   248 
   249 !CheckBox  class methodsFor:'instance creation'!
   249 !CheckBox class methodsFor:'instance creation'!
   250 
   250 
   251 label:aStringOrImage model:aModel
   251 label:aStringOrImage model:aModel
   252     "create & return a new checkBox, on aModel (typically a ValueHolder),
   252     "create & return a new checkBox, on aModel (typically a ValueHolder),
   253      with aStringOrImage as label."
   253      with aStringOrImage as label."
   254 
   254 
   261     "create & return a new checkBox, on aModel (typically a ValueHolder)"
   261     "create & return a new checkBox, on aModel (typically a ValueHolder)"
   262 
   262 
   263     ^ self new model:aModel
   263     ^ self new model:aModel
   264 ! !
   264 ! !
   265 
   265 
   266 !CheckBox  class methodsFor:'defaults'!
   266 !CheckBox class methodsFor:'defaults'!
   267 
   267 
   268 updateStyleCache
   268 updateStyleCache
   269     "extract values from the styleSheet and cache them in class variables"
   269     "extract values from the styleSheet and cache them in class variables"
   270 
   270 
   271     <resource: #style (#checkBoxLabelForegroundColor 
   271     <resource: #style (#checkBoxLabelForegroundColor 
   565 
   565 
   566     "Created: 14.12.1995 / 14:50:03 / cg"
   566     "Created: 14.12.1995 / 14:50:03 / cg"
   567 !
   567 !
   568 
   568 
   569 initialize
   569 initialize
       
   570     <resource: #style (#name)>
       
   571 
   570     super initialize.
   572     super initialize.
   571 
   573 
   572     borderWidth := 0.
   574     borderWidth := 0.
   573 
   575 
   574     hLayout := #fixLeftSpace.
   576     hLayout := #fixLeftSpace.
   576 
   578 
   577     toggleView := CheckToggle in:self.
   579     toggleView := CheckToggle in:self.
   578 
   580 
   579     labelView := Label in:self.
   581     labelView := Label in:self.
   580     styleSheet name ~~ #motif ifTrue:[
   582     styleSheet name ~~ #motif ifTrue:[
   581 	labelView label:'check'; borderWidth:0.
   583         labelView label:'check'; borderWidth:0.
   582     ].
   584     ].
   583     labelView forceResize.
   585     labelView forceResize.
   584     labelView adjust:#left.
   586     labelView adjust:#left.
   585     self initialHeight:labelView preferredExtent y + ViewSpacing.
   587     self initialHeight:labelView preferredExtent y + ViewSpacing.
   586 
   588 
   599      b := CheckBox new.
   601      b := CheckBox new.
   600      b label:'foo'.
   602      b label:'foo'.
   601      b open
   603      b open
   602     "
   604     "
   603 
   605 
   604     "Modified: 18.7.1996 / 12:05:10 / cg"
   606     "Modified: 9.1.1997 / 10:56:50 / cg"
   605 ! !
   607 ! !
   606 
   608 
   607 !CheckBox methodsFor:'private'!
   609 !CheckBox methodsFor:'private'!
   608 
   610 
   609 sendChangeMessageWith:aValue
   611 sendChangeMessageWith:aValue
   637 "/    ^ (prefCheck x + prefLabel x + (3 * ViewSpacing)) @ ((prefCheck y max:prefLabel y) + bw2 + 2)
   639 "/    ^ (prefCheck x + prefLabel x + (3 * ViewSpacing)) @ ((prefCheck y max:prefLabel y) + bw2 + 2)
   638 
   640 
   639     "Modified: 19.7.1996 / 20:43:47 / cg"
   641     "Modified: 19.7.1996 / 20:43:47 / cg"
   640 ! !
   642 ! !
   641 
   643 
   642 !CheckBox  class methodsFor:'documentation'!
   644 !CheckBox class methodsFor:'documentation'!
   643 
   645 
   644 version
   646 version
   645     ^ '$Header: /cvs/stx/stx/libwidg2/CheckBox.st,v 1.34 1996-12-16 22:11:54 cg Exp $'
   647     ^ '$Header: /cvs/stx/stx/libwidg2/CheckBox.st,v 1.35 1997-01-09 11:52:16 cg Exp $'
   646 ! !
   648 ! !