#TUNING by cg
class: PullDownMenu
changed:
#drawTitle:x:selected:
#redraw
draw by sending messages to gc instead of self.
(new GC structure)
--- a/PullDownMenu.st Tue Jan 24 23:14:59 2017 +0100
+++ b/PullDownMenu.st Tue Jan 24 23:16:12 2017 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
"
COPYRIGHT (c) 1989 by Claus Gittinger
All Rights Reserved
@@ -946,8 +944,8 @@
].
w := w + (wSpace * 2).
- self paint:bg.
- self fillRectangleX:x y:0 width:w height:height.
+ gc paint:bg.
+ gc fillRectangleX:x y:0 width:w height:height.
self is3D ifTrue:[
self drawEdgesForX:x y:0
@@ -955,10 +953,10 @@
height:height
level:(selected ifTrue:[onLevel] ifFalse:[offLevel])
].
- self paint:fg on:bg.
+ gc paint:fg on:bg.
x := x + wSpace.
stringOrImage isString ifTrue:[
- self displayOpaqueString:stringOrImage x:x y:y
+ gc displayOpaqueString:stringOrImage x:x y:y
] ifFalse:[
stringOrImage isImageOrForm ifTrue:[
stringOrImage depth == 1 ifTrue:[
@@ -966,12 +964,12 @@
map at:1 put:((map at:1) onDevice:device).
map at:2 put:((map at:2) onDevice:device).
- self paint:(map at:2) on:(map at:1).
- self displayOpaqueForm:stringOrImage x:x y:y.
+ gc paint:(map at:2) on:(map at:1).
+ gc displayOpaqueForm:stringOrImage x:x y:y.
^ self
]
].
- self displayForm:stringOrImage x:x y:y
+ gc displayForm:stringOrImage x:x y:y
] ifFalse:[
stringOrImage displayOn:self x:x y:y
]
@@ -1009,15 +1007,15 @@
x := x + wSpace + wSpace.
showSeparatingLines ifTrue:[
self is3D ifTrue:[
- self paint:shadowColor.
- self displayLineFromX:x y:0 toX:x y:y.
+ gc paint:shadowColor.
+ gc displayLineFromX:x y:0 toX:x y:y.
x := x + 1.
clr := lightColor.
] ifFalse:[
clr := fgColor.
].
- self paint:clr.
- self displayLineFromX:x y:0 toX:x y:y.
+ gc paint:clr.
+ gc displayLineFromX:x y:0 toX:x y:y.
x := x + 1
].
index := index + 1