allow redefinition of used CheckToggle class
authorca
Wed, 28 Nov 2007 15:43:10 +0100
changeset 3287 0022d5b3949b
parent 3286 91e2e2399b81
child 3288 9ca1e4eb9044
allow redefinition of used CheckToggle class
CheckBox.st
--- a/CheckBox.st	Wed Nov 28 15:07:15 2007 +0100
+++ b/CheckBox.st	Wed Nov 28 15:43:10 2007 +0100
@@ -9,8 +9,6 @@
  other person.  No title to or ownership of the software is
  hereby transferred.
 "
-
-
 "{ Package: 'stx:libwidg2' }"
 
 HorizontalPanelView subclass:#CheckBox
@@ -492,7 +490,7 @@
     "set backgroundColor"
 
     labelView backgroundColor: backgroundColor.
-    super viewBackground: backgroundColor
+    super viewBackground: backgroundColor.
 ! !
 
 !CheckBox methodsFor:'accessing-components'!
@@ -745,6 +743,10 @@
 
 !CheckBox methodsFor:'initialization & release'!
 
+defaultCheckToggleClass
+    ^ CheckToggle
+!
+
 defaultControllerClass
     ^ ToggleController
 
@@ -773,16 +775,19 @@
 initialize
     <resource: #style (#name)>
 
+    |checkToggleClass|
+
     super initialize.
 
     borderWidth := 0.
+    checkToggleClass := self defaultCheckToggleClass.
 
     hLayout := #fixLeftSpace.
     vLayout := #center.
 
     CheckToggleLeft ~~ false ifTrue:[
         "/ toggle first ...
-        toggleView := CheckToggle in:self.
+        toggleView := checkToggleClass in:self.
     ].
 
     labelView := CheckLabel in:self.
@@ -796,7 +801,7 @@
 
     CheckToggleLeft == false ifTrue:[
         "/ toggle last ...
-        toggleView := CheckToggle in:self.
+        toggleView := checkToggleClass in:self.
     ].
 
     (StyleSheet at:'checkBoxStyle' default:StyleSheet name) == #motif ifTrue:[
@@ -922,5 +927,5 @@
 !CheckBox class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/CheckBox.st,v 1.75 2005-12-21 11:34:46 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/CheckBox.st,v 1.76 2007-11-28 14:43:10 ca Exp $'
 ! !