#UI_ENHANCEMENT by cg
authorClaus Gittinger <cg@exept.de>
Wed, 27 Mar 2019 22:58:38 +0100
changeset 6569 d3ef04c096f6
parent 6568 327aa6e0a885
child 6570 32fbafd67a49
#UI_ENHANCEMENT by cg class: DialogBox remember last extent reopen with this size (same as done in AppModel) added: #defaultExtent #hide changed: #computePreferredExtent #doAccept
DialogBox.st
--- a/DialogBox.st	Wed Mar 27 22:36:49 2019 +0100
+++ b/DialogBox.st	Wed Mar 27 22:58:38 2019 +0100
@@ -10363,6 +10363,21 @@
 
 !DialogBox methodsFor:'initialization & release'!
 
+defaultExtent
+    "redefined to return my last extent
+     as default for the open"
+
+    |last|
+
+    (last := ApplicationModel defaultExtentFor:self class) notNil ifTrue:[
+        needResize := false.
+        ^ last
+    ].    
+    ^ super defaultExtent.
+
+    "Created: / 27-03-2019 / 22:45:34 / Claus Gittinger"
+!
+
 initialize
     <modifier: #super> "must be called if redefined"
 
@@ -10872,10 +10887,11 @@
 "/    h := ViewSpacing
 "/         + p y
 "/         + ViewSpacing.
-"/
+
     ^ w @ h
 
     "Created: / 09-11-2018 / 19:50:59 / Claus Gittinger"
+    "Modified (comment): / 27-03-2019 / 22:56:58 / Claus Gittinger"
 !
 
 interfaceSpecFor:aSelector
@@ -11004,9 +11020,21 @@
             ]
         ].
     ].
+
     acceptValue value:true.
 
-    "Modified: 4.3.1996 / 12:14:56 / cg"
+    "Modified: / 04-03-1996 / 12:14:56 / cg"
+    "Modified: / 27-03-2019 / 22:44:02 / Claus Gittinger"
+!
+
+hide
+    "redefined to remember my last extent;
+     used as default for the next open"
+     
+    ApplicationModel rememberLastExtentOf:self for:self class.
+    super hide
+
+    "Created: / 27-03-2019 / 22:44:32 / Claus Gittinger"
 !
 
 keyPress:aKey x:x y:y