dont offer special-character display in menu, if its not available.
authorClaus Gittinger <cg@exept.de>
Wed, 11 Oct 2006 21:51:43 +0200
changeset 3405 9a03bc64e285
parent 3404 7c42d37d18ea
child 3406 c5efa51e7929
dont offer special-character display in menu, if its not available.
FontPanel.st
--- a/FontPanel.st	Wed Oct 11 21:49:01 2006 +0200
+++ b/FontPanel.st	Wed Oct 11 21:51:43 2006 +0200
@@ -9,9 +9,6 @@
  other person.  No title to or ownership of the software is
  hereby transferred.
 "
-
-
-
 "{ Package: 'stx:libwidg' }"
 
 DialogBox subclass:#FontPanel
@@ -250,15 +247,17 @@
             label: 'Show Character Set'
             itemValue: previewShowCharacterSet
             translateLabel: true
+            isVisible: characterSetViewClassAvailable
           )
          (MenuItem
             label: 'Show Character Set (Using xfd)'
             itemValue: previewShowCharacterSetUsingXFD
             translateLabel: true
-            isVisible: false
+            isVisible: osIsUNIX
           )
          (MenuItem
             label: '-'
+            isVisible: characterSetViewClassAvailableOrOSIsUNIX
           )
          (MenuItem
             label: 'Inspect Font'
@@ -269,6 +268,8 @@
         nil
         nil
       )
+
+    "Modified: / 11-10-2006 / 21:51:02 / cg"
 ! !
 
 !FontPanel class methodsFor:'startup'!
@@ -613,14 +614,12 @@
 
     |menu|
 
-    menu :=  Menu new fromLiteralArrayEncoding:self class previewMenu.
+    menu :=  Menu new fromLiteralArrayEncoding:(self class previewMenu).
     menu findGuiResourcesIn:self.
     menu receiver:self.
+    ^ menu
 
-    OperatingSystem isUNIXlike ifTrue:[
-        (menu menuItemWithValue:#previewShowCharacterSetUsingXFD) isVisible: true
-    ].
-    ^ menu
+    "Modified: / 11-10-2006 / 21:30:57 / cg"
 ! !
 
 !FontPanel methodsFor:'private'!
@@ -756,6 +755,24 @@
 
 !FontPanel methodsFor:'queries'!
 
+characterSetViewClassAvailable
+    ^ CharacterSetView notNil
+
+    "Created: / 11-10-2006 / 21:27:51 / cg"
+!
+
+characterSetViewClassAvailableOrOSIsUNIX
+    ^ self characterSetViewClassAvailable or:[self osIsUNIX]
+
+    "Created: / 11-10-2006 / 21:29:20 / cg"
+!
+
+osIsUNIX
+    ^ OperatingSystem isUNIXlike
+
+    "Modified: / 11-10-2006 / 21:28:59 / cg"
+!
+
 preferredExtent
     "return the boxes preferredExtent"
 
@@ -953,5 +970,5 @@
 !FontPanel class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/FontPanel.st,v 1.87 2006-03-06 08:55:35 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/FontPanel.st,v 1.88 2006-10-11 19:51:43 cg Exp $'
 ! !