no label, if motif style
authorClaus Gittinger <cg@exept.de>
Sun, 26 May 1996 11:45:46 +0200
changeset 188 3649c62aad46
parent 187 36e76da4bb4e
child 189 62771f258ef8
no label, if motif style
CheckBox.st
--- a/CheckBox.st	Fri May 24 18:46:50 1996 +0200
+++ b/CheckBox.st	Sun May 26 11:45:46 1996 +0200
@@ -56,6 +56,15 @@
 
 examples
 "
+  no-op checkBox without a label:
+                                                                        [exBegin]
+     |b|
+
+     b := CheckBox new.
+     b open
+                                                                        [exEnd]
+
+
   no-op checkBox:
                                                                         [exBegin]
      |b|
@@ -548,7 +557,9 @@
     toggleView := CheckToggle in:self.
 
     labelView := Label in:self.
-    labelView label:'check'; borderWidth:0.
+    styleSheet name ~~ #motif ifTrue:[
+        labelView label:'check'; borderWidth:0.
+    ].
     labelView forceResize.
     labelView adjust:#left.
     self height:labelView preferredExtent y + ViewSpacing.
@@ -565,6 +576,8 @@
      b label:'foo'.
      b open
     "
+
+    "Modified: 24.5.1996 / 15:17:35 / cg"
 ! !
 
 !CheckBox methodsFor:'private'!
@@ -583,6 +596,9 @@
 
     |prefCheck prefLabel bw2|
 
+    labelView label isEmpty ifTrue:[
+        ^ super preferredExtent
+    ].
     ^ super preferredExtent + (10@0).
 
 "/    prefCheck := toggleView preferredExtent.
@@ -590,11 +606,11 @@
 "/    bw2 := borderWidth * 2.
 "/    ^ (prefCheck x + prefLabel x + (3 * ViewSpacing)) @ ((prefCheck y max:prefLabel y) + bw2 + 2)
 
-    "Modified: 25.4.1996 / 16:34:42 / cg"
+    "Modified: 24.5.1996 / 15:18:27 / cg"
 ! !
 
 !CheckBox class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/CheckBox.st,v 1.25 1996-05-22 11:17:51 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/CheckBox.st,v 1.26 1996-05-26 09:45:46 cg Exp $'
 ! !