MenuPanel.st
changeset 1478 38f08dec8e34
parent 1475 2eebc866712e
child 1499 07951b17b43e
--- a/MenuPanel.st	Wed Aug 18 16:35:51 1999 +0200
+++ b/MenuPanel.st	Wed Aug 18 16:41:24 1999 +0200
@@ -985,10 +985,10 @@
      use this method; instead leave the value as defined in the styleSheet.
     "
     activeBgColor ~~ aColor ifTrue:[
-	activeBgColor := aColor on:device.
-	shown ifTrue:[
-	    self invalidate "/ RepairNow:true
-	]
+        activeBgColor := aColor onDevice:device.
+        shown ifTrue:[
+            self invalidate "/ RepairNow:true
+        ]
     ]
 
     "Modified: / 6.6.1998 / 19:49:46 / cg"
@@ -1005,10 +1005,10 @@
      use this method; instead leave the value as defined in the styleSheet.
     "
     activeFgColor ~~ aColor ifTrue:[
-	activeFgColor := aColor on:device.
-	shown ifTrue:[
-	    self invalidate "/ RepairNow:true
-	]
+        activeFgColor := aColor onDevice:device.
+        shown ifTrue:[
+            self invalidate "/ RepairNow:true
+        ]
     ]
 
     "Modified: / 6.6.1998 / 19:50:01 / cg"
@@ -1105,10 +1105,10 @@
      use this method; instead leave the value as defined in the styleSheet.
     "
     disabledFgColor ~~ aColor ifTrue:[
-	disabledFgColor := aColor on:device.
-	shown ifTrue:[
-	    self invalidate "/ RepairNow:true
-	]
+        disabledFgColor := aColor onDevice:device.
+        shown ifTrue:[
+            self invalidate "/ RepairNow:true
+        ]
     ].
 
     "Modified: / 6.6.1998 / 19:50:17 / cg"
@@ -1118,12 +1118,12 @@
     "set the font
     "
     (aFont notNil and:[aFont ~= font]) ifTrue:[
-	super font:(aFont on:device).
-
-	superMenu notNil ifTrue:[
-	    self extent:(self preferredExtent)
-	].
-	self mustRearrange.
+        super font:(aFont onDevice:device).
+
+        superMenu notNil ifTrue:[
+            self extent:(self preferredExtent)
+        ].
+        self mustRearrange.
     ]
 !
 
@@ -1140,10 +1140,10 @@
      instead leave the value as defined in the styleSheet.
     "
     fgColor ~~ aColor ifTrue:[
-	fgColor := aColor on:device.
-	shown ifTrue:[
-	    self invalidate "/ RepairNow:true
-	]
+        fgColor := aColor onDevice:device.
+        shown ifTrue:[
+            self invalidate "/ RepairNow:true
+        ]
     ]
 
     "Modified: / 6.6.1998 / 19:50:46 / cg"
@@ -1827,111 +1827,111 @@
 
 "/  fetch font from superMenu
     (superMenu notNil and:[(f := superMenu font) ~~ font]) ifTrue:[
-	super font:(f on:device)
+        super font:(f onDevice:device)
     ].
     (noItems := items size) == 0 ifTrue:[
-	mustRearrange := false.
+        mustRearrange := false.
       ^ self
     ].
     expLast  := false.
     isVert   := self verticalLayout.
 
     self hasGroupDividers ifTrue:[
-	self isFitPanel ifFalse:[
-	    grpDivSz := groupDividerSize
-	] ifTrue:[
-	    expLast := true.
-	    x := margin.
-	    e := self computeExtent.
-
-	    isVert ifTrue:[
-		items do:[:el | x := x + el preferredExtent y].
-		y := e y.
-	    ] ifFalse:[
-		items do:[:el|x := x + el preferredExtent x].
-		y := e x.
-	    ].
-	    x := x + (noItems + 1 * itemSpace).
-
-	    (grpDivSz := (y - x) // (groupSizes size)) <= 0 ifTrue:[
-		grpDivSz := nil
-	    ].
-	    x > (width-margin) ifTrue:[
-		grpDivSz := nil
-	    ]
-	]
+        self isFitPanel ifFalse:[
+            grpDivSz := groupDividerSize
+        ] ifTrue:[
+            expLast := true.
+            x := margin.
+            e := self computeExtent.
+
+            isVert ifTrue:[
+                items do:[:el | x := x + el preferredExtent y].
+                y := e y.
+            ] ifFalse:[
+                items do:[:el|x := x + el preferredExtent x].
+                y := e x.
+            ].
+            x := x + (noItems + 1 * itemSpace).
+
+            (grpDivSz := (y - x) // (groupSizes size)) <= 0 ifTrue:[
+                grpDivSz := nil
+            ].
+            x > (width-margin) ifTrue:[
+                grpDivSz := nil
+            ]
+        ]
     ].
 
     (self isPopUpView or:[explicitExtent ~~ true]) ifTrue:[
-	e := self preferredExtent copy.
-
-	self isPopUpView ifFalse:[
-	    isVert ifTrue:[e y:1.0]
-		  ifFalse:[e x:1.0]
-	].
-	self extent:e
+        e := self preferredExtent copy.
+
+        self isPopUpView ifFalse:[
+            isVert ifTrue:[e y:1.0]
+                  ifFalse:[e x:1.0]
+        ].
+        self extent:e
     ] ifFalse:[
-	e := self computeExtent
+        e := self computeExtent
     ].
 
     x := y := margin.
 
     isVert ifTrue:[y := y + itemSpace]
-	  ifFalse:[x := x + itemSpace].
+          ifFalse:[x := x + itemSpace].
 
     self keysAndValuesDo:[:anIndex :el| |org corn elPref|
-	el isVisible ifTrue:[
-	    el isButton ifTrue:[
-		org := Point x:(x+DefaultButtonItemSpace) y:(y+DefaultButtonItemSpace).
-	    ] ifFalse:[
-		org := Point x:x y:y.
-	    ].
-	    elPref := el preferredExtent.
-	    isVert ifTrue:[
-		y := y + elPref y.
-		corn := (e x - margin @ y).
-		el isButton ifTrue:[
-		    corn := corn - (DefaultButtonItemSpace @ 0).
-		    el layout:(Rectangle origin:org corner:corn).
-		    y := y + (2 * DefaultButtonItemSpace).
-		] ifFalse:[
-		    el layout:(Rectangle origin:org corner:corn).
-		].
-		y := y + itemSpace.
-	    ] ifFalse:[
-		x := x + elPref x.
-		el isButton ifTrue:[
-		    x := x + DefaultButtonItemSpace.
-		    corn := (x @ (e y - margin)).
-		    corn := corn - (0 @ DefaultButtonItemSpace).
-		    el layout:(Rectangle origin:org corner:corn).
-		    x := x + DefaultButtonItemSpace.
-		] ifFalse:[
-		    corn := (x @ e y).
-		    el layout:(Rectangle origin:org corner:corn).
-		].
-		x := x + itemSpace.
-	    ].
-
-	    (grpDivSz notNil and:[self hasGroupDividerAt:anIndex]) ifTrue:[
-		isVert ifTrue:[y := y + grpDivSz]
-		      ifFalse:[x := x + grpDivSz]
-	    ]
-	] ifFalse:[
-	    org := Point x:x y:y.
-	    el layout:(Rectangle origin:org corner:org)
-	]
+        el isVisible ifTrue:[
+            el isButton ifTrue:[
+                org := Point x:(x+DefaultButtonItemSpace) y:(y+DefaultButtonItemSpace).
+            ] ifFalse:[
+                org := Point x:x y:y.
+            ].
+            elPref := el preferredExtent.
+            isVert ifTrue:[
+                y := y + elPref y.
+                corn := (e x - margin @ y).
+                el isButton ifTrue:[
+                    corn := corn - (DefaultButtonItemSpace @ 0).
+                    el layout:(Rectangle origin:org corner:corn).
+                    y := y + (2 * DefaultButtonItemSpace).
+                ] ifFalse:[
+                    el layout:(Rectangle origin:org corner:corn).
+                ].
+                y := y + itemSpace.
+            ] ifFalse:[
+                x := x + elPref x.
+                el isButton ifTrue:[
+                    x := x + DefaultButtonItemSpace.
+                    corn := (x @ (e y - margin)).
+                    corn := corn - (0 @ DefaultButtonItemSpace).
+                    el layout:(Rectangle origin:org corner:corn).
+                    x := x + DefaultButtonItemSpace.
+                ] ifFalse:[
+                    corn := (x @ e y).
+                    el layout:(Rectangle origin:org corner:corn).
+                ].
+                x := x + itemSpace.
+            ].
+
+            (grpDivSz notNil and:[self hasGroupDividerAt:anIndex]) ifTrue:[
+                isVert ifTrue:[y := y + grpDivSz]
+                      ifFalse:[x := x + grpDivSz]
+            ]
+        ] ifFalse:[
+            org := Point x:x y:y.
+            el layout:(Rectangle origin:org corner:org)
+        ]
     ].
 
     expLast ifTrue:[
-	e := items last.
-
-	e isVisible ifTrue:[
-	    layout := items last layout.
-
-	    isVert ifTrue:[layout bottom:((self extent y) + 1)]
-		  ifFalse:[layout  right:((self extent x) + 1)].
-	]
+        e := items last.
+
+        e isVisible ifTrue:[
+            layout := items last layout.
+
+            isVert ifTrue:[layout bottom:((self extent y) + 1)]
+                  ifFalse:[layout  right:((self extent x) + 1)].
+        ]
     ].
     self rearrangeGroups.
     mustRearrange := false.
@@ -5426,6 +5426,6 @@
 !MenuPanel class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/MenuPanel.st,v 1.173 1999-08-17 14:57:34 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/MenuPanel.st,v 1.174 1999-08-18 14:41:24 cg Exp $'
 ! !
 MenuPanel initialize!