class: FramedBox
authorStefan Vogel <sv@exept.de>
Thu, 13 Feb 2014 19:42:34 +0100
changeset 4890 9601eeb529d6
parent 4889 3ee5b37416a1
child 4891 9f33a5a44868
class: FramedBox changed:5 methods access font via message send
FramedBox.st
--- a/FramedBox.st	Thu Feb 13 19:37:39 2014 +0100
+++ b/FramedBox.st	Thu Feb 13 19:42:34 2014 +0100
@@ -280,7 +280,7 @@
              method, which allows specific control over
              normalFont/boldFont/italicFont parameters."
 
-    (font ~= aFont) ifTrue:[
+    (self font ~= aFont) ifTrue:[
         super font:aFont.
         self invalidate
     ]
@@ -574,7 +574,7 @@
     ] ifFalse:[
         label isString ifTrue:[
             l := ' ' , label , ' '.
-            font := font onDevice:device.
+            gc createFontOnDevice.
         ] ifFalse:[
             l := label
         ].
@@ -593,19 +593,19 @@
                 "
                  label at top
                 "
-                y := font ascent + margin.
+                y := gc font ascent + margin.
             ] ifFalse:[
                 "
                  label at bottom
                 "
-                y := height - margin - font descent.
+                y := height - margin - gc font descent.
             ].
             (labelPosition == #topLeft
             or:[labelPosition == #bottomLeft]) ifTrue:[
                 "
                  label at left
                 "
-                x := font height + margin
+                x := gc font height + margin
             ] ifFalse:[
                 (labelPosition == #topRight
                 or:[labelPosition == #bottomRight]) ifTrue:[
@@ -668,8 +668,7 @@
     fgColor := StyleSheet at:'framedBox.foregroundColor' default:Black.
     labelPosition := StyleSheet at:'framedBox.labelPosition' default:#topCenter.
     frame3D := StyleSheet at:'framedBox.3DFrame' default:true.
-    font := StyleSheet at:'framedBox.font' default:(StyleSheet at:'label.font' default:font).
-    font := font onDevice:device.
+    self basicFont:(StyleSheet at:'framedBox.font' default:(StyleSheet at:'label.font' default:self font)).
     self borderWidth:0.
 
     "Modified: / 26.10.1997 / 17:00:57 / cg"
@@ -710,7 +709,7 @@
         ^ preferredExtent
     ].
 
-    sep := font heightOn:device.
+    sep := gc font heightOn:device.
     sep2 := sep + sep.
 
     true "showFrame" ifFalse:[
@@ -727,7 +726,7 @@
 
     |mH mV sepH sepV imH imV lw|
 
-    sepH := sepV := font heightOn:device.
+    sepH := sepV := gc font heightOn:device.
     horizontalSpace notNil ifTrue:[
         sepH := horizontalSpace
     ].
@@ -765,9 +764,10 @@
 !FramedBox class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/FramedBox.st,v 1.54 2010-03-19 12:07:20 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/FramedBox.st,v 1.55 2014-02-13 18:42:34 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg/FramedBox.st,v 1.54 2010-03-19 12:07:20 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/FramedBox.st,v 1.55 2014-02-13 18:42:34 stefan Exp $'
 ! !
+