PullDownMenu.st
changeset 4955 d5ac89b4093d
parent 4710 8a081c228e90
child 4959 76b3fff9c9bb
--- a/PullDownMenu.st	Wed Mar 19 11:04:19 2014 +0100
+++ b/PullDownMenu.st	Wed Mar 19 11:04:23 2014 +0100
@@ -645,7 +645,7 @@
         |e|
 
         entry isImage ifTrue:[
-            e := entry onDevice:device
+            e := entry onDevice:self graphicsDevice
         ] ifFalse:[
             e := entry printString
         ].
@@ -820,7 +820,7 @@
      You should not use this method; instead leave the value as
      defined in the styleSheet."
 
-    bgColor := aColor onDevice:device
+    bgColor := aColor onDevice:self graphicsDevice
 !
 
 font:aFont
@@ -834,7 +834,7 @@
              normalFont/boldFont/italicFont parameters."
 
     aFont ~~ font ifTrue:[
-        super font:(aFont onDevice:device).
+        super font:(aFont onDevice:self graphicsDevice).
         self height:(font height + (font descent * 2)).
         shown ifTrue:[
             self setMenuOrigins
@@ -849,7 +849,7 @@
      You should not use this method; instead leave the value as
      defined in the styleSheet."
 
-    fgColor := aColor onDevice:device
+    fgColor := aColor onDevice:self graphicsDevice
 !
 
 showSeparatingLines:aBoolean
@@ -954,8 +954,8 @@
         stringOrImage isImageOrForm ifTrue:[
             stringOrImage depth == 1 ifTrue:[
                 (map := stringOrImage colorMap) notNil ifTrue:[
-                    map at:1 put:((map at:1) onDevice:device).
-                    map at:2 put:((map at:2) onDevice:device).
+                    map at:1 put:((map at:1) onDevice:self graphicsDevice).
+                    map at:2 put:((map at:2) onDevice:self graphicsDevice).
 
                     self paint:(map at:2) on:(map at:1).
                     self displayOpaqueForm:stringOrImage x:x y:y.
@@ -1431,11 +1431,11 @@
 
     super fetchDeviceResources.
 
-    bgColor notNil ifTrue:[bgColor := bgColor onDevice:device].
-    fgColor notNil ifTrue:[fgColor := fgColor onDevice:device].
+    bgColor notNil ifTrue:[bgColor := bgColor onDevice:self graphicsDevice].
+    fgColor notNil ifTrue:[fgColor := fgColor onDevice:self graphicsDevice].
 
-    activeBgColor notNil ifTrue:[activeBgColor := activeBgColor onDevice:device].
-    activeFgColor notNil ifTrue:[activeFgColor := activeFgColor onDevice:device].
+    activeBgColor notNil ifTrue:[activeBgColor := activeBgColor onDevice:self graphicsDevice].
+    activeFgColor notNil ifTrue:[activeFgColor := activeFgColor onDevice:self graphicsDevice].
 
     "Created: 13.1.1997 / 23:25:14 / cg"
 !
@@ -1459,7 +1459,7 @@
 
     showSeparatingLines := DefaultSeparatingLines. "/ false.
     DefaultViewBackground notNil ifTrue:[
-        viewBackground := DefaultViewBackground onDevice:device
+        viewBackground := DefaultViewBackground onDevice:self graphicsDevice
     ].
 
     DefaultForegroundColor notNil ifTrue:[
@@ -1476,12 +1476,12 @@
     offLevel := DefaultLevel.
 
     self is3D ifTrue:[
-        device hasColors ifTrue:[
+        self graphicsDevice hasColors ifTrue:[
             activeFgColor := Color name:'yellow'
         ] ifFalse:[
             activeFgColor := White
         ].
-        device hasGrayscales ifTrue:[
+        self graphicsDevice hasGrayscales ifTrue:[
             activeBgColor := bgColor.
         ] ifFalse:[
             activeBgColor := fgColor.
@@ -1529,7 +1529,7 @@
 initialize
     super initialize.
 
-    font := font onDevice:device.
+    font := font onDevice:self graphicsDevice.
     self origin:(0.0 @ 0.0)
          extent:(1.0 @ self preferredHeight)
 "/         extent:(1.0 @ (font height + (font descent * 2)  + topMargin)).
@@ -1633,16 +1633,16 @@
 setMenuOrigins
     "adjust origins of menus when font changes"
 
-    (font graphicsDevice == device) ifTrue:[
-	menus notNil ifTrue:[
-	    menus keysAndValuesDo:[:index :aMenu |
-		aMenu notNil ifTrue:[
-		    aMenu origin:((left + (self titleLenUpTo:index)) 
-				  @
-				  (height + aMenu borderWidth))
-		].
-	    ]
-	]
+    (font graphicsDevice == self graphicsDevice) ifTrue:[
+        menus notNil ifTrue:[
+            menus keysAndValuesDo:[:index :aMenu |
+                aMenu notNil ifTrue:[
+                    aMenu origin:((left + (self titleLenUpTo:index)) 
+                                  @
+                                  (height + aMenu borderWidth))
+                ].
+            ]
+        ]
     ]
 
     "Modified: 5.7.1996 / 17:55:08 / cg"
@@ -1814,10 +1814,10 @@
 !PullDownMenu class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/PullDownMenu.st,v 1.108 2013-08-31 17:19:38 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/PullDownMenu.st,v 1.109 2014-03-19 10:04:23 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg/PullDownMenu.st,v 1.108 2013-08-31 17:19:38 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/PullDownMenu.st,v 1.109 2014-03-19 10:04:23 stefan Exp $'
 ! !