#REFACTORING by cg
class: CheckBox
added: #computePreferredExtent
removed: #preferredExtent
--- a/CheckBox.st Sat Nov 10 00:21:45 2018 +0100
+++ b/CheckBox.st Sat Nov 10 00:22:28 2018 +0100
@@ -924,30 +924,23 @@
!CheckBox methodsFor:'queries'!
-preferredExtent
+computePreferredExtent
"compute & return the boxes preferredExtent from the components' sizes"
- "/ If I have an explicit preferredExtent..
- explicitExtent notNil ifTrue:[
- ^ explicitExtent
- ].
+ |ext|
- "/ If I have a cached preferredExtent value..
- preferredExtent notNil ifTrue:[
- ^ preferredExtent
+ ext := super computePreferredExtent.
+ (labelView isNil or:[labelView label isEmptyOrNil]) ifTrue:[
+ ^ ext
].
-
- (labelView isNil or:[labelView label isEmptyOrNil]) ifTrue:[
- ^ super preferredExtent
- ].
- ^ super preferredExtent + (10@0).
+ ^ ext + (10@0).
"/ prefCheck := toggleView preferredExtent.
"/ prefLabel := labelView preferredExtent.
"/ bw2 := borderWidth * 2.
"/ ^ (prefCheck x + prefLabel x + (3 * ViewSpacing)) @ ((prefCheck y max:prefLabel y) + bw2 + 2)
- "Modified: / 12-01-2008 / 23:27:45 / cg"
+ "Created: / 09-11-2018 / 19:48:14 / Claus Gittinger"
! !
!CheckBox class methodsFor:'documentation'!