#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Tue, 26 Feb 2019 15:42:42 +0100
changeset 23777 c1a7bebf28ab
parent 23776 8ab5e2adcf65
child 23778 971693ebe429
#FEATURE by cg class: Warning an optional title (for alert boxes) class definition added: #title: comment/format in: #optionalTitle: changed: #showWarnDialog
Warning.st
--- a/Warning.st	Tue Feb 26 14:02:32 2019 +0100
+++ b/Warning.st	Tue Feb 26 15:42:42 2019 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1999 by eXept Software AG
               All Rights Reserved
@@ -14,7 +16,7 @@
 "{ NameSpace: Smalltalk }"
 
 UserNotification subclass:#Warning
-	instanceVariableNames:''
+	instanceVariableNames:'optionalTitle'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Kernel-Exceptions'
@@ -120,6 +122,16 @@
 ! !
 
 
+!Warning methodsFor:'accessing'!
+
+title:aWarnBoxWindowTitle
+    "an optional title for the warn box"
+    
+    optionalTitle := aWarnBoxWindowTitle.
+
+    "Created: / 26-02-2019 / 15:41:47 / Claus Gittinger"
+! !
+
 !Warning methodsFor:'default actions'!
 
 defaultAction
@@ -143,7 +155,11 @@
     text := self description.
 
     self hasDialog ifTrue:[
-        Dialog warn:text.
+        optionalTitle notNil ifTrue:[
+            Dialog warn:text title:optionalTitle
+        ] ifFalse:[    
+            Dialog warn:text.
+        ].
     ] ifFalse:[
         "
          on systems without GUI, simply show
@@ -154,9 +170,11 @@
 
     "
       Warning raiseRequestErrorString:' abc'
+      (Warning new title:'Alert') raiseRequestErrorString:' abc'
     "
 
-    "Modified: / 3.8.1999 / 14:06:41 / stefan"
+    "Modified: / 03-08-1999 / 14:06:41 / stefan"
+    "Modified (comment): / 26-02-2019 / 15:41:34 / Claus Gittinger"
 ! !
 
 !Warning class methodsFor:'documentation'!