--- a/UIObjectView.st Tue Mar 04 17:39:10 1997 +0100
+++ b/UIObjectView.st Tue Mar 04 17:41:19 1997 +0100
@@ -425,13 +425,17 @@
"minimum extent
"
- extent := self extent.
- x := extent x // 3.
- y := extent y // 3.
- extent := anObject preferredExtent.
-
- (extent x > x) ifTrue:[extent x:x].
- (extent y > y) ifTrue:[extent y:y].
+ (anObject specClass supportsSubComponents) ifTrue:[
+ extent := 5@5
+ ] ifFalse:[
+ extent := self extent.
+ x := extent x // 3.
+ y := extent y // 3.
+ extent := anObject preferredExtent.
+
+ (extent x > x) ifTrue:[extent x:x].
+ (extent y > y) ifTrue:[extent y:y].
+ ].
"setup structure
"
@@ -557,6 +561,8 @@
object origin:(frame origin).
self initializeCreatedObject:object.
+ self actionCreate:object frame:frame delta:delta.
+ object extent:(actionData minExtent).
object realize.
self actionCreate:object frame:frame delta:delta.
@@ -1354,6 +1360,14 @@
^ self subclassResponsibility
+!
+
+supportsLabel:aComponent
+ "returns true if component supports label
+ "
+ ^ self subclassResponsibility
+
+
! !
!UIObjectView methodsFor:'transaction'!
--- a/UIPainterView.st Tue Mar 04 17:39:10 1997 +0100
+++ b/UIPainterView.st Tue Mar 04 17:41:19 1997 +0100
@@ -830,7 +830,7 @@
props name:(self uniqueNameFor:cls).
viewProperties add:props.
- ((anObject respondsTo:#label:) and:[(spec respondsTo:#label:)]) ifTrue:[
+ ((spec respondsTo:#label:) and:[self supportsLabel:anObject]) ifTrue:[
anObject label:(props name).
spec label:(props name)
].
@@ -1363,22 +1363,15 @@
self transaction:#specification selectionDo:[:aView|
builder := UIBuilder new.
props := self propertyOfView:aView.
- name := aSpec name.
-
- self undoSpecModify:(props identifier).
+ name := (aSpec name) withoutSeparators.
- name = (aView name) ifFalse:[
- name notNil ifTrue:[
- name := name withoutSeparators.
-
- (name isEmpty or:[(self propertyOfName:name) notNil]) ifTrue:[
- name := nil
- ]
- ].
- name isNil ifTrue:[
- aSpec name:(aView name).
+ name = props name ifFalse:[
+ (self propertyOfName:name) notNil ifTrue:[
+ name := props name
]
].
+ aSpec name:name.
+ self undoSpecModify:(props identifier).
aSpec needsRebuildForAttributes ifTrue:[
v := aSpec buildViewWithLayoutFor:builder in:aView superView.
@@ -1396,9 +1389,7 @@
]
].
self changed:#tree
- ].
-
- "Modified: 1.3.1997 / 01:39:53 / cg"
+ ]
! !
!UIPainterView methodsFor:'testing'!
@@ -1444,6 +1435,19 @@
^ true
+!
+
+supportsLabel:aComponent
+ "returns true if component supports label
+ "
+ (aComponent respondsTo:#label:) ifTrue:[
+ ( (aComponent isKindOf:ArrowButton)
+ or:[aComponent isKindOf:CheckToggle]
+ ) ifFalse:[
+ ^ true
+ ]
+ ].
+ ^ false
! !
!UIPainterView methodsFor:'transaction'!