--- a/RegressionTests__LabelResizingTest.st Tue Aug 13 16:37:08 2019 +0200
+++ b/RegressionTests__LabelResizingTest.st Thu Aug 15 19:50:18 2019 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"{ Package: 'stx:goodies/regression' }"
"{ NameSpace: RegressionTests }"
@@ -66,365 +68,365 @@
^
#(FullSpec
- name: windowSpec
- window:
+ name: windowSpec
+ window:
(WindowSpec
- label: 'Claus'
- name: 'Claus'
- min: (Point 10 10)
- max: (Point 1024 768)
- bounds: (Rectangle 0 0 518 496)
- menu: mainMenu
- )
- component:
+ label: 'Claus'
+ name: 'Claus'
+ min: (Point 10 10)
+ max: (Point 1024 768)
+ bounds: (Rectangle 0 0 518 496)
+ menu: mainMenu
+ )
+ component:
(SpecCollection
- collection: (
- (ViewSpec
- name: 'Box'
- layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
- backgroundColor: (Color 86.999313344015 86.999313344015 86.999313344015)
- component:
- (SpecCollection
- collection: (
- (LabelSpec
- label: 'Label'
- name: 'Label'
- layout: (AlignmentOrigin -5 1.0 5 0 1 0)
- visibilityChannel: visibleHolder
- backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
- translateLabel: true
- labelChannel: lableHolder
- resizeForLabel: true
- adjust: left
- postBuildCallback: postBuildLabel:
- )
- (ActionButtonSpec
- label: 'Button'
- name: 'Button'
- layout: (AlignmentOrigin -5 1.0 40 0 1 0)
- visibilityChannel: visibleHolder
- backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
- translateLabel: true
- labelChannel: lableHolder
- resizeForLabel: true
- )
- (LabelSpec
- label: 'Point'
- name: 'Point'
- layout: (Point 5 5)
- translateLabel: true
- labelChannel: lableHolder
- resizeForLabel: true
- )
- (LabelSpec
- label: 'Alignment Origin TopLeft'
- name: 'Alignment Origin TopLeft'
- layout: (AlignmentOrigin 5 0 30 0 0 0)
- translateLabel: true
- labelChannel: lableHolder
- resizeForLabel: true
- )
- (LabelSpec
- label: 'Origin'
- name: 'Origin'
- layout: (LayoutOrigin 5 0 55 0)
- translateLabel: true
- labelChannel: lableHolder
- resizeForLabel: true
- )
- )
+ collection: (
+ (ViewSpec
+ name: 'Box'
+ layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
+ backgroundColor: (Color 86.999313344015 86.999313344015 86.999313344015)
+ component:
+ (SpecCollection
+ collection: (
+ (LabelSpec
+ label: 'Label'
+ name: 'Label'
+ layout: (AlignmentOrigin -5 1.0 5 0 1 0)
+ visibilityChannel: visibleHolder
+ backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
+ translateLabel: true
+ labelChannel: labelHolder
+ resizeForLabel: true
+ adjust: left
+ postBuildCallback: postBuildLabel:
+ )
+ (ActionButtonSpec
+ label: 'Button'
+ name: 'Button'
+ layout: (AlignmentOrigin -5 1.0 40 0 1 0)
+ visibilityChannel: visibleHolder
+ backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
+ translateLabel: true
+ labelChannel: labelHolder
+ resizeForLabel: true
+ )
+ (LabelSpec
+ label: 'Point'
+ name: 'Point'
+ layout: (Point 5 5)
+ translateLabel: true
+ labelChannel: labelHolder
+ resizeForLabel: true
+ )
+ (LabelSpec
+ label: 'Alignment Origin TopLeft'
+ name: 'Alignment Origin TopLeft'
+ layout: (AlignmentOrigin 5 0 30 0 0 0)
+ translateLabel: true
+ labelChannel: labelHolder
+ resizeForLabel: true
+ )
+ (LabelSpec
+ label: 'Origin'
+ name: 'Origin'
+ layout: (LayoutOrigin 5 0 55 0)
+ translateLabel: true
+ labelChannel: labelHolder
+ resizeForLabel: true
+ )
+ )
- )
- )
- (LabelSpec
- label: 'Variable Horizontal Panel'
- name: 'Variable Horizontal Panel'
- layout: (LayoutFrame 0 0.0 90 0 0 1.0 120 0)
- backgroundColor: (Color 49.999237048905 49.999237048905 100.0)
- translateLabel: true
- resizeForLabel: true
- )
- (VariableHorizontalPanelSpec
- name: 'VariableHorizontalPanel'
- layout: (LayoutFrame 0 0.0 120 0 0 1.0 170 0)
- snapMode: both
- component:
- (SpecCollection
- collection: (
- (LabelSpec
- label: 'Label'
- name: 'Label1'
- backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
- translateLabel: true
- labelChannel: lableHolder
- resizeForLabel: true
- )
- (ActionButtonSpec
- label: 'Button'
- name: 'Button1'
- backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
- translateLabel: true
- labelChannel: lableHolder
- resizeForLabel: true
- )
- (LabelSpec
- label: 'Label'
- name: 'Label2'
- backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
- translateLabel: true
- labelChannel: lableHolder
- resizeForLabel: true
- )
- )
+ )
+ )
+ (LabelSpec
+ label: 'Variable Horizontal Panel'
+ name: 'Variable Horizontal Panel'
+ layout: (LayoutFrame 0 0.0 90 0 0 1.0 120 0)
+ backgroundColor: (Color 49.999237048905 49.999237048905 100.0)
+ translateLabel: true
+ resizeForLabel: true
+ )
+ (VariableHorizontalPanelSpec
+ name: 'VariableHorizontalPanel'
+ layout: (LayoutFrame 0 0.0 120 0 0 1.0 170 0)
+ snapMode: both
+ component:
+ (SpecCollection
+ collection: (
+ (LabelSpec
+ label: 'Label'
+ name: 'Label1'
+ backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
+ translateLabel: true
+ labelChannel: labelHolder
+ resizeForLabel: true
+ )
+ (ActionButtonSpec
+ label: 'Button'
+ name: 'Button1'
+ backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
+ translateLabel: true
+ labelChannel: labelHolder
+ resizeForLabel: true
+ )
+ (LabelSpec
+ label: 'Label'
+ name: 'Label2'
+ backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
+ translateLabel: true
+ labelChannel: labelHolder
+ resizeForLabel: true
+ )
+ )
- )
- handles: (Any 0.33333333333333 0.66666666666667 1.0)
- )
- (LabelSpec
- label: 'Horizontal Panel'
- name: 'Horizontal Panel'
- layout: (LayoutFrame 0 0.0 170 0 0 1.0 200 0)
- backgroundColor: (Color 49.999237048905 49.999237048905 100.0)
- translateLabel: true
- resizeForLabel: true
- )
- (HorizontalPanelViewSpec
- name: 'HorizontalPanel'
- layout: (LayoutFrame 0 0.0 200 0 0 1.0 250 0)
- horizontalLayout: center
- verticalLayout: center
- horizontalSpace: 3
- verticalSpace: 3
- elementsChangeSize: true
- component:
- (SpecCollection
- collection: (
- (LabelSpec
- label: 'Label'
- name: 'Label3'
- backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
- translateLabel: true
- labelChannel: lableHolder
- resizeForLabel: true
- extent: (Point 74 20)
- )
- (ActionButtonSpec
- label: 'Button'
- name: 'Button2'
- backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
- translateLabel: true
- labelChannel: lableHolder
- resizeForLabel: true
- extent: (Point 78 24)
- )
- (LabelSpec
- label: 'Label'
- name: 'Label4'
- backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
- translateLabel: true
- labelChannel: lableHolder
- resizeForLabel: true
- extent: (Point 74 20)
- )
- )
+ )
+ handles: (Any 0.33333333333333 0.66666666666667 1.0)
+ )
+ (LabelSpec
+ label: 'Horizontal Panel'
+ name: 'Horizontal Panel'
+ layout: (LayoutFrame 0 0.0 170 0 0 1.0 200 0)
+ backgroundColor: (Color 49.999237048905 49.999237048905 100.0)
+ translateLabel: true
+ resizeForLabel: true
+ )
+ (HorizontalPanelViewSpec
+ name: 'HorizontalPanel'
+ layout: (LayoutFrame 0 0.0 200 0 0 1.0 250 0)
+ horizontalLayout: center
+ verticalLayout: center
+ horizontalSpace: 3
+ verticalSpace: 3
+ elementsChangeSize: true
+ component:
+ (SpecCollection
+ collection: (
+ (LabelSpec
+ label: 'Label'
+ name: 'Label3'
+ backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
+ translateLabel: true
+ labelChannel: labelHolder
+ resizeForLabel: true
+ extent: (Point 74 20)
+ )
+ (ActionButtonSpec
+ label: 'Button'
+ name: 'Button2'
+ backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
+ translateLabel: true
+ labelChannel: labelHolder
+ resizeForLabel: true
+ extent: (Point 78 24)
+ )
+ (LabelSpec
+ label: 'Label'
+ name: 'Label4'
+ backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
+ translateLabel: true
+ labelChannel: labelHolder
+ resizeForLabel: true
+ extent: (Point 74 20)
+ )
+ )
- )
- )
- (LabelSpec
- label: 'Vertical Panels'
- name: 'Vertical Panels'
- layout: (LayoutFrame 0 0.0 250 0 0 1.0 280 0)
- backgroundColor: (Color 49.999237048905 49.999237048905 100.0)
- translateLabel: true
- )
- (HorizontalPanelViewSpec
- name: 'All Panels'
- layout: (LayoutFrame 0 0.0 280 0 0 1.0 -5 1.0)
- horizontalLayout: fitSpace
- verticalLayout: fitSpace
- horizontalSpace: 3
- verticalSpace: 3
- component:
- (SpecCollection
- collection: (
- (ViewSpec
- name: 'VerticalPanelView'
- component:
- (SpecCollection
- collection: (
- (LabelSpec
- label: 'Vertical Panel'
- name: 'Vertical Panel'
- layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 30 0)
- backgroundColor: (Color 49.999237048905 49.999237048905 100.0)
- translateLabel: true
- )
- (VerticalPanelViewSpec
- name: 'VerticalPanel'
- layout: (LayoutFrame 0 0.0 32 0.0 0 1.0 0 1.0)
- horizontalLayout: center
- verticalLayout: center
- horizontalSpace: 3
- verticalSpace: 3
- elementsChangeSize: true
- component:
- (SpecCollection
- collection: (
- (LabelSpec
- label: 'Label'
- name: 'Label5'
- backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
- translateLabel: true
- labelChannel: lableHolder
- resizeForLabel: true
- extent: (Point 74 20)
- )
- (ActionButtonSpec
- label: 'Button'
- name: 'Button3'
- backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
- translateLabel: true
- labelChannel: lableHolder
- resizeForLabel: true
- extent: (Point 78 24)
- )
- (LabelSpec
- label: 'Label'
- name: 'Label6'
- backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
- translateLabel: true
- labelChannel: lableHolder
- resizeForLabel: true
- extent: (Point 74 20)
- )
- )
+ )
+ )
+ (LabelSpec
+ label: 'Vertical Panels'
+ name: 'Vertical Panels'
+ layout: (LayoutFrame 0 0.0 250 0 0 1.0 280 0)
+ backgroundColor: (Color 49.999237048905 49.999237048905 100.0)
+ translateLabel: true
+ )
+ (HorizontalPanelViewSpec
+ name: 'All Panels'
+ layout: (LayoutFrame 0 0.0 280 0 0 1.0 -5 1.0)
+ horizontalLayout: fitSpace
+ verticalLayout: fitSpace
+ horizontalSpace: 3
+ verticalSpace: 3
+ component:
+ (SpecCollection
+ collection: (
+ (ViewSpec
+ name: 'VerticalPanelView'
+ component:
+ (SpecCollection
+ collection: (
+ (LabelSpec
+ label: 'Vertical Panel'
+ name: 'Vertical Panel'
+ layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 30 0)
+ backgroundColor: (Color 49.999237048905 49.999237048905 100.0)
+ translateLabel: true
+ )
+ (VerticalPanelViewSpec
+ name: 'VerticalPanel'
+ layout: (LayoutFrame 0 0.0 32 0.0 0 1.0 0 1.0)
+ horizontalLayout: center
+ verticalLayout: center
+ horizontalSpace: 3
+ verticalSpace: 3
+ elementsChangeSize: true
+ component:
+ (SpecCollection
+ collection: (
+ (LabelSpec
+ label: 'Label'
+ name: 'Label5'
+ backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
+ translateLabel: true
+ labelChannel: labelHolder
+ resizeForLabel: true
+ extent: (Point 74 20)
+ )
+ (ActionButtonSpec
+ label: 'Button'
+ name: 'Button3'
+ backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
+ translateLabel: true
+ labelChannel: labelHolder
+ resizeForLabel: true
+ extent: (Point 78 24)
+ )
+ (LabelSpec
+ label: 'Label'
+ name: 'Label6'
+ backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
+ translateLabel: true
+ labelChannel: labelHolder
+ resizeForLabel: true
+ extent: (Point 74 20)
+ )
+ )
- )
- )
- )
+ )
+ )
+ )
- )
- extent: (Point 168 205)
- )
- (ViewSpec
- name: 'PanelView'
- component:
- (SpecCollection
- collection: (
- (LabelSpec
- label: 'Panel'
- name: 'PanelLabel'
- layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 30 0)
- backgroundColor: (Color 49.999237048905 49.999237048905 100.0)
- translateLabel: true
- )
- (PanelViewSpec
- name: 'Panel'
- layout: (LayoutFrame 0 0.0 32 0.0 0 1.0 0 1.0)
- horizontalLayout: fitSpace
- verticalLayout: fitSpace
- horizontalSpace: 3
- verticalSpace: 3
- elementsChangeSize: true
- component:
- (SpecCollection
- collection: (
- (LabelSpec
- label: 'Label'
- name: 'Label7'
- backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
- translateLabel: true
- labelChannel: lableHolder
- resizeForLabel: true
- extent: (Point 74 20)
- )
- (ActionButtonSpec
- label: 'Button'
- name: 'Button4'
- backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
- translateLabel: true
- labelChannel: lableHolder
- resizeForLabel: true
- extent: (Point 78 24)
- )
- (LabelSpec
- label: 'Label'
- name: 'Label9'
- backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
- translateLabel: true
- labelChannel: lableHolder
- resizeForLabel: true
- extent: (Point 74 20)
- )
- )
+ )
+ extent: (Point 168 205)
+ )
+ (ViewSpec
+ name: 'PanelView'
+ component:
+ (SpecCollection
+ collection: (
+ (LabelSpec
+ label: 'Panel'
+ name: 'PanelLabel'
+ layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 30 0)
+ backgroundColor: (Color 49.999237048905 49.999237048905 100.0)
+ translateLabel: true
+ )
+ (PanelViewSpec
+ name: 'Panel'
+ layout: (LayoutFrame 0 0.0 32 0.0 0 1.0 0 1.0)
+ horizontalLayout: fitSpace
+ verticalLayout: fitSpace
+ horizontalSpace: 3
+ verticalSpace: 3
+ elementsChangeSize: true
+ component:
+ (SpecCollection
+ collection: (
+ (LabelSpec
+ label: 'Label'
+ name: 'Label7'
+ backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
+ translateLabel: true
+ labelChannel: labelHolder
+ resizeForLabel: true
+ extent: (Point 74 20)
+ )
+ (ActionButtonSpec
+ label: 'Button'
+ name: 'Button4'
+ backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
+ translateLabel: true
+ labelChannel: labelHolder
+ resizeForLabel: true
+ extent: (Point 78 24)
+ )
+ (LabelSpec
+ label: 'Label'
+ name: 'Label9'
+ backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
+ translateLabel: true
+ labelChannel: labelHolder
+ resizeForLabel: true
+ extent: (Point 74 20)
+ )
+ )
- )
- )
- )
+ )
+ )
+ )
- )
- extent: (Point 169 205)
- )
- (ViewSpec
- name: 'VariableVerticalPanelView'
- component:
- (SpecCollection
- collection: (
- (LabelSpec
- label: 'Variable Vertical Panel'
- name: 'Variable Vertical Panel'
- layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 30 0)
- backgroundColor: (Color 49.999237048905 49.999237048905 100.0)
- translateLabel: true
- )
- (VariableVerticalPanelSpec
- name: 'VariableVerticalPanel'
- layout: (LayoutFrame 0 0.0 32 0.0 0 1.0 0 1.0)
- snapMode: both
- component:
- (SpecCollection
- collection: (
- (LabelSpec
- label: 'Label'
- name: 'Label8'
- backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
- translateLabel: true
- labelChannel: lableHolder
- resizeForLabel: true
- )
- (ActionButtonSpec
- label: 'Button'
- name: 'Button5'
- backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
- translateLabel: true
- labelChannel: lableHolder
- resizeForLabel: true
- )
- (LabelSpec
- label: 'Label'
- name: 'Label10'
- backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
- translateLabel: true
- labelChannel: lableHolder
- resizeForLabel: true
- )
- )
+ )
+ extent: (Point 169 205)
+ )
+ (ViewSpec
+ name: 'VariableVerticalPanelView'
+ component:
+ (SpecCollection
+ collection: (
+ (LabelSpec
+ label: 'Variable Vertical Panel'
+ name: 'Variable Vertical Panel'
+ layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 30 0)
+ backgroundColor: (Color 49.999237048905 49.999237048905 100.0)
+ translateLabel: true
+ )
+ (VariableVerticalPanelSpec
+ name: 'VariableVerticalPanel'
+ layout: (LayoutFrame 0 0.0 32 0.0 0 1.0 0 1.0)
+ snapMode: both
+ component:
+ (SpecCollection
+ collection: (
+ (LabelSpec
+ label: 'Label'
+ name: 'Label8'
+ backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
+ translateLabel: true
+ labelChannel: labelHolder
+ resizeForLabel: true
+ )
+ (ActionButtonSpec
+ label: 'Button'
+ name: 'Button5'
+ backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
+ translateLabel: true
+ labelChannel: labelHolder
+ resizeForLabel: true
+ )
+ (LabelSpec
+ label: 'Label'
+ name: 'Label10'
+ backgroundColor: (Color 49.999237048905 100.0 49.999237048905)
+ translateLabel: true
+ labelChannel: labelHolder
+ resizeForLabel: true
+ )
+ )
- )
- handles: (Any 0.33333333333333 0.66666666666667 1.0)
- )
- )
+ )
+ handles: (Any 0.33333333333333 0.66666666666667 1.0)
+ )
+ )
- )
- extent: (Point 169 205)
- )
- )
+ )
+ extent: (Point 169 205)
+ )
+ )
- )
- )
- )
+ )
+ )
+ )
- )
+ )
)
! !
@@ -501,24 +503,24 @@
|label size|
how == #null ifTrue:[
- size := 0.
+ size := 0.
] ifFalse:[
- size := self lableHolder value size.
+ size := self labelHolder value size.
- how == #smaller ifTrue:[
- size := (size - 2) max:2.
- ] ifFalse:[
- size == 0 ifTrue:[ size := 8 ]
- ifFalse:[ size := size + 2 ].
- ]
+ how == #smaller ifTrue:[
+ size := (size - 2) max:2.
+ ] ifFalse:[
+ size == 0 ifTrue:[ size := 8 ]
+ ifFalse:[ size := size + 2 ].
+ ]
].
label := String new:size.
1 to:size do:[:i| |c|
- c := i \\ 10.
- c == 0 ifTrue:[ label at:i put:$- ]
- ifFalse:[ label at:i put:(Character digitValue:c) ].
+ c := i \\ 10.
+ c == 0 ifTrue:[ label at:i put:$- ]
+ ifFalse:[ label at:i put:(Character digitValue:c) ].
].
- self lableHolder value:label.
+ self labelHolder value:label.
!
doInspectLabelView
@@ -531,11 +533,11 @@
!LabelResizingTest methodsFor:'aspects'!
-lableHolder
+labelHolder
|holder|
- (holder := builder bindingAt:#lableHolder) isNil ifTrue:[
- builder aspectAt:#lableHolder put:(holder := '' asValue).
+ (holder := builder bindingAt:#labelHolder) isNil ifTrue:[
+ builder aspectAt:#labelHolder put:(holder := '' asValue).
].
^ holder
!
@@ -560,3 +562,4 @@
version
^ '$Header$'
! !
+