UILayoutTool.st
changeset 1339 b989732e3610
parent 1334 36c1ee53aede
child 1343 7d97b214f2ac
equal deleted inserted replaced
1338:3c1a528c50db 1339:b989732e3610
    19 	classVariableNames:''
    19 	classVariableNames:''
    20 	poolDictionaries:''
    20 	poolDictionaries:''
    21 	category:'Interface-UIPainter'
    21 	category:'Interface-UIPainter'
    22 !
    22 !
    23 
    23 
    24 ApplicationModel subclass:#Extent
    24 ApplicationModel subclass:#Rectangle
       
    25 	instanceVariableNames:''
       
    26 	classVariableNames:''
       
    27 	poolDictionaries:''
       
    28 	privateIn:UILayoutTool
       
    29 !
       
    30 
       
    31 ApplicationModel subclass:#AlignmentOrigin
    25 	instanceVariableNames:''
    32 	instanceVariableNames:''
    26 	classVariableNames:''
    33 	classVariableNames:''
    27 	poolDictionaries:''
    34 	poolDictionaries:''
    28 	privateIn:UILayoutTool
    35 	privateIn:UILayoutTool
    29 !
    36 !
    33 	classVariableNames:''
    40 	classVariableNames:''
    34 	poolDictionaries:''
    41 	poolDictionaries:''
    35 	privateIn:UILayoutTool
    42 	privateIn:UILayoutTool
    36 !
    43 !
    37 
    44 
    38 ApplicationModel subclass:#AlignmentOrigin
       
    39 	instanceVariableNames:''
       
    40 	classVariableNames:''
       
    41 	poolDictionaries:''
       
    42 	privateIn:UILayoutTool
       
    43 !
       
    44 
       
    45 ApplicationModel subclass:#Point
    45 ApplicationModel subclass:#Point
    46 	instanceVariableNames:''
    46 	instanceVariableNames:''
    47 	classVariableNames:''
    47 	classVariableNames:''
    48 	poolDictionaries:''
    48 	poolDictionaries:''
    49 	privateIn:UILayoutTool
    49 	privateIn:UILayoutTool
    54 	classVariableNames:''
    54 	classVariableNames:''
    55 	poolDictionaries:''
    55 	poolDictionaries:''
    56 	privateIn:UILayoutTool
    56 	privateIn:UILayoutTool
    57 !
    57 !
    58 
    58 
    59 ApplicationModel subclass:#Rectangle
    59 ApplicationModel subclass:#Extent
    60 	instanceVariableNames:''
    60 	instanceVariableNames:''
    61 	classVariableNames:''
    61 	classVariableNames:''
    62 	poolDictionaries:''
    62 	poolDictionaries:''
    63 	privateIn:UILayoutTool
    63 	privateIn:UILayoutTool
    64 !
    64 !
   135 
   135 
   136 #leftRelative
   136 #leftRelative
   137 'Relative origin x of the selected widget.'
   137 'Relative origin x of the selected widget.'
   138 
   138 
   139 #makeLeftAbsolute
   139 #makeLeftAbsolute
   140 'Computes current left offset and relative origin x to an absolute origin x.'
   140 'Compute pure-absolute x'
   141 
   141 
   142 #makeLeftRelative
   142 #makeLeftRelative
   143 'Compute current relative origin x and offset of the left edge to a relative origin x.'
   143 'Compute pure-fraction x.'
       
   144 
       
   145 #makeLeftRelativeFromRight
       
   146 'Compute fraction+offset for x relative to containers right.'
   144 
   147 
   145 #makeTopAbsolute
   148 #makeTopAbsolute
   146 'Computes current top offset and relative origin y to an absolute origin y.'
   149 'Compute pure-absolute y.'
   147 
   150 
   148 #makeTopRelative
   151 #makeTopRelative
   149 'Computes current relative origin y and offset of the top edge to a relative origin y.'
   152 'Computes pure-fractional y.'
       
   153 
       
   154 #makeTopRelativeFromBottom
       
   155 'Compute fraction+offset for y relative to containers bottom.'
   150 
   156 
   151 #originX
   157 #originX
   152 'Absolute origin x of the selected widget.'
   158 'Absolute origin x of the selected widget.'
   153 
   159 
   154 #originY
   160 #originY
   186        #(#WindowSpec
   192        #(#WindowSpec
   187           #label: 'UILayoutTool'
   193           #label: 'UILayoutTool'
   188           #name: 'UILayoutTool'
   194           #name: 'UILayoutTool'
   189           #min: #(#Point 10 10)
   195           #min: #(#Point 10 10)
   190           #max: #(#Point 1152 900)
   196           #max: #(#Point 1152 900)
   191           #bounds: #(#Rectangle 506 24 851 206)
   197           #bounds: #(#Rectangle 37 37 382 219)
   192         )
   198         )
   193         #component: 
   199         #component: 
   194        #(#SpecCollection
   200        #(#SpecCollection
   195           #collection: #(
   201           #collection: #(
   196            #(#FramedBoxSpec
   202            #(#FramedBoxSpec
   202              #(#SpecCollection
   208              #(#SpecCollection
   203                 #collection: #(
   209                 #collection: #(
   204                  #(#LabelSpec
   210                  #(#LabelSpec
   205                     #label: 'Relative:'
   211                     #label: 'Relative:'
   206                     #name: 'labelRelative'
   212                     #name: 'labelRelative'
   207                     #layout: #(#Point 87 6)
   213                     #layout: #(#Point 103 6)
   208                   )
   214                   )
   209                  #(#LabelSpec
   215                  #(#LabelSpec
   210                     #label: 'Offset:'
   216                     #label: 'Offset:'
   211                     #name: 'labelAbsolute'
   217                     #name: 'labelAbsolute'
   212                     #layout: #(#Point 187 6)
   218                     #layout: #(#Point 203 6)
   213                   )
   219                   )
   214                  #(#LabelSpec
   220                  #(#LabelSpec
   215                     #label: 'Left:'
   221                     #label: 'Left:'
   216                     #name: 'labelLeft'
   222                     #name: 'labelLeft'
   217                     #layout: #(#AlignmentOrigin 85 0 27 0 1 0)
   223                     #layout: #(#AlignmentOrigin 68 0 27 0 1 0)
       
   224                   )
       
   225                  #(#ActionButtonSpec
       
   226                     #label: '>'
       
   227                     #name: 'actionRelativeLeft'
       
   228                     #layout: #(#LayoutFrame 77 0 24 0 99 0 46 0)
       
   229                     #activeHelpKey: #makeLeftRelative
       
   230                     #tabable: true
       
   231                     #model: #relativeLeft
   218                   )
   232                   )
   219                  #(#InputFieldSpec
   233                  #(#InputFieldSpec
   220                     #attributes: 
       
   221                    #(#tabable
       
   222                       true
       
   223                     )
       
   224                     #name: 'fieldLeftFraction'
   234                     #name: 'fieldLeftFraction'
   225                     #layout: #(#LayoutFrame 87 0 24 0 137 0 46 0)
   235                     #layout: #(#LayoutFrame 103 0 24 0 153 0 46 0)
   226                     #activeHelpKey: #leftRelative
   236                     #activeHelpKey: #leftRelative
   227                     #tabable: true
   237                     #tabable: true
   228                     #model: #leftFraction
   238                     #model: #leftFraction
   229                     #group: #inputGroup
   239                     #group: #inputGroup
   230                     #type: #numberOrNil
   240                     #type: #numberOrNil
   231                     #acceptChannel: #acceptChannel
   241                     #acceptChannel: #acceptChannel
   232                     #modifiedChannel: #modifiedChannel
   242                     #modifiedChannel: #modifiedChannel
   233                     #acceptOnPointerLeave: false
   243                     #acceptOnPointerLeave: false
   234                   )
   244                   )
   235                  #(#ActionButtonSpec
   245                  #(#ActionButtonSpec
   236                     #attributes: 
   246                     #label: '<'
   237                    #(#tabable
   247                     #name: 'actionRightRelativeLeft'
   238                       true
   248                     #layout: #(#LayoutFrame 158 0 24 0 180 0 46 0)
   239                     )
   249                     #activeHelpKey: #makeLeftRelativeFromRight
   240                     #name: 'actionRelativeLeft'
   250                     #tabable: true
   241                     #layout: #(#LayoutFrame 142 0 24 0 164 0 46 0)
   251                     #model: #rightRelativeLeft
   242                     #activeHelpKey: #makeLeftRelative
       
   243                     #tabable: true
       
   244                     #model: #relativeLeft
       
   245                   )
   252                   )
   246                  #(#InputFieldSpec
   253                  #(#InputFieldSpec
   247                     #attributes: 
       
   248                    #(#tabable
       
   249                       true
       
   250                     )
       
   251                     #name: 'fieldLeftOffset'
   254                     #name: 'fieldLeftOffset'
   252                     #layout: #(#LayoutFrame 187 0 24 0 237 0 46 0)
   255                     #layout: #(#LayoutFrame 203 0 24 0 253 0 46 0)
   253                     #activeHelpKey: #leftAbsolute
   256                     #activeHelpKey: #leftAbsolute
   254                     #tabable: true
   257                     #tabable: true
   255                     #model: #leftOffset
   258                     #model: #leftOffset
   256                     #group: #inputGroup
   259                     #group: #inputGroup
   257                     #type: #numberOrNil
   260                     #type: #numberOrNil
   258                     #acceptChannel: #acceptChannel
   261                     #acceptChannel: #acceptChannel
   259                     #modifiedChannel: #modifiedChannel
   262                     #modifiedChannel: #modifiedChannel
   260                     #acceptOnPointerLeave: false
   263                     #acceptOnPointerLeave: false
   261                   )
   264                   )
   262                  #(#ActionButtonSpec
   265                  #(#ActionButtonSpec
   263                     #attributes: 
   266                     #label: '>'
   264                    #(#tabable
       
   265                       true
       
   266                     )
       
   267                     #name: 'actionAbsoluteLeft'
   267                     #name: 'actionAbsoluteLeft'
   268                     #layout: #(#LayoutFrame 242 0 24 0 264 0 46 0)
   268                     #layout: #(#LayoutFrame 258 0 24 0 280 0 46 0)
   269                     #activeHelpKey: #makeLeftAbsolute
   269                     #activeHelpKey: #makeLeftAbsolute
   270                     #tabable: true
   270                     #tabable: true
   271                     #model: #absoluteLeft
   271                     #model: #absoluteLeft
   272                   )
   272                   )
   273                  #(#LabelSpec
   273                  #(#LabelSpec
   274                     #label: 'Top:'
   274                     #label: 'Top:'
   275                     #name: 'labelTop'
   275                     #name: 'labelTop'
   276                     #layout: #(#AlignmentOrigin 85 0 54 0 1 0)
   276                     #layout: #(#AlignmentOrigin 68 0 54 0 1 0)
       
   277                   )
       
   278                  #(#ActionButtonSpec
       
   279                     #label: 'v'
       
   280                     #name: 'actionRelativeTop'
       
   281                     #layout: #(#LayoutFrame 77 0 51 0 99 0 73 0)
       
   282                     #activeHelpKey: #makeTopRelative
       
   283                     #tabable: true
       
   284                     #model: #relativeTop
   277                   )
   285                   )
   278                  #(#InputFieldSpec
   286                  #(#InputFieldSpec
   279                     #attributes: 
       
   280                    #(#tabable
       
   281                       true
       
   282                     )
       
   283                     #name: 'fieldTopFraction'
   287                     #name: 'fieldTopFraction'
   284                     #layout: #(#LayoutFrame 87 0 51 0 137 0 73 0)
   288                     #layout: #(#LayoutFrame 103 0 51 0 153 0 73 0)
   285                     #activeHelpKey: #topRelative
   289                     #activeHelpKey: #topRelative
   286                     #tabable: true
   290                     #tabable: true
   287                     #model: #topFraction
   291                     #model: #topFraction
   288                     #group: #inputGroup
   292                     #group: #inputGroup
   289                     #type: #numberOrNil
   293                     #type: #numberOrNil
   290                     #acceptChannel: #acceptChannel
   294                     #acceptChannel: #acceptChannel
   291                     #modifiedChannel: #modifiedChannel
   295                     #modifiedChannel: #modifiedChannel
   292                     #acceptOnPointerLeave: false
   296                     #acceptOnPointerLeave: false
   293                   )
   297                   )
   294                  #(#ActionButtonSpec
   298                  #(#ActionButtonSpec
   295                     #attributes: 
   299                     #label: '^'
   296                    #(#tabable
   300                     #name: 'actionBottomRelativeTop'
   297                       true
   301                     #layout: #(#LayoutFrame 158 0 51 0 180 0 73 0)
   298                     )
   302                     #activeHelpKey: #makeTopRelativeFromBottom
   299                     #name: 'actionRelativeTop'
   303                     #tabable: true
   300                     #layout: #(#LayoutFrame 142 0 51 0 164 0 73 0)
   304                     #model: #bottomRelativeTop
   301                     #activeHelpKey: #makeTopRelative
       
   302                     #tabable: true
       
   303                     #model: #relativeTop
       
   304                   )
   305                   )
   305                  #(#InputFieldSpec
   306                  #(#InputFieldSpec
   306                     #attributes: 
       
   307                    #(#tabable
       
   308                       true
       
   309                     )
       
   310                     #name: 'fieldTopOffset'
   307                     #name: 'fieldTopOffset'
   311                     #layout: #(#LayoutFrame 187 0 51 0 237 0 73 0)
   308                     #layout: #(#LayoutFrame 203 0 51 0 253 0 73 0)
   312                     #activeHelpKey: #topAbsolute
   309                     #activeHelpKey: #topAbsolute
   313                     #tabable: true
   310                     #tabable: true
   314                     #model: #topOffset
   311                     #model: #topOffset
   315                     #group: #inputGroup
   312                     #group: #inputGroup
   316                     #type: #numberOrNil
   313                     #type: #numberOrNil
   317                     #acceptChannel: #acceptChannel
   314                     #acceptChannel: #acceptChannel
   318                     #modifiedChannel: #modifiedChannel
   315                     #modifiedChannel: #modifiedChannel
   319                     #acceptOnPointerLeave: false
   316                     #acceptOnPointerLeave: false
   320                   )
   317                   )
   321                  #(#ActionButtonSpec
   318                  #(#ActionButtonSpec
   322                     #attributes: 
   319                     #label: 'v'
   323                    #(#tabable
       
   324                       true
       
   325                     )
       
   326                     #name: 'actionAbsoluteTop'
   320                     #name: 'actionAbsoluteTop'
   327                     #layout: #(#LayoutFrame 242 0 51 0 264 0 73 0)
   321                     #layout: #(#LayoutFrame 258 0 51 0 280 0 73 0)
   328                     #activeHelpKey: #makeTopAbsolute
   322                     #activeHelpKey: #makeTopAbsolute
   329                     #tabable: true
   323                     #tabable: true
   330                     #model: #absoluteTop
   324                     #model: #absoluteTop
   331                   )
   325                   )
   332                  )
   326                  )
   651 ! !
   645 ! !
   652 
   646 
   653 !UILayoutTool methodsFor:'converting absolute'!
   647 !UILayoutTool methodsFor:'converting absolute'!
   654 
   648 
   655 absolute:what xOrY:xOrY
   649 absolute:what xOrY:xOrY
   656     |extent fraction offset fractSymb offsetSymb fractHolder offsetHolder|
   650     "compute what as absolute (i.e. fraction=0, offset >= 0)"
       
   651 
       
   652     |extent fraction offset fractSymb offsetSymb 
       
   653      newOffset newFraction fractHolder offsetHolder|
   657 
   654 
   658     extent     := (self layoutView superView computeExtent) perform:xOrY.
   655     extent     := (self layoutView superView computeExtent) perform:xOrY.
   659     fractSymb  := (what, 'Fraction') asSymbol.
   656     fractSymb  := (what, 'Fraction') asSymbol.
   660     offsetSymb := (what,   'Offset') asSymbol.
   657     offsetSymb := (what,   'Offset') asSymbol.
   661     fractHolder := (self aspectFor:fractSymb).
   658     fractHolder := (self aspectFor:fractSymb).
   662     offsetHolder := (self aspectFor:offsetSymb).
   659     offsetHolder := (self aspectFor:offsetSymb).
   663     fraction   := fractHolder  value.
   660     fraction   := fractHolder  value.
   664     offset     := offsetHolder value.
   661     offset     := offsetHolder value.
   665     offset     := offset + ((fraction * extent) asInteger).
   662 
       
   663     newOffset := offset + ((fraction * extent) asInteger).
       
   664     newFraction := 0.
   666 
   665 
   667     offsetHolder value:offset.
   666     offsetHolder value:offset.
   668     fractHolder  value:0.
   667     fractHolder  value:newFraction.
   669 
       
   670 
       
   671 
       
   672 !
   668 !
   673 
   669 
   674 absoluteBottom
   670 absoluteBottom
       
   671     "compute bottom as absolute (i.e. fraction=0, offset >= 0)"
       
   672 
   675     self absolute:'bottom' xOrY:#y
   673     self absolute:'bottom' xOrY:#y
   676 
   674 
   677 !
   675 !
   678 
   676 
   679 absoluteLeft
   677 absoluteLeft
       
   678     "compute left as absolute (i.e. fraction=0, offset >= 0)"
       
   679 
   680     self absolute:'left' xOrY:#x
   680     self absolute:'left' xOrY:#x
   681 
   681 
   682 !
   682 !
   683 
   683 
   684 absoluteRight
   684 absoluteRight
       
   685     "compute right as absolute (i.e. fraction=0, offset >= 0)"
       
   686 
   685     self absolute:'right' xOrY:#x
   687     self absolute:'right' xOrY:#x
   686 
   688 
   687 !
   689 !
   688 
   690 
   689 absoluteTop
   691 absoluteTop
       
   692     "compute top as absolute (i.e. fraction=0, offset >= 0)"
       
   693 
   690     self absolute:'top' xOrY:#y
   694     self absolute:'top' xOrY:#y
   691 
   695 
   692 ! !
   696 ! !
   693 
   697 
   694 !UILayoutTool methodsFor:'converting relative'!
   698 !UILayoutTool methodsFor:'converting absolute from corner'!
   695 
   699 
   696 relative:what xOrY:xOrY
   700 bottomRelativeBottom
   697     |extent fraction offset fractSymb offsetSymb fractHolder offsetHolder|
   701     "compute bottom relative to containers bottom (fraction=1, offset negative)"
       
   702 
       
   703     self cornerRelative:'bottom' xOrY:#y
       
   704 
       
   705 !
       
   706 
       
   707 bottomRelativeTop
       
   708     "compute top relative to containers bottom (fraction=1, offset negative)"
       
   709 
       
   710     self cornerRelative:'top' xOrY:#y
       
   711 
       
   712 !
       
   713 
       
   714 cornerRelative:what xOrY:xOrY
       
   715     "compute what relative to the corner (i.e. fraction=1, offset negative)"
       
   716 
       
   717     |extent fraction offset fractSymb offsetSymb 
       
   718      newFraction newOffset fractHolder offsetHolder|
   698 
   719 
   699     extent     := (self layoutView superView computeExtent) perform:xOrY.
   720     extent     := (self layoutView superView computeExtent) perform:xOrY.
   700     fractSymb  := (what, 'Fraction') asSymbol.
   721     fractSymb  := (what, 'Fraction') asSymbol.
   701     offsetSymb := (what,   'Offset') asSymbol.
   722     offsetSymb := (what,   'Offset') asSymbol.
   702     fractHolder := (self aspectFor:fractSymb).
   723     fractHolder := (self aspectFor:fractSymb).
   703     offsetHolder := (self aspectFor:offsetSymb).
   724     offsetHolder := (self aspectFor:offsetSymb).
   704     fraction   := fractHolder  value.
   725     fraction   := fractHolder  value.
   705     offset     := offsetHolder value.
   726     offset     := offsetHolder value.
   706     fraction   := (fraction + (offset / extent)) asFloat.
   727 
   707 
   728     newOffset := offset + ((fraction * extent) asInteger).
   708     (fraction > 1.0) ifTrue:[ fraction := 1.0 ].
   729     newOffset := newOffset - extent.
   709     (fraction < 0.0) ifTrue:[ fraction := 0 ].
   730     newFraction := 1.
   710 
   731 
   711     offsetHolder value:0.
   732     fractHolder  value:newFraction.
   712     fractHolder  value:fraction.
   733     offsetHolder value:newOffset.
       
   734 
       
   735 
       
   736 
       
   737 !
       
   738 
       
   739 rightRelativeLeft
       
   740     "compute left relative to containers right (fraction=1, offset negative)"
       
   741 
       
   742     self cornerRelative:'left' xOrY:#x
       
   743 
       
   744 !
       
   745 
       
   746 rightRelativeRight
       
   747     "compute right relative to containers right (fraction=1, offset negative)"
       
   748 
       
   749     self cornerRelative:'right' xOrY:#x
       
   750 
       
   751 ! !
       
   752 
       
   753 !UILayoutTool methodsFor:'converting relative'!
       
   754 
       
   755 relative:what xOrY:xOrY
       
   756     "compute what relative to the origin (i.e. fraction=0..1, offset 0)"
       
   757 
       
   758     |extent fraction offset fractSymb offsetSymb 
       
   759      newFraction newOffset
       
   760      fractHolder offsetHolder|
       
   761 
       
   762     extent     := (self layoutView superView computeExtent) perform:xOrY.
       
   763     fractSymb  := (what, 'Fraction') asSymbol.
       
   764     offsetSymb := (what,   'Offset') asSymbol.
       
   765     fractHolder := (self aspectFor:fractSymb).
       
   766     offsetHolder := (self aspectFor:offsetSymb).
       
   767     fraction   := fractHolder  value.
       
   768     offset     := offsetHolder value.
       
   769 
       
   770     newFraction   := (fraction + (offset / extent)) asFloat.
       
   771     newOffset := 0.
       
   772 
       
   773     (newFraction > 1.0) ifTrue:[newFraction := 1.0].
       
   774     (newFraction < 0.0) ifTrue:[newFraction := 0].
       
   775 
       
   776     offsetHolder value:newOffset.
       
   777     fractHolder  value:newFraction.
   713 
   778 
   714 
   779 
   715 
   780 
   716 !
   781 !
   717 
   782 
   718 relativeBottom
   783 relativeBottom
       
   784     "compute bottom relative to the origin (i.e. fraction=0..1, offset 0)"
       
   785 
   719     self relative:'bottom' xOrY:#y
   786     self relative:'bottom' xOrY:#y
   720 
   787 
   721 
   788 
   722 !
   789 !
   723 
   790 
   724 relativeLeft
   791 relativeLeft
       
   792     "compute left relative to the origin (i.e. fraction=0..1, offset 0)"
       
   793 
   725     self relative:'left' xOrY:#x
   794     self relative:'left' xOrY:#x
   726 
   795 
   727 !
   796 !
   728 
   797 
   729 relativeRight
   798 relativeRight
       
   799     "compute right relative to the origin (i.e. fraction=0..1, offset 0)"
       
   800 
   730     self relative:'right' xOrY:#x
   801     self relative:'right' xOrY:#x
   731 
   802 
   732 !
   803 !
   733 
   804 
   734 relativeTop
   805 relativeTop
       
   806     "compute top relative to the origin (i.e. fraction=0..1, offset 0)"
       
   807 
   735     self relative:'top' xOrY:#y
   808     self relative:'top' xOrY:#y
   736 
   809 
   737 ! !
   810 ! !
   738 
   811 
   739 !UILayoutTool methodsFor:'initialization'!
   812 !UILayoutTool methodsFor:'initialization'!
   832     self update
   905     self update
   833 
   906 
   834     "Modified: / 4.2.2000 / 22:31:41 / cg"
   907     "Modified: / 4.2.2000 / 22:31:41 / cg"
   835 ! !
   908 ! !
   836 
   909 
   837 !UILayoutTool::Extent class methodsFor:'help specs'!
   910 !UILayoutTool::Rectangle class methodsFor:'interface specs'!
   838 
       
   839 helpSpec
       
   840     "This resource specification was automatically generated
       
   841      by the UIHelpTool of ST/X."
       
   842 
       
   843     "Do not manually edit this!! If it is corrupted,
       
   844      the UIHelpTool may not be able to read the specification."
       
   845 
       
   846     "
       
   847      UIHelpTool openOnClass:UILayoutTool::Extent    
       
   848     "
       
   849 
       
   850     <resource: #help>
       
   851 
       
   852     ^super helpSpec addPairsFrom:#(
       
   853 
       
   854 #hrzExtent
       
   855 'Horizontal extent of the selected widget.'
       
   856 
       
   857 #vrtExtent
       
   858 'Vertical extent of the selected widget.'
       
   859 
       
   860 )
       
   861 ! !
       
   862 
       
   863 !UILayoutTool::Extent class methodsFor:'interface specs'!
       
   864 
   911 
   865 windowSpec
   912 windowSpec
   866     "This resource specification was automatically generated
   913     "This resource specification was automatically generated
   867      by the UIPainter of ST/X."
   914      by the UIPainter of ST/X."
   868 
   915 
   869     "Do not manually edit this!! If it is corrupted,
   916     "Do not manually edit this!! If it is corrupted,
   870      the UIPainter may not be able to read the specification."
   917      the UIPainter may not be able to read the specification."
   871 
   918 
   872     "
   919     "
   873      UIPainter new openOnClass:UILayoutTool::Extent andSelector:#windowSpec
   920      UIPainter new openOnClass:UILayoutTool::Rectangle andSelector:#windowSpec
   874      UILayoutTool::Extent new openInterface:#windowSpec
   921      UILayoutTool::Rectangle new openInterface:#windowSpec
   875      UILayoutTool::Extent open
   922      UILayoutTool::Rectangle open
   876     "
       
   877 
       
   878     <resource: #canvas>
       
   879 
       
   880     ^ 
       
   881      #(#FullSpec
       
   882         #name: #windowSpec
       
   883         #window: 
       
   884        #(#WindowSpec
       
   885           #label: 'UILayoutTool-Extent'
       
   886           #name: 'UILayoutTool-Extent'
       
   887           #min: #(#Point 10 10)
       
   888           #max: #(#Point 1152 900)
       
   889           #bounds: #(#Rectangle 506 24 832 173)
       
   890         )
       
   891         #component: 
       
   892        #(#SpecCollection
       
   893           #collection: #(
       
   894            #(#FramedBoxSpec
       
   895               #label: 'Extent'
       
   896               #name: 'FramedBox'
       
   897               #layout: #(#LayoutFrame 0 0.0 6 0.0 0 1.0 137 0)
       
   898               #labelPosition: #topLeft
       
   899               #component: 
       
   900              #(#SpecCollection
       
   901                 #collection: #(
       
   902                  #(#LabelSpec
       
   903                     #label: 'Width:'
       
   904                     #name: 'labelWidth'
       
   905                     #layout: #(#AlignmentOrigin 89 0 24 0 1 0.5)
       
   906                     #adjust: #right
       
   907                   )
       
   908                  #(#InputFieldSpec
       
   909                     #attributes: 
       
   910                    #(#tabable
       
   911                       true
       
   912                     )
       
   913                     #name: 'fieldLeftOffset'
       
   914                     #layout: #(#LayoutFrame 90 0 13 0 140 0 35 0)
       
   915                     #activeHelpKey: #hrzExtent
       
   916                     #enableChannel: #notUsingDefaultExtent
       
   917                     #tabable: true
       
   918                     #model: #leftOffset
       
   919                     #group: #inputGroup
       
   920                     #type: #numberOrNil
       
   921                     #acceptOnLostFocus: true
       
   922                     #acceptChannel: #acceptChannel
       
   923                     #modifiedChannel: #modifiedChannel
       
   924                     #acceptOnPointerLeave: false
       
   925                   )
       
   926                  #(#LabelSpec
       
   927                     #label: 'Height:'
       
   928                     #name: 'labelHeight'
       
   929                     #layout: #(#AlignmentOrigin 89 0 49 0 1 0.5)
       
   930                     #adjust: #right
       
   931                   )
       
   932                  #(#InputFieldSpec
       
   933                     #attributes: 
       
   934                    #(#tabable
       
   935                       true
       
   936                     )
       
   937                     #name: 'fieldRightOffset'
       
   938                     #layout: #(#LayoutFrame 90 0 38 0 140 0 60 0)
       
   939                     #activeHelpKey: #vrtExtent
       
   940                     #enableChannel: #notUsingDefaultExtent
       
   941                     #tabable: true
       
   942                     #model: #rightOffset
       
   943                     #group: #inputGroup
       
   944                     #type: #numberOrNil
       
   945                     #acceptOnLostFocus: true
       
   946                     #acceptChannel: #acceptChannel
       
   947                     #modifiedChannel: #modifiedChannel
       
   948                     #acceptOnPointerLeave: false
       
   949                   )
       
   950                  #(#CheckBoxSpec
       
   951                     #attributes: 
       
   952                    #(#tabable
       
   953                       true
       
   954                     )
       
   955                     #label: 'Use Widgets Default Extent'
       
   956                     #name: 'useDefaultExtentCheckBox'
       
   957                     #layout: #(#Point 5 74)
       
   958                     #enableChannel: #defaultExtentEnabled
       
   959                     #tabable: true
       
   960                     #model: #useDefaultExtent
       
   961                     #translateLabel: true
       
   962                   )
       
   963                  )
       
   964                
       
   965               )
       
   966             )
       
   967            )
       
   968          
       
   969         )
       
   970       )
       
   971 ! !
       
   972 
       
   973 !UILayoutTool::Extent methodsFor:'accessing'!
       
   974 
       
   975 fetch:aView spec:aSpec
       
   976     "fetch extent
       
   977     "
       
   978     |extent|
       
   979 
       
   980     extent  := aView computeExtent.
       
   981 
       
   982     (self aspectFor:#leftOffset)  value:(extent x).
       
   983     (self aspectFor:#rightOffset) value:(extent y).
       
   984 
       
   985     (self aspectFor:#useDefaultExtent) value:aSpec useDefaultExtent 
       
   986 !
       
   987 
       
   988 layout
       
   989     "returns current extent
       
   990     "
       
   991   ^ Smalltalk::Point x:(((self aspectFor:#leftOffset)   value) ? 0)
       
   992                      y:(((self aspectFor:#rightOffset)  value) ? 0)
       
   993 
       
   994 ! !
       
   995 
       
   996 !UILayoutTool::LayoutOrigin class methodsFor:'interface specs'!
       
   997 
       
   998 windowSpec
       
   999     "This resource specification was automatically generated
       
  1000      by the UIPainter of ST/X."
       
  1001 
       
  1002     "Do not manually edit this!! If it is corrupted,
       
  1003      the UIPainter may not be able to read the specification."
       
  1004 
       
  1005     "
       
  1006      UIPainter new openOnClass:UILayoutTool::LayoutOrigin andSelector:#windowSpec
       
  1007      UILayoutTool::LayoutOrigin new openInterface:#windowSpec
       
  1008      UILayoutTool::LayoutOrigin open
       
  1009     "
   923     "
  1010 
   924 
  1011     <resource: #canvas>
   925     <resource: #canvas>
  1012 
   926 
  1013     ^
   927     ^
  1014      
   928      
  1015        #(#FullSpec
   929        #(#FullSpec
  1016           #window: 
   930           #window: 
  1017            #(#WindowSpec
   931            #(#WindowSpec
  1018               #name: 'UILayoutTool-LayoutOrigin'
   932               #name: 'UILayoutTool-Rectangle'
  1019               #layout: #(#LayoutFrame 290 0 420 0 647 0 565 0)
   933               #layout: #(#LayoutFrame 291 0 130 0 632 0 328 0)
  1020               #label: 'UILayoutTool-LayoutOrigin'
   934               #label: 'UILayoutTool-Rectangle'
  1021               #min: #(#Point 10 10)
   935               #min: #(#Point 10 10)
  1022               #max: #(#Point 1152 900)
   936               #max: #(#Point 1152 900)
  1023               #bounds: #(#Rectangle 290 420 648 566)
   937               #bounds: #(#Rectangle 291 130 633 329)
  1024               #usePreferredExtent: false
   938               #usePreferredExtent: false
  1025           )
   939           )
  1026           #component: 
   940           #component: 
  1027            #(#SpecCollection
   941            #(#SpecCollection
  1028               #collection: 
   942               #collection: 
  1029                #(
   943                #(
  1030                  #(#UISubSpecification
   944                  #(#UISubSpecification
  1031                     #name: 'layoutOriginSpec'
   945                     #name: 'subSpecification'
  1032                     #layout: #(#LayoutFrame 1 0.0 6 0 0 1.0 110 0)
   946                     #layout: #(#LayoutFrame 1 0.0 6 0 0 1.0 96 0)
  1033                     #majorKey: #UILayoutTool
   947                     #majorKey: #UILayoutTool
  1034                     #minorKey: #layoutOriginSpec
   948                     #minorKey: #layoutPointSpec
       
   949                 )
       
   950                  #(#FramedBoxSpec
       
   951                     #name: 'FramedBox'
       
   952                     #layout: #(#LayoutFrame 1 0.0 99 0 0 1.0 194 0)
       
   953                     #component: 
       
   954                      #(#SpecCollection
       
   955                         #collection: 
       
   956                          #(
       
   957                            #(#LabelSpec
       
   958                               #name: 'labelCornerY'
       
   959                               #layout: #(#AlignmentOrigin 83 0 16 0 1 0)
       
   960                               #label: 'Right:'
       
   961                               #adjust: #left
       
   962                           )
       
   963                            #(#InputFieldSpec
       
   964                               #name: 'fieldCornerX'
       
   965                               #layout: #(#LayoutFrame 85 0 13 0 135 0 35 0)
       
   966                               #activeHelpKey: #cornerX
       
   967                               #tabable: true
       
   968                               #model: #rightOffset
       
   969                               #group: #inputGroup
       
   970                               #type: #numberOrNil
       
   971                               #acceptOnLostFocus: true
       
   972                     #acceptChannel: #acceptChannel
       
   973                     #modifiedChannel: #modifiedChannel
       
   974                           )
       
   975                            #(#LabelSpec
       
   976                               #name: 'labelCornerX'
       
   977                               #layout: #(#AlignmentOrigin 83 0 41 0 1 0)
       
   978                               #label: 'Bottom:'
       
   979                               #adjust: #left
       
   980                           )
       
   981                            #(#InputFieldSpec
       
   982                               #name: 'fieldCornerY'
       
   983                               #layout: #(#LayoutFrame 85 0 38 0 135 0 60 0)
       
   984                               #activeHelpKey: #cornerY
       
   985                               #tabable: true
       
   986                               #model: #bottomOffset
       
   987                               #group: #inputGroup
       
   988                               #type: #numberOrNil
       
   989                               #acceptOnLostFocus: true
       
   990                     #acceptChannel: #acceptChannel
       
   991                     #modifiedChannel: #modifiedChannel
       
   992                           )
       
   993                         )
       
   994                     )
       
   995                     #label: 'Corner'
       
   996                     #labelPosition: #topLeft
  1035                 )
   997                 )
  1036               )
   998               )
  1037           )
   999           )
  1038       )
  1000       )
  1039 ! !
  1001 
  1040 
  1002     "Modified: / 13.8.1998 / 19:59:16 / cg"
  1041 !UILayoutTool::LayoutOrigin methodsFor:'accessing'!
  1003 ! !
       
  1004 
       
  1005 !UILayoutTool::Rectangle methodsFor:'accessing'!
  1042 
  1006 
  1043 fetch:aView spec:aSpec
  1007 fetch:aView spec:aSpec
  1044     "fetch layoutOrigin
  1008     "fetch rectangle
  1045     "
  1009     "
  1046     |layout|
  1010     |origin corner|
  1047 
  1011 
  1048     layout  := UIPainterView asLayoutFrameFromView:aView.
  1012     origin := aView computeOrigin.
  1049 
  1013     corner := aView computeCorner.
  1050     (self aspectFor:#leftOffset)   value:(layout leftOffset).
  1014 
  1051     (self aspectFor:#leftFraction) value:(layout leftFraction).
  1015     (self aspectFor:#leftOffset)   value:(origin x).
  1052     (self aspectFor:#topOffset)    value:(layout topOffset).
  1016     (self aspectFor:#rightOffset)  value:(corner x).
  1053     (self aspectFor:#topFraction)  value:(layout topFraction).
  1017     (self aspectFor:#topOffset)    value:(origin y).
       
  1018     (self aspectFor:#bottomOffset) value:(corner y).
  1054 
  1019 
  1055 
  1020 
  1056 !
  1021 !
  1057 
  1022 
  1058 layout
  1023 layout
  1059     "returns current layout as layoutOrigin
  1024     "returns current layout as rectangle
  1060     "
  1025     "
  1061     |layout|
  1026   ^ Smalltalk::Rectangle left:(((self aspectFor:#leftOffset)   value) ? 0)
  1062 
  1027                           top:(((self aspectFor:#topOffset)    value) ? 0)
  1063     layout  := Smalltalk::LayoutOrigin new.
  1028                         right:(((self aspectFor:#rightOffset)  value) ? 0)
  1064 
  1029                        bottom:(((self aspectFor:#bottomOffset) value) ? 0)
  1065     layout   leftOffset:((self aspectFor:#leftOffset)   value) ? 0.
  1030 
  1066     layout    topOffset:((self aspectFor:#topOffset)    value) ? 0.
       
  1067     layout leftFraction:((self aspectFor:#leftFraction) value) ? 0.
       
  1068     layout  topFraction:((self aspectFor:#topFraction)  value) ? 0.
       
  1069 
       
  1070   ^ layout
       
  1071 
  1031 
  1072 ! !
  1032 ! !
  1073 
  1033 
  1074 !UILayoutTool::AlignmentOrigin class methodsFor:'help specs'!
  1034 !UILayoutTool::AlignmentOrigin class methodsFor:'help specs'!
  1075 
  1035 
  1485     self makeAlignLeft:1 top:0
  1445     self makeAlignLeft:1 top:0
  1486 
  1446 
  1487 
  1447 
  1488 ! !
  1448 ! !
  1489 
  1449 
       
  1450 !UILayoutTool::LayoutOrigin class methodsFor:'interface specs'!
       
  1451 
       
  1452 windowSpec
       
  1453     "This resource specification was automatically generated
       
  1454      by the UIPainter of ST/X."
       
  1455 
       
  1456     "Do not manually edit this!! If it is corrupted,
       
  1457      the UIPainter may not be able to read the specification."
       
  1458 
       
  1459     "
       
  1460      UIPainter new openOnClass:UILayoutTool::LayoutOrigin andSelector:#windowSpec
       
  1461      UILayoutTool::LayoutOrigin new openInterface:#windowSpec
       
  1462      UILayoutTool::LayoutOrigin open
       
  1463     "
       
  1464 
       
  1465     <resource: #canvas>
       
  1466 
       
  1467     ^
       
  1468      
       
  1469        #(#FullSpec
       
  1470           #window: 
       
  1471            #(#WindowSpec
       
  1472               #name: 'UILayoutTool-LayoutOrigin'
       
  1473               #layout: #(#LayoutFrame 290 0 420 0 647 0 565 0)
       
  1474               #label: 'UILayoutTool-LayoutOrigin'
       
  1475               #min: #(#Point 10 10)
       
  1476               #max: #(#Point 1152 900)
       
  1477               #bounds: #(#Rectangle 290 420 648 566)
       
  1478               #usePreferredExtent: false
       
  1479           )
       
  1480           #component: 
       
  1481            #(#SpecCollection
       
  1482               #collection: 
       
  1483                #(
       
  1484                  #(#UISubSpecification
       
  1485                     #name: 'layoutOriginSpec'
       
  1486                     #layout: #(#LayoutFrame 1 0.0 6 0 0 1.0 110 0)
       
  1487                     #majorKey: #UILayoutTool
       
  1488                     #minorKey: #layoutOriginSpec
       
  1489                 )
       
  1490               )
       
  1491           )
       
  1492       )
       
  1493 ! !
       
  1494 
       
  1495 !UILayoutTool::LayoutOrigin methodsFor:'accessing'!
       
  1496 
       
  1497 fetch:aView spec:aSpec
       
  1498     "fetch layoutOrigin
       
  1499     "
       
  1500     |layout|
       
  1501 
       
  1502     layout  := UIPainterView asLayoutFrameFromView:aView.
       
  1503 
       
  1504     (self aspectFor:#leftOffset)   value:(layout leftOffset).
       
  1505     (self aspectFor:#leftFraction) value:(layout leftFraction).
       
  1506     (self aspectFor:#topOffset)    value:(layout topOffset).
       
  1507     (self aspectFor:#topFraction)  value:(layout topFraction).
       
  1508 
       
  1509 
       
  1510 !
       
  1511 
       
  1512 layout
       
  1513     "returns current layout as layoutOrigin
       
  1514     "
       
  1515     |layout|
       
  1516 
       
  1517     layout  := Smalltalk::LayoutOrigin new.
       
  1518 
       
  1519     layout   leftOffset:((self aspectFor:#leftOffset)   value) ? 0.
       
  1520     layout    topOffset:((self aspectFor:#topOffset)    value) ? 0.
       
  1521     layout leftFraction:((self aspectFor:#leftFraction) value) ? 0.
       
  1522     layout  topFraction:((self aspectFor:#topFraction)  value) ? 0.
       
  1523 
       
  1524   ^ layout
       
  1525 
       
  1526 ! !
       
  1527 
  1490 !UILayoutTool::Point class methodsFor:'interface specs'!
  1528 !UILayoutTool::Point class methodsFor:'interface specs'!
  1491 
  1529 
  1492 windowSpec
  1530 windowSpec
  1493     "This resource specification was automatically generated
  1531     "This resource specification was automatically generated
  1494      by the UIPainter of ST/X."
  1532      by the UIPainter of ST/X."
  1579 'Set the layout for a fixed area at the bottom of the widgets containers space'
  1617 'Set the layout for a fixed area at the bottom of the widgets containers space'
  1580 
  1618 
  1581 #bottomHalfLayout
  1619 #bottomHalfLayout
  1582 'Set the layout for the bottom half of the widgets containers space'
  1620 'Set the layout for the bottom half of the widgets containers space'
  1583 
  1621 
       
  1622 #bottomLeftQuarterLayout
       
  1623 'Set the layout for the bottom-left quarter of the widgets containers space'
       
  1624 
  1584 #bottomRelative
  1625 #bottomRelative
  1585 'Relative corner y of the selected widget.'
  1626 'Relative corner y of the selected widget.'
  1586 
  1627 
       
  1628 #bottomRightQuarterLayout
       
  1629 'Set the layout for the bottom-right quarter of the widgets containers space'
       
  1630 
  1587 #leftHalfLayout
  1631 #leftHalfLayout
  1588 'Set the layout for the left half of the widgets containers space'
  1632 'Set the layout for the left half of the widgets containers space'
  1589 
  1633 
  1590 #makeBottomAbsolute
  1634 #makeBottomAbsolute
  1591 'Computes current bottom offset and relative corner y to an absolute corner y.'
  1635 'Compute pure-absolute y.'
  1592 
  1636 
  1593 #makeBottomRelative
  1637 #makeBottomRelative
  1594 'Computes current relative corner y and offset of the bottom edge to a relative corner y.'
  1638 'Computes pure-fractional y.'
       
  1639 
       
  1640 #makeBottomRelativeFromBottom
       
  1641 'Compute fraction+offset for y relative to containers bottom.'
  1595 
  1642 
  1596 #makeRightAbsolute
  1643 #makeRightAbsolute
  1597 'Computes current right offset and relative corner x to an absolute corner x.'
  1644 'Compute pure-absolute x.'
  1598 
  1645 
  1599 #makeRightRelative
  1646 #makeRightRelative
  1600 'Computes current relative corner x and offset of the right edge to a relative corner x.'
  1647 'Compute pure-fraction x.'
       
  1648 
       
  1649 #makeRightRelativeFromRight
       
  1650 'Compute fraction+offset for x relative to containers right.'
  1601 
  1651 
  1602 #rightAbsolute
  1652 #rightAbsolute
  1603 'Offset of the right edge; positive is to the right, negative to the left.'
  1653 'Offset of the right edge; positive is to the right, negative to the left.'
  1604 
  1654 
  1605 #rightHalfLayout
  1655 #rightHalfLayout
  1617 #topLeftQuarterLayout
  1667 #topLeftQuarterLayout
  1618 'Set the layout for the top-left quarter of the widgets containers space'
  1668 'Set the layout for the top-left quarter of the widgets containers space'
  1619 
  1669 
  1620 #topRightQuarterLayout
  1670 #topRightQuarterLayout
  1621 'Set the layout for the top-right quarter of the widgets containers space'
  1671 'Set the layout for the top-right quarter of the widgets containers space'
  1622 
       
  1623 #bottomRightQuarterLayout
       
  1624 'Set the layout for the bottom-right quarter of the widgets containers space'
       
  1625 
       
  1626 #bottomLeftQuarterLayout
       
  1627 'Set the layout for the bottom-left quarter of the widgets containers space'
       
  1628 
  1672 
  1629 )
  1673 )
  1630 ! !
  1674 ! !
  1631 
  1675 
  1632 !UILayoutTool::LayoutFrame class methodsFor:'image specs'!
  1676 !UILayoutTool::LayoutFrame class methodsFor:'image specs'!
  1835        #(#WindowSpec
  1879        #(#WindowSpec
  1836           #label: 'UILayoutTool-LayoutFrame'
  1880           #label: 'UILayoutTool-LayoutFrame'
  1837           #name: 'UILayoutTool-LayoutFrame'
  1881           #name: 'UILayoutTool-LayoutFrame'
  1838           #min: #(#Point 10 10)
  1882           #min: #(#Point 10 10)
  1839           #max: #(#Point 1152 900)
  1883           #max: #(#Point 1152 900)
  1840           #bounds: #(#Rectangle 12 22 411 325)
  1884           #bounds: #(#Rectangle 12 36 411 339)
  1841           #forceRecursiveBackground: false
  1885           #forceRecursiveBackground: false
  1842         )
  1886         )
  1843         #component: 
  1887         #component: 
  1844        #(#SpecCollection
  1888        #(#SpecCollection
  1845           #collection: #(
  1889           #collection: #(
  1858              #(#SpecCollection
  1902              #(#SpecCollection
  1859                 #collection: #(
  1903                 #collection: #(
  1860                  #(#LabelSpec
  1904                  #(#LabelSpec
  1861                     #label: 'Right:'
  1905                     #label: 'Right:'
  1862                     #name: 'labelRight'
  1906                     #name: 'labelRight'
  1863                     #layout: #(#AlignmentOrigin 88 0 25 0 1 0.5)
  1907                     #layout: #(#AlignmentOrigin 68 0 25 0 1 0.5)
       
  1908                   )
       
  1909                  #(#ActionButtonSpec
       
  1910                     #label: '>'
       
  1911                     #name: 'actionRelativeRight'
       
  1912                     #layout: #(#LayoutFrame 78 0 14 0 100 0 36 0)
       
  1913                     #activeHelpKey: #makeRightRelative
       
  1914                     #tabable: true
       
  1915                     #model: #relativeRight
  1864                   )
  1916                   )
  1865                  #(#InputFieldSpec
  1917                  #(#InputFieldSpec
  1866                     #attributes: 
       
  1867                    #(#fieldRightFraction
       
  1868                       nil #tabable
       
  1869                       true
       
  1870                     )
       
  1871                     #name: 'fieldRightFraction'
  1918                     #name: 'fieldRightFraction'
  1872                     #layout: #(#LayoutFrame 90 0 14 0 140 0 36 0)
  1919                     #layout: #(#LayoutFrame 103 0 14 0 153 0 36 0)
  1873                     #activeHelpKey: #rightRelative
  1920                     #activeHelpKey: #rightRelative
  1874                     #tabable: true
  1921                     #tabable: true
  1875                     #model: #rightFraction
  1922                     #model: #rightFraction
  1876                     #group: #inputGroup
  1923                     #group: #inputGroup
  1877                     #type: #numberOrNil
  1924                     #type: #numberOrNil
  1879                     #acceptChannel: #acceptChannel
  1926                     #acceptChannel: #acceptChannel
  1880                     #modifiedChannel: #modifiedChannel
  1927                     #modifiedChannel: #modifiedChannel
  1881                     #acceptOnPointerLeave: false
  1928                     #acceptOnPointerLeave: false
  1882                   )
  1929                   )
  1883                  #(#ActionButtonSpec
  1930                  #(#ActionButtonSpec
  1884                     #attributes: 
  1931                     #label: '<'
  1885                    #(#tabable
  1932                     #name: 'actionRightRelativeRight'
  1886                       true
  1933                     #layout: #(#LayoutFrame 158 0 14 0 180 0 36 0)
  1887                     )
  1934                     #activeHelpKey: #makeRightRelativeFromRight
  1888                     #name: 'actionRelativeRight'
  1935                     #tabable: true
  1889                     #layout: #(#LayoutFrame 145 0 14 0 167 0 36 0)
  1936                     #model: #rightRelativeRight
  1890                     #activeHelpKey: #makeRightRelative
       
  1891                     #tabable: true
       
  1892                     #model: #relativeRight
       
  1893                   )
  1937                   )
  1894                  #(#InputFieldSpec
  1938                  #(#InputFieldSpec
  1895                     #attributes: 
       
  1896                    #(#fieldRightOffset
       
  1897                       nil #tabable
       
  1898                       true
       
  1899                     )
       
  1900                     #name: 'fieldRightOffset'
  1939                     #name: 'fieldRightOffset'
  1901                     #layout: #(#LayoutFrame 190 0 14 0 240 0 36 0)
  1940                     #layout: #(#LayoutFrame 203 0 14 0 253 0 36 0)
  1902                     #activeHelpKey: #rightAbsolute
  1941                     #activeHelpKey: #rightAbsolute
  1903                     #tabable: true
  1942                     #tabable: true
  1904                     #model: #rightOffset
  1943                     #model: #rightOffset
  1905                     #group: #inputGroup
  1944                     #group: #inputGroup
  1906                     #type: #numberOrNil
  1945                     #type: #numberOrNil
  1908                     #acceptChannel: #acceptChannel
  1947                     #acceptChannel: #acceptChannel
  1909                     #modifiedChannel: #modifiedChannel
  1948                     #modifiedChannel: #modifiedChannel
  1910                     #acceptOnPointerLeave: false
  1949                     #acceptOnPointerLeave: false
  1911                   )
  1950                   )
  1912                  #(#ActionButtonSpec
  1951                  #(#ActionButtonSpec
  1913                     #attributes: 
  1952                     #label: '>'
  1914                    #(#tabable
       
  1915                       true
       
  1916                     )
       
  1917                     #name: 'actionAbsoluteRight'
  1953                     #name: 'actionAbsoluteRight'
  1918                     #layout: #(#LayoutFrame 245 0 14 0 267 0 36 0)
  1954                     #layout: #(#LayoutFrame 258 0 14 0 280 0 36 0)
  1919                     #activeHelpKey: #makeRightAbsolute
  1955                     #activeHelpKey: #makeRightAbsolute
  1920                     #tabable: true
  1956                     #tabable: true
  1921                     #model: #absoluteRight
  1957                     #model: #absoluteRight
  1922                   )
  1958                   )
  1923                  #(#LabelSpec
  1959                  #(#LabelSpec
  1924                     #label: 'Bottom:'
  1960                     #label: 'Bottom:'
  1925                     #name: 'labelBottom'
  1961                     #name: 'labelBottom'
  1926                     #layout: #(#AlignmentOrigin 88 0 53 0 1 0.5)
  1962                     #layout: #(#AlignmentOrigin 68 0 53 0 1 0.5)
       
  1963                   )
       
  1964                  #(#ActionButtonSpec
       
  1965                     #label: 'v'
       
  1966                     #name: 'actionRelativeBottom'
       
  1967                     #layout: #(#LayoutFrame 78 0 42 0 100 0 64 0)
       
  1968                     #activeHelpKey: #makeBottomRelative
       
  1969                     #tabable: true
       
  1970                     #model: #relativeBottom
  1927                   )
  1971                   )
  1928                  #(#InputFieldSpec
  1972                  #(#InputFieldSpec
  1929                     #attributes: 
       
  1930                    #(#fieldBottomFraction
       
  1931                       nil #tabable
       
  1932                       true
       
  1933                     )
       
  1934                     #name: 'fieldBottomFraction'
  1973                     #name: 'fieldBottomFraction'
  1935                     #layout: #(#LayoutFrame 90 0 42 0 140 0 64 0)
  1974                     #layout: #(#LayoutFrame 103 0 42 0 153 0 64 0)
  1936                     #activeHelpKey: #bottomRelative
  1975                     #activeHelpKey: #bottomRelative
  1937                     #tabable: true
  1976                     #tabable: true
  1938                     #model: #bottomFraction
  1977                     #model: #bottomFraction
  1939                     #group: #inputGroup
  1978                     #group: #inputGroup
  1940                     #type: #numberOrNil
  1979                     #type: #numberOrNil
  1942                     #acceptChannel: #acceptChannel
  1981                     #acceptChannel: #acceptChannel
  1943                     #modifiedChannel: #modifiedChannel
  1982                     #modifiedChannel: #modifiedChannel
  1944                     #acceptOnPointerLeave: false
  1983                     #acceptOnPointerLeave: false
  1945                   )
  1984                   )
  1946                  #(#ActionButtonSpec
  1985                  #(#ActionButtonSpec
  1947                     #attributes: 
  1986                     #label: '^'
  1948                    #(#tabable
  1987                     #name: 'actionBottomRelativeBottom'
  1949                       true
  1988                     #layout: #(#LayoutFrame 158 0 42 0 180 0 64 0)
  1950                     )
  1989                     #activeHelpKey: #makeBottomRelativeFromBottom
  1951                     #name: 'actionRelativeBottom'
  1990                     #tabable: true
  1952                     #layout: #(#LayoutFrame 145 0 42 0 167 0 64 0)
  1991                     #model: #bottomRelativeBottom
  1953                     #activeHelpKey: #makeBottomRelative
       
  1954                     #tabable: true
       
  1955                     #model: #relativeBottom
       
  1956                   )
  1992                   )
  1957                  #(#InputFieldSpec
  1993                  #(#InputFieldSpec
  1958                     #attributes: 
       
  1959                    #(#fieldBottomOffset
       
  1960                       nil #tabable
       
  1961                       true
       
  1962                     )
       
  1963                     #name: 'fieldBottomOffset'
  1994                     #name: 'fieldBottomOffset'
  1964                     #layout: #(#LayoutFrame 190 0 42 0 240 0 64 0)
  1995                     #layout: #(#LayoutFrame 203 0 42 0 253 0 64 0)
  1965                     #activeHelpKey: #bottomAbsolute
  1996                     #activeHelpKey: #bottomAbsolute
  1966                     #tabable: true
  1997                     #tabable: true
  1967                     #model: #bottomOffset
  1998                     #model: #bottomOffset
  1968                     #group: #inputGroup
  1999                     #group: #inputGroup
  1969                     #type: #numberOrNil
  2000                     #type: #numberOrNil
  1971                     #acceptChannel: #acceptChannel
  2002                     #acceptChannel: #acceptChannel
  1972                     #modifiedChannel: #modifiedChannel
  2003                     #modifiedChannel: #modifiedChannel
  1973                     #acceptOnPointerLeave: false
  2004                     #acceptOnPointerLeave: false
  1974                   )
  2005                   )
  1975                  #(#ActionButtonSpec
  2006                  #(#ActionButtonSpec
  1976                     #attributes: 
  2007                     #label: 'v'
  1977                    #(#tabable
       
  1978                       true
       
  1979                     )
       
  1980                     #name: 'actionAbsoluteBottom'
  2008                     #name: 'actionAbsoluteBottom'
  1981                     #layout: #(#LayoutFrame 245 0 42 0 267 0 64 0)
  2009                     #layout: #(#LayoutFrame 258 0 42 0 280 0 64 0)
  1982                     #activeHelpKey: #makeBottomAbsolute
  2010                     #activeHelpKey: #makeBottomAbsolute
  1983                     #tabable: true
  2011                     #tabable: true
  1984                     #model: #absoluteBottom
  2012                     #model: #absoluteBottom
  1985                   )
  2013                   )
  1986                  )
  2014                  )
  1987                
  2015                
  1988               )
  2016               )
  1989             )
  2017             )
  1990            #(#MenuPanelSpec
  2018            #(#MenuPanelSpec
  1991               #attributes: 
       
  1992              #(#tabable
       
  1993                 true
       
  1994               )
       
  1995               #name: 'commonLayoutToolBar'
  2019               #name: 'commonLayoutToolBar'
  1996               #layout: #(#LayoutFrame 6 0.0 231 0 -4 1.0 263 0)
  2020               #layout: #(#LayoutFrame 6 0.0 231 0 -4 1.0 263 0)
  1997               #level: 0
  2021               #level: 0
  1998               #tabable: true
  2022               #tabable: true
  1999               #menu: #commonFrameLayoutsMenu
  2023               #menu: #commonFrameLayoutsMenu
  2257         right:1          offset:0 
  2281         right:1          offset:0 
  2258         top:0            offset:0 
  2282         top:0            offset:0 
  2259         bottom:0.5       offset:0
  2283         bottom:0.5       offset:0
  2260 ! !
  2284 ! !
  2261 
  2285 
  2262 !UILayoutTool::Rectangle class methodsFor:'interface specs'!
  2286 !UILayoutTool::Extent class methodsFor:'help specs'!
       
  2287 
       
  2288 helpSpec
       
  2289     "This resource specification was automatically generated
       
  2290      by the UIHelpTool of ST/X."
       
  2291 
       
  2292     "Do not manually edit this!! If it is corrupted,
       
  2293      the UIHelpTool may not be able to read the specification."
       
  2294 
       
  2295     "
       
  2296      UIHelpTool openOnClass:UILayoutTool::Extent    
       
  2297     "
       
  2298 
       
  2299     <resource: #help>
       
  2300 
       
  2301     ^super helpSpec addPairsFrom:#(
       
  2302 
       
  2303 #hrzExtent
       
  2304 'Horizontal extent of the selected widget.'
       
  2305 
       
  2306 #vrtExtent
       
  2307 'Vertical extent of the selected widget.'
       
  2308 
       
  2309 )
       
  2310 ! !
       
  2311 
       
  2312 !UILayoutTool::Extent class methodsFor:'interface specs'!
  2263 
  2313 
  2264 windowSpec
  2314 windowSpec
  2265     "This resource specification was automatically generated
  2315     "This resource specification was automatically generated
  2266      by the UIPainter of ST/X."
  2316      by the UIPainter of ST/X."
  2267 
  2317 
  2268     "Do not manually edit this!! If it is corrupted,
  2318     "Do not manually edit this!! If it is corrupted,
  2269      the UIPainter may not be able to read the specification."
  2319      the UIPainter may not be able to read the specification."
  2270 
  2320 
  2271     "
  2321     "
  2272      UIPainter new openOnClass:UILayoutTool::Rectangle andSelector:#windowSpec
  2322      UIPainter new openOnClass:UILayoutTool::Extent andSelector:#windowSpec
  2273      UILayoutTool::Rectangle new openInterface:#windowSpec
  2323      UILayoutTool::Extent new openInterface:#windowSpec
  2274      UILayoutTool::Rectangle open
  2324      UILayoutTool::Extent open
  2275     "
  2325     "
  2276 
  2326 
  2277     <resource: #canvas>
  2327     <resource: #canvas>
  2278 
  2328 
  2279     ^
  2329     ^ 
  2280      
  2330      #(#FullSpec
  2281        #(#FullSpec
  2331         #name: #windowSpec
  2282           #window: 
  2332         #window: 
  2283            #(#WindowSpec
  2333        #(#WindowSpec
  2284               #name: 'UILayoutTool-Rectangle'
  2334           #label: 'UILayoutTool-Extent'
  2285               #layout: #(#LayoutFrame 291 0 130 0 632 0 328 0)
  2335           #name: 'UILayoutTool-Extent'
  2286               #label: 'UILayoutTool-Rectangle'
  2336           #min: #(#Point 10 10)
  2287               #min: #(#Point 10 10)
  2337           #max: #(#Point 1152 900)
  2288               #max: #(#Point 1152 900)
  2338           #bounds: #(#Rectangle 506 24 832 173)
  2289               #bounds: #(#Rectangle 291 130 633 329)
  2339         )
  2290               #usePreferredExtent: false
  2340         #component: 
  2291           )
  2341        #(#SpecCollection
  2292           #component: 
  2342           #collection: #(
  2293            #(#SpecCollection
  2343            #(#FramedBoxSpec
  2294               #collection: 
  2344               #label: 'Extent'
  2295                #(
  2345               #name: 'FramedBox'
  2296                  #(#UISubSpecification
  2346               #layout: #(#LayoutFrame 0 0.0 6 0.0 0 1.0 137 0)
  2297                     #name: 'subSpecification'
  2347               #labelPosition: #topLeft
  2298                     #layout: #(#LayoutFrame 1 0.0 6 0 0 1.0 96 0)
  2348               #component: 
  2299                     #majorKey: #UILayoutTool
  2349              #(#SpecCollection
  2300                     #minorKey: #layoutPointSpec
  2350                 #collection: #(
  2301                 )
  2351                  #(#LabelSpec
  2302                  #(#FramedBoxSpec
  2352                     #label: 'Width:'
  2303                     #name: 'FramedBox'
  2353                     #name: 'labelWidth'
  2304                     #layout: #(#LayoutFrame 1 0.0 99 0 0 1.0 194 0)
  2354                     #layout: #(#AlignmentOrigin 89 0 24 0 1 0.5)
  2305                     #component: 
  2355                     #adjust: #right
  2306                      #(#SpecCollection
  2356                   )
  2307                         #collection: 
  2357                  #(#InputFieldSpec
  2308                          #(
  2358                     #attributes: 
  2309                            #(#LabelSpec
  2359                    #(#tabable
  2310                               #name: 'labelCornerY'
  2360                       true
  2311                               #layout: #(#AlignmentOrigin 83 0 16 0 1 0)
  2361                     )
  2312                               #label: 'Right:'
  2362                     #name: 'fieldLeftOffset'
  2313                               #adjust: #left
  2363                     #layout: #(#LayoutFrame 90 0 13 0 140 0 35 0)
  2314                           )
  2364                     #activeHelpKey: #hrzExtent
  2315                            #(#InputFieldSpec
  2365                     #enableChannel: #notUsingDefaultExtent
  2316                               #name: 'fieldCornerX'
  2366                     #tabable: true
  2317                               #layout: #(#LayoutFrame 85 0 13 0 135 0 35 0)
  2367                     #model: #leftOffset
  2318                               #activeHelpKey: #cornerX
  2368                     #group: #inputGroup
  2319                               #tabable: true
  2369                     #type: #numberOrNil
  2320                               #model: #rightOffset
  2370                     #acceptOnLostFocus: true
  2321                               #group: #inputGroup
       
  2322                               #type: #numberOrNil
       
  2323                               #acceptOnLostFocus: true
       
  2324                     #acceptChannel: #acceptChannel
  2371                     #acceptChannel: #acceptChannel
  2325                     #modifiedChannel: #modifiedChannel
  2372                     #modifiedChannel: #modifiedChannel
  2326                           )
  2373                     #acceptOnPointerLeave: false
  2327                            #(#LabelSpec
  2374                   )
  2328                               #name: 'labelCornerX'
  2375                  #(#LabelSpec
  2329                               #layout: #(#AlignmentOrigin 83 0 41 0 1 0)
  2376                     #label: 'Height:'
  2330                               #label: 'Bottom:'
  2377                     #name: 'labelHeight'
  2331                               #adjust: #left
  2378                     #layout: #(#AlignmentOrigin 89 0 49 0 1 0.5)
  2332                           )
  2379                     #adjust: #right
  2333                            #(#InputFieldSpec
  2380                   )
  2334                               #name: 'fieldCornerY'
  2381                  #(#InputFieldSpec
  2335                               #layout: #(#LayoutFrame 85 0 38 0 135 0 60 0)
  2382                     #attributes: 
  2336                               #activeHelpKey: #cornerY
  2383                    #(#tabable
  2337                               #tabable: true
  2384                       true
  2338                               #model: #bottomOffset
  2385                     )
  2339                               #group: #inputGroup
  2386                     #name: 'fieldRightOffset'
  2340                               #type: #numberOrNil
  2387                     #layout: #(#LayoutFrame 90 0 38 0 140 0 60 0)
  2341                               #acceptOnLostFocus: true
  2388                     #activeHelpKey: #vrtExtent
       
  2389                     #enableChannel: #notUsingDefaultExtent
       
  2390                     #tabable: true
       
  2391                     #model: #rightOffset
       
  2392                     #group: #inputGroup
       
  2393                     #type: #numberOrNil
       
  2394                     #acceptOnLostFocus: true
  2342                     #acceptChannel: #acceptChannel
  2395                     #acceptChannel: #acceptChannel
  2343                     #modifiedChannel: #modifiedChannel
  2396                     #modifiedChannel: #modifiedChannel
  2344                           )
  2397                     #acceptOnPointerLeave: false
  2345                         )
  2398                   )
       
  2399                  #(#CheckBoxSpec
       
  2400                     #attributes: 
       
  2401                    #(#tabable
       
  2402                       true
  2346                     )
  2403                     )
  2347                     #label: 'Corner'
  2404                     #label: 'Use Widgets Default Extent'
  2348                     #labelPosition: #topLeft
  2405                     #name: 'useDefaultExtentCheckBox'
  2349                 )
  2406                     #layout: #(#Point 5 74)
       
  2407                     #enableChannel: #defaultExtentEnabled
       
  2408                     #tabable: true
       
  2409                     #model: #useDefaultExtent
       
  2410                     #translateLabel: true
       
  2411                   )
       
  2412                  )
       
  2413                
  2350               )
  2414               )
  2351           )
  2415             )
       
  2416            )
       
  2417          
       
  2418         )
  2352       )
  2419       )
  2353 
  2420 ! !
  2354     "Modified: / 13.8.1998 / 19:59:16 / cg"
  2421 
  2355 ! !
  2422 !UILayoutTool::Extent methodsFor:'accessing'!
  2356 
       
  2357 !UILayoutTool::Rectangle methodsFor:'accessing'!
       
  2358 
  2423 
  2359 fetch:aView spec:aSpec
  2424 fetch:aView spec:aSpec
  2360     "fetch rectangle
  2425     "fetch extent
  2361     "
  2426     "
  2362     |origin corner|
  2427     |extent|
  2363 
  2428 
  2364     origin := aView computeOrigin.
  2429     extent  := aView computeExtent.
  2365     corner := aView computeCorner.
  2430 
  2366 
  2431     (self aspectFor:#leftOffset)  value:(extent x).
  2367     (self aspectFor:#leftOffset)   value:(origin x).
  2432     (self aspectFor:#rightOffset) value:(extent y).
  2368     (self aspectFor:#rightOffset)  value:(corner x).
  2433 
  2369     (self aspectFor:#topOffset)    value:(origin y).
  2434     (self aspectFor:#useDefaultExtent) value:aSpec useDefaultExtent 
  2370     (self aspectFor:#bottomOffset) value:(corner y).
       
  2371 
       
  2372 
       
  2373 !
  2435 !
  2374 
  2436 
  2375 layout
  2437 layout
  2376     "returns current layout as rectangle
  2438     "returns current extent
  2377     "
  2439     "
  2378   ^ Smalltalk::Rectangle left:(((self aspectFor:#leftOffset)   value) ? 0)
  2440   ^ Smalltalk::Point x:(((self aspectFor:#leftOffset)   value) ? 0)
  2379                           top:(((self aspectFor:#topOffset)    value) ? 0)
  2441                      y:(((self aspectFor:#rightOffset)  value) ? 0)
  2380                         right:(((self aspectFor:#rightOffset)  value) ? 0)
       
  2381                        bottom:(((self aspectFor:#bottomOffset) value) ? 0)
       
  2382 
       
  2383 
  2442 
  2384 ! !
  2443 ! !
  2385 
  2444 
  2386 !UILayoutTool class methodsFor:'documentation'!
  2445 !UILayoutTool class methodsFor:'documentation'!
  2387 
  2446