--- a/EnterBox.st Fri Mar 31 15:43:02 2017 +0200
+++ b/EnterBox.st Fri Mar 31 15:52:26 2017 +0200
@@ -580,7 +580,7 @@
preferredExtent
"compute the boxes preferredExtent from the components' sizes"
- |wWanted hWanted wPanel vs2 min
+ |wWanted hWanted vs2 min
labelPref enterPref panelPref|
"/ If I have an explicit preferredExtent..
@@ -596,29 +596,24 @@
panelPref := buttonPanel preferredExtent.
labelPref := labelField preferredExtent.
enterPref := enterField preferredExtent.
- wWanted := (labelPref x max:enterPref x).
- wPanel := panelPref x.
- wPanel > wWanted ifTrue:[
- wWanted := wPanel
- ].
+ wWanted := (labelPref x max:enterPref x) max:panelPref x.
+
hWanted := labelPref y + ViewSpacing + enterPref y +
ViewSpacing + panelPref y + ViewSpacing.
verticalPanel notNil ifTrue:[
hWanted := hWanted + ViewSpacing + (verticalPanel preferredHeight).
].
+ vs2 := ViewSpacing * 2.
min := self class minExtent.
- wWanted < min x ifTrue:[
- wWanted := min x
- ].
- hWanted < min y ifTrue:[
- hWanted := min y
- ].
- vs2 := ViewSpacing * 2.
- ^ (wWanted + vs2) @ (hWanted + vs2)
+ wWanted := (wWanted max: min x) + vs2.
+ hWanted := (hWanted max: min y) + vs2.
- "Modified: / 22.1.1998 / 09:57:55 / md"
- "Modified: / 27.7.1998 / 20:18:41 / cg"
+ ^ wWanted @ hWanted
+
+ "Modified: / 22-01-1998 / 09:57:55 / md"
+ "Modified: / 27-07-1998 / 20:18:41 / cg"
+ "Modified: / 30-03-2017 / 18:42:12 / stefan"
! !
!EnterBox methodsFor:'startup'!