TextBox.st
changeset 6080 a90e3bbb4c79
parent 6075 0c168e2e1937
child 6086 00b0df472506
equal deleted inserted replaced
6079:c61b633da982 6080:a90e3bbb4c79
   291 !TextBox methodsFor:'queries'!
   291 !TextBox methodsFor:'queries'!
   292 
   292 
   293 computePreferredExtent
   293 computePreferredExtent
   294     "return the extent needed to make everything visible"
   294     "return the extent needed to make everything visible"
   295 
   295 
   296     |wWanted hWanted wPanel|
   296     |wWanted hWanted wLabel wPanel wText hText|
   297 
   297 
   298     wWanted := labelField width + ViewSpacing + ViewSpacing.
   298     wLabel := labelField width + ViewSpacing + ViewSpacing.
   299     (wWanted > width) ifFalse:[
   299 
   300         wWanted := width
       
   301     ].
       
   302     wPanel := ViewSpacing * 3.
   300     wPanel := ViewSpacing * 3.
   303     buttonPanel subViews do:[:aView |
   301     buttonPanel subViews do:[:aView |
   304         wPanel := wPanel + aView width + ViewSpacing
   302         wPanel := wPanel + aView width + ViewSpacing
   305     ].
   303     ].
   306     wPanel > wWanted ifTrue:[
   304 
   307         wWanted := wPanel
   305     wWanted := (width max:wPanel) max:wLabel.
       
   306 
       
   307     textView notNil ifTrue:[
       
   308         wText := (textView scrolledView widthOfContents + 30) min:1024.
       
   309         hText := (textView scrolledView heightOfContents + 20) min:400.
       
   310         wWanted := wWanted max:wText.
   308     ].
   311     ].
       
   312 
   309     hWanted := ViewSpacing + labelField height +
   313     hWanted := ViewSpacing + labelField height +
   310                ViewSpacing + textView height +
   314                ViewSpacing + hText +
   311                (ViewSpacing * 6) + buttonPanel preferredHeight +
   315                (ViewSpacing * 6) + buttonPanel preferredHeight +
   312                ViewSpacing.
   316                ViewSpacing.
   313     ^ (wWanted @ hWanted)
   317     ^ (wWanted @ hWanted)
   314 
   318 
   315     "Created: / 09-11-2018 / 20:02:29 / Claus Gittinger"
   319     "Created: / 09-11-2018 / 20:02:29 / Claus Gittinger"
       
   320     "Modified: / 28-06-2019 / 11:06:25 / Claus Gittinger"
   316 ! !
   321 ! !
   317 
   322 
   318 !TextBox class methodsFor:'documentation'!
   323 !TextBox class methodsFor:'documentation'!
   319 
   324 
   320 version
   325 version