fontPanels actionblock passes a fontDescription
authorClaus Gittinger <cg@exept.de>
Thu, 10 Apr 1997 10:01:44 +0200
changeset 102 6fa9c1f05564
parent 101 8d674e606a94
child 103 139c7537c6b6
fontPanels actionblock passes a fontDescription
UIPainterView.st
--- a/UIPainterView.st	Tue Apr 08 20:19:05 1997 +0200
+++ b/UIPainterView.st	Thu Apr 10 10:01:44 1997 +0200
@@ -829,20 +829,23 @@
 !
 
 showFontPanel
-    |action|
+    |action theFont|
 
     fontPanel isNil ifTrue:[
-	fontPanel := FontPanel new 
+        fontPanel := FontPanel new 
     ].
 
     selection notNil ifTrue:[
-	action := [:family :face :style :size |
-		       self changeFontFamily:family face:face
-				       style:style size:size
-		  ].
-	fontPanel action:action.
-	fontPanel showAtPointer
+        action := [:aFontDescription | theFont := aFontDescription].
+        fontPanel action:action.
+        fontPanel showAtPointer.
+        fontPanel destroy.
+        theFont notNil ifTrue:[
+            self changeFont:theFont
+        ]
     ]
+
+    "Modified: 10.4.1997 / 09:55:43 / cg"
 !
 
 subMenuAlign
@@ -995,6 +998,29 @@
 
 !UIPainterView methodsFor:'misc'!
 
+changeFont:aFontDescription
+    |f|
+
+    f := aFontDescription onDevice:device.
+"/    f := Font family:family
+"/                face:face
+"/               style:style
+"/                size:size.
+
+    f notNil ifTrue:[
+        self withSelectionHiddenDo:[
+            self selectionDo:[:aView |
+                aView font:f.
+                self elementChangedSize:aView.
+            ]
+        ].
+        self changed:#any.
+    ]
+
+    "Modified: 5.9.1995 / 12:13:27 / claus"
+    "Created: 10.4.1997 / 09:56:16 / cg"
+!
+
 changeFontFamily:family face:face style:style size:size
     |f|