--- a/UILayoutTool.st Sat Jan 22 21:47:15 2000 +0100
+++ b/UILayoutTool.st Mon Jan 24 12:02:32 2000 +0100
@@ -20,14 +20,21 @@
category:'Interface-UIPainter'
!
-ApplicationModel subclass:#LayoutFrame
+ApplicationModel subclass:#LayoutOrigin
instanceVariableNames:''
classVariableNames:''
poolDictionaries:''
privateIn:UILayoutTool
!
-ApplicationModel subclass:#LayoutOrigin
+ApplicationModel subclass:#AlignmentOrigin
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:UILayoutTool
+!
+
+ApplicationModel subclass:#Rectangle
instanceVariableNames:''
classVariableNames:''
poolDictionaries:''
@@ -41,7 +48,7 @@
privateIn:UILayoutTool
!
-ApplicationModel subclass:#AlignmentOrigin
+ApplicationModel subclass:#LayoutFrame
instanceVariableNames:''
classVariableNames:''
poolDictionaries:''
@@ -55,13 +62,6 @@
privateIn:UILayoutTool
!
-ApplicationModel subclass:#Rectangle
- instanceVariableNames:''
- classVariableNames:''
- poolDictionaries:''
- privateIn:UILayoutTool
-!
-
!UILayoutTool class methodsFor:'documentation'!
copyright
@@ -178,128 +178,164 @@
<resource: #canvas>
- ^
-
- #(#FullSpec
- #window:
- #(#WindowSpec
- #name: 'UILayoutTool'
- #layout: #(#LayoutFrame 216 0 173 0 560 0 354 0)
- #label: 'UILayoutTool'
- #min: #(#Point 10 10)
- #max: #(#Point 1152 900)
- #bounds: #(#Rectangle 216 173 561 355)
- #usePreferredExtent: false
- )
- #component:
- #(#SpecCollection
- #collection:
- #(
- #(#FramedBoxSpec
- #name: 'FramedBox'
- #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 108 0)
- #component:
- #(#SpecCollection
- #collection:
- #(
- #(#LabelSpec
- #name: 'labelRelative'
- #layout: #(#Point 87 6)
- #label: 'Relative:'
- )
- #(#LabelSpec
- #name: 'labelAbsolute'
- #layout: #(#Point 187 6)
- #label: 'Offset:'
- )
- #(#LabelSpec
- #name: 'labelLeft'
- #layout: #(#AlignmentOrigin 85 0 27 0 1 0)
- #label: 'Left:'
- )
- #(#InputFieldSpec
- #name: 'fieldLeftFraction'
- #layout: #(#LayoutFrame 87 0 24 0 137 0 46 0)
- #activeHelpKey: #leftRelative
- #tabable: true
- #model: #leftFraction
- #group: #inputGroup
- #type: #numberOrNil
+ ^
+ #(#FullSpec
+ #name: #layoutOriginSpec
+ #window:
+ #(#WindowSpec
+ #label: 'UILayoutTool'
+ #name: 'UILayoutTool'
+ #min: #(#Point 10 10)
+ #max: #(#Point 1152 900)
+ #bounds: #(#Rectangle 506 24 851 206)
+ )
+ #component:
+ #(#SpecCollection
+ #collection: #(
+ #(#FramedBoxSpec
+ #label: 'Origin'
+ #name: 'FramedBox'
+ #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 108 0)
+ #labelPosition: #topLeft
+ #component:
+ #(#SpecCollection
+ #collection: #(
+ #(#LabelSpec
+ #label: 'Relative:'
+ #name: 'labelRelative'
+ #layout: #(#Point 87 6)
+ )
+ #(#LabelSpec
+ #label: 'Offset:'
+ #name: 'labelAbsolute'
+ #layout: #(#Point 187 6)
+ )
+ #(#LabelSpec
+ #label: 'Left:'
+ #name: 'labelLeft'
+ #layout: #(#AlignmentOrigin 85 0 27 0 1 0)
+ )
+ #(#InputFieldSpec
+ #attributes:
+ #(#tabable
+ true
+ )
+ #name: 'fieldLeftFraction'
+ #layout: #(#LayoutFrame 87 0 24 0 137 0 46 0)
+ #activeHelpKey: #leftRelative
+ #tabable: true
+ #model: #leftFraction
+ #group: #inputGroup
+ #type: #numberOrNil
+ #acceptChannel: #acceptChannel
+ #modifiedChannel: #modifiedChannel
+ #acceptOnPointerLeave: false
+ )
+ #(#ActionButtonSpec
+ #attributes:
+ #(#tabable
+ true
+ )
+ #name: 'actionRelativeLeft'
+ #layout: #(#LayoutFrame 142 0 24 0 164 0 46 0)
+ #activeHelpKey: #makeLeftRelative
+ #tabable: true
+ #model: #relativeLeft
+ )
+ #(#InputFieldSpec
+ #attributes:
+ #(#tabable
+ true
+ )
+ #name: 'fieldLeftOffset'
+ #layout: #(#LayoutFrame 187 0 24 0 237 0 46 0)
+ #activeHelpKey: #leftAbsolute
+ #tabable: true
+ #model: #leftOffset
+ #group: #inputGroup
+ #type: #numberOrNil
#acceptChannel: #acceptChannel
#modifiedChannel: #modifiedChannel
- )
- #(#ActionButtonSpec
- #name: 'actionRelativeLeft'
- #layout: #(#LayoutFrame 142 0 24 0 164 0 46 0)
- #activeHelpKey: #makeLeftRelative
- #model: #relativeLeft
- )
- #(#InputFieldSpec
- #name: 'fieldLeftOffset'
- #layout: #(#LayoutFrame 187 0 24 0 237 0 46 0)
- #activeHelpKey: #leftAbsolute
- #tabable: true
- #model: #leftOffset
- #group: #inputGroup
- #type: #numberOrNil
+ #acceptOnPointerLeave: false
+ )
+ #(#ActionButtonSpec
+ #attributes:
+ #(#tabable
+ true
+ )
+ #name: 'actionAbsoluteLeft'
+ #layout: #(#LayoutFrame 242 0 24 0 264 0 46 0)
+ #activeHelpKey: #makeLeftAbsolute
+ #tabable: true
+ #model: #absoluteLeft
+ )
+ #(#LabelSpec
+ #label: 'Top:'
+ #name: 'labelTop'
+ #layout: #(#AlignmentOrigin 85 0 54 0 1 0)
+ )
+ #(#InputFieldSpec
+ #attributes:
+ #(#tabable
+ true
+ )
+ #name: 'fieldTopFraction'
+ #layout: #(#LayoutFrame 87 0 51 0 137 0 73 0)
+ #activeHelpKey: #topRelative
+ #tabable: true
+ #model: #topFraction
+ #group: #inputGroup
+ #type: #numberOrNil
#acceptChannel: #acceptChannel
#modifiedChannel: #modifiedChannel
- )
- #(#ActionButtonSpec
- #name: 'actionAbsoluteLeft'
- #layout: #(#LayoutFrame 242 0 24 0 264 0 46 0)
- #activeHelpKey: #makeLeftAbsolute
- #model: #absoluteLeft
- )
- #(#LabelSpec
- #name: 'labelTop'
- #layout: #(#AlignmentOrigin 85 0 54 0 1 0)
- #label: 'Top:'
- )
- #(#InputFieldSpec
- #name: 'fieldTopFraction'
- #layout: #(#LayoutFrame 87 0 51 0 137 0 73 0)
- #activeHelpKey: #topRelative
- #tabable: true
- #model: #topFraction
- #group: #inputGroup
- #type: #numberOrNil
+ #acceptOnPointerLeave: false
+ )
+ #(#ActionButtonSpec
+ #attributes:
+ #(#tabable
+ true
+ )
+ #name: 'actionRelativeTop'
+ #layout: #(#LayoutFrame 142 0 51 0 164 0 73 0)
+ #activeHelpKey: #makeTopRelative
+ #tabable: true
+ #model: #relativeTop
+ )
+ #(#InputFieldSpec
+ #attributes:
+ #(#tabable
+ true
+ )
+ #name: 'fieldTopOffset'
+ #layout: #(#LayoutFrame 187 0 51 0 237 0 73 0)
+ #activeHelpKey: #topAbsolute
+ #tabable: true
+ #model: #topOffset
+ #group: #inputGroup
+ #type: #numberOrNil
#acceptChannel: #acceptChannel
#modifiedChannel: #modifiedChannel
- )
- #(#ActionButtonSpec
- #name: 'actionRelativeTop'
- #layout: #(#LayoutFrame 142 0 51 0 164 0 73 0)
- #activeHelpKey: #makeTopRelative
- #model: #relativeTop
- )
- #(#InputFieldSpec
- #name: 'fieldTopOffset'
- #layout: #(#LayoutFrame 187 0 51 0 237 0 73 0)
- #activeHelpKey: #topAbsolute
- #tabable: true
- #model: #topOffset
- #group: #inputGroup
- #type: #numberOrNil
- #acceptChannel: #acceptChannel
- #modifiedChannel: #modifiedChannel
- )
- #(#ActionButtonSpec
- #name: 'actionAbsoluteTop'
- #layout: #(#LayoutFrame 242 0 51 0 264 0 73 0)
- #activeHelpKey: #makeTopAbsolute
- #model: #absoluteTop
- )
- )
+ #acceptOnPointerLeave: false
+ )
+ #(#ActionButtonSpec
+ #attributes:
+ #(#tabable
+ true
)
- #label: 'Origin'
- #labelPosition: #topLeft
- )
+ #name: 'actionAbsoluteTop'
+ #layout: #(#LayoutFrame 242 0 51 0 264 0 73 0)
+ #activeHelpKey: #makeTopAbsolute
+ #tabable: true
+ #model: #absoluteTop
+ )
+ )
+
)
- )
+ )
+ )
+
+ )
)
-
- "Modified: / 13.8.1998 / 19:52:04 / cg"
!
layoutPointSpec
@@ -790,6 +826,692 @@
! !
+!UILayoutTool::LayoutOrigin class methodsFor:'interface specs'!
+
+windowSpec
+ "This resource specification was automatically generated
+ by the UIPainter of ST/X."
+
+ "Do not manually edit this!! If it is corrupted,
+ the UIPainter may not be able to read the specification."
+
+ "
+ UIPainter new openOnClass:UILayoutTool::LayoutOrigin andSelector:#windowSpec
+ UILayoutTool::LayoutOrigin new openInterface:#windowSpec
+ UILayoutTool::LayoutOrigin open
+ "
+
+ <resource: #canvas>
+
+ ^
+
+ #(#FullSpec
+ #window:
+ #(#WindowSpec
+ #name: 'UILayoutTool-LayoutOrigin'
+ #layout: #(#LayoutFrame 290 0 420 0 647 0 565 0)
+ #label: 'UILayoutTool-LayoutOrigin'
+ #min: #(#Point 10 10)
+ #max: #(#Point 1152 900)
+ #bounds: #(#Rectangle 290 420 648 566)
+ #usePreferredExtent: false
+ )
+ #component:
+ #(#SpecCollection
+ #collection:
+ #(
+ #(#UISubSpecification
+ #name: 'layoutOriginSpec'
+ #layout: #(#LayoutFrame 1 0.0 6 0 0 1.0 110 0)
+ #majorKey: #UILayoutTool
+ #minorKey: #layoutOriginSpec
+ )
+ )
+ )
+ )
+! !
+
+!UILayoutTool::LayoutOrigin methodsFor:'accessing'!
+
+fetch:aView spec:aSpec
+ "fetch layoutOrigin
+ "
+ |layout|
+
+ layout := UIPainterView asLayoutFrameFromView:aView.
+
+ (self aspectFor:#leftOffset) value:(layout leftOffset).
+ (self aspectFor:#leftFraction) value:(layout leftFraction).
+ (self aspectFor:#topOffset) value:(layout topOffset).
+ (self aspectFor:#topFraction) value:(layout topFraction).
+
+
+!
+
+layout
+ "returns current layout as layoutOrigin
+ "
+ |layout|
+
+ layout := Smalltalk::LayoutOrigin new.
+
+ layout leftOffset:((self aspectFor:#leftOffset) value) ? 0.
+ layout topOffset:((self aspectFor:#topOffset) value) ? 0.
+ layout leftFraction:((self aspectFor:#leftFraction) value) ? 0.
+ layout topFraction:((self aspectFor:#topFraction) value) ? 0.
+
+ ^ layout
+
+! !
+
+!UILayoutTool::AlignmentOrigin class methodsFor:'help specs'!
+
+helpSpec
+ "This resource specification was automatically generated
+ by the UIHelpTool of ST/X."
+
+ "Do not manually edit this!! If it is corrupted,
+ the UIHelpTool may not be able to read the specification."
+
+ "
+ UIHelpTool openOnClass:UILayoutTool::AlignmentOrigin
+ "
+
+ <resource: #help>
+
+ ^super helpSpec addPairsFrom:#(
+
+#alignBottomCenter
+'Aligns the selected widget bottomCenter to location.'
+
+#alignBottomLeft
+'Aligns the selected widget bottomLeft to location.'
+
+#alignBottomRight
+'Aligns the selected widget bottomRight to location.'
+
+#alignCenter
+'Aligns the selected widget center to location.'
+
+#alignHorizontal
+'Horizontal inset to the location point of the selected widget.'
+
+#alignLeftCenter
+'Aligns the selected widget leftCenter to location.'
+
+#alignRightCenter
+'Aligns the selected widget rightCenter to location.'
+
+#alignTopCenter
+'Aligns the selected widget topCenter to location.'
+
+#alignTopLeft
+'Aligns the selected widget topLeft to location.'
+
+#alignTopRight
+'Aligns the selected widget topRight to location.'
+
+#alignVertical
+'Vertical inset to the location point of the widget.'
+
+)
+! !
+
+!UILayoutTool::AlignmentOrigin class methodsFor:'interface specs'!
+
+windowSpec
+ "This resource specification was automatically generated
+ by the UIPainter of ST/X."
+
+ "Do not manually edit this!! If it is corrupted,
+ the UIPainter may not be able to read the specification."
+
+ "
+ UIPainter new openOnClass:UILayoutTool::AlignmentOrigin andSelector:#windowSpec
+ UILayoutTool::AlignmentOrigin new openInterface:#windowSpec
+ UILayoutTool::AlignmentOrigin open
+ "
+
+ <resource: #canvas>
+
+ ^
+ #(#FullSpec
+ #name: #windowSpec
+ #window:
+ #(#WindowSpec
+ #label: 'UILayoutTool-AlignmentOrigin'
+ #name: 'UILayoutTool-AlignmentOrigin'
+ #min: #(#Point 10 10)
+ #max: #(#Point 1152 900)
+ #bounds: #(#Rectangle 42 231 447 438)
+ )
+ #component:
+ #(#SpecCollection
+ #collection: #(
+ #(#UISubSpecification
+ #name: 'layoutOriginSpec'
+ #layout: #(#LayoutFrame 1 0.0 6 0 0 1.0 111 0)
+ #majorKey: #UILayoutTool
+ #minorKey: #layoutOriginSpec
+ )
+ #(#FramedBoxSpec
+ #label: 'Alignment'
+ #name: 'FramedBox'
+ #layout: #(#LayoutFrame 1 0.0 113 0 0 1.0 208 0)
+ #labelPosition: #topLeft
+ #component:
+ #(#SpecCollection
+ #collection: #(
+ #(#LabelSpec
+ #label: 'Horizontal:'
+ #name: 'alignHLabel'
+ #layout: #(#AlignmentOrigin 88 0 17 0 1 0)
+ #adjust: #right
+ )
+ #(#InputFieldSpec
+ #attributes:
+ #(#tabable
+ true
+ )
+ #name: 'leftAlignmentFractionField'
+ #layout: #(#LayoutFrame 90 0 14 0 147 0 36 0)
+ #activeHelpKey: #alignHorizontal
+ #tabable: true
+ #model: #leftAlignmentFraction
+ #group: #inputGroup
+ #type: #numberOrNil
+ #acceptOnLostFocus: true
+ #acceptChannel: #acceptChannel
+ #modifiedChannel: #modifiedChannel
+ #acceptOnPointerLeave: false
+ )
+ #(#LabelSpec
+ #label: 'Vertical:'
+ #name: 'alignVLabel'
+ #layout: #(#AlignmentOrigin 88 0 43 0 1 0)
+ #adjust: #right
+ )
+ #(#InputFieldSpec
+ #attributes:
+ #(#tabable
+ true
+ )
+ #name: 'topAlignmentFractionField'
+ #layout: #(#LayoutFrame 90 0 40 0 147 0 62 0)
+ #activeHelpKey: #alignVertical
+ #tabable: true
+ #model: #topAlignmentFraction
+ #group: #inputGroup
+ #type: #numberOrNil
+ #acceptOnLostFocus: true
+ #acceptChannel: #acceptChannel
+ #modifiedChannel: #modifiedChannel
+ #acceptOnPointerLeave: false
+ )
+ #(#DividerSpec
+ #name: 'separator1'
+ #layout: #(#LayoutFrame 204 0 19 0 245 0 22 0)
+ )
+ #(#DividerSpec
+ #name: 'separator2'
+ #layout: #(#LayoutFrame 204 0 55 0 245 0 58 0)
+ )
+ #(#DividerSpec
+ #name: 'separator3'
+ #layout: #(#LayoutFrame 196 0 28 0 199 0 50 0)
+ #orientation: #vertical
+ )
+ #(#DividerSpec
+ #name: 'separator4'
+ #layout: #(#LayoutFrame 250 0 28 0 253 0 50 0)
+ #orientation: #vertical
+ )
+ #(#ActionButtonSpec
+ #attributes:
+ #(#tabable
+ true
+ )
+ #name: 'alignTopLeft'
+ #layout: #(#LayoutFrame 190 0 14 0 204 0 28 0)
+ #activeHelpKey: #alignTopLeft
+ #tabable: true
+ #model: #alignTopLeft
+ )
+ #(#ActionButtonSpec
+ #attributes:
+ #(#tabable
+ true
+ )
+ #name: 'alignTopCenter'
+ #layout: #(#LayoutFrame 217 0 14 0 231 0 28 0)
+ #activeHelpKey: #alignTopCenter
+ #tabable: true
+ #model: #alignTopCenter
+ )
+ #(#ActionButtonSpec
+ #attributes:
+ #(#tabable
+ true
+ )
+ #name: 'alignTopRight'
+ #layout: #(#LayoutFrame 245 0 14 0 259 0 28 0)
+ #activeHelpKey: #alignTopRight
+ #tabable: true
+ #model: #alignTopRight
+ )
+ #(#ActionButtonSpec
+ #attributes:
+ #(#tabable
+ true
+ )
+ #name: 'alignLeftCenter'
+ #layout: #(#LayoutFrame 190 0 32 0 204 0 46 0)
+ #activeHelpKey: #alignLeftCenter
+ #tabable: true
+ #model: #alignLeftCenter
+ )
+ #(#ActionButtonSpec
+ #attributes:
+ #(#tabable
+ true
+ )
+ #name: 'alignCenter'
+ #layout: #(#LayoutFrame 217 0 32 0 231 0 46 0)
+ #activeHelpKey: #alignCenter
+ #tabable: true
+ #model: #alignCenter
+ )
+ #(#ActionButtonSpec
+ #attributes:
+ #(#tabable
+ true
+ )
+ #name: 'alignRightCenter'
+ #layout: #(#LayoutFrame 245 0 32 0 259 0 46 0)
+ #activeHelpKey: #alignRightCenter
+ #tabable: true
+ #model: #alignRightCenter
+ )
+ #(#ActionButtonSpec
+ #attributes:
+ #(#tabable
+ true
+ )
+ #name: 'alignBottomLeft'
+ #layout: #(#LayoutFrame 190 0 50 0 204 0 64 0)
+ #activeHelpKey: #alignBottomLeft
+ #tabable: true
+ #model: #alignBottomLeft
+ )
+ #(#ActionButtonSpec
+ #attributes:
+ #(#tabable
+ true
+ )
+ #name: 'alignBottomCenter'
+ #layout: #(#LayoutFrame 217 0 50 0 231 0 64 0)
+ #activeHelpKey: #alignBottomCenter
+ #tabable: true
+ #model: #alignBottomCenter
+ )
+ #(#ActionButtonSpec
+ #attributes:
+ #(#tabable
+ true
+ )
+ #name: 'alignBottomRight'
+ #layout: #(#LayoutFrame 245 0 50 0 259 0 64 0)
+ #activeHelpKey: #alignBottomRight
+ #tabable: true
+ #model: #alignBottomRight
+ )
+ )
+
+ )
+ )
+ )
+
+ )
+ )
+! !
+
+!UILayoutTool::AlignmentOrigin methodsFor:'accessing'!
+
+fetch:aView spec:aSpec
+ "fetch alignmentOrigin
+ "
+ |layout type
+ leftAlignmentFractionHolder topAlignmentFractionHolder
+ leftOffsetHolder leftFractionHolder topOffsetHolder topFractionHolder|
+
+ type := UIPainterView layoutType:aView.
+ layout := aView geometryLayout.
+
+ leftOffsetHolder := (self aspectFor:#leftOffset).
+ leftFractionHolder := (self aspectFor:#leftFraction).
+ topOffsetHolder := (self aspectFor:#topOffset).
+ topFractionHolder := (self aspectFor:#topFraction).
+ leftAlignmentFractionHolder := (self aspectFor:#leftAlignmentFraction).
+ topAlignmentFractionHolder := (self aspectFor:#topAlignmentFraction).
+
+ layout isLayout ifTrue:[
+ leftOffsetHolder value:(layout leftOffset).
+ leftFractionHolder value:(layout leftFraction).
+ topOffsetHolder value:(layout topOffset).
+ topFractionHolder value:(layout topFraction).
+
+ type == #AlignmentOrigin ifTrue:[
+ leftAlignmentFractionHolder value:(layout leftAlignmentFraction).
+ topAlignmentFractionHolder value:(layout topAlignmentFraction).
+ ^ self
+ ]
+ ] ifFalse:[
+ layout := aView computeOrigin.
+
+ leftOffsetHolder value:(layout x).
+ leftFractionHolder value:0.
+ topOffsetHolder value:(layout y).
+ topFractionHolder value:0.
+ ].
+ leftAlignmentFractionHolder value:0.
+ topAlignmentFractionHolder value:0.
+
+
+!
+
+layout
+ "returns current layout as alignmentOrigin
+ "
+ |layout|
+
+ layout := Smalltalk::AlignmentOrigin new.
+
+ layout leftOffset:((self aspectFor:#leftOffset) value) ? 0.
+ layout topOffset:((self aspectFor:#topOffset) value) ? 0.
+ layout leftFraction:((self aspectFor:#leftFraction) value) ? 0.
+ layout topFraction:((self aspectFor:#topFraction) value) ? 0.
+
+ layout leftAlignmentFraction:((self aspectFor:#leftAlignmentFraction) value) ? 0.
+ layout topAlignmentFraction:((self aspectFor:#topAlignmentFraction) value) ? 0.
+
+ ^ layout
+! !
+
+!UILayoutTool::AlignmentOrigin methodsFor:'alignment'!
+
+alignBottomCenter
+ self makeAlignLeft:0.5 top:1
+
+
+!
+
+alignBottomLeft
+ self makeAlignLeft:0 top:1
+
+
+!
+
+alignBottomRight
+ self makeAlignLeft:1 top:1
+
+
+!
+
+alignCenter
+ self makeAlignLeft:0.5 top:0.5
+
+
+!
+
+alignLeftCenter
+ self makeAlignLeft:0 top:0.5
+
+
+!
+
+alignRightCenter
+ self makeAlignLeft:1 top:0.5
+
+
+!
+
+alignTopCenter
+ self makeAlignLeft:0.5 top:0
+
+
+!
+
+alignTopLeft
+ self makeAlignLeft:0 top:0
+
+
+!
+
+alignTopRight
+ self makeAlignLeft:1 top:0
+
+
+!
+
+makeAlignLeft:leftAlignmentFraction top:topAlignmentFraction
+ |lAF tAF lO tO ext lAHolder tAHolder lOHolder tOHolder|
+
+ lAF := (lAHolder := self aspectFor:#leftAlignmentFraction) value ? 0.
+ tAF := (tAHolder := self aspectFor:#topAlignmentFraction) value ? 0.
+ ext := (self aspectFor:#layoutView) computeExtent.
+
+ lAHolder value:leftAlignmentFraction.
+ tAHolder value:topAlignmentFraction.
+
+ lO := (lOHolder := self aspectFor:#leftOffset) value ? 0.
+ tO := (tOHolder := self aspectFor:#topOffset) value ? 0.
+
+ lO := lO + (ext x * (leftAlignmentFraction - lAF)).
+ tO := tO + (ext y * (topAlignmentFraction - tAF)).
+
+ lOHolder value:(lO rounded).
+ tOHolder value:(tO rounded).
+
+!
+
+makeAlignTopRight
+ self makeAlignLeft:1 top:0
+
+
+! !
+
+!UILayoutTool::Rectangle class methodsFor:'interface specs'!
+
+windowSpec
+ "This resource specification was automatically generated
+ by the UIPainter of ST/X."
+
+ "Do not manually edit this!! If it is corrupted,
+ the UIPainter may not be able to read the specification."
+
+ "
+ UIPainter new openOnClass:UILayoutTool::Rectangle andSelector:#windowSpec
+ UILayoutTool::Rectangle new openInterface:#windowSpec
+ UILayoutTool::Rectangle open
+ "
+
+ <resource: #canvas>
+
+ ^
+
+ #(#FullSpec
+ #window:
+ #(#WindowSpec
+ #name: 'UILayoutTool-Rectangle'
+ #layout: #(#LayoutFrame 291 0 130 0 632 0 328 0)
+ #label: 'UILayoutTool-Rectangle'
+ #min: #(#Point 10 10)
+ #max: #(#Point 1152 900)
+ #bounds: #(#Rectangle 291 130 633 329)
+ #usePreferredExtent: false
+ )
+ #component:
+ #(#SpecCollection
+ #collection:
+ #(
+ #(#UISubSpecification
+ #name: 'subSpecification'
+ #layout: #(#LayoutFrame 1 0.0 6 0 0 1.0 96 0)
+ #majorKey: #UILayoutTool
+ #minorKey: #layoutPointSpec
+ )
+ #(#FramedBoxSpec
+ #name: 'FramedBox'
+ #layout: #(#LayoutFrame 1 0.0 99 0 0 1.0 194 0)
+ #component:
+ #(#SpecCollection
+ #collection:
+ #(
+ #(#LabelSpec
+ #name: 'labelCornerY'
+ #layout: #(#AlignmentOrigin 83 0 16 0 1 0)
+ #label: 'Right:'
+ #adjust: #left
+ )
+ #(#InputFieldSpec
+ #name: 'fieldCornerX'
+ #layout: #(#LayoutFrame 85 0 13 0 135 0 35 0)
+ #activeHelpKey: #cornerX
+ #tabable: true
+ #model: #rightOffset
+ #group: #inputGroup
+ #type: #numberOrNil
+ #acceptOnLostFocus: true
+ #acceptChannel: #acceptChannel
+ #modifiedChannel: #modifiedChannel
+ )
+ #(#LabelSpec
+ #name: 'labelCornerX'
+ #layout: #(#AlignmentOrigin 83 0 41 0 1 0)
+ #label: 'Bottom:'
+ #adjust: #left
+ )
+ #(#InputFieldSpec
+ #name: 'fieldCornerY'
+ #layout: #(#LayoutFrame 85 0 38 0 135 0 60 0)
+ #activeHelpKey: #cornerY
+ #tabable: true
+ #model: #bottomOffset
+ #group: #inputGroup
+ #type: #numberOrNil
+ #acceptOnLostFocus: true
+ #acceptChannel: #acceptChannel
+ #modifiedChannel: #modifiedChannel
+ )
+ )
+ )
+ #label: 'Corner'
+ #labelPosition: #topLeft
+ )
+ )
+ )
+ )
+
+ "Modified: / 13.8.1998 / 19:59:16 / cg"
+! !
+
+!UILayoutTool::Rectangle methodsFor:'accessing'!
+
+fetch:aView spec:aSpec
+ "fetch rectangle
+ "
+ |origin corner|
+
+ origin := aView computeOrigin.
+ corner := aView computeCorner.
+
+ (self aspectFor:#leftOffset) value:(origin x).
+ (self aspectFor:#rightOffset) value:(corner x).
+ (self aspectFor:#topOffset) value:(origin y).
+ (self aspectFor:#bottomOffset) value:(corner y).
+
+
+!
+
+layout
+ "returns current layout as rectangle
+ "
+ ^ Smalltalk::Rectangle left:(((self aspectFor:#leftOffset) value) ? 0)
+ top:(((self aspectFor:#topOffset) value) ? 0)
+ right:(((self aspectFor:#rightOffset) value) ? 0)
+ bottom:(((self aspectFor:#bottomOffset) value) ? 0)
+
+
+! !
+
+!UILayoutTool::Point class methodsFor:'interface specs'!
+
+windowSpec
+ "This resource specification was automatically generated
+ by the UIPainter of ST/X."
+
+ "Do not manually edit this!! If it is corrupted,
+ the UIPainter may not be able to read the specification."
+
+ "
+ UIPainter new openOnClass:UILayoutTool::Point andSelector:#windowSpec
+ UILayoutTool::Point new openInterface:#windowSpec
+ UILayoutTool::Point open
+ "
+
+ <resource: #canvas>
+
+ ^
+
+ #(#FullSpec
+ #window:
+ #(#WindowSpec
+ #name: 'UILayoutTool-Point'
+ #layout: #(#LayoutFrame 324 0 410 0 618 0 547 0)
+ #label: 'UILayoutTool-Point'
+ #min: #(#Point 10 10)
+ #max: #(#Point 1152 900)
+ #bounds: #(#Rectangle 324 410 619 548)
+ #usePreferredExtent: false
+ )
+ #component:
+ #(#SpecCollection
+ #collection:
+ #(
+ #(#UISubSpecification
+ #name: 'layoutPointSpec'
+ #layout: #(#LayoutFrame 1 0.0 6 0 0 1.0 100 0)
+ #majorKey: #UILayoutTool
+ #minorKey: #layoutPointSpec
+ )
+ )
+ )
+ )
+! !
+
+!UILayoutTool::Point methodsFor:'accessing'!
+
+fetch:aView spec:aSpec
+ "fetch point
+ "
+ |origin|
+
+ origin := aView computeOrigin.
+
+ (self aspectFor:#leftOffset) value:(origin x).
+ (self aspectFor:#topOffset) value:(origin y).
+
+
+!
+
+layout
+ "returns current layout as point
+ "
+ ^ Smalltalk::Point x:(((self aspectFor:#leftOffset) value) ? 0)
+ y:(((self aspectFor:#topOffset) value) ? 0)
+
+! !
+
!UILayoutTool::LayoutFrame class methodsFor:'help specs'!
helpSpec
@@ -1063,133 +1785,175 @@
<resource: #canvas>
- ^
-
- #(#FullSpec
- #name: #windowSpec
- #window:
- #(#WindowSpec
- #name: 'UILayoutTool-LayoutFrame'
- #layout: #(#LayoutFrame 216 0 173 0 614 0 475 0)
+ ^
+ #(#FullSpec
+ #name: #windowSpec
+ #window:
+ #(#WindowSpec
+ #label: 'UILayoutTool-LayoutFrame'
+ #name: 'UILayoutTool-LayoutFrame'
+ #min: #(#Point 10 10)
+ #max: #(#Point 1152 900)
+ #bounds: #(#Rectangle 228 240 627 543)
+ #forceRecursiveBackground: false
+ )
+ #component:
+ #(#SpecCollection
+ #collection: #(
+ #(#UISubSpecification
+ #name: 'layoutOriginSpec'
+ #layout: #(#LayoutFrame 1 0.0 6 0 0 1.0 110 0)
+ #majorKey: #UILayoutTool
+ #minorKey: #layoutOriginSpec
+ )
+ #(#FramedBoxSpec
+ #label: 'Corner'
+ #name: 'FramedBox'
+ #layout: #(#LayoutFrame 1 0.0 113 0 0 1.0 214 0)
+ #labelPosition: #topLeft
+ #component:
+ #(#SpecCollection
+ #collection: #(
+ #(#LabelSpec
+ #label: 'Right:'
+ #name: 'labelRight'
+ #layout: #(#AlignmentOrigin 88 0 25 0 1 0.5)
+ )
+ #(#InputFieldSpec
+ #attributes:
+ #(#fieldRightFraction
+ nil #tabable
+ true
+ )
+ #name: 'fieldRightFraction'
+ #layout: #(#LayoutFrame 90 0 14 0 140 0 36 0)
+ #activeHelpKey: #rightRelative
+ #tabable: true
+ #model: #rightFraction
+ #group: #inputGroup
+ #type: #numberOrNil
+ #acceptOnLostFocus: true
+ #acceptChannel: #acceptChannel
+ #modifiedChannel: #modifiedChannel
+ #acceptOnPointerLeave: false
+ )
+ #(#ActionButtonSpec
+ #attributes:
+ #(#tabable
+ true
+ )
+ #name: 'actionRelativeRight'
+ #layout: #(#LayoutFrame 145 0 14 0 167 0 36 0)
+ #activeHelpKey: #makeRightRelative
+ #tabable: true
+ #model: #relativeRight
+ )
+ #(#InputFieldSpec
+ #attributes:
+ #(#fieldRightOffset
+ nil #tabable
+ true
+ )
+ #name: 'fieldRightOffset'
+ #layout: #(#LayoutFrame 190 0 14 0 240 0 36 0)
+ #activeHelpKey: #rightAbsolute
+ #tabable: true
+ #model: #rightOffset
+ #group: #inputGroup
+ #type: #numberOrNil
+ #acceptOnLostFocus: true
+ #acceptChannel: #acceptChannel
+ #modifiedChannel: #modifiedChannel
+ #acceptOnPointerLeave: false
+ )
+ #(#ActionButtonSpec
+ #attributes:
+ #(#tabable
+ true
+ )
+ #name: 'actionAbsoluteRight'
+ #layout: #(#LayoutFrame 245 0 14 0 267 0 36 0)
+ #activeHelpKey: #makeRightAbsolute
+ #tabable: true
+ #model: #absoluteRight
+ )
+ #(#LabelSpec
+ #label: 'Bottom:'
+ #name: 'labelBottom'
+ #layout: #(#AlignmentOrigin 88 0 53 0 1 0.5)
+ )
+ #(#InputFieldSpec
+ #attributes:
+ #(#fieldBottomFraction
+ nil #tabable
+ true
+ )
+ #name: 'fieldBottomFraction'
+ #layout: #(#LayoutFrame 90 0 42 0 140 0 64 0)
+ #activeHelpKey: #bottomRelative
+ #tabable: true
+ #model: #bottomFraction
+ #group: #inputGroup
+ #type: #numberOrNil
+ #acceptOnLostFocus: true
+ #acceptChannel: #acceptChannel
+ #modifiedChannel: #modifiedChannel
+ #acceptOnPointerLeave: false
+ )
+ #(#ActionButtonSpec
+ #attributes:
+ #(#tabable
+ true
+ )
+ #name: 'actionRelativeBottom'
+ #layout: #(#LayoutFrame 145 0 42 0 167 0 64 0)
+ #activeHelpKey: #makeBottomRelative
+ #tabable: true
+ #model: #relativeBottom
+ )
+ #(#InputFieldSpec
+ #attributes:
+ #(#fieldBottomOffset
+ nil #tabable
+ true
+ )
+ #name: 'fieldBottomOffset'
+ #layout: #(#LayoutFrame 190 0 42 0 240 0 64 0)
+ #activeHelpKey: #bottomAbsolute
+ #tabable: true
+ #model: #bottomOffset
+ #group: #inputGroup
+ #type: #numberOrNil
+ #acceptOnLostFocus: true
+ #acceptChannel: #acceptChannel
+ #modifiedChannel: #modifiedChannel
+ #acceptOnPointerLeave: false
+ )
+ #(#ActionButtonSpec
+ #attributes:
+ #(#tabable
+ true
+ )
+ #name: 'actionAbsoluteBottom'
+ #layout: #(#LayoutFrame 245 0 42 0 267 0 64 0)
+ #activeHelpKey: #makeBottomAbsolute
+ #tabable: true
+ #model: #absoluteBottom
+ )
+ )
+
+ )
+ )
+ #(#MenuPanelSpec
+ #name: 'commonLayoutToolBar'
+ #layout: #(#LayoutFrame 10 0.0 224 0 0 1.0 256 0)
#level: 0
- #label: 'UILayoutTool-LayoutFrame'
- #min: #(#Point 10 10)
- #max: #(#Point 1152 900)
- #bounds: #(#Rectangle 216 173 615 476)
- #usePreferredExtent: false
- #forceRecursiveBackground: false
- #returnIsOKInDialog: true
- #escapeIsCancelInDialog: true
- )
- #component:
- #(#SpecCollection
- #collection:
- #(
- #(#UISubSpecification
- #name: 'layoutOriginSpec'
- #layout: #(#LayoutFrame 1 0.0 6 0 0 1.0 110 0)
- #majorKey: #UILayoutTool
- #minorKey: #layoutOriginSpec
- )
- #(#FramedBoxSpec
- #name: 'FramedBox'
- #layout: #(#LayoutFrame 1 0.0 113 0 0 1.0 214 0)
- #component:
- #(#SpecCollection
- #collection:
- #(
- #(#LabelSpec
- #name: 'labelRight'
- #layout: #(#AlignmentOrigin 88 0 25 0 1 0.5)
- #label: 'Right:'
- )
- #(#InputFieldSpec
- #name: 'fieldRightFraction'
- #layout: #(#LayoutFrame 90 0 14 0 140 0 36 0)
- #activeHelpKey: #rightRelative
- #model: #rightFraction
- #group: #inputGroup
- #type: #numberOrNil
- #acceptOnLostFocus: true
- #acceptChannel: #acceptChannel
- #modifiedChannel: #modifiedChannel
- )
- #(#ActionButtonSpec
- #name: 'actionRelativeRight'
- #layout: #(#LayoutFrame 145 0 14 0 167 0 36 0)
- #activeHelpKey: #makeRightRelative
- #model: #relativeRight
- )
- #(#InputFieldSpec
- #name: 'fieldRightOffset'
- #layout: #(#LayoutFrame 190 0 14 0 240 0 36 0)
- #activeHelpKey: #rightAbsolute
- #model: #rightOffset
- #group: #inputGroup
- #type: #numberOrNil
- #acceptOnLostFocus: true
- #acceptChannel: #acceptChannel
- #modifiedChannel: #modifiedChannel
- )
- #(#ActionButtonSpec
- #name: 'actionAbsoluteRight'
- #layout: #(#LayoutFrame 245 0 14 0 267 0 36 0)
- #activeHelpKey: #makeRightAbsolute
- #model: #absoluteRight
- )
- #(#LabelSpec
- #name: 'labelBottom'
- #layout: #(#AlignmentOrigin 88 0 53 0 1 0.5)
- #label: 'Bottom:'
- )
- #(#InputFieldSpec
- #name: 'fieldBottomFraction'
- #layout: #(#LayoutFrame 90 0 42 0 140 0 64 0)
- #activeHelpKey: #bottomRelative
- #model: #bottomFraction
- #group: #inputGroup
- #type: #numberOrNil
- #acceptOnLostFocus: true
- #acceptChannel: #acceptChannel
- #modifiedChannel: #modifiedChannel
- )
- #(#ActionButtonSpec
- #name: 'actionRelativeBottom'
- #layout: #(#LayoutFrame 145 0 42 0 167 0 64 0)
- #activeHelpKey: #makeBottomRelative
- #model: #relativeBottom
- )
- #(#InputFieldSpec
- #name: 'fieldBottomOffset'
- #layout: #(#LayoutFrame 190 0 42 0 240 0 64 0)
- #activeHelpKey: #bottomAbsolute
- #model: #bottomOffset
- #group: #inputGroup
- #type: #numberOrNil
- #acceptOnLostFocus: true
- #acceptChannel: #acceptChannel
- #modifiedChannel: #modifiedChannel
- )
- #(#ActionButtonSpec
- #name: 'actionAbsoluteBottom'
- #layout: #(#LayoutFrame 245 0 42 0 267 0 64 0)
- #activeHelpKey: #makeBottomAbsolute
- #model: #absoluteBottom
- )
- )
- )
- #label: 'Corner'
- #labelPosition: #topLeft
- )
- #(#MenuPanelSpec
- #name: 'commonLayoutToolBar'
- #layout: #(#LayoutFrame 10 0.0 224 0 0 1.0 256 0)
- #level: 0
- #menu: #commonFrameLayoutsMenu
- #textDefault: true
- )
- )
- )
+ #menu: #commonFrameLayoutsMenu
+ #textDefault: true
+ )
+ )
+
+ )
)
! !
@@ -1447,517 +2211,6 @@
bottom:0.5 offset:0
! !
-!UILayoutTool::LayoutOrigin class methodsFor:'interface specs'!
-
-windowSpec
- "This resource specification was automatically generated
- by the UIPainter of ST/X."
-
- "Do not manually edit this!! If it is corrupted,
- the UIPainter may not be able to read the specification."
-
- "
- UIPainter new openOnClass:UILayoutTool::LayoutOrigin andSelector:#windowSpec
- UILayoutTool::LayoutOrigin new openInterface:#windowSpec
- UILayoutTool::LayoutOrigin open
- "
-
- <resource: #canvas>
-
- ^
-
- #(#FullSpec
- #window:
- #(#WindowSpec
- #name: 'UILayoutTool-LayoutOrigin'
- #layout: #(#LayoutFrame 290 0 420 0 647 0 565 0)
- #label: 'UILayoutTool-LayoutOrigin'
- #min: #(#Point 10 10)
- #max: #(#Point 1152 900)
- #bounds: #(#Rectangle 290 420 648 566)
- #usePreferredExtent: false
- )
- #component:
- #(#SpecCollection
- #collection:
- #(
- #(#UISubSpecification
- #name: 'layoutOriginSpec'
- #layout: #(#LayoutFrame 1 0.0 6 0 0 1.0 110 0)
- #majorKey: #UILayoutTool
- #minorKey: #layoutOriginSpec
- )
- )
- )
- )
-! !
-
-!UILayoutTool::LayoutOrigin methodsFor:'accessing'!
-
-fetch:aView spec:aSpec
- "fetch layoutOrigin
- "
- |layout|
-
- layout := UIPainterView asLayoutFrameFromView:aView.
-
- (self aspectFor:#leftOffset) value:(layout leftOffset).
- (self aspectFor:#leftFraction) value:(layout leftFraction).
- (self aspectFor:#topOffset) value:(layout topOffset).
- (self aspectFor:#topFraction) value:(layout topFraction).
-
-
-!
-
-layout
- "returns current layout as layoutOrigin
- "
- |layout|
-
- layout := Smalltalk::LayoutOrigin new.
-
- layout leftOffset:((self aspectFor:#leftOffset) value) ? 0.
- layout topOffset:((self aspectFor:#topOffset) value) ? 0.
- layout leftFraction:((self aspectFor:#leftFraction) value) ? 0.
- layout topFraction:((self aspectFor:#topFraction) value) ? 0.
-
- ^ layout
-
-! !
-
-!UILayoutTool::Point class methodsFor:'interface specs'!
-
-windowSpec
- "This resource specification was automatically generated
- by the UIPainter of ST/X."
-
- "Do not manually edit this!! If it is corrupted,
- the UIPainter may not be able to read the specification."
-
- "
- UIPainter new openOnClass:UILayoutTool::Point andSelector:#windowSpec
- UILayoutTool::Point new openInterface:#windowSpec
- UILayoutTool::Point open
- "
-
- <resource: #canvas>
-
- ^
-
- #(#FullSpec
- #window:
- #(#WindowSpec
- #name: 'UILayoutTool-Point'
- #layout: #(#LayoutFrame 324 0 410 0 618 0 547 0)
- #label: 'UILayoutTool-Point'
- #min: #(#Point 10 10)
- #max: #(#Point 1152 900)
- #bounds: #(#Rectangle 324 410 619 548)
- #usePreferredExtent: false
- )
- #component:
- #(#SpecCollection
- #collection:
- #(
- #(#UISubSpecification
- #name: 'layoutPointSpec'
- #layout: #(#LayoutFrame 1 0.0 6 0 0 1.0 100 0)
- #majorKey: #UILayoutTool
- #minorKey: #layoutPointSpec
- )
- )
- )
- )
-! !
-
-!UILayoutTool::Point methodsFor:'accessing'!
-
-fetch:aView spec:aSpec
- "fetch point
- "
- |origin|
-
- origin := aView computeOrigin.
-
- (self aspectFor:#leftOffset) value:(origin x).
- (self aspectFor:#topOffset) value:(origin y).
-
-
-!
-
-layout
- "returns current layout as point
- "
- ^ Smalltalk::Point x:(((self aspectFor:#leftOffset) value) ? 0)
- y:(((self aspectFor:#topOffset) value) ? 0)
-
-! !
-
-!UILayoutTool::AlignmentOrigin class methodsFor:'help specs'!
-
-helpSpec
- "This resource specification was automatically generated
- by the UIHelpTool of ST/X."
-
- "Do not manually edit this!! If it is corrupted,
- the UIHelpTool may not be able to read the specification."
-
- "
- UIHelpTool openOnClass:UILayoutTool::AlignmentOrigin
- "
-
- <resource: #help>
-
- ^super helpSpec addPairsFrom:#(
-
-#alignBottomCenter
-'Aligns the selected widget bottomCenter to location.'
-
-#alignBottomLeft
-'Aligns the selected widget bottomLeft to location.'
-
-#alignBottomRight
-'Aligns the selected widget bottomRight to location.'
-
-#alignCenter
-'Aligns the selected widget center to location.'
-
-#alignHorizontal
-'Horizontal inset to the location point of the selected widget.'
-
-#alignLeftCenter
-'Aligns the selected widget leftCenter to location.'
-
-#alignRightCenter
-'Aligns the selected widget rightCenter to location.'
-
-#alignTopCenter
-'Aligns the selected widget topCenter to location.'
-
-#alignTopLeft
-'Aligns the selected widget topLeft to location.'
-
-#alignTopRight
-'Aligns the selected widget topRight to location.'
-
-#alignVertical
-'Vertical inset to the location point of the widget.'
-
-)
-! !
-
-!UILayoutTool::AlignmentOrigin class methodsFor:'interface specs'!
-
-windowSpec
- "This resource specification was automatically generated
- by the UIPainter of ST/X."
-
- "Do not manually edit this!! If it is corrupted,
- the UIPainter may not be able to read the specification."
-
- "
- UIPainter new openOnClass:UILayoutTool::AlignmentOrigin andSelector:#windowSpec
- UILayoutTool::AlignmentOrigin new openInterface:#windowSpec
- UILayoutTool::AlignmentOrigin open
- "
-
- <resource: #canvas>
-
- ^
-
- #(#FullSpec
- #window:
- #(#WindowSpec
- #name: 'UILayoutTool-AlignmentOrigin'
- #layout: #(#LayoutFrame 291 0 130 0 695 0 336 0)
- #label: 'UILayoutTool-AlignmentOrigin'
- #min: #(#Point 10 10)
- #max: #(#Point 1152 900)
- #bounds: #(#Rectangle 291 130 696 337)
- #usePreferredExtent: false
- )
- #component:
- #(#SpecCollection
- #collection:
- #(
- #(#UISubSpecification
- #name: 'layoutOriginSpec'
- #layout: #(#LayoutFrame 1 0.0 6 0 0 1.0 111 0)
- #majorKey: #UILayoutTool
- #minorKey: #layoutOriginSpec
- )
- #(#FramedBoxSpec
- #name: 'FramedBox'
- #layout: #(#LayoutFrame 1 0.0 113 0 0 1.0 208 0)
- #component:
- #(#SpecCollection
- #collection:
- #(
- #(#LabelSpec
- #name: 'alignHLabel'
- #layout: #(#AlignmentOrigin 88 0 17 0 1 0)
- #label: 'Horizontal:'
- #adjust: #right
- )
- #(#LabelSpec
- #name: 'alignVLabel'
- #layout: #(#AlignmentOrigin 88 0 43 0 1 0)
- #label: 'Vertical:'
- #adjust: #right
- )
- #(#InputFieldSpec
- #name: 'leftAlignmentFractionField'
- #layout: #(#LayoutFrame 90 0 14 0 147 0 36 0)
- #activeHelpKey: #alignHorizontal
- #tabable: true
- #model: #leftAlignmentFraction
- #group: #inputGroup
- #type: #numberOrNil
- #acceptOnLostFocus: true
- #acceptChannel: #acceptChannel
- #modifiedChannel: #modifiedChannel
- )
- #(#InputFieldSpec
- #name: 'topAlignmentFractionField'
- #layout: #(#LayoutFrame 90 0 40 0 147 0 62 0)
- #activeHelpKey: #alignVertical
- #tabable: true
- #model: #topAlignmentFraction
- #group: #inputGroup
- #type: #numberOrNil
- #acceptOnLostFocus: true
- #acceptChannel: #acceptChannel
- #modifiedChannel: #modifiedChannel
- )
- #(#DividerSpec
- #name: 'separator1'
- #layout: #(#LayoutFrame 204 0 19 0 245 0 22 0)
- )
- #(#DividerSpec
- #name: 'separator2'
- #layout: #(#LayoutFrame 204 0 55 0 245 0 58 0)
- )
- #(#DividerSpec
- #name: 'separator3'
- #layout: #(#LayoutFrame 196 0 28 0 199 0 50 0)
- #orientation: #vertical
- )
- #(#DividerSpec
- #name: 'separator4'
- #layout: #(#LayoutFrame 250 0 28 0 253 0 50 0)
- #orientation: #vertical
- )
- #(#ActionButtonSpec
- #name: 'alignBottomRight'
- #layout: #(#LayoutFrame 245 0 50 0 259 0 64 0)
- #activeHelpKey: #alignBottomRight
- #model: #alignBottomRight
- )
- #(#ActionButtonSpec
- #name: 'alignTopLeft'
- #layout: #(#LayoutFrame 190 0 14 0 204 0 28 0)
- #activeHelpKey: #alignTopLeft
- #model: #alignTopLeft
- )
- #(#ActionButtonSpec
- #name: 'alignTopRight'
- #layout: #(#LayoutFrame 245 0 14 0 259 0 28 0)
- #activeHelpKey: #alignTopRight
- #model: #alignTopRight
- )
- #(#ActionButtonSpec
- #name: 'alignBottomLeft'
- #layout: #(#LayoutFrame 190 0 50 0 204 0 64 0)
- #activeHelpKey: #alignBottomLeft
- #model: #alignBottomLeft
- )
- #(#ActionButtonSpec
- #name: 'alignTopCenter'
- #layout: #(#LayoutFrame 217 0 14 0 231 0 28 0)
- #activeHelpKey: #alignTopCenter
- #model: #alignTopCenter
- )
- #(#ActionButtonSpec
- #name: 'alignBottomCenter'
- #layout: #(#LayoutFrame 217 0 50 0 231 0 64 0)
- #activeHelpKey: #alignBottomCenter
- #model: #alignBottomCenter
- )
- #(#ActionButtonSpec
- #name: 'alignLeftCenter'
- #layout: #(#LayoutFrame 190 0 32 0 204 0 46 0)
- #activeHelpKey: #alignLeftCenter
- #model: #alignLeftCenter
- )
- #(#ActionButtonSpec
- #name: 'alignRightCenter'
- #layout: #(#LayoutFrame 245 0 32 0 259 0 46 0)
- #activeHelpKey: #alignRightCenter
- #model: #alignRightCenter
- )
- #(#ActionButtonSpec
- #name: 'alignCenter'
- #layout: #(#LayoutFrame 217 0 32 0 231 0 46 0)
- #activeHelpKey: #alignCenter
- #model: #alignCenter
- )
- )
- )
- #label: 'Alignment'
- #labelPosition: #topLeft
- )
- )
- )
- )
-
- "Modified: / 13.8.1998 / 19:57:47 / cg"
-! !
-
-!UILayoutTool::AlignmentOrigin methodsFor:'accessing'!
-
-fetch:aView spec:aSpec
- "fetch alignmentOrigin
- "
- |layout type
- leftAlignmentFractionHolder topAlignmentFractionHolder
- leftOffsetHolder leftFractionHolder topOffsetHolder topFractionHolder|
-
- type := UIPainterView layoutType:aView.
- layout := aView geometryLayout.
-
- leftOffsetHolder := (self aspectFor:#leftOffset).
- leftFractionHolder := (self aspectFor:#leftFraction).
- topOffsetHolder := (self aspectFor:#topOffset).
- topFractionHolder := (self aspectFor:#topFraction).
- leftAlignmentFractionHolder := (self aspectFor:#leftAlignmentFraction).
- topAlignmentFractionHolder := (self aspectFor:#topAlignmentFraction).
-
- layout isLayout ifTrue:[
- leftOffsetHolder value:(layout leftOffset).
- leftFractionHolder value:(layout leftFraction).
- topOffsetHolder value:(layout topOffset).
- topFractionHolder value:(layout topFraction).
-
- type == #AlignmentOrigin ifTrue:[
- leftAlignmentFractionHolder value:(layout leftAlignmentFraction).
- topAlignmentFractionHolder value:(layout topAlignmentFraction).
- ^ self
- ]
- ] ifFalse:[
- layout := aView computeOrigin.
-
- leftOffsetHolder value:(layout x).
- leftFractionHolder value:0.
- topOffsetHolder value:(layout y).
- topFractionHolder value:0.
- ].
- leftAlignmentFractionHolder value:0.
- topAlignmentFractionHolder value:0.
-
-
-!
-
-layout
- "returns current layout as alignmentOrigin
- "
- |layout|
-
- layout := Smalltalk::AlignmentOrigin new.
-
- layout leftOffset:((self aspectFor:#leftOffset) value) ? 0.
- layout topOffset:((self aspectFor:#topOffset) value) ? 0.
- layout leftFraction:((self aspectFor:#leftFraction) value) ? 0.
- layout topFraction:((self aspectFor:#topFraction) value) ? 0.
-
- layout leftAlignmentFraction:((self aspectFor:#leftAlignmentFraction) value) ? 0.
- layout topAlignmentFraction:((self aspectFor:#topAlignmentFraction) value) ? 0.
-
- ^ layout
-! !
-
-!UILayoutTool::AlignmentOrigin methodsFor:'alignment'!
-
-alignBottomCenter
- self makeAlignLeft:0.5 top:1
-
-
-!
-
-alignBottomLeft
- self makeAlignLeft:0 top:1
-
-
-!
-
-alignBottomRight
- self makeAlignLeft:1 top:1
-
-
-!
-
-alignCenter
- self makeAlignLeft:0.5 top:0.5
-
-
-!
-
-alignLeftCenter
- self makeAlignLeft:0 top:0.5
-
-
-!
-
-alignRightCenter
- self makeAlignLeft:1 top:0.5
-
-
-!
-
-alignTopCenter
- self makeAlignLeft:0.5 top:0
-
-
-!
-
-alignTopLeft
- self makeAlignLeft:0 top:0
-
-
-!
-
-alignTopRight
- self makeAlignLeft:1 top:0
-
-
-!
-
-makeAlignLeft:leftAlignmentFraction top:topAlignmentFraction
- |lAF tAF lO tO ext lAHolder tAHolder lOHolder tOHolder|
-
- lAF := (lAHolder := self aspectFor:#leftAlignmentFraction) value ? 0.
- tAF := (tAHolder := self aspectFor:#topAlignmentFraction) value ? 0.
- ext := (self aspectFor:#layoutView) computeExtent.
-
- lAHolder value:leftAlignmentFraction.
- tAHolder value:topAlignmentFraction.
-
- lO := (lOHolder := self aspectFor:#leftOffset) value ? 0.
- tO := (tOHolder := self aspectFor:#topOffset) value ? 0.
-
- lO := lO + (ext x * (leftAlignmentFraction - lAF)).
- tO := tO + (ext y * (topAlignmentFraction - tAF)).
-
- lOHolder value:(lO rounded).
- tOHolder value:(tO rounded).
-
-!
-
-makeAlignTopRight
- self makeAlignLeft:1 top:0
-
-
-! !
-
!UILayoutTool::Extent class methodsFor:'help specs'!
helpSpec
@@ -2001,87 +2254,96 @@
<resource: #canvas>
- ^
-
- #(#FullSpec
- #name: #windowSpec
- #window:
- #(#WindowSpec
- #name: 'UILayoutTool-Extent'
- #layout: #(#LayoutFrame 216 0 173 0 541 0 321 0)
- #level: 0
- #label: 'UILayoutTool-Extent'
- #min: #(#Point 10 10)
- #max: #(#Point 1152 900)
- #bounds: #(#Rectangle 216 173 542 322)
- #usePreferredExtent: false
- #returnIsOKInDialog: true
- #escapeIsCancelInDialog: true
- )
- #component:
- #(#SpecCollection
- #collection:
- #(
- #(#FramedBoxSpec
- #name: 'FramedBox'
- #layout: #(#LayoutFrame 0 0.0 6 0.0 0 1.0 137 0)
- #component:
- #(#SpecCollection
- #collection:
- #(
- #(#LabelSpec
- #name: 'labelWidth'
- #layout: #(#AlignmentOrigin 89 0 24 0 1 0.5)
- #label: 'Width:'
- #adjust: #right
- )
- #(#InputFieldSpec
- #name: 'fieldLeftOffset'
- #layout: #(#LayoutFrame 90 0 13 0 140 0 35 0)
- #activeHelpKey: #hrzExtent
- #enableChannel: #notUsingDefaultExtent
- #tabable: true
- #model: #leftOffset
- #group: #inputGroup
- #type: #numberOrNil
- #acceptOnLostFocus: true
- #acceptChannel: #acceptChannel
- #modifiedChannel: #modifiedChannel
- )
- #(#LabelSpec
- #name: 'labelHeight'
- #layout: #(#AlignmentOrigin 89 0 49 0 1 0.5)
- #label: 'Height:'
- #adjust: #right
- )
- #(#InputFieldSpec
- #name: 'fieldRightOffset'
- #layout: #(#LayoutFrame 90 0 38 0 140 0 60 0)
- #activeHelpKey: #vrtExtent
- #enableChannel: #notUsingDefaultExtent
- #tabable: true
- #model: #rightOffset
- #group: #inputGroup
- #type: #numberOrNil
- #acceptOnLostFocus: true
- #acceptChannel: #acceptChannel
- #modifiedChannel: #modifiedChannel
- )
- #(#CheckBoxSpec
- #name: 'useDefaultExtentCheckBox'
- #layout: #(#LayoutFrame -1 0 75 0 296 0 97 0)
- #model: #useDefaultExtent
- #label: 'Use Widgets Default Extent'
- #translateLabel: true
- #enableChannel: #defaultExtentEnabled
- )
- )
+ ^
+ #(#FullSpec
+ #name: #windowSpec
+ #window:
+ #(#WindowSpec
+ #label: 'UILayoutTool-Extent'
+ #name: 'UILayoutTool-Extent'
+ #min: #(#Point 10 10)
+ #max: #(#Point 1152 900)
+ #bounds: #(#Rectangle 506 24 832 173)
+ )
+ #component:
+ #(#SpecCollection
+ #collection: #(
+ #(#FramedBoxSpec
+ #label: 'Extent'
+ #name: 'FramedBox'
+ #layout: #(#LayoutFrame 0 0.0 6 0.0 0 1.0 137 0)
+ #labelPosition: #topLeft
+ #component:
+ #(#SpecCollection
+ #collection: #(
+ #(#LabelSpec
+ #label: 'Width:'
+ #name: 'labelWidth'
+ #layout: #(#AlignmentOrigin 89 0 24 0 1 0.5)
+ #adjust: #right
+ )
+ #(#InputFieldSpec
+ #attributes:
+ #(#tabable
+ true
)
- #label: 'Extent'
- #labelPosition: #topLeft
- )
+ #name: 'fieldLeftOffset'
+ #layout: #(#LayoutFrame 90 0 13 0 140 0 35 0)
+ #activeHelpKey: #hrzExtent
+ #enableChannel: #notUsingDefaultExtent
+ #tabable: true
+ #model: #leftOffset
+ #group: #inputGroup
+ #type: #numberOrNil
+ #acceptOnLostFocus: true
+ #acceptChannel: #acceptChannel
+ #modifiedChannel: #modifiedChannel
+ #acceptOnPointerLeave: false
+ )
+ #(#LabelSpec
+ #label: 'Height:'
+ #name: 'labelHeight'
+ #layout: #(#AlignmentOrigin 89 0 49 0 1 0.5)
+ #adjust: #right
+ )
+ #(#InputFieldSpec
+ #attributes:
+ #(#tabable
+ true
+ )
+ #name: 'fieldRightOffset'
+ #layout: #(#LayoutFrame 90 0 38 0 140 0 60 0)
+ #activeHelpKey: #vrtExtent
+ #enableChannel: #notUsingDefaultExtent
+ #tabable: true
+ #model: #rightOffset
+ #group: #inputGroup
+ #type: #numberOrNil
+ #acceptOnLostFocus: true
+ #acceptChannel: #acceptChannel
+ #modifiedChannel: #modifiedChannel
+ #acceptOnPointerLeave: false
+ )
+ #(#CheckBoxSpec
+ #attributes:
+ #(#tabable
+ true
+ )
+ #label: 'Use Widgets Default Extent'
+ #name: 'useDefaultExtentCheckBox'
+ #layout: #(#Point 5 74)
+ #enableChannel: #defaultExtentEnabled
+ #tabable: true
+ #model: #useDefaultExtent
+ #translateLabel: true
+ )
+ )
+
)
- )
+ )
+ )
+
+ )
)
! !
@@ -2108,130 +2370,6 @@
! !
-!UILayoutTool::Rectangle class methodsFor:'interface specs'!
-
-windowSpec
- "This resource specification was automatically generated
- by the UIPainter of ST/X."
-
- "Do not manually edit this!! If it is corrupted,
- the UIPainter may not be able to read the specification."
-
- "
- UIPainter new openOnClass:UILayoutTool::Rectangle andSelector:#windowSpec
- UILayoutTool::Rectangle new openInterface:#windowSpec
- UILayoutTool::Rectangle open
- "
-
- <resource: #canvas>
-
- ^
-
- #(#FullSpec
- #window:
- #(#WindowSpec
- #name: 'UILayoutTool-Rectangle'
- #layout: #(#LayoutFrame 291 0 130 0 632 0 328 0)
- #label: 'UILayoutTool-Rectangle'
- #min: #(#Point 10 10)
- #max: #(#Point 1152 900)
- #bounds: #(#Rectangle 291 130 633 329)
- #usePreferredExtent: false
- )
- #component:
- #(#SpecCollection
- #collection:
- #(
- #(#UISubSpecification
- #name: 'subSpecification'
- #layout: #(#LayoutFrame 1 0.0 6 0 0 1.0 96 0)
- #majorKey: #UILayoutTool
- #minorKey: #layoutPointSpec
- )
- #(#FramedBoxSpec
- #name: 'FramedBox'
- #layout: #(#LayoutFrame 1 0.0 99 0 0 1.0 194 0)
- #component:
- #(#SpecCollection
- #collection:
- #(
- #(#LabelSpec
- #name: 'labelCornerY'
- #layout: #(#AlignmentOrigin 83 0 16 0 1 0)
- #label: 'Right:'
- #adjust: #left
- )
- #(#InputFieldSpec
- #name: 'fieldCornerX'
- #layout: #(#LayoutFrame 85 0 13 0 135 0 35 0)
- #activeHelpKey: #cornerX
- #tabable: true
- #model: #rightOffset
- #group: #inputGroup
- #type: #numberOrNil
- #acceptOnLostFocus: true
- #acceptChannel: #acceptChannel
- #modifiedChannel: #modifiedChannel
- )
- #(#LabelSpec
- #name: 'labelCornerX'
- #layout: #(#AlignmentOrigin 83 0 41 0 1 0)
- #label: 'Bottom:'
- #adjust: #left
- )
- #(#InputFieldSpec
- #name: 'fieldCornerY'
- #layout: #(#LayoutFrame 85 0 38 0 135 0 60 0)
- #activeHelpKey: #cornerY
- #tabable: true
- #model: #bottomOffset
- #group: #inputGroup
- #type: #numberOrNil
- #acceptOnLostFocus: true
- #acceptChannel: #acceptChannel
- #modifiedChannel: #modifiedChannel
- )
- )
- )
- #label: 'Corner'
- #labelPosition: #topLeft
- )
- )
- )
- )
-
- "Modified: / 13.8.1998 / 19:59:16 / cg"
-! !
-
-!UILayoutTool::Rectangle methodsFor:'accessing'!
-
-fetch:aView spec:aSpec
- "fetch rectangle
- "
- |origin corner|
-
- origin := aView computeOrigin.
- corner := aView computeCorner.
-
- (self aspectFor:#leftOffset) value:(origin x).
- (self aspectFor:#rightOffset) value:(corner x).
- (self aspectFor:#topOffset) value:(origin y).
- (self aspectFor:#bottomOffset) value:(corner y).
-
-
-!
-
-layout
- "returns current layout as rectangle
- "
- ^ Smalltalk::Rectangle left:(((self aspectFor:#leftOffset) value) ? 0)
- top:(((self aspectFor:#topOffset) value) ? 0)
- right:(((self aspectFor:#rightOffset) value) ? 0)
- bottom:(((self aspectFor:#bottomOffset) value) ? 0)
-
-
-! !
-
!UILayoutTool class methodsFor:'documentation'!
version