allow either image or imageFileName to be specified
authorClaus Gittinger <cg@exept.de>
Tue, 01 Apr 1997 14:54:41 +0200
changeset 1173 86440dfaca06
parent 1172 d10e4627b0e3
child 1174 556e32f9e6e3
allow either image or imageFileName to be specified in styleSheet;
WarnBox.st
WarningBox.st
YesNoBox.st
--- a/WarnBox.st	Tue Apr 01 14:54:08 1997 +0200
+++ b/WarnBox.st	Tue Apr 01 14:54:41 1997 +0200
@@ -138,11 +138,21 @@
      This is the default image; you can overwrite this in a concrete
      instance with the image: message"
 
+    <resource: #style (#warningBoxIcon #warningBoxIconFile)>
+
+    |img imgFileName|
+
     WarnBitmap isNil ifTrue:[
-	WarnBitmap := Image fromFile:'bitmaps/Warning.xbm'.
-	WarnBitmap notNil ifTrue:[
-	    WarnBitmap := WarnBitmap on:Display
-	]
+        img := StyleSheet at:'warningBoxIcon'.
+        img notNil ifTrue:[
+            WarnBitmap := img
+        ] ifFalse:[
+            imgFileName := StyleSheet at:'warningBoxIconFile' default:'bitmaps/Warning.xbm'.
+            WarnBitmap := Image fromFile:imgFileName.
+        ].
+        WarnBitmap notNil ifTrue:[
+            WarnBitmap := WarnBitmap on:Display
+        ]
     ].
     ^ WarnBitmap
 
@@ -164,21 +174,18 @@
     "
 
     "Created: 17.11.1995 / 18:16:47 / cg"
+    "Modified: 1.4.1997 / 14:28:07 / cg"
 ! !
 
 !WarningBox class methodsFor:'styles'!
 
 updateStyleCache
-    "extract values from the styleSheet and cache them in class variables"
-
-    <resource: #style (#warningBoxIcon)>
+    "extract values from the styleSheet and cache them in class variables.
+     Here, the cached infoBitmap is simply flushed."
 
-    |img|
+    WarnBitmap := nil
 
-    img := StyleSheet at:'warningBoxIcon'.
-    img notNil ifTrue:[WarnBitmap := img on:Display].
-
-    "Modified: 1.3.1996 / 13:51:43 / cg"
+    "Modified: 1.4.1997 / 14:44:59 / cg"
 ! !
 
 !WarningBox methodsFor:'initialization'!
@@ -206,5 +213,5 @@
 !WarningBox class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Attic/WarnBox.st,v 1.20 1996-05-28 14:59:43 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Attic/WarnBox.st,v 1.21 1997-04-01 12:54:23 cg Exp $'
 ! !
--- a/WarningBox.st	Tue Apr 01 14:54:08 1997 +0200
+++ b/WarningBox.st	Tue Apr 01 14:54:41 1997 +0200
@@ -138,11 +138,21 @@
      This is the default image; you can overwrite this in a concrete
      instance with the image: message"
 
+    <resource: #style (#warningBoxIcon #warningBoxIconFile)>
+
+    |img imgFileName|
+
     WarnBitmap isNil ifTrue:[
-	WarnBitmap := Image fromFile:'bitmaps/Warning.xbm'.
-	WarnBitmap notNil ifTrue:[
-	    WarnBitmap := WarnBitmap on:Display
-	]
+        img := StyleSheet at:'warningBoxIcon'.
+        img notNil ifTrue:[
+            WarnBitmap := img
+        ] ifFalse:[
+            imgFileName := StyleSheet at:'warningBoxIconFile' default:'bitmaps/Warning.xbm'.
+            WarnBitmap := Image fromFile:imgFileName.
+        ].
+        WarnBitmap notNil ifTrue:[
+            WarnBitmap := WarnBitmap on:Display
+        ]
     ].
     ^ WarnBitmap
 
@@ -164,21 +174,18 @@
     "
 
     "Created: 17.11.1995 / 18:16:47 / cg"
+    "Modified: 1.4.1997 / 14:28:07 / cg"
 ! !
 
 !WarningBox class methodsFor:'styles'!
 
 updateStyleCache
-    "extract values from the styleSheet and cache them in class variables"
-
-    <resource: #style (#warningBoxIcon)>
+    "extract values from the styleSheet and cache them in class variables.
+     Here, the cached infoBitmap is simply flushed."
 
-    |img|
+    WarnBitmap := nil
 
-    img := StyleSheet at:'warningBoxIcon'.
-    img notNil ifTrue:[WarnBitmap := img on:Display].
-
-    "Modified: 1.3.1996 / 13:51:43 / cg"
+    "Modified: 1.4.1997 / 14:44:59 / cg"
 ! !
 
 !WarningBox methodsFor:'initialization'!
@@ -206,5 +213,5 @@
 !WarningBox class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/WarningBox.st,v 1.20 1996-05-28 14:59:43 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/WarningBox.st,v 1.21 1997-04-01 12:54:23 cg Exp $'
 ! !
--- a/YesNoBox.st	Tue Apr 01 14:54:08 1997 +0200
+++ b/YesNoBox.st	Tue Apr 01 14:54:41 1997 +0200
@@ -162,38 +162,41 @@
 !YesNoBox class methodsFor:'icon bitmap'!
 
 iconBitmap
-    "return the bitmap shown as icon in my instances"
+    "return the bitmap shown as icon in my instances.
+     This is the default image; you can overwrite this in a concrete
+     instance with the image: message"
 
-    |img|
+    <resource: #style (#requestBoxIcon #requestBoxIconFile)>
+
+    |img imgFileName|
 
     RequestBitmap isNil ifTrue:[
-        img := Image fromFile:'bitmaps/Request.xbm'. 
+        img := StyleSheet at:'requestBoxIcon'.
         img notNil ifTrue:[
-            RequestBitmap := img on:Display 
+            RequestBitmap := img
+        ] ifFalse:[
+            imgFileName := StyleSheet at:'requestBoxIconFile' default:'bitmaps/Request.xbm'.
+            RequestBitmap := Image fromFile:imgFileName.
         ].
+        RequestBitmap notNil ifTrue:[
+            RequestBitmap := RequestBitmap on:Display
+        ]
     ].
     ^ RequestBitmap
 
-    "Modified: 15.2.1997 / 15:01:56 / cg"
+    "Created: 17.11.1995 / 18:16:47 / cg"
+    "Modified: 1.4.1997 / 14:50:35 / cg"
 ! !
 
 !YesNoBox class methodsFor:'styles'!
 
 updateStyleCache
-    "extract values from the styleSheet and cache them in class variables"
-
-    <resource: #style (#requestBoxIcon)>
-
-    |img|
+    "extract values from the styleSheet and cache them in class variables.
+     Here, the cached infoBitmap is simply flushed."
 
-    img := StyleSheet at:'requestBoxIcon'.
-    img notNil ifTrue:[
-        RequestBitmap := img on:Display
-    ] ifFalse:[
-        RequestBitmap := nil
-    ].
+    RequestBitmap := nil
 
-    "Modified: 15.2.1997 / 15:01:09 / cg"
+    "Modified: 1.4.1997 / 14:51:30 / cg"
 ! !
 
 !YesNoBox methodsFor:'accessing'!
@@ -419,5 +422,5 @@
 !YesNoBox class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/YesNoBox.st,v 1.36 1997-01-16 10:33:29 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/YesNoBox.st,v 1.37 1997-04-01 12:54:41 cg Exp $'
 ! !