# HG changeset patch # User Claus Gittinger # Date 950112990 -3600 # Node ID 7d97b214f2acdca8d57441e044cce9a50e3755e9 # Parent 75be821d97c3c0d191f0d11cf7bb05e7ed026797 buttons diff -r 75be821d97c3 -r 7d97b214f2ac UILayoutTool.st --- a/UILayoutTool.st Wed Feb 09 16:48:15 2000 +0100 +++ b/UILayoutTool.st Wed Feb 09 17:16:30 2000 +0100 @@ -21,42 +21,49 @@ category:'Interface-UIPainter' ! -ApplicationModel subclass:#Rectangle +ApplicationModel subclass:#AnyLayout instanceVariableNames:'' classVariableNames:'' poolDictionaries:'' privateIn:UILayoutTool ! -ApplicationModel subclass:#AlignmentOrigin +UILayoutTool::AnyLayout subclass:#AlignmentOrigin + instanceVariableNames:'' + classVariableNames:'' + poolDictionaries:'' + privateIn:UILayoutTool +! + +UILayoutTool::AnyLayout subclass:#LayoutOrigin instanceVariableNames:'' classVariableNames:'' poolDictionaries:'' privateIn:UILayoutTool ! -ApplicationModel subclass:#LayoutOrigin +UILayoutTool::AnyLayout subclass:#LayoutFrame instanceVariableNames:'' classVariableNames:'' poolDictionaries:'' privateIn:UILayoutTool ! -ApplicationModel subclass:#Point +UILayoutTool::AnyLayout subclass:#Point instanceVariableNames:'' classVariableNames:'' poolDictionaries:'' privateIn:UILayoutTool ! -ApplicationModel subclass:#LayoutFrame +UILayoutTool::AnyLayout subclass:#Rectangle instanceVariableNames:'' classVariableNames:'' poolDictionaries:'' privateIn:UILayoutTool ! -ApplicationModel subclass:#Extent +UILayoutTool::AnyLayout subclass:#Extent instanceVariableNames:'' classVariableNames:'' poolDictionaries:'' @@ -194,7 +201,7 @@ #name: 'UILayoutTool' #min: #(#Point 10 10) #max: #(#Point 1152 900) - #bounds: #(#Rectangle 37 37 382 219) + #bounds: #(#Rectangle 12 22 357 204) ) #component: #(#SpecCollection @@ -223,10 +230,11 @@ #layout: #(#AlignmentOrigin 68 0 27 0 1 0) ) #(#ActionButtonSpec - #label: '>' + #label: 'imageFractX' #name: 'actionRelativeLeft' #layout: #(#LayoutFrame 77 0 24 0 99 0 46 0) #activeHelpKey: #makeLeftRelative + #hasCharacterOrientedLabel: false #tabable: true #model: #relativeLeft ) @@ -243,10 +251,11 @@ #acceptOnPointerLeave: false ) #(#ActionButtonSpec - #label: '<' + #label: 'imageAbsXFromRight' #name: 'actionRightRelativeLeft' - #layout: #(#LayoutFrame 158 0 24 0 180 0 46 0) + #layout: #(#LayoutFrame 257 0 24 0 279 0 46 0) #activeHelpKey: #makeLeftRelativeFromRight + #hasCharacterOrientedLabel: false #tabable: true #model: #rightRelativeLeft ) @@ -263,10 +272,11 @@ #acceptOnPointerLeave: false ) #(#ActionButtonSpec - #label: '>' + #label: 'imageAbsX' #name: 'actionAbsoluteLeft' - #layout: #(#LayoutFrame 258 0 24 0 280 0 46 0) + #layout: #(#LayoutFrame 178 0 24 0 200 0 46 0) #activeHelpKey: #makeLeftAbsolute + #hasCharacterOrientedLabel: false #tabable: true #model: #absoluteLeft ) @@ -276,10 +286,11 @@ #layout: #(#AlignmentOrigin 68 0 54 0 1 0) ) #(#ActionButtonSpec - #label: 'v' + #label: 'imageFractY' #name: 'actionRelativeTop' #layout: #(#LayoutFrame 77 0 51 0 99 0 73 0) #activeHelpKey: #makeTopRelative + #hasCharacterOrientedLabel: false #tabable: true #model: #relativeTop ) @@ -296,10 +307,11 @@ #acceptOnPointerLeave: false ) #(#ActionButtonSpec - #label: '^' + #label: 'imageAbsYFromBottom' #name: 'actionBottomRelativeTop' - #layout: #(#LayoutFrame 158 0 51 0 180 0 73 0) + #layout: #(#LayoutFrame 257 0 51 0 279 0 73 0) #activeHelpKey: #makeTopRelativeFromBottom + #hasCharacterOrientedLabel: false #tabable: true #model: #bottomRelativeTop ) @@ -316,10 +328,11 @@ #acceptOnPointerLeave: false ) #(#ActionButtonSpec - #label: 'v' + #label: 'imageAbsY' #name: 'actionAbsoluteTop' - #layout: #(#LayoutFrame 258 0 51 0 280 0 73 0) + #layout: #(#LayoutFrame 178 0 51 0 200 0 73 0) #activeHelpKey: #makeTopAbsolute + #hasCharacterOrientedLabel: false #tabable: true #model: #absoluteTop ) @@ -663,8 +676,8 @@ newOffset := offset + ((fraction * extent) asInteger). newFraction := 0. - offsetHolder value:offset. fractHolder value:newFraction. + offsetHolder value:newOffset. ! absoluteBottom @@ -907,129 +920,121 @@ "Modified: / 4.2.2000 / 22:31:41 / cg" ! ! -!UILayoutTool::Rectangle class methodsFor:'interface specs'! - -windowSpec +!UILayoutTool::AnyLayout class methodsFor:'image specs'! + +imageAbsX "This resource specification was automatically generated - by the UIPainter of ST/X." + by the ImageEditor of ST/X." "Do not manually edit this!! If it is corrupted, - the UIPainter may not be able to read the specification." + the ImageEditor may not be able to read the specification." + + " + self imageAbsX inspect + ImageEditor openOnClass:self andSelector:#imageAbsX + " + + + + ^Icon + constantNamed:#'UILayoutTool imageAbsX' + ifAbsentPut:[(Depth1Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' +<@BP@I@N$L*P*)BZ''8*@@(@B''8*P&)B*$L*PC)@@<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'<@C0@O@N??;??/?>??;0?/C. + + ^Icon + constantNamed:#'UILayoutTool imageAbsXFromRight' + ifAbsentPut:[(Depth1Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@<@BW@IT0%UBU$IT_%@@T@AT_%YBUTIT0%0BP@I@@ + + ^Icon + constantNamed:#'UILayoutTool imageAbsY' + ifAbsentPut:[(Depth1Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??>@@X@A?'' - - ^ - - #(#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 + + + ^Icon + constantNamed:#'UILayoutTool imageAbsYFromBottom' + ifAbsentPut:[(Depth1Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@??B@DO''0DH@ PD@ ^^@I@@$@BP@I@?''>@@X@A??@O@@<@C0@O@?????????? + + ^Icon + constantNamed:#'UILayoutTool::AnyLayout imageFractX' + ifAbsentPut:[(Depth1Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' +<@>PBY@I&A&TJYII$X&@@X@A$X&RRYP)&A&PBY@I<@<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'<@?0C?@O>A?_?0?>A?0C?@O<@ + + ^Icon + constantNamed:#'UILayoutTool::AnyLayout imageFractY' + ifAbsentPut:[(Depth1Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??>@@X@A?''@@X@A??@?0A>@C0@O@A>@O - - ^ - - #(#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 @@ -1881,7 +1818,7 @@ #name: 'UILayoutTool-LayoutFrame' #min: #(#Point 10 10) #max: #(#Point 1152 900) - #bounds: #(#Rectangle 12 36 411 339) + #bounds: #(#Rectangle 12 22 411 325) #forceRecursiveBackground: false ) #component: @@ -1907,10 +1844,11 @@ #layout: #(#AlignmentOrigin 68 0 25 0 1 0.5) ) #(#ActionButtonSpec - #label: '>' + #label: 'imageFractX' #name: 'actionRelativeRight' #layout: #(#LayoutFrame 78 0 14 0 100 0 36 0) #activeHelpKey: #makeRightRelative + #hasCharacterOrientedLabel: false #tabable: true #model: #relativeRight ) @@ -1928,10 +1866,11 @@ #acceptOnPointerLeave: false ) #(#ActionButtonSpec - #label: '<' + #label: 'imageAbsXFromRight' #name: 'actionRightRelativeRight' - #layout: #(#LayoutFrame 158 0 14 0 180 0 36 0) + #layout: #(#LayoutFrame 257 0 14 0 279 0 36 0) #activeHelpKey: #makeRightRelativeFromRight + #hasCharacterOrientedLabel: false #tabable: true #model: #rightRelativeRight ) @@ -1949,10 +1888,11 @@ #acceptOnPointerLeave: false ) #(#ActionButtonSpec - #label: '>' + #label: 'imageAbsX' #name: 'actionAbsoluteRight' - #layout: #(#LayoutFrame 258 0 14 0 280 0 36 0) + #layout: #(#LayoutFrame 178 0 14 0 200 0 36 0) #activeHelpKey: #makeRightAbsolute + #hasCharacterOrientedLabel: false #tabable: true #model: #absoluteRight ) @@ -1962,10 +1902,11 @@ #layout: #(#AlignmentOrigin 68 0 53 0 1 0.5) ) #(#ActionButtonSpec - #label: 'v' + #label: 'imageFractY' #name: 'actionRelativeBottom' #layout: #(#LayoutFrame 78 0 42 0 100 0 64 0) #activeHelpKey: #makeBottomRelative + #hasCharacterOrientedLabel: false #tabable: true #model: #relativeBottom ) @@ -1983,10 +1924,11 @@ #acceptOnPointerLeave: false ) #(#ActionButtonSpec - #label: '^' + #label: 'imageAbsYFromBottom' #name: 'actionBottomRelativeBottom' - #layout: #(#LayoutFrame 158 0 42 0 180 0 64 0) + #layout: #(#LayoutFrame 257 0 42 0 279 0 64 0) #activeHelpKey: #makeBottomRelativeFromBottom + #hasCharacterOrientedLabel: false #tabable: true #model: #bottomRelativeBottom ) @@ -2004,10 +1946,11 @@ #acceptOnPointerLeave: false ) #(#ActionButtonSpec - #label: 'v' + #label: 'imageAbsY' #name: 'actionAbsoluteBottom' - #layout: #(#LayoutFrame 258 0 42 0 280 0 64 0) + #layout: #(#LayoutFrame 178 0 42 0 200 0 64 0) #activeHelpKey: #makeBottomAbsolute + #hasCharacterOrientedLabel: false #tabable: true #model: #absoluteBottom ) @@ -2283,6 +2226,198 @@ bottom:0.5 offset: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 + " + + + + ^ + + #(#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::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 + " + + + + ^ + + #(#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::Extent class methodsFor:'help specs'! helpSpec