dont shrink smaller than min-extent
authorclaus
Fri, 12 Aug 1994 01:46:28 +0200
changeset 43 2375d30c645b
parent 42 2904f8679ede
child 44 f5e3a267fe4e
dont shrink smaller than min-extent
EnterBox.st
--- a/EnterBox.st	Fri Aug 12 01:46:08 1994 +0200
+++ b/EnterBox.st	Fri Aug 12 01:46:28 1994 +0200
@@ -23,7 +23,7 @@
 COPYRIGHT (c) 1990 by Claus Gittinger
               All Rights Reserved
 
-$Header: /cvs/stx/stx/libwidg/EnterBox.st,v 1.7 1994-08-07 13:21:31 claus Exp $
+$Header: /cvs/stx/stx/libwidg/EnterBox.st,v 1.8 1994-08-11 23:46:28 claus Exp $
 '!
 
 !EnterBox class methodsFor:'documentation'!
@@ -44,7 +44,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libwidg/EnterBox.st,v 1.7 1994-08-07 13:21:31 claus Exp $
+$Header: /cvs/stx/stx/libwidg/EnterBox.st,v 1.8 1994-08-11 23:46:28 claus Exp $
 "
 !
 
@@ -97,6 +97,10 @@
 
 defaultExtent
     ^ (Display pixelPerMillimeter * (60 @ 30)) rounded
+! 
+
+minExtent
+    ^ self defaultExtent
 ! !
 
 !EnterBox class methodsFor:'instance creation'!
@@ -221,7 +225,7 @@
 resize
     "resize myself to make everything visible"
 
-    |wWanted hWanted wPanel vs2 nx ny|
+    |wWanted hWanted wPanel vs2 nx ny min|
 
     vs2 := ViewSpacing * 2.
     wWanted := (labelField widthIncludingBorder max:enterField preferredExtent x) + vs2.
@@ -232,6 +236,13 @@
     hWanted := vs2 + labelField height + enterField height +
                (ViewSpacing * 6) + buttonPanel height + ViewSpacing.
 
+    min := self class minExtent.
+    wWanted <  min x ifTrue:[
+        wWanted :=  min x
+    ].
+    hWanted <  min y ifTrue:[
+        hWanted :=  min y
+    ].
     ((wWanted ~= width) or:[hWanted ~= height]) ifTrue:[
         "
          make sure, that we are fully visible