UILayoutTool.st
author Claus Gittinger <cg@exept.de>
Wed, 29 Jul 2009 20:02:02 +0200
changeset 2570 4e663bc64364
parent 2533 460098ee1f39
child 2794 56fb74312287
permissions -rw-r--r--
changed #requestPackage
     1 "
     2  COPYRIGHT (c) 1995 by eXept Software AG
     3               All Rights Reserved
     4 
     5  This software is furnished under a license and may be used
     6  only in accordance with the terms of that license and with the
     7  inclusion of the above copyright notice.   This software may not
     8  be provided or otherwise made available to, or used by, any
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    11 "
    12 "{ Package: 'stx:libtool2' }"
    13 
    14 ApplicationModel subclass:#UILayoutTool
    15 	instanceVariableNames:'modifiedHolder aspects selection currentTool layoutView tabList
    16 		layoutSpec toolsDictionary'
    17 	classVariableNames:''
    18 	poolDictionaries:''
    19 	category:'Interface-UIPainter'
    20 !
    21 
    22 ApplicationModel subclass:#AnyLayout
    23 	instanceVariableNames:''
    24 	classVariableNames:''
    25 	poolDictionaries:''
    26 	privateIn:UILayoutTool
    27 !
    28 
    29 UILayoutTool::AnyLayout subclass:#AlignmentOrigin
    30 	instanceVariableNames:''
    31 	classVariableNames:''
    32 	poolDictionaries:''
    33 	privateIn:UILayoutTool
    34 !
    35 
    36 UILayoutTool::AnyLayout subclass:#Extent
    37 	instanceVariableNames:''
    38 	classVariableNames:''
    39 	poolDictionaries:''
    40 	privateIn:UILayoutTool
    41 !
    42 
    43 UILayoutTool::AnyLayout subclass:#LayoutFrame
    44 	instanceVariableNames:''
    45 	classVariableNames:'DefaultFixPartHeight'
    46 	poolDictionaries:''
    47 	privateIn:UILayoutTool
    48 !
    49 
    50 UILayoutTool::AnyLayout subclass:#LayoutOrigin
    51 	instanceVariableNames:''
    52 	classVariableNames:''
    53 	poolDictionaries:''
    54 	privateIn:UILayoutTool
    55 !
    56 
    57 UILayoutTool::AnyLayout subclass:#Point
    58 	instanceVariableNames:''
    59 	classVariableNames:''
    60 	poolDictionaries:''
    61 	privateIn:UILayoutTool
    62 !
    63 
    64 UILayoutTool::AnyLayout subclass:#Rectangle
    65 	instanceVariableNames:''
    66 	classVariableNames:''
    67 	poolDictionaries:''
    68 	privateIn:UILayoutTool
    69 !
    70 
    71 !UILayoutTool class methodsFor:'documentation'!
    72 
    73 copyright
    74 "
    75  COPYRIGHT (c) 1995 by eXept Software AG
    76               All Rights Reserved
    77 
    78  This software is furnished under a license and may be used
    79  only in accordance with the terms of that license and with the
    80  inclusion of the above copyright notice.   This software may not
    81  be provided or otherwise made available to, or used by, any
    82  other person.  No title to or ownership of the software is
    83  hereby transferred.
    84 "
    85 
    86 
    87 
    88 !
    89 
    90 documentation
    91 "
    92     used by the UIPainter to manipulate the layout of the selected component
    93 
    94     [author:]
    95         Claus Atzkern
    96 
    97     [see also:]
    98         UIPainter
    99         UIHelpTool
   100         UISpecificationTool
   101 "
   102 
   103 
   104 ! !
   105 
   106 !UILayoutTool class methodsFor:'constants'!
   107 
   108 label
   109     ^ 'Layout'
   110 ! !
   111 
   112 !UILayoutTool class methodsFor:'help specs'!
   113 
   114 helpSpec
   115     "This resource specification was automatically generated
   116      by the UIHelpTool of ST/X."
   117 
   118     "Do not manually edit this!! If it is corrupted,
   119      the UIHelpTool may not be able to read the specification."
   120 
   121     "
   122      UIHelpTool openOnClass:UILayoutTool    
   123     "
   124 
   125     <resource: #help>
   126 
   127     ^super helpSpec addPairsFrom:#(
   128 
   129 #cornerX
   130 'Absolute corner x of the selected widget.'
   131 
   132 #cornerY
   133 'Absolute corner y of the selected widget.'
   134 
   135 #layoutTool
   136 'Tool to set the layout of the selected widget.'
   137 
   138 #leftAbsolute
   139 'Offset of the left edge; positive is to the right, negative to the left.'
   140 
   141 #leftRelative
   142 'Relative origin x of the selected widget.'
   143 
   144 #makeLeftAbsolute
   145 'Compute pure-absolute x'
   146 
   147 #makeLeftRelative
   148 'Compute pure-fractional x.'
   149 
   150 #makeLeftRelativeFromRight
   151 'Compute fraction+offset for x relative to containers right.'
   152 
   153 #makeTopAbsolute
   154 'Compute pure-absolute y.'
   155 
   156 #makeTopRelative
   157 'Compute pure-fractional y.'
   158 
   159 #makeTopRelativeFromBottom
   160 'Compute fraction+offset for y relative to containers bottom.'
   161 
   162 #originX
   163 'Absolute origin x of the selected widget.'
   164 
   165 #originY
   166 'Absolute origin y of the selected widget.'
   167 
   168 #topAbsolute
   169 'Offset of the top edge; positive is to the bottom, negative to the top.'
   170 
   171 #topRelative
   172 'Relative origin y of the selected widget.'
   173 
   174 )
   175 ! !
   176 
   177 !UILayoutTool class methodsFor:'interface specs'!
   178 
   179 layoutOriginSpec
   180     "This resource specification was automatically generated
   181      by the UIPainter of ST/X."
   182 
   183     "Do not manually edit this!! If it is corrupted,
   184      the UIPainter may not be able to read the specification."
   185 
   186     "
   187      UIPainter new openOnClass:UILayoutTool andSelector:#layoutOriginSpec
   188      UILayoutTool new openInterface:#layoutOriginSpec
   189     "
   190 
   191     <resource: #canvas>
   192 
   193     ^ 
   194      #(FullSpec
   195         name: layoutOriginSpec
   196         window: 
   197        (WindowSpec
   198           label: 'UILayoutTool'
   199           name: 'UILayoutTool'
   200           min: (Point 10 10)
   201           bounds: (Rectangle 0 0 345 107)
   202         )
   203         component: 
   204        (SpecCollection
   205           collection: (
   206            (FramedBoxSpec
   207               label: 'Origin'
   208               name: 'FramedBox'
   209               layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 108 0)
   210               labelPosition: topLeft
   211               translateLabel: true
   212               component: 
   213              (SpecCollection
   214                 collection: (
   215                  (LabelSpec
   216                     label: 'Relative:'
   217                     name: 'labelRelative'
   218                     layout: (Point 103 6)
   219                     translateLabel: true
   220                   )
   221                  (LabelSpec
   222                     label: 'Offset:'
   223                     name: 'labelAbsolute'
   224                     layout: (Point 203 6)
   225                     translateLabel: true
   226                   )
   227                  (LabelSpec
   228                     label: 'Left:'
   229                     name: 'labelLeft'
   230                     layout: (AlignmentOrigin 68 0 27 0 1 0)
   231                     translateLabel: true
   232                   )
   233                  (ActionButtonSpec
   234                     label: 'imageFractX'
   235                     name: 'actionRelativeLeft'
   236                     layout: (LayoutFrame 77 0 24 0 99 0 46 0)
   237                     activeHelpKey: makeLeftRelative
   238                     hasCharacterOrientedLabel: false
   239                     tabable: true
   240                     model: relativeLeft
   241                   )
   242                  (InputFieldSpec
   243                     name: 'fieldLeftFraction'
   244                     layout: (LayoutFrame 102 0 25 0 152 0 47 0)
   245                     activeHelpKey: leftRelative
   246                     tabable: true
   247                     model: leftFraction
   248                     group: inputGroup
   249                     type: numberOrNil
   250                     acceptChannel: acceptChannel
   251                     modifiedChannel: modifiedChannel
   252                     acceptOnPointerLeave: false
   253                   )
   254                  (ActionButtonSpec
   255                     label: 'imageAbsX'
   256                     name: 'actionAbsoluteLeft'
   257                     layout: (LayoutFrame 178 0 24 0 200 0 46 0)
   258                     activeHelpKey: makeLeftAbsolute
   259                     hasCharacterOrientedLabel: false
   260                     tabable: true
   261                     model: absoluteLeft
   262                   )
   263                  (InputFieldSpec
   264                     name: 'fieldLeftOffset'
   265                     layout: (LayoutFrame 203 0 24 0 253 0 46 0)
   266                     activeHelpKey: leftAbsolute
   267                     tabable: true
   268                     model: leftOffset
   269                     group: inputGroup
   270                     type: numberOrNil
   271                     acceptChannel: acceptChannel
   272                     modifiedChannel: modifiedChannel
   273                     acceptOnPointerLeave: false
   274                   )
   275                  (ActionButtonSpec
   276                     label: 'imageAbsXFromRight'
   277                     name: 'actionRightRelativeLeft'
   278                     layout: (LayoutFrame 257 0 24 0 279 0 46 0)
   279                     activeHelpKey: makeLeftRelativeFromRight
   280                     hasCharacterOrientedLabel: false
   281                     tabable: true
   282                     model: rightRelativeLeft
   283                   )
   284                  (LabelSpec
   285                     label: 'Top:'
   286                     name: 'labelTop'
   287                     layout: (AlignmentOrigin 68 0 54 0 1 0)
   288                     translateLabel: true
   289                   )
   290                  (ActionButtonSpec
   291                     label: 'imageFractY'
   292                     name: 'actionRelativeTop'
   293                     layout: (LayoutFrame 77 0 51 0 99 0 73 0)
   294                     activeHelpKey: makeTopRelative
   295                     hasCharacterOrientedLabel: false
   296                     tabable: true
   297                     model: relativeTop
   298                   )
   299                  (InputFieldSpec
   300                     name: 'fieldTopFraction'
   301                     layout: (LayoutFrame 103 0 51 0 153 0 73 0)
   302                     activeHelpKey: topRelative
   303                     tabable: true
   304                     model: topFraction
   305                     group: inputGroup
   306                     type: numberOrNil
   307                     acceptChannel: acceptChannel
   308                     modifiedChannel: modifiedChannel
   309                     acceptOnPointerLeave: false
   310                   )
   311                  (ActionButtonSpec
   312                     label: 'imageAbsY'
   313                     name: 'actionAbsoluteTop'
   314                     layout: (LayoutFrame 178 0 51 0 200 0 73 0)
   315                     activeHelpKey: makeTopAbsolute
   316                     hasCharacterOrientedLabel: false
   317                     tabable: true
   318                     model: absoluteTop
   319                   )
   320                  (InputFieldSpec
   321                     name: 'fieldTopOffset'
   322                     layout: (LayoutFrame 203 0 51 0 253 0 73 0)
   323                     activeHelpKey: topAbsolute
   324                     tabable: true
   325                     model: topOffset
   326                     group: inputGroup
   327                     type: numberOrNil
   328                     acceptChannel: acceptChannel
   329                     modifiedChannel: modifiedChannel
   330                     acceptOnPointerLeave: false
   331                   )
   332                  (ActionButtonSpec
   333                     label: 'imageAbsYFromBottom'
   334                     name: 'actionBottomRelativeTop'
   335                     layout: (LayoutFrame 257 0 51 0 279 0 73 0)
   336                     activeHelpKey: makeTopRelativeFromBottom
   337                     hasCharacterOrientedLabel: false
   338                     tabable: true
   339                     model: bottomRelativeTop
   340                   )
   341                  )
   342                
   343               )
   344             )
   345            )
   346          
   347         )
   348       )
   349 !
   350 
   351 layoutPointSpec
   352     "This resource specification was automatically generated
   353      by the UIPainter of ST/X."
   354 
   355     "Do not manually edit this!! If it is corrupted,
   356      the UIPainter may not be able to read the specification."
   357 
   358     "
   359      UIPainter new openOnClass:UILayoutTool andSelector:#layoutPointSpec
   360      UILayoutTool new openInterface:#layoutPointSpec
   361     "
   362 
   363     <resource: #canvas>
   364 
   365     ^ 
   366      #(FullSpec
   367         name: layoutPointSpec
   368         window: 
   369        (WindowSpec
   370           label: 'UILayoutTool'
   371           name: 'UILayoutTool'
   372           min: (Point 10 10)
   373           bounds: (Rectangle 14 46 292 170)
   374         )
   375         component: 
   376        (SpecCollection
   377           collection: (
   378            (FramedBoxSpec
   379               label: 'Origin'
   380               name: 'FramedBox'
   381               layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 94 0)
   382               labelPosition: topLeft
   383                     translateLabel: true
   384               component: 
   385              (SpecCollection
   386                 collection: (
   387                  (LabelSpec
   388                     label: 'Left:'
   389                     name: 'labelOriginY'
   390                     layout: (AlignmentOrigin 83 0 14 0 1 0)
   391                     translateLabel: true
   392                   )
   393                  (InputFieldSpec
   394                     name: 'fieldOriginX'
   395                     layout: (LayoutFrame 85 0 11 0 135 0 33 0)
   396                     activeHelpKey: originX
   397                     tabable: true
   398                     model: leftOffset
   399                     group: inputGroup
   400                     type: numberOrNil
   401                     acceptChannel: acceptChannel
   402                     modifiedChannel: modifiedChannel
   403                     acceptOnPointerLeave: false
   404                   )
   405                  (LabelSpec
   406                     label: 'Top:'
   407                     name: 'labelOriginX'
   408                     layout: (AlignmentOrigin 83 0 39 0 1 0)
   409                     translateLabel: true
   410                   )
   411                  (InputFieldSpec
   412                     name: 'fieldOriginY'
   413                     layout: (LayoutFrame 85 0 36 0 135 0 58 0)
   414                     activeHelpKey: originY
   415                     tabable: true
   416                     model: topOffset
   417                     group: inputGroup
   418                     type: numberOrNil
   419                     acceptChannel: acceptChannel
   420                     modifiedChannel: modifiedChannel
   421                     acceptOnPointerLeave: false
   422                   )
   423                  )
   424                
   425               )
   426             )
   427            )
   428          
   429         )
   430       )
   431 !
   432 
   433 slices
   434     ^ #(
   435         ( 'Frame'          LayoutFrame)
   436         ( 'Origin'         LayoutOrigin)
   437         ( 'Alig.Origin'    AlignmentOrigin)
   438         ( 'Point'          Point)
   439         ( 'Rectangle'      Rectangle)
   440         ( 'Extent'         Extent)
   441        ) 
   442 
   443 !
   444 
   445 windowSpec
   446     "This resource specification was automatically generated
   447      by the UIPainter of ST/X."
   448 
   449     "Do not manually edit this!! If it is corrupted,
   450      the UIPainter may not be able to read the specification."
   451 
   452     "
   453      UIPainter new openOnClass:UILayoutTool andSelector:#windowSpec
   454      UILayoutTool new openInterface:#windowSpec
   455      UILayoutTool open
   456     "
   457 
   458     <resource: #canvas>
   459 
   460     ^ 
   461      #(FullSpec
   462         name: windowSpec
   463         window: 
   464        (WindowSpec
   465           label: 'UILayoutTool'
   466           name: 'UILayoutTool'
   467           min: (Point 10 10)
   468           bounds: (Rectangle 12 22 354 321)
   469         )
   470         component: 
   471        (SpecCollection
   472           collection: (
   473            (NoteBookViewSpec
   474               name: 'NoteBook'
   475               layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
   476               activeHelpKey: layoutTool
   477               enableChannel: enableChannel
   478               tabable: true
   479               model: noteBookModel
   480               menu: noteBookList
   481               direction: bottom
   482               translateLabel: true
   483               canvas: layoutCanvasHolder
   484               tabTopMargin: 0
   485               tabBottomMargin: 0
   486               keepCanvasAlive: true
   487               tabLevel: 0
   488             )
   489            )
   490          
   491         )
   492       )
   493 ! !
   494 
   495 !UILayoutTool class methodsFor:'resources'!
   496 
   497 classResources
   498     "my translations are found in the UIPainter classes resources"
   499 
   500     ^ UIPainter classResources 
   501 ! !
   502 
   503 !UILayoutTool methodsFor:'accessing'!
   504 
   505 acceptChannel
   506     "return the value of the instance variable 'acceptChannel' (automatically generated)"
   507 
   508     ^ masterApplication acceptChannel
   509 !
   510 
   511 layout
   512     "returns configued layout or nil
   513     "
   514     ^ currentTool notNil ifTrue:[currentTool layout]
   515                         ifFalse:[nil]
   516 !
   517 
   518 layoutType
   519     "returns current layout type or nil
   520     "
   521     |slice|
   522 
   523     (slice := self selectedSlice) notNil ifTrue:[
   524         ^ slice last
   525     ].
   526   ^ nil
   527 !
   528 
   529 layoutView
   530     "returns current edited view
   531     "
   532     ^ layoutView
   533 !
   534 
   535 layoutView:aView type:aTypeOrNil spec:aSpec
   536     "change current edited view
   537     "
   538     |type name list|
   539 
   540     layoutView := aView.
   541     layoutSpec := aSpec.
   542 
   543     (self aspectFor:#defaultExtentEnabled) value:(aSpec class ==  WindowSpec) not.
   544 
   545     aTypeOrNil notNil ifTrue:[ 
   546         self class slices findFirst:[:e|
   547             e last == aTypeOrNil 
   548                 ifTrue:[name := e first. true] 
   549                 ifFalse:[false].
   550         ].
   551         list := Array with:name with: 'Frame'.
   552     ] ifFalse:[
   553         (type := UIPainterView layoutType:layoutView) notNil ifTrue:[
   554             self class slices findFirst:[:e|
   555                 e last == type ifTrue:[name := e first. true] ifFalse:[false]
   556             ].
   557             list := tabList.
   558             type == #Extent ifTrue:[ 
   559                 aView superView specClass isLayoutContainer ifTrue:[
   560                     list := Array with:name
   561                 ] ifFalse:[
   562                     list := list copyWith:name
   563                 ]
   564             ]
   565         ]
   566     ].
   567     self noteBookList  value:list.
   568     self noteBookModel value:name.
   569     self update.
   570 !
   571 
   572 modifiedHolder:aValueHolder
   573     "set the value holder set to true in case of modifying attributes
   574     "
   575     modifiedHolder notNil ifTrue:[
   576         modifiedHolder removeDependent:self. 
   577     ].
   578 
   579     (modifiedHolder := aValueHolder) notNil ifTrue:[
   580         modifiedHolder addDependent:self.
   581     ].
   582 
   583 !
   584 
   585 update
   586     "update from view
   587     "
   588     |view|
   589 
   590     (selection notNil and:[currentTool notNil]) ifTrue:[
   591         (view := layoutView) notNil ifTrue:[
   592             currentTool fetch:view spec:layoutSpec
   593         ]
   594     ].
   595         
   596 ! !
   597 
   598 !UILayoutTool methodsFor:'aspects'!
   599 
   600 aspectFor:aKey
   601     "returns the aspect for a aKey or nil"
   602 
   603     ^ aspects at:aKey ifAbsent:[ super aspectFor:aKey ]
   604 !
   605 
   606 layoutCanvasHolder
   607     |holder|
   608 
   609     (holder := builder bindingAt:#layoutCanvasHolder) isNil ifTrue:[
   610         holder := ValueHolder new.
   611         builder aspectAt:#layoutCanvasHolder put:holder
   612     ].
   613   ^ holder
   614 !
   615 
   616 notUsingDefaultExtent
   617     |holder|
   618 
   619     (holder := builder bindingAt:#notUsingDefaultExtent) isNil ifTrue:[
   620         holder := BlockValue forLogicalNot:(self aspectFor:#useDefaultExtent).
   621         builder aspectAt:#notUsingDefaultExtent put:holder.
   622     ].
   623     ^ holder
   624 
   625 !
   626 
   627 noteBookList
   628     "holds the list of tab labels"
   629 
   630     ^ builder valueAspectFor:#noteBookList initialValue:nil
   631 !
   632 
   633 noteBookModel
   634     "automatically generated by UIPainter ..."
   635 
   636     |holder|
   637 
   638     (holder := builder bindingAt:#noteBookModel) isNil ifTrue:[
   639         holder := AspectAdaptor new subject:self; forAspect:#selection.
   640         builder aspectAt:#noteBookModel put:holder.
   641     ].
   642     ^ holder
   643 ! !
   644 
   645 !UILayoutTool methodsFor:'change & update'!
   646 
   647 update:something with:aParameter from:changedObject
   648     "one of my models changed its value
   649     "
   650     changedObject ~~ modifiedHolder ifTrue:[
   651         modifiedHolder value ~~ true ifTrue:[
   652             modifiedHolder isNil ifFalse:[
   653                 modifiedHolder value:true
   654             ]
   655         ]
   656     ]
   657 
   658 ! !
   659 
   660 !UILayoutTool methodsFor:'converting absolute'!
   661 
   662 absolute:what xOrY:xOrY
   663     "compute what as absolute (i.e. fraction=0, offset >= 0)"
   664 
   665     |extent fraction offset fractSymb offsetSymb 
   666      newOffset newFraction fractHolder offsetHolder|
   667 
   668     extent     := (self layoutView superView computeExtent) perform:xOrY.
   669     fractSymb  := (what, 'Fraction') asSymbol.
   670     offsetSymb := (what,   'Offset') asSymbol.
   671     fractHolder := (self aspectFor:fractSymb).
   672     offsetHolder := (self aspectFor:offsetSymb).
   673     fraction   := fractHolder  value.
   674     offset     := offsetHolder value.
   675 
   676     newOffset := offset + ((fraction * extent) asInteger).
   677     newFraction := 0.
   678 
   679     fractHolder  value:newFraction.
   680     offsetHolder value:newOffset.
   681 !
   682 
   683 absoluteBottom
   684     "compute bottom as absolute (i.e. fraction=0, offset >= 0)"
   685 
   686     self absolute:'bottom' xOrY:#y
   687 
   688 !
   689 
   690 absoluteLeft
   691     "compute left as absolute (i.e. fraction=0, offset >= 0)"
   692 
   693     self absolute:'left' xOrY:#x
   694 
   695 !
   696 
   697 absoluteRight
   698     "compute right as absolute (i.e. fraction=0, offset >= 0)"
   699 
   700     self absolute:'right' xOrY:#x
   701 
   702 !
   703 
   704 absoluteTop
   705     "compute top as absolute (i.e. fraction=0, offset >= 0)"
   706 
   707     self absolute:'top' xOrY:#y
   708 
   709 ! !
   710 
   711 !UILayoutTool methodsFor:'converting absolute from corner'!
   712 
   713 bottomRelativeBottom
   714     "compute bottom relative to containers bottom (fraction=1, offset negative)"
   715 
   716     self cornerRelative:'bottom' xOrY:#y
   717 
   718 !
   719 
   720 bottomRelativeTop
   721     "compute top relative to containers bottom (fraction=1, offset negative)"
   722 
   723     self cornerRelative:'top' xOrY:#y
   724 
   725 !
   726 
   727 cornerRelative:what xOrY:xOrY
   728     "compute what relative to the corner (i.e. fraction=1, offset negative)"
   729 
   730     |extent fraction offset fractSymb offsetSymb 
   731      newFraction newOffset fractHolder offsetHolder|
   732 
   733     extent     := (self layoutView superView computeExtent) perform:xOrY.
   734     fractSymb  := (what, 'Fraction') asSymbol.
   735     offsetSymb := (what,   'Offset') asSymbol.
   736     fractHolder := (self aspectFor:fractSymb).
   737     offsetHolder := (self aspectFor:offsetSymb).
   738     fraction   := fractHolder  value.
   739     offset     := offsetHolder value.
   740 
   741     newOffset := offset + ((fraction * extent) asInteger).
   742     newOffset := newOffset - extent.
   743     newFraction := 1.
   744 
   745     fractHolder  value:newFraction.
   746     offsetHolder value:newOffset.
   747 
   748 
   749 
   750 !
   751 
   752 rightRelativeLeft
   753     "compute left relative to containers right (fraction=1, offset negative)"
   754 
   755     self cornerRelative:'left' xOrY:#x
   756 
   757 !
   758 
   759 rightRelativeRight
   760     "compute right relative to containers right (fraction=1, offset negative)"
   761 
   762     self cornerRelative:'right' xOrY:#x
   763 
   764 ! !
   765 
   766 !UILayoutTool methodsFor:'converting relative'!
   767 
   768 relative:what xOrY:xOrY
   769     "compute what relative to the origin (i.e. fraction=0..1, offset 0)"
   770 
   771     |extent fraction offset fractSymb offsetSymb 
   772      newFraction newOffset
   773      fractHolder offsetHolder|
   774 
   775     extent     := (self layoutView superView computeExtent) perform:xOrY.
   776     fractSymb  := (what, 'Fraction') asSymbol.
   777     offsetSymb := (what,   'Offset') asSymbol.
   778     fractHolder := (self aspectFor:fractSymb).
   779     offsetHolder := (self aspectFor:offsetSymb).
   780     fraction   := fractHolder  value.
   781     offset     := offsetHolder value.
   782 
   783     newFraction   := (fraction + (offset / extent)) asFloat.
   784     newOffset := 0.
   785 
   786     (newFraction > 1.0) ifTrue:[newFraction := 1.0].
   787     (newFraction < 0.0) ifTrue:[newFraction := 0].
   788 
   789     offsetHolder value:newOffset.
   790     fractHolder  value:newFraction.
   791 
   792 
   793 
   794 !
   795 
   796 relativeBottom
   797     "compute bottom relative to the origin (i.e. fraction=0..1, offset 0)"
   798 
   799     self relative:'bottom' xOrY:#y
   800 
   801 
   802 !
   803 
   804 relativeLeft
   805     "compute left relative to the origin (i.e. fraction=0..1, offset 0)"
   806 
   807     self relative:'left' xOrY:#x
   808 
   809 !
   810 
   811 relativeRight
   812     "compute right relative to the origin (i.e. fraction=0..1, offset 0)"
   813 
   814     self relative:'right' xOrY:#x
   815 
   816 !
   817 
   818 relativeTop
   819     "compute top relative to the origin (i.e. fraction=0..1, offset 0)"
   820 
   821     self relative:'top' xOrY:#y
   822 
   823 ! !
   824 
   825 !UILayoutTool methodsFor:'initialization'!
   826 
   827 initialize
   828     "initialize channels
   829     "
   830     |slices size|
   831 
   832     super initialize.
   833 
   834     aspects  := IdentityDictionary new.
   835     toolsDictionary := IdentityDictionary new.
   836 
   837     #(  bottomFraction          bottomOffset
   838         leftFraction            leftOffset
   839         topFraction             topOffset
   840         rightFraction           rightOffset
   841         leftAlignmentFraction   topAlignmentFraction
   842         (useDefaultExtent     false)
   843         (defaultExtentEnabled false)
   844 
   845         (usePreferredWidth false)
   846         (usePreferredHeight false)
   847         (useDynamicPreferredWidth false)
   848         (useDynamicPreferredHeight false)
   849     )
   850 
   851     do:[:aKeyOrPair| |holder key val|
   852         (key := aKeyOrPair) isSymbol ifFalse:[
   853             key := aKeyOrPair first.
   854             val := aKeyOrPair second
   855         ].
   856         holder := val asValue.
   857         holder addDependent:self.
   858         aspects at:key put:holder.
   859     ].
   860 
   861     slices  := self class slices.
   862     size    := slices size - 1.
   863     tabList := Array new:size.
   864 
   865     1 to:size do:[:i| tabList at:i put:((slices at:i) first) ].
   866 ! !
   867 
   868 !UILayoutTool methodsFor:'selection'!
   869 
   870 selectedSlice
   871     "returns the slice assigned to the selection or nil"
   872 
   873     selection isNil ifTrue:[^ nil].
   874     ^ self class slices detect:[:aSlice | aSlice first = selection] ifNone:nil
   875 
   876 "/    selection notNil ifTrue:[
   877 "/        self class slices do:[:aSlice|
   878 "/            aSlice first = selection ifTrue:[
   879 "/                ^ aSlice
   880 "/            ]
   881 "/        ]
   882 "/    ].
   883 "/    ^ nil
   884 !
   885 
   886 selection
   887     ^ selection
   888 !
   889 
   890 selection:aSelection
   891     |appl slice sel key view|
   892 
   893     aSelection isNumber ifTrue:[
   894         aSelection ~~ 0 ifTrue:[sel := tabList at:aSelection]
   895     ] ifFalse:[
   896         sel := aSelection
   897     ].
   898 
   899     selection = sel ifFalse:[
   900         (selection := sel) notNil ifTrue:[
   901             key := selection asSymbol.
   902             appl := toolsDictionary at:key ifAbsent:nil.
   903 
   904             appl isNil ifTrue:[
   905                 view  := ApplicationSubView new.
   906                 slice := self selectedSlice.
   907                 appl  := slice last asString.
   908                 appl := Smalltalk classNamed:(self class name asString, '::', appl).
   909                 appl := appl new.
   910                 appl masterApplication:self.
   911                 appl createBuilder.
   912                 view client:appl.
   913                 appl window:view.
   914                 toolsDictionary at:key put:appl.
   915             ] ifFalse:[
   916                 view := appl window
   917             ].
   918             modifiedHolder value:true.
   919         ].
   920         currentTool := appl.
   921         self layoutCanvasHolder value:view.
   922     ].
   923     self update
   924 
   925     "Modified: / 4.2.2000 / 22:31:41 / cg"
   926 ! !
   927 
   928 !UILayoutTool::AnyLayout class methodsFor:'image specs'!
   929 
   930 imageAbsX
   931     "This resource specification was automatically generated
   932      by the ImageEditor of ST/X."
   933 
   934     "Do not manually edit this!! If it is corrupted,
   935      the ImageEditor may not be able to read the specification."
   936 
   937     "
   938      self imageAbsX inspect
   939      ImageEditor openOnClass:self andSelector:#imageAbsX
   940      Icon flushCachedIcons
   941     "
   942 
   943     <resource: #image>
   944 
   945     ^Icon
   946         constantNamed:'UILayoutTool::AnyLayout class imageAbsX'
   947         ifAbsentPut:[(Depth1Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
   948 <@BP@I@N$L*P*)BZ''8*@@(@B''8*P&)B*$L*PC)@@<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
   949 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
   950 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@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<L;0;/C>??;??/?>??;0?/C.<L;0C/@@<@@b') ; yourself); yourself]
   951 !
   952 
   953 imageAbsXFromRight
   954     "This resource specification was automatically generated
   955      by the ImageEditor of ST/X."
   956 
   957     "Do not manually edit this!! If it is corrupted,
   958      the ImageEditor may not be able to read the specification."
   959 
   960     "
   961      self imageAbsXFromRight inspect
   962      ImageEditor openOnClass:self andSelector:#imageAbsXFromRight
   963      Icon flushCachedIcons
   964     "
   965 
   966     <resource: #image>
   967 
   968     ^Icon
   969         constantNamed:'UILayoutTool::AnyLayout class imageAbsXFromRight'
   970         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@@<b') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@<@C7@O\0=7C7<O_?=??7??_?=?C7\O\0=0C0@O@@<b') ; yourself); yourself]
   971 !
   972 
   973 imageAbsY
   974     "This resource specification was automatically generated
   975      by the ImageEditor of ST/X."
   976 
   977     "Do not manually edit this!! If it is corrupted,
   978      the ImageEditor may not be able to read the specification."
   979 
   980     "
   981      self imageAbsY inspect
   982      ImageEditor openOnClass:self andSelector:#imageAbsY
   983      Icon flushCachedIcons
   984     "
   985 
   986     <resource: #image>
   987 
   988     ^Icon
   989         constantNamed:'UILayoutTool::AnyLayout class imageAbsY'
   990         ifAbsentPut:[(Depth1Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??>@@X@A?''<BP@I@@$@BPA98D@ HD@P O''0 AC?<@@@b') ; 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@@<@C0A?8G? O<@_ O?0??C?<@@@b') ; yourself); yourself]
   991 !
   992 
   993 imageAbsYFromBottom
   994     "This resource specification was automatically generated
   995      by the ImageEditor of ST/X."
   996 
   997     "Do not manually edit this!! If it is corrupted,
   998      the ImageEditor may not be able to read the specification."
   999 
  1000     "
  1001      self imageAbsYFromBottom inspect
  1002      ImageEditor openOnClass:self andSelector:#imageAbsYFromBottom
  1003      Icon flushCachedIcons
  1004     "
  1005 
  1006     <resource: #image>
  1007 
  1008     ^Icon
  1009         constantNamed:'UILayoutTool::AnyLayout class imageAbsYFromBottom'
  1010         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??<b') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@??C?<O?0G8@?0G? _>@O@@<@C0@O@??????????<b') ; yourself); yourself]
  1011 !
  1012 
  1013 imageFractX
  1014     "This resource specification was automatically generated
  1015      by the ImageEditor of ST/X."
  1016 
  1017     "Do not manually edit this!! If it is corrupted,
  1018      the ImageEditor may not be able to read the specification."
  1019 
  1020     "
  1021      self imageFractX inspect
  1022      ImageEditor openOnClass:self andSelector:#imageFractX
  1023      Icon flushCachedIcons
  1024     "
  1025 
  1026     <resource: #image>
  1027 
  1028     ^Icon
  1029         constantNamed:'UILayoutTool::AnyLayout class imageFractX'
  1030         ifAbsentPut:[(Depth1Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
  1031 <@>PBY@I&A&TJYII$X&@@X@A$X&RRYP)&A&PBY@I<@<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  1032 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  1033 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@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?<O?9????????????>_?0?>A?0C?@O<@<b') ; yourself); yourself]
  1034 !
  1035 
  1036 imageFractY
  1037     "This resource specification was automatically generated
  1038      by the ImageEditor of ST/X."
  1039 
  1040     "Do not manually edit this!! If it is corrupted,
  1041      the ImageEditor may not be able to read the specification."
  1042 
  1043     "
  1044      self imageFractY inspect
  1045      ImageEditor openOnClass:self andSelector:#imageFractY
  1046      Icon flushCachedIcons
  1047     "
  1048 
  1049     <resource: #image>
  1050 
  1051     ^Icon
  1052         constantNamed:'UILayoutTool::AnyLayout class imageFractY'
  1053         ifAbsentPut:[(Depth1Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??>@@X@A?''<PB@ PAB@BP@I@AB@HDA@H?''>@@X@A??<b') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??????????<_>@?0A>@C0@O@A>@O<A?8??????????<b') ; yourself); yourself]
  1054 ! !
  1055 
  1056 !UILayoutTool::AlignmentOrigin class methodsFor:'help specs'!
  1057 
  1058 helpSpec
  1059     "This resource specification was automatically generated
  1060      by the UIHelpTool of ST/X."
  1061 
  1062     "Do not manually edit this!! If it is corrupted,
  1063      the UIHelpTool may not be able to read the specification."
  1064 
  1065     "
  1066      UIHelpTool openOnClass:UILayoutTool::AlignmentOrigin    
  1067     "
  1068 
  1069     <resource: #help>
  1070 
  1071     ^super helpSpec addPairsFrom:#(
  1072 
  1073 #alignBottomCenter
  1074 'Aligns the selected widget bottomCenter to location.'
  1075 
  1076 #alignBottomLeft
  1077 'Aligns the selected widget bottomLeft to location.'
  1078 
  1079 #alignBottomRight
  1080 'Aligns the selected widget bottomRight to location.'
  1081 
  1082 #alignCenter
  1083 'Aligns the selected widget center to location.'
  1084 
  1085 #alignHorizontal
  1086 'Horizontal inset to the location point of the selected widget.'
  1087 
  1088 #alignLeftCenter
  1089 'Aligns the selected widget leftCenter to location.'
  1090 
  1091 #alignRightCenter
  1092 'Aligns the selected widget rightCenter to location.'
  1093 
  1094 #alignTopCenter
  1095 'Aligns the selected widget topCenter to location.'
  1096 
  1097 #alignTopLeft
  1098 'Aligns the selected widget topLeft to location.'
  1099 
  1100 #alignTopRight
  1101 'Aligns the selected widget topRight to location.'
  1102 
  1103 #alignVertical
  1104 'Vertical inset to the location point of the widget.'
  1105 
  1106 )
  1107 ! !
  1108 
  1109 !UILayoutTool::AlignmentOrigin class methodsFor:'interface specs'!
  1110 
  1111 windowSpec
  1112     "This resource specification was automatically generated
  1113      by the UIPainter of ST/X."
  1114 
  1115     "Do not manually edit this!! If it is corrupted,
  1116      the UIPainter may not be able to read the specification."
  1117 
  1118     "
  1119      UIPainter new openOnClass:UILayoutTool::AlignmentOrigin andSelector:#windowSpec
  1120      UILayoutTool::AlignmentOrigin new openInterface:#windowSpec
  1121      UILayoutTool::AlignmentOrigin open
  1122     "
  1123 
  1124     <resource: #canvas>
  1125 
  1126     ^ 
  1127      #(FullSpec
  1128         name: windowSpec
  1129         window: 
  1130        (WindowSpec
  1131           label: 'UILayoutTool-AlignmentOrigin'
  1132           name: 'UILayoutTool-AlignmentOrigin'
  1133           min: (Point 10 10)
  1134           bounds: (Rectangle 14 46 419 253)
  1135         )
  1136         component: 
  1137        (SpecCollection
  1138           collection: (
  1139            (UISubSpecification
  1140               name: 'layoutOriginSpec'
  1141               layout: (LayoutFrame 1 0.0 6 0 0 1.0 111 0)
  1142               majorKey: UILayoutTool
  1143               minorKey: layoutOriginSpec
  1144             )
  1145            (FramedBoxSpec
  1146               label: 'Alignment'
  1147               name: 'FramedBox'
  1148               layout: (LayoutFrame 1 0.0 113 0 0 1.0 208 0)
  1149               labelPosition: topLeft
  1150               translateLabel: true
  1151               component: 
  1152              (SpecCollection
  1153                 collection: (
  1154                  (LabelSpec
  1155                     label: 'Horizontal:'
  1156                     name: 'alignHLabel'
  1157                     layout: (AlignmentOrigin 88 0 17 0 1 0)
  1158                     adjust: right
  1159                     translateLabel: true
  1160                   )
  1161                  (InputFieldSpec
  1162                     name: 'leftAlignmentFractionField'
  1163                     layout: (LayoutFrame 90 0 14 0 147 0 36 0)
  1164                     activeHelpKey: alignHorizontal
  1165                     tabable: true
  1166                     model: leftAlignmentFraction
  1167                     group: inputGroup
  1168                     type: numberOrNil
  1169                     acceptOnLostFocus: true
  1170                     acceptChannel: acceptChannel
  1171                     modifiedChannel: modifiedChannel
  1172                     acceptOnPointerLeave: false
  1173                   )
  1174                  (LabelSpec
  1175                     label: 'Vertical:'
  1176                     name: 'alignVLabel'
  1177                     layout: (AlignmentOrigin 88 0 43 0 1 0)
  1178                     adjust: right
  1179                     translateLabel: true
  1180                   )
  1181                  (InputFieldSpec
  1182                     name: 'topAlignmentFractionField'
  1183                     layout: (LayoutFrame 90 0 40 0 147 0 62 0)
  1184                     activeHelpKey: alignVertical
  1185                     tabable: true
  1186                     model: topAlignmentFraction
  1187                     group: inputGroup
  1188                     type: numberOrNil
  1189                     acceptOnLostFocus: true
  1190                     acceptChannel: acceptChannel
  1191                     modifiedChannel: modifiedChannel
  1192                     acceptOnPointerLeave: false
  1193                   )
  1194                  (DividerSpec
  1195                     name: 'separator1'
  1196                     layout: (LayoutFrame 204 0 19 0 245 0 22 0)
  1197                   )
  1198                  (DividerSpec
  1199                     name: 'separator2'
  1200                     layout: (LayoutFrame 204 0 55 0 245 0 58 0)
  1201                   )
  1202                  (DividerSpec
  1203                     name: 'separator3'
  1204                     layout: (LayoutFrame 196 0 28 0 199 0 50 0)
  1205                     orientation: vertical
  1206                   )
  1207                  (DividerSpec
  1208                     name: 'separator4'
  1209                     layout: (LayoutFrame 250 0 28 0 253 0 50 0)
  1210                     orientation: vertical
  1211                   )
  1212                  (ActionButtonSpec
  1213                     name: 'alignTopLeft'
  1214                     layout: (LayoutFrame 190 0 14 0 204 0 28 0)
  1215                     activeHelpKey: alignTopLeft
  1216                     tabable: true
  1217                     model: alignTopLeft
  1218                   )
  1219                  (ActionButtonSpec
  1220                     name: 'alignTopCenter'
  1221                     layout: (LayoutFrame 217 0 14 0 231 0 28 0)
  1222                     activeHelpKey: alignTopCenter
  1223                     tabable: true
  1224                     model: alignTopCenter
  1225                   )
  1226                  (ActionButtonSpec
  1227                     name: 'alignTopRight'
  1228                     layout: (LayoutFrame 245 0 14 0 259 0 28 0)
  1229                     activeHelpKey: alignTopRight
  1230                     tabable: true
  1231                     model: alignTopRight
  1232                   )
  1233                  (ActionButtonSpec
  1234                     name: 'alignLeftCenter'
  1235                     layout: (LayoutFrame 190 0 32 0 204 0 46 0)
  1236                     activeHelpKey: alignLeftCenter
  1237                     tabable: true
  1238                     model: alignLeftCenter
  1239                   )
  1240                  (ActionButtonSpec
  1241                     name: 'alignCenter'
  1242                     layout: (LayoutFrame 217 0 32 0 231 0 46 0)
  1243                     activeHelpKey: alignCenter
  1244                     tabable: true
  1245                     model: alignCenter
  1246                   )
  1247                  (ActionButtonSpec
  1248                     name: 'alignRightCenter'
  1249                     layout: (LayoutFrame 245 0 32 0 259 0 46 0)
  1250                     activeHelpKey: alignRightCenter
  1251                     tabable: true
  1252                     model: alignRightCenter
  1253                   )
  1254                  (ActionButtonSpec
  1255                     name: 'alignBottomLeft'
  1256                     layout: (LayoutFrame 190 0 50 0 204 0 64 0)
  1257                     activeHelpKey: alignBottomLeft
  1258                     tabable: true
  1259                     model: alignBottomLeft
  1260                   )
  1261                  (ActionButtonSpec
  1262                     name: 'alignBottomCenter'
  1263                     layout: (LayoutFrame 217 0 50 0 231 0 64 0)
  1264                     activeHelpKey: alignBottomCenter
  1265                     tabable: true
  1266                     model: alignBottomCenter
  1267                   )
  1268                  (ActionButtonSpec
  1269                     name: 'alignBottomRight'
  1270                     layout: (LayoutFrame 245 0 50 0 259 0 64 0)
  1271                     activeHelpKey: alignBottomRight
  1272                     tabable: true
  1273                     model: alignBottomRight
  1274                   )
  1275                  )
  1276                
  1277               )
  1278             )
  1279            )
  1280          
  1281         )
  1282       )
  1283 ! !
  1284 
  1285 !UILayoutTool::AlignmentOrigin methodsFor:'accessing'!
  1286 
  1287 fetch:aView spec:aSpec
  1288     "fetch alignmentOrigin
  1289     "
  1290     |layout type 
  1291      leftAlignmentFractionHolder topAlignmentFractionHolder
  1292      leftOffsetHolder leftFractionHolder topOffsetHolder topFractionHolder|
  1293 
  1294     type   := UIPainterView layoutType:aView.
  1295     layout := aView geometryLayout.
  1296 
  1297     leftOffsetHolder := (self aspectFor:#leftOffset).
  1298     leftFractionHolder := (self aspectFor:#leftFraction).
  1299     topOffsetHolder := (self aspectFor:#topOffset).
  1300     topFractionHolder := (self aspectFor:#topFraction).
  1301     leftAlignmentFractionHolder := (self aspectFor:#leftAlignmentFraction).
  1302     topAlignmentFractionHolder := (self aspectFor:#topAlignmentFraction).
  1303 
  1304     layout isLayout ifTrue:[
  1305         leftOffsetHolder   value:(layout leftOffset).
  1306         leftFractionHolder value:(layout leftFraction).
  1307         topOffsetHolder    value:(layout topOffset).
  1308         topFractionHolder  value:(layout topFraction).
  1309 
  1310         type == #AlignmentOrigin ifTrue:[
  1311             leftAlignmentFractionHolder value:(layout leftAlignmentFraction).
  1312             topAlignmentFractionHolder  value:(layout topAlignmentFraction).
  1313           ^ self
  1314         ]
  1315     ] ifFalse:[
  1316         layout := aView computeOrigin.
  1317 
  1318         leftOffsetHolder   value:(layout x).
  1319         leftFractionHolder value:0.
  1320         topOffsetHolder    value:(layout y).
  1321         topFractionHolder  value:0.
  1322     ].
  1323     leftAlignmentFractionHolder value:0.
  1324     topAlignmentFractionHolder  value:0.
  1325 
  1326 
  1327 !
  1328 
  1329 layout
  1330     "returns current layout as alignmentOrigin
  1331     "
  1332     |layout|
  1333 
  1334     layout  := Smalltalk::AlignmentOrigin new.
  1335 
  1336     layout 
  1337         leftFraction:(((self aspectFor:#leftFraction) value) ? 0)
  1338               offset:(((self aspectFor:#leftOffset)   value) ? 0)
  1339         topFraction:(((self aspectFor:#topFraction)  value) ? 0)
  1340              offset:(((self aspectFor:#topOffset)    value) ? 0).
  1341 
  1342     layout 
  1343         leftAlignmentFraction:(((self aspectFor:#leftAlignmentFraction) value) ? 0)
  1344         topAlignmentFraction:(((self aspectFor:#topAlignmentFraction)  value) ? 0).
  1345 
  1346   ^ layout
  1347 ! !
  1348 
  1349 !UILayoutTool::AlignmentOrigin methodsFor:'alignment'!
  1350 
  1351 alignBottomCenter
  1352     self makeAlignLeft:0.5 top:1
  1353 
  1354 
  1355 !
  1356 
  1357 alignBottomLeft
  1358     self makeAlignLeft:0 top:1
  1359 
  1360 
  1361 !
  1362 
  1363 alignBottomRight
  1364     self makeAlignLeft:1 top:1
  1365 
  1366 
  1367 !
  1368 
  1369 alignCenter
  1370     self makeAlignLeft:0.5 top:0.5
  1371 
  1372 
  1373 !
  1374 
  1375 alignLeftCenter
  1376     self makeAlignLeft:0 top:0.5
  1377 
  1378 
  1379 !
  1380 
  1381 alignRightCenter
  1382     self makeAlignLeft:1 top:0.5
  1383 
  1384 
  1385 !
  1386 
  1387 alignTopCenter
  1388     self makeAlignLeft:0.5 top:0
  1389 
  1390 
  1391 !
  1392 
  1393 alignTopLeft
  1394     self makeAlignLeft:0 top:0
  1395 
  1396 
  1397 !
  1398 
  1399 alignTopRight
  1400     self makeAlignLeft:1 top:0
  1401 
  1402 
  1403 !
  1404 
  1405 makeAlignLeft:leftAlignmentFraction top:topAlignmentFraction
  1406     |lAF tAF lO tO ext lAHolder tAHolder lOHolder tOHolder|
  1407 
  1408     lAF     := (lAHolder := self aspectFor:#leftAlignmentFraction) value ? 0.
  1409     tAF     := (tAHolder := self aspectFor:#topAlignmentFraction)  value ? 0.
  1410     ext     := (self aspectFor:#layoutView) computeExtent.
  1411 
  1412     lAHolder value:leftAlignmentFraction.
  1413     tAHolder  value:topAlignmentFraction.
  1414 
  1415     lO := (lOHolder := self aspectFor:#leftOffset) value ? 0.
  1416     tO := (tOHolder := self aspectFor:#topOffset)  value ? 0.
  1417 
  1418     lO := lO + (ext x * (leftAlignmentFraction - lAF)).
  1419     tO := tO + (ext y * (topAlignmentFraction  - tAF)).
  1420 
  1421     lOHolder value:(lO rounded).
  1422     tOHolder value:(tO rounded).
  1423 
  1424 !
  1425 
  1426 makeAlignTopRight
  1427     self makeAlignLeft:1 top:0
  1428 
  1429 
  1430 ! !
  1431 
  1432 !UILayoutTool::Extent class methodsFor:'help specs'!
  1433 
  1434 helpSpec
  1435     "This resource specification was automatically generated
  1436      by the UIHelpTool of ST/X."
  1437 
  1438     "Do not manually edit this!! If it is corrupted,
  1439      the UIHelpTool may not be able to read the specification."
  1440 
  1441     "
  1442      UIHelpTool openOnClass:UILayoutTool::Extent    
  1443     "
  1444 
  1445     <resource: #help>
  1446 
  1447     ^super helpSpec addPairsFrom:#(
  1448 
  1449 #hrzExtent
  1450 'Horizontal extent of the selected widget.'
  1451 
  1452 #vrtExtent
  1453 'Vertical extent of the selected widget.'
  1454 
  1455 )
  1456 ! !
  1457 
  1458 !UILayoutTool::Extent class methodsFor:'interface specs'!
  1459 
  1460 windowSpec
  1461     "This resource specification was automatically generated
  1462      by the UIPainter of ST/X."
  1463 
  1464     "Do not manually edit this!! If it is corrupted,
  1465      the UIPainter may not be able to read the specification."
  1466 
  1467     "
  1468      UIPainter new openOnClass:UILayoutTool::Extent andSelector:#windowSpec
  1469      UILayoutTool::Extent new openInterface:#windowSpec
  1470      UILayoutTool::Extent open
  1471     "
  1472 
  1473     <resource: #canvas>
  1474 
  1475     ^ 
  1476      #(FullSpec
  1477         name: windowSpec
  1478         window: 
  1479        (WindowSpec
  1480           label: 'UILayoutTool-Extent'
  1481           name: 'UILayoutTool-Extent'
  1482           min: (Point 10 10)
  1483           bounds: (Rectangle 0 0 505 149)
  1484         )
  1485         component: 
  1486        (SpecCollection
  1487           collection: (
  1488            (FramedBoxSpec
  1489               label: 'Extent'
  1490               name: 'FramedBox'
  1491               layout: (LayoutFrame 0 0.0 6 0.0 0 1.0 145 0)
  1492               labelPosition: topLeft
  1493               translateLabel: true
  1494               component: 
  1495              (SpecCollection
  1496                 collection: (
  1497                  (LabelSpec
  1498                     label: 'Width:'
  1499                     name: 'labelWidth'
  1500                     layout: (AlignmentOrigin 89 0 41 0 1 0.5)
  1501                     translateLabel: true
  1502                     adjust: right
  1503                   )
  1504                  (InputFieldSpec
  1505                     name: 'fieldLeftOffset'
  1506                     layout: (LayoutFrame 90 0 30 0 140 0 52 0)
  1507                     activeHelpKey: hrzExtent
  1508                     enableChannel: notUsingDefaultExtent
  1509                     tabable: true
  1510                     model: leftOffset
  1511                     group: inputGroup
  1512                     type: numberOrNil
  1513                     acceptOnLostFocus: true
  1514                     acceptChannel: acceptChannel
  1515                     modifiedChannel: modifiedChannel
  1516                     acceptOnPointerLeave: false
  1517                   )
  1518                  (LabelSpec
  1519                     label: 'Height:'
  1520                     name: 'labelHeight'
  1521                     layout: (AlignmentOrigin 89 0 66 0 1 0.5)
  1522                     translateLabel: true
  1523                     adjust: right
  1524                   )
  1525                  (InputFieldSpec
  1526                     name: 'fieldRightOffset'
  1527                     layout: (LayoutFrame 90 0 55 0 140 0 77 0)
  1528                     activeHelpKey: vrtExtent
  1529                     enableChannel: notUsingDefaultExtent
  1530                     tabable: true
  1531                     model: topOffset
  1532                     group: inputGroup
  1533                     type: numberOrNil
  1534                     acceptOnLostFocus: true
  1535                     acceptChannel: acceptChannel
  1536                     modifiedChannel: modifiedChannel
  1537                     acceptOnPointerLeave: false
  1538                   )
  1539                  (CheckBoxSpec
  1540                     label: 'Use Preferred'
  1541                     name: 'CheckBox1'
  1542                     layout: (LayoutFrame 169 0 30 0 275 0 52 0)
  1543                     model: usePreferredWidth
  1544                     translateLabel: true
  1545                   )
  1546                  (CheckBoxSpec
  1547                     label: 'Dynamic'
  1548                     name: 'CheckBox3'
  1549                     layout: (LayoutFrame 276 0 30 0 353 0 52 0)
  1550                     model: useDynamicPreferredWidth
  1551                     translateLabel: true
  1552                   )
  1553                  (CheckBoxSpec
  1554                     label: 'Use Preferred'
  1555                     name: 'CheckBox2'
  1556                     layout: (LayoutFrame 169 0 58 0 275 0 80 0)
  1557                     model: usePreferredHeight
  1558                     translateLabel: true
  1559                   )
  1560                  (CheckBoxSpec
  1561                     label: 'Dynamic'
  1562                     name: 'CheckBox4'
  1563                     layout: (LayoutFrame 276 0 58 0 353 0 80 0)
  1564                     model: useDynamicPreferredHeight
  1565                     translateLabel: true
  1566                   )
  1567                  (CheckBoxSpec
  1568                     label: 'Use Widgets Default Extent'
  1569                     name: 'useDefaultExtentCheckBox'
  1570                     layout: (Point 5 84)
  1571                     enableChannel: defaultExtentEnabled
  1572                     tabable: true
  1573                     model: useDefaultExtent
  1574                     translateLabel: true
  1575                   )
  1576                  )
  1577                
  1578               )
  1579             )
  1580            (PopUpListSpec
  1581               label: 'Common Extents'
  1582               name: 'CommonExtentsPopUpList'
  1583               layout: (LayoutFrame 189 0 21 0 314 0 43 0)
  1584               tabable: true
  1585               menu: listOfCommonExtents
  1586               useIndex: true
  1587               ignoreReselect: false
  1588               stateChangeCallBackSelector: commonExtentSelected:
  1589             )
  1590            )
  1591          
  1592         )
  1593       )
  1594 ! !
  1595 
  1596 !UILayoutTool::Extent methodsFor:'accessing'!
  1597 
  1598 fetch:aView spec:aSpec
  1599     "fetch the extent from aView"
  1600 
  1601     |extent|
  1602 
  1603     extent  := aView computeExtent.
  1604 
  1605     (self aspectFor:#leftOffset)  value:(extent x).
  1606     (self aspectFor:#topOffset)   value:(extent y).
  1607 
  1608     (self aspectFor:#usePreferredWidth) value:(aSpec usePreferredWidth).
  1609     (self aspectFor:#usePreferredHeight) value:(aSpec usePreferredHeight).
  1610     (self aspectFor:#useDynamicPreferredWidth) value:(aSpec useDynamicPreferredWidth).
  1611     (self aspectFor:#useDynamicPreferredHeight) value:(aSpec useDynamicPreferredHeight).
  1612     (self aspectFor:#useDefaultExtent) value:aSpec useDefaultExtent 
  1613 !
  1614 
  1615 layout
  1616     "returns the current extent"
  1617 
  1618     ^ (((self aspectFor:#leftOffset) value) ? 0) @ (((self aspectFor:#topOffset)  value) ? 0)
  1619 ! !
  1620 
  1621 !UILayoutTool::Extent methodsFor:'aspects'!
  1622 
  1623 commonExtentsSpec
  1624     ^ #( 
  1625         ('200 x 100'  (200 100) ) 
  1626         ('300 x 300'  (300 300) ) 
  1627         ('640 x 400'  (640 400) ) 
  1628         ('800 x 600'  (800 600) ) 
  1629         ('1024 x 768'  (1024 768) ) 
  1630         ('1200 x 800'  (1200 800) ) 
  1631       )
  1632 !
  1633 
  1634 listOfCommonExtents
  1635     ^ self commonExtentsSpec collect:[:eachRow | eachRow first].
  1636 ! !
  1637 
  1638 !UILayoutTool::Extent methodsFor:'user actions'!
  1639 
  1640 commonExtentSelected:index
  1641     |xy x y|
  1642 
  1643     xy := (self commonExtentsSpec at:index) second. 
  1644     x := xy at:1.
  1645     y := xy at:2.
  1646 
  1647     (self aspectFor:#leftOffset)  value:x.
  1648     (self aspectFor:#topOffset)   value:y.
  1649 
  1650     (builder componentAt:#CommonExtentsPopUpList) 
  1651         label:(resources string:'Common Extents').
  1652 ! !
  1653 
  1654 !UILayoutTool::LayoutFrame class methodsFor:'defaults'!
  1655 
  1656 defaultFixPartHeight
  1657     ^ DefaultFixPartHeight ? 30
  1658 ! !
  1659 
  1660 !UILayoutTool::LayoutFrame class methodsFor:'help specs'!
  1661 
  1662 helpSpec
  1663     "This resource specification was automatically generated
  1664      by the UIHelpTool of ST/X."
  1665 
  1666     "Do not manually edit this!! If it is corrupted,
  1667      the UIHelpTool may not be able to read the specification."
  1668 
  1669     "
  1670      UIHelpTool openOnClass:UILayoutTool::LayoutFrame    
  1671     "
  1672 
  1673     <resource: #help>
  1674 
  1675     ^ super helpSpec addPairsFrom:#(
  1676 
  1677 #bottomAbsolute
  1678 'Offset of the bottom edge; positive is to the bottom, negative to the top.'
  1679 
  1680 #bigBottomFixPartLayout
  1681 'Set layout for a big fixed area at the bottom of the widgets container'
  1682 
  1683 #bottomFixPartLayout
  1684 'Set layout for a small fixed area at the bottom of the widgets container'
  1685 
  1686 #bottomHalfLayout
  1687 'Set layout for the bottom half of the widgets container'
  1688 
  1689 #bottomLeftQuarterLayout
  1690 'Set layout for the bottom-left quarter of the widgets container'
  1691 
  1692 #bottomRelative
  1693 'Relative corner y of the selected widget.'
  1694 
  1695 #bottomRightQuarterLayout
  1696 'Set layout for the bottom-right quarter of the widgets container'
  1697 
  1698 #fullLayout
  1699 'Set layout to fill all of the widgets container'
  1700 
  1701 #horizontalFixPartLayout
  1702 'Set layout for a small fixed-height area centered vertically in the widgets container'
  1703 
  1704 #bigHorizontalFixPartLayout
  1705 'Set layout for a big fixed-height area centered vertically in the widgets container'
  1706 
  1707 #leftFixPartLayout
  1708 'Set layout for a small fixed area at the left of the widgets container'
  1709 
  1710 #leftHalfLayout
  1711 'Set layout for the left half of the widgets container'
  1712 
  1713 #makeBottomAbsolute
  1714 'Compute pure-absolute y.'
  1715 
  1716 #makeBottomRelative
  1717 'Compute pure-fractional y.'
  1718 
  1719 #makeBottomRelativeFromBottom
  1720 'Compute fraction+offset for y relative to containers bottom.'
  1721 
  1722 #makeRightAbsolute
  1723 'Compute pure-absolute x.'
  1724 
  1725 #makeRightRelative
  1726 'Compute pure-fractional x.'
  1727 
  1728 #makeRightRelativeFromRight
  1729 'Compute fraction+offset for x relative to containers right.'
  1730 
  1731 #rightAbsolute
  1732 'Offset of the right edge; positive is to the right, negative to the left.'
  1733 
  1734 #rightFixPartLayout
  1735 'Set layout for a small fixed area at the right of the widgets container'
  1736 
  1737 #rightHalfLayout
  1738 'Set layout for the right half of the widgets container'
  1739 
  1740 #rightRelative
  1741 'Relative corner x of the selected widget.'
  1742 
  1743 #screenFrameLayout
  1744 ''
  1745 
  1746 #topFixPartLayout
  1747 'Set layout for a small fixed area at the top of the widgets container'
  1748 
  1749 #bigTopFixPartLayout
  1750 'Set layout for a big fixed area at the top of the widgets container'
  1751 
  1752 #topHalfLayout
  1753 'Set layout for the top half of the widgets container'
  1754 
  1755 #topLeftQuarterLayout
  1756 'Set layout for the top-left quarter of the widgets container'
  1757 
  1758 #topRightQuarterLayout
  1759 'Set layout for the top-right quarter of the widgets container'
  1760 
  1761 #verticalFixPartLayout
  1762 'Set layout for a small fixed-width area centered horizontally in the widgets container'
  1763 
  1764 )
  1765 ! !
  1766 
  1767 !UILayoutTool::LayoutFrame class methodsFor:'image specs'!
  1768 
  1769 setBigBottomFixPartIcon
  1770     "This resource specification was automatically generated
  1771      by the ImageEditor of ST/X."
  1772 
  1773     "Do not manually edit this!! If it is corrupted,
  1774      the ImageEditor may not be able to read the specification."
  1775 
  1776     "
  1777      self setBigBottomFixPartIcon inspect
  1778      ImageEditor openOnClass:self andSelector:#setBigBottomFixPartIcon
  1779      Icon flushCachedIcons
  1780     "
  1781 
  1782     <resource: #image>
  1783 
  1784     ^Icon
  1785         constantNamed:'UILayoutTool::LayoutFrame class setBigBottomFixPartIcon'
  1786         ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
  1787 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"H"H"H"H"@BDQDQDQDQH@HQDQDQDQD @!!DQDQDQDR@BDQDQDQDQH@HQ
  1788 DQDQDQD @!!DQDQDQDR@BDQDQDQDQH@H"H"H"H"H @@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??>A XFA XFA _????????????????????????????<b') ; yourself); yourself]
  1789 !
  1790 
  1791 setBigHorizontalFixPartIcon
  1792     "This resource specification was automatically generated
  1793      by the ImageEditor of ST/X."
  1794 
  1795     "Do not manually edit this!! If it is corrupted,
  1796      the ImageEditor may not be able to read the specification."
  1797 
  1798     "
  1799      self setBigHorizontalFixPartIcon inspect
  1800      ImageEditor openOnClass:self andSelector:#setBigHorizontalFixPartIcon
  1801      Icon flushCachedIcons
  1802     "
  1803 
  1804     <resource: #image>
  1805 
  1806     ^Icon
  1807         constantNamed:'UILayoutTool::LayoutFrame class setBigHorizontalFixPartIcon'
  1808         ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
  1809 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@BH"H"H"H"H@HQDQDQDQD @!!DQDQDQDR@BDQDQDQDQH@HQDQDQDQD @!!DQDQDQDR@BDQDQDQDQH@H"
  1810 H"H"H"H @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??>A XFA??????????????????????????>A XFA??<b') ; yourself); yourself]
  1811 !
  1812 
  1813 setBigTopFixPartIcon
  1814     "This resource specification was automatically generated
  1815      by the ImageEditor of ST/X."
  1816 
  1817     "Do not manually edit this!! If it is corrupted,
  1818      the ImageEditor may not be able to read the specification."
  1819 
  1820     "
  1821      self setBigTopFixPartIcon inspect
  1822      ImageEditor openOnClass:self andSelector:#setBigTopFixPartIcon
  1823      Icon flushCachedIcons
  1824     "
  1825 
  1826     <resource: #image>
  1827 
  1828     ^Icon
  1829         constantNamed:'UILayoutTool::LayoutFrame class setBigTopFixPartIcon'
  1830         ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
  1831 @@@@@@@@@@@BH"H"H"H"H@HQDQDQDQD @!!DQDQDQDR@BDQDQDQDQH@HQDQDQDQD @!!DQDQDQDR@BDQDQDQDQH@HQDQDQDQD @"H"H"H"H"@@@@@@@@@@@@@@
  1832 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'?????????????????????????????8FA XFA XFA??<b') ; yourself); yourself]
  1833 !
  1834 
  1835 setBottomFixPartIcon
  1836     "This resource specification was automatically generated
  1837      by the ImageEditor of ST/X."
  1838 
  1839     "Do not manually edit this!! If it is corrupted,
  1840      the ImageEditor may not be able to read the specification."
  1841 
  1842     "
  1843      self setBottomFixPartIcon inspect
  1844      ImageEditor openOnClass:self andSelector:#setBottomFixPartIcon
  1845      Icon flushCachedIcons
  1846     "
  1847 
  1848     <resource: #image>
  1849 
  1850     ^Icon
  1851         constantNamed:'UILayoutTool::LayoutFrame class setBottomFixPartIcon'
  1852         ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
  1853 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@H"
  1854 H"@BH"H @!!DQD@DQDR@BDQDP@QDQH@H"H"@BH"H @@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??>@@X@A @F@@X@A @F@@X@A @G???????????????<b') ; yourself); yourself]
  1855 !
  1856 
  1857 setBottomHalfIcon
  1858     "This resource specification was automatically generated
  1859      by the ImageEditor of ST/X."
  1860 
  1861     "Do not manually edit this!! If it is corrupted,
  1862      the ImageEditor may not be able to read the specification."
  1863 
  1864     "
  1865      self setBottomHalfIcon inspect
  1866      ImageEditor openOnClass:self andSelector:#setBottomHalfIcon
  1867      Icon flushCachedIcons
  1868     "
  1869 
  1870     <resource: #image>
  1871 
  1872     ^Icon
  1873         constantNamed:'UILayoutTool::LayoutFrame class setBottomHalfIcon'
  1874         ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
  1875 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"H"H"H"H"@BDQDQDQDQH@HQ
  1876 DQDQDQD @!!DQDQDQDR@BDQDQDQDQH@H"H"H"H"H @@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??>@@X@A @F@@X@A @F@@_????????????????????<b') ; yourself); yourself]
  1877 !
  1878 
  1879 setBottomLeftQuarterIcon
  1880     "This resource specification was automatically generated
  1881      by the ImageEditor of ST/X."
  1882 
  1883     "Do not manually edit this!! If it is corrupted,
  1884      the ImageEditor may not be able to read the specification."
  1885 
  1886     "
  1887      self setBottomLeftQuarterIcon inspect
  1888      ImageEditor openOnClass:self andSelector:#setBottomLeftQuarterIcon
  1889      Icon flushCachedIcons
  1890     "
  1891 
  1892     <resource: #image>
  1893 
  1894     ^Icon
  1895         constantNamed:'UILayoutTool::LayoutFrame class setBottomLeftQuarterIcon'
  1896         ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
  1897 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@H"H"@@@@@@@!!DQH@@@@@@BDQD @@@@@@HQ
  1898 DR@@@@@@@!!DQH@@@@@@BDQD @@@@@@H"H"@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??>@@X@A @F@@X@A @G?@_<A?0G?@_<A?0G?@_<A??<b') ; yourself); yourself]
  1899 !
  1900 
  1901 setBottomRightQuarterIcon
  1902     "This resource specification was automatically generated
  1903      by the ImageEditor of ST/X."
  1904 
  1905     "Do not manually edit this!! If it is corrupted,
  1906      the ImageEditor may not be able to read the specification."
  1907 
  1908     "
  1909      self setBottomRightQuarterIcon inspect
  1910      ImageEditor openOnClass:self andSelector:#setBottomRightQuarterIcon
  1911      Icon flushCachedIcons
  1912     "
  1913 
  1914     <resource: #image>
  1915 
  1916     ^Icon
  1917         constantNamed:'UILayoutTool::LayoutFrame class setBottomRightQuarterIcon'
  1918         ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
  1919 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@BH"H"@@@@@@HQDQH@@@
  1920 @@@!!DQD @@@@@BDQDR@@@@@@HQDQH@@@@@@"H"H @@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??>@@X@A @F@@X@A @F@@XG? _>A?8G? _>A?8G???<b') ; yourself); yourself]
  1921 !
  1922 
  1923 setFullIcon
  1924     "This resource specification was automatically generated
  1925      by the ImageEditor of ST/X."
  1926 
  1927     "Do not manually edit this!! If it is corrupted,
  1928      the ImageEditor may not be able to read the specification."
  1929 
  1930     "
  1931      self setFullIcon inspect
  1932      ImageEditor openOnClass:self andSelector:#setFullIcon
  1933      Icon flushCachedIcons
  1934     "
  1935 
  1936     <resource: #image>
  1937 
  1938     ^Icon
  1939         constantNamed:'UILayoutTool::LayoutFrame class setFullIcon'
  1940         ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
  1941 @@@@@@@@@@@BH"H"H"H"H@HQDQDQDQD @!!DQDQDQDR@BDQDQDQDQH@HQDQDQDQD @!!DQDQDQDR@BDQDQDQDQH@HQDQDQDQD @!!DQDQDQDR@BDQDQDQDQH@HQ
  1942 DQDQDQD @!!DQDQDQDR@BDQDQDQDQH@H"H"H"H"H @@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??????????????????????????????????????????<b') ; yourself); yourself]
  1943 !
  1944 
  1945 setHorizontalFixPartIcon
  1946     "This resource specification was automatically generated
  1947      by the ImageEditor of ST/X."
  1948 
  1949     "Do not manually edit this!! If it is corrupted,
  1950      the ImageEditor may not be able to read the specification."
  1951 
  1952     "
  1953      self setHorizontalFixPartIcon inspect
  1954      ImageEditor openOnClass:self andSelector:#setHorizontalFixPartIcon
  1955      Icon flushCachedIcons
  1956     "
  1957 
  1958     <resource: #image>
  1959 
  1960     ^Icon
  1961         constantNamed:'UILayoutTool::LayoutFrame class setHorizontalFixPartIcon'
  1962         ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
  1963 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"H"H@H"H"@BDQDP@QDQH@HQDQ@ADQD @"H"H@H"H"@@@@@@@@@@@@@@
  1964 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??>@@X@A @F@@_???????????????8@A @F@@X@A??<b') ; yourself); yourself]
  1965 !
  1966 
  1967 setLeftFixPartIcon
  1968     "This resource specification was automatically generated
  1969      by the ImageEditor of ST/X."
  1970 
  1971     "Do not manually edit this!! If it is corrupted,
  1972      the ImageEditor may not be able to read the specification."
  1973 
  1974     "
  1975      self setLeftFixPartIcon inspect
  1976      ImageEditor openOnClass:self andSelector:#setLeftFixPartIcon
  1977      Icon flushCachedIcons
  1978     "
  1979 
  1980     <resource: #image>
  1981 
  1982     ^Icon
  1983         constantNamed:'UILayoutTool::LayoutFrame class setLeftFixPartIcon'
  1984         ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
  1985 @@@@@@@@@@@BH"@@@@@@@@HQH@@@@@@@@!!D @@@@@@@BDR@@@@@@@@HQH@@@@@@@@!!D @@@@@@@@@@@@@@@@@@@@@@@@@@@@@!!D @@@@@@@BDR@@@@@@@@HQ
  1986 H@@@@@@@@!!D @@@@@@@BDR@@@@@@@@H"H@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???<@_0A?@G<@_0A?@G<@_0A?@G<@_0A?@G<@_0A??<b') ; yourself); yourself]
  1987 !
  1988 
  1989 setLeftHalfIcon
  1990     "This resource specification was automatically generated
  1991      by the ImageEditor of ST/X."
  1992 
  1993     "Do not manually edit this!! If it is corrupted,
  1994      the ImageEditor may not be able to read the specification."
  1995 
  1996     "
  1997      self setLeftHalfIcon inspect
  1998      ImageEditor openOnClass:self andSelector:#setLeftHalfIcon
  1999      Icon flushCachedIcons
  2000     "
  2001 
  2002     <resource: #image>
  2003 
  2004     ^Icon
  2005         constantNamed:'UILayoutTool::LayoutFrame class setLeftHalfIcon'
  2006         ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
  2007 @@@@@@@@@@@BH"H @@@@@@HQDR@@@@@@@!!DQH@@@@@@BDQD @@@@@@HQDR@@@@@@@!!DQH@@@@@@BDQD @@@@@@HQDR@@@@@@@!!DQH@@@@@@BDQD @@@@@@HQ
  2008 DR@@@@@@@!!DQH@@@@@@BDQD @@@@@@H"H"@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'????@_<A?0G?@_<A?0G?@_<A?0G?@_<A?0G?@_<A??<b') ; yourself); yourself]
  2009 !
  2010 
  2011 setRightFixPartIcon
  2012     "This resource specification was automatically generated
  2013      by the ImageEditor of ST/X."
  2014 
  2015     "Do not manually edit this!! If it is corrupted,
  2016      the ImageEditor may not be able to read the specification."
  2017 
  2018     "
  2019      self setRightFixPartIcon inspect
  2020      ImageEditor openOnClass:self andSelector:#setRightFixPartIcon
  2021      Icon flushCachedIcons
  2022     "
  2023 
  2024     <resource: #image>
  2025 
  2026     ^Icon
  2027         constantNamed:'UILayoutTool::LayoutFrame class setRightFixPartIcon'
  2028         ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
  2029 @@@@@@@@@@@@@@@@@@H"H@@@@@@@@!!D @@@@@@@BDR@@@@@@@@HQH@@@@@@@@!!D @@@@@@@BDR@@@@@@@@@@@@@@@@@@@@@@@@@@@@@BDR@@@@@@@@HQH@@@
  2030 @@@@@!!D @@@@@@@BDR@@@@@@@@HQH@@@@@@@@"H @@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??>@O8@? C>@O8@? C>@O8@? C>@O8@? C>@O8@???<b') ; yourself); yourself]
  2031 !
  2032 
  2033 setRightHalfIcon
  2034     "This resource specification was automatically generated
  2035      by the ImageEditor of ST/X."
  2036 
  2037     "Do not manually edit this!! If it is corrupted,
  2038      the ImageEditor may not be able to read the specification."
  2039 
  2040     "
  2041      self setRightHalfIcon inspect
  2042      ImageEditor openOnClass:self andSelector:#setRightHalfIcon
  2043      Icon flushCachedIcons
  2044     "
  2045 
  2046     <resource: #image>
  2047 
  2048     ^Icon
  2049         constantNamed:'UILayoutTool::LayoutFrame class setRightHalfIcon'
  2050         ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
  2051 @@@@@@@@@@@@@@@@@"H"H@@@@@@BDQD @@@@@@HQDR@@@@@@@!!DQH@@@@@@BDQD @@@@@@HQDR@@@@@@@!!DQH@@@@@@BDQD @@@@@@HQDR@@@@@@@!!DQH@@@
  2052 @@@BDQD @@@@@@HQDR@@@@@@@!!DQH@@@@@@BH"H @@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??>@?8C? O>@?8C? O>@?8C? O>@?8C? O>@?8C???<b') ; yourself); yourself]
  2053 !
  2054 
  2055 setToRightQuarterIcon
  2056     "This resource specification was automatically generated
  2057      by the ImageEditor of ST/X."
  2058 
  2059     "Do not manually edit this!! If it is corrupted,
  2060      the ImageEditor may not be able to read the specification."
  2061 
  2062     "
  2063      self setToRightQuarterIcon inspect
  2064      ImageEditor openOnClass:self andSelector:#setToRightQuarterIcon
  2065      Icon flushCachedIcons
  2066     "
  2067 
  2068     <resource: #image>
  2069 
  2070     ^Icon
  2071         constantNamed:'UILayoutTool::LayoutFrame class setToRightQuarterIcon'
  2072         ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
  2073 @@@@@@@@@@@@@@@@@"H"H@@@@@@BDQD @@@@@@HQDR@@@@@@@!!DQH@@@@@@BDQD @@@@@@HQDR@@@@@@@"H"H@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  2074 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??>@?8C? O>@?8C? O>@?8C? @F@@X@A @F@@X@A??<b') ; yourself); yourself]
  2075 !
  2076 
  2077 setTopFixPartIcon
  2078     "This resource specification was automatically generated
  2079      by the ImageEditor of ST/X."
  2080 
  2081     "Do not manually edit this!! If it is corrupted,
  2082      the ImageEditor may not be able to read the specification."
  2083 
  2084     "
  2085      self setTopFixPartIcon inspect
  2086      ImageEditor openOnClass:self andSelector:#setTopFixPartIcon
  2087      Icon flushCachedIcons
  2088     "
  2089 
  2090     <resource: #image>
  2091 
  2092     ^Icon
  2093         constantNamed:'UILayoutTool::LayoutFrame class setTopFixPartIcon'
  2094         ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
  2095 @@@@@@@@@@@BH"H @"H"H@HQDQ@ADQD @!!DQD@DQDR@BH"H @"H"H@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  2096 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???????????????? @F@@X@A @F@@X@A @F@@X@A??<b') ; yourself); yourself]
  2097 !
  2098 
  2099 setTopHalfIcon
  2100     "This resource specification was automatically generated
  2101      by the ImageEditor of ST/X."
  2102 
  2103     "Do not manually edit this!! If it is corrupted,
  2104      the ImageEditor may not be able to read the specification."
  2105 
  2106     "
  2107      self setTopHalfIcon inspect
  2108      ImageEditor openOnClass:self andSelector:#setTopHalfIcon
  2109      Icon flushCachedIcons
  2110     "
  2111 
  2112     <resource: #image>
  2113 
  2114     ^Icon
  2115         constantNamed:'UILayoutTool::LayoutFrame class setTopHalfIcon'
  2116         ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
  2117 @@@@@@@@@@@BH"H"H"H"H@HQDQDQDQD @!!DQDQDQDR@BDQDQDQDQH@HQDQDQDQD @"H"H"H"H"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  2118 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'?????????????????????8@A @F@@X@A @F@@X@A??<b') ; yourself); yourself]
  2119 !
  2120 
  2121 setTopLeftQuarterIcon
  2122     "This resource specification was automatically generated
  2123      by the ImageEditor of ST/X."
  2124 
  2125     "Do not manually edit this!! If it is corrupted,
  2126      the ImageEditor may not be able to read the specification."
  2127 
  2128     "
  2129      self setTopLeftQuarterIcon inspect
  2130      ImageEditor openOnClass:self andSelector:#setTopLeftQuarterIcon
  2131      Icon flushCachedIcons
  2132     "
  2133 
  2134     <resource: #image>
  2135 
  2136     ^Icon
  2137         constantNamed:'UILayoutTool::LayoutFrame class setTopLeftQuarterIcon'
  2138         ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
  2139 @@@@@@@@@@@BH"H"@@@@@@HQDQH@@@@@@!!DQD @@@@@BDQDR@@@@@@HQDQH@@@@@@"H"H @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  2140 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???? _>A?8G? _>A?8G? X@A @F@@X@A @F@@X@A??<b') ; yourself); yourself]
  2141 !
  2142 
  2143 setVerticalFixPartIcon
  2144     "This resource specification was automatically generated
  2145      by the ImageEditor of ST/X."
  2146 
  2147     "Do not manually edit this!! If it is corrupted,
  2148      the ImageEditor may not be able to read the specification."
  2149 
  2150     "
  2151      self setVerticalFixPartIcon inspect
  2152      ImageEditor openOnClass:self andSelector:#setVerticalFixPartIcon
  2153      Icon flushCachedIcons
  2154     "
  2155 
  2156     <resource: #image>
  2157 
  2158     ^Icon
  2159         constantNamed:'UILayoutTool::LayoutFrame class setVerticalFixPartIcon'
  2160         ifAbsentPut:[(Depth4Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(4)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
  2161 @@@@@@@@@@@@@@@"H @@@@@@@BDR@@@@@@@@HQH@@@@@@@@!!D @@@@@@@BDR@@@@@@@@HQH@@@@@@@@@@@@@@@@@@@@@@@@@@@@@HQH@@@@@@@@!!D @@@@@@
  2162 @BDR@@@@@@@@HQH@@@@@@@@!!D @@@@@@@BH"@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 0 0 255 255 255]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??>G8X_!!!!>FG8X_!!!!>FG8X_!!!!>FG8X_!!!!>FG8X_!!??<b') ; yourself); yourself]
  2163 ! !
  2164 
  2165 !UILayoutTool::LayoutFrame class methodsFor:'interface specs'!
  2166 
  2167 windowSpec
  2168     "This resource specification was automatically generated
  2169      by the UIPainter of ST/X."
  2170 
  2171     "Do not manually edit this!! If it is corrupted,
  2172      the UIPainter may not be able to read the specification."
  2173 
  2174     "
  2175      UIPainter new openOnClass:UILayoutTool::LayoutFrame andSelector:#windowSpec
  2176      UILayoutTool::LayoutFrame new openInterface:#windowSpec
  2177      UILayoutTool::LayoutFrame open
  2178     "
  2179 
  2180     <resource: #canvas>
  2181 
  2182     ^ 
  2183      #(FullSpec
  2184         name: windowSpec
  2185         window: 
  2186        (WindowSpec
  2187           label: 'UILayoutTool-LayoutFrame'
  2188           name: 'UILayoutTool-LayoutFrame'
  2189           min: (Point 10 10)
  2190           bounds: (Rectangle 0 0 511 302)
  2191         )
  2192         component: 
  2193        (SpecCollection
  2194           collection: (
  2195            (UISubSpecification
  2196               name: 'layoutOriginSpec'
  2197               layout: (LayoutFrame 1 0.0 6 0 0 1.0 110 0)
  2198               majorKey: UILayoutTool
  2199               minorKey: layoutOriginSpec
  2200             )
  2201            (FramedBoxSpec
  2202               label: 'Corner'
  2203               name: 'FramedBox'
  2204               layout: (LayoutFrame 1 0.0 113 0 0 1.0 214 0)
  2205               labelPosition: topLeft
  2206               translateLabel: true
  2207               component: 
  2208              (SpecCollection
  2209                 collection: (
  2210                  (LabelSpec
  2211                     label: 'Right:'
  2212                     name: 'labelRight'
  2213                     layout: (AlignmentOrigin 68 0 25 0 1 0.5)
  2214                     translateLabel: true
  2215                   )
  2216                  (ActionButtonSpec
  2217                     label: 'imageFractX'
  2218                     name: 'actionRelativeRight'
  2219                     layout: (LayoutFrame 78 0 14 0 100 0 36 0)
  2220                     activeHelpKey: makeRightRelative
  2221                     hasCharacterOrientedLabel: false
  2222                     tabable: true
  2223                     model: relativeRight
  2224                   )
  2225                  (InputFieldSpec
  2226                     name: 'fieldRightFraction'
  2227                     layout: (LayoutFrame 103 0 14 0 153 0 36 0)
  2228                     activeHelpKey: rightRelative
  2229                     tabable: true
  2230                     model: rightFraction
  2231                     group: inputGroup
  2232                     type: numberOrNil
  2233                     acceptOnLostFocus: true
  2234                     acceptChannel: acceptChannel
  2235                     modifiedChannel: modifiedChannel
  2236                     acceptOnPointerLeave: false
  2237                   )
  2238                  (ActionButtonSpec
  2239                     label: 'imageAbsX'
  2240                     name: 'actionAbsoluteRight'
  2241                     layout: (LayoutFrame 178 0 14 0 200 0 36 0)
  2242                     activeHelpKey: makeRightAbsolute
  2243                     hasCharacterOrientedLabel: false
  2244                     tabable: true
  2245                     model: absoluteRight
  2246                   )
  2247                  (InputFieldSpec
  2248                     name: 'fieldRightOffset'
  2249                     layout: (LayoutFrame 203 0 14 0 253 0 36 0)
  2250                     activeHelpKey: rightAbsolute
  2251                     tabable: true
  2252                     model: rightOffset
  2253                     group: inputGroup
  2254                     type: numberOrNil
  2255                     acceptOnLostFocus: true
  2256                     acceptChannel: acceptChannel
  2257                     modifiedChannel: modifiedChannel
  2258                     acceptOnPointerLeave: false
  2259                   )
  2260                  (ActionButtonSpec
  2261                     label: 'imageAbsXFromRight'
  2262                     name: 'actionRightRelativeRight'
  2263                     layout: (LayoutFrame 257 0 14 0 279 0 36 0)
  2264                     activeHelpKey: makeRightRelativeFromRight
  2265                     hasCharacterOrientedLabel: false
  2266                     tabable: true
  2267                     model: rightRelativeRight
  2268                   )
  2269                  (LabelSpec
  2270                     label: 'Bottom:'
  2271                     name: 'labelBottom'
  2272                     layout: (AlignmentOrigin 68 0 53 0 1 0.5)
  2273                     translateLabel: true
  2274                   )
  2275                  (ActionButtonSpec
  2276                     label: 'imageFractY'
  2277                     name: 'actionRelativeBottom'
  2278                     layout: (LayoutFrame 78 0 42 0 100 0 64 0)
  2279                     activeHelpKey: makeBottomRelative
  2280                     hasCharacterOrientedLabel: false
  2281                     tabable: true
  2282                     model: relativeBottom
  2283                   )
  2284                  (InputFieldSpec
  2285                     name: 'fieldBottomFraction'
  2286                     layout: (LayoutFrame 103 0 42 0 153 0 64 0)
  2287                     activeHelpKey: bottomRelative
  2288                     tabable: true
  2289                     model: bottomFraction
  2290                     group: inputGroup
  2291                     type: numberOrNil
  2292                     acceptOnLostFocus: true
  2293                     acceptChannel: acceptChannel
  2294                     modifiedChannel: modifiedChannel
  2295                     acceptOnPointerLeave: false
  2296                   )
  2297                  (ActionButtonSpec
  2298                     label: 'imageAbsY'
  2299                     name: 'actionAbsoluteBottom'
  2300                     layout: (LayoutFrame 178 0 42 0 200 0 64 0)
  2301                     activeHelpKey: makeBottomAbsolute
  2302                     hasCharacterOrientedLabel: false
  2303                     tabable: true
  2304                     model: absoluteBottom
  2305                   )
  2306                  (InputFieldSpec
  2307                     name: 'fieldBottomOffset'
  2308                     layout: (LayoutFrame 203 0 42 0 253 0 64 0)
  2309                     activeHelpKey: bottomAbsolute
  2310                     tabable: true
  2311                     model: bottomOffset
  2312                     group: inputGroup
  2313                     type: numberOrNil
  2314                     acceptOnLostFocus: true
  2315                     acceptChannel: acceptChannel
  2316                     modifiedChannel: modifiedChannel
  2317                     acceptOnPointerLeave: false
  2318                   )
  2319                  (ActionButtonSpec
  2320                     label: 'imageAbsYFromBottom'
  2321                     name: 'actionBottomRelativeBottom'
  2322                     layout: (LayoutFrame 257 0 42 0 279 0 64 0)
  2323                     activeHelpKey: makeBottomRelativeFromBottom
  2324                     hasCharacterOrientedLabel: false
  2325                     tabable: true
  2326                     model: bottomRelativeBottom
  2327                   )
  2328                  (CheckBoxSpec
  2329                     label: 'Use Preferred'
  2330                     name: 'CheckBox1'
  2331                     layout: (LayoutFrame 287 0 14 0 393 0 36 0)
  2332                     model: usePreferredWidth
  2333                     translateLabel: true
  2334                   )
  2335                  (CheckBoxSpec
  2336                     label: 'Use Preferred'
  2337                     name: 'CheckBox2'
  2338                     layout: (LayoutFrame 287 0 42 0 393 0 64 0)
  2339                     model: usePreferredHeight
  2340                     translateLabel: true
  2341                   )
  2342                  (CheckBoxSpec
  2343                     label: 'Dynamic'
  2344                     name: 'CheckBox3'
  2345                     layout: (LayoutFrame 394 0 14 0 471 0 36 0)
  2346                     model: useDynamicPreferredWidth
  2347                     translateLabel: true
  2348                   )
  2349                  (CheckBoxSpec
  2350                     label: 'Dynamic'
  2351                     name: 'CheckBox4'
  2352                     layout: (LayoutFrame 394 0 42 0 471 0 64 0)
  2353                     model: useDynamicPreferredHeight
  2354                     translateLabel: true
  2355                   )
  2356                  )
  2357                
  2358               )
  2359             )
  2360            (MenuPanelSpec
  2361               name: 'commonLayoutToolBar1'
  2362               layout: (LayoutFrame 6 0.0 215 0 -4 1.0 247 0)
  2363               level: 0
  2364               tabable: true
  2365               menu: commonFrameLayoutsMenu1
  2366               textDefault: true
  2367             )
  2368            (MenuPanelSpec
  2369               name: 'commonLayoutToolBar2'
  2370               layout: (LayoutFrame 6 0.0 255 0 -4 1.0 287 0)
  2371               level: 0
  2372               tabable: true
  2373               menu: commonFrameLayoutsMenu2
  2374               textDefault: true
  2375             )
  2376            (MenuPanelSpec
  2377               name: 'commonLayoutToolBar3'
  2378               layout: (LayoutFrame 6 0.0 295 0 -4 1.0 327 0)
  2379               level: 0
  2380               tabable: true
  2381               menu: commonFrameLayoutsMenu3
  2382               textDefault: true
  2383             )
  2384            )
  2385          
  2386         )
  2387       )
  2388 ! !
  2389 
  2390 !UILayoutTool::LayoutFrame class methodsFor:'menu specs'!
  2391 
  2392 commonFrameLayoutsMenu1
  2393     "This resource specification was automatically generated
  2394      by the MenuEditor of ST/X."
  2395 
  2396     "Do not manually edit this!! If it is corrupted,
  2397      the MenuEditor may not be able to read the specification."
  2398 
  2399     "
  2400      MenuEditor new openOnClass:UILayoutTool::LayoutFrame andSelector:#commonFrameLayoutsMenu1
  2401      (Menu new fromLiteralArrayEncoding:(UILayoutTool::LayoutFrame commonFrameLayoutsMenu1)) startUp
  2402     "
  2403 
  2404     <resource: #menu>
  2405 
  2406     ^ 
  2407      #(#Menu
  2408         #(
  2409          #(#MenuItem
  2410             #activeHelpKey: #fullLayout
  2411             #label: 'setFullFrame'
  2412             #itemValue: #setFullFrame
  2413             #nameKey: #setFullFrame
  2414             #translateLabel: true
  2415             #isButton: true
  2416             #labelImage: #(#ResourceRetriever #'UILayoutTool::LayoutFrame' #setFullIcon)
  2417           )
  2418          #(#MenuItem
  2419             #label: ''
  2420           )
  2421          #(#MenuItem
  2422             #activeHelpKey: #topHalfLayout
  2423             #label: 'setTopHalfFrame'
  2424             #itemValue: #setTopHalfFrame
  2425             #nameKey: #setTopHalfFrame
  2426             #translateLabel: true
  2427             #isButton: true
  2428             #labelImage: #(#ResourceRetriever #'UILayoutTool::LayoutFrame' #setTopHalfIcon)
  2429           )
  2430          #(#MenuItem
  2431             #activeHelpKey: #bottomHalfLayout
  2432             #label: 'setBottomHalfFrame'
  2433             #itemValue: #setBottomHalfFrame
  2434             #nameKey: #setBottomHalfFrame
  2435             #translateLabel: true
  2436             #isButton: true
  2437             #labelImage: #(#ResourceRetriever nil #setBottomHalfIcon)
  2438           )
  2439          #(#MenuItem
  2440             #activeHelpKey: #leftHalfLayout
  2441             #label: 'setLeftHalfFrame'
  2442             #itemValue: #setLeftHalfFrame
  2443             #nameKey: #setLeftHalfFrame
  2444             #translateLabel: true
  2445             #isButton: true
  2446             #labelImage: #(#ResourceRetriever nil #setLeftHalfIcon)
  2447           )
  2448          #(#MenuItem
  2449             #activeHelpKey: #rightHalfLayout
  2450             #label: 'setRightHalfFrame'
  2451             #itemValue: #setRightHalfFrame
  2452             #nameKey: #setRightHalfFrame
  2453             #translateLabel: true
  2454             #isButton: true
  2455             #labelImage: #(#ResourceRetriever nil #setRightHalfIcon)
  2456           )
  2457          #(#MenuItem
  2458             #label: ''
  2459           )
  2460          #(#MenuItem
  2461             #activeHelpKey: #topLeftQuarterLayout
  2462             #label: 'setTopLeftQuarterFrame'
  2463             #itemValue: #setTopLeftQuarterFrame
  2464             #nameKey: #setTopLeftQuarterFrame
  2465             #translateLabel: true
  2466             #isButton: true
  2467             #labelImage: #(#ResourceRetriever nil #setTopLeftQuarterIcon)
  2468           )
  2469          #(#MenuItem
  2470             #activeHelpKey: #topRightQuarterLayout
  2471             #label: 'setTopRightQuarterFrame'
  2472             #itemValue: #setTopRightQuarterFrame
  2473             #nameKey: #setTopRightQuarterFrame
  2474             #translateLabel: true
  2475             #isButton: true
  2476             #labelImage: #(#ResourceRetriever nil #setToRightQuarterIcon)
  2477           )
  2478          #(#MenuItem
  2479             #activeHelpKey: #bottomRightQuarterLayout
  2480             #label: 'setBottomRightQuarterFrame'
  2481             #itemValue: #setBottomRightQuarterFrame
  2482             #nameKey: #setBottomRightQuarterFrame
  2483             #translateLabel: true
  2484             #isButton: true
  2485             #labelImage: #(#ResourceRetriever nil #setBottomRightQuarterIcon)
  2486           )
  2487          #(#MenuItem
  2488             #activeHelpKey: #bottomLeftQuarterLayout
  2489             #label: 'setBottomLeftQuarterFrame'
  2490             #itemValue: #setBottomLeftQuarterFrame
  2491             #nameKey: #setBottomLeftQuarterFrame
  2492             #translateLabel: true
  2493             #isButton: true
  2494             #labelImage: #(#ResourceRetriever nil #setBottomLeftQuarterIcon)
  2495           )
  2496          )
  2497         nil
  2498         nil
  2499       )
  2500 !
  2501 
  2502 commonFrameLayoutsMenu2
  2503     "This resource specification was automatically generated
  2504      by the MenuEditor of ST/X."
  2505 
  2506     "Do not manually edit this!! If it is corrupted,
  2507      the MenuEditor may not be able to read the specification."
  2508 
  2509     "
  2510      MenuEditor new openOnClass:UILayoutTool::LayoutFrame andSelector:#commonFrameLayoutsMenu2
  2511      (Menu new fromLiteralArrayEncoding:(UILayoutTool::LayoutFrame commonFrameLayoutsMenu2)) startUp
  2512     "
  2513 
  2514     <resource: #menu>
  2515 
  2516     ^ 
  2517      #(#Menu
  2518         #(
  2519          #(#MenuItem
  2520             #activeHelpKey: #topFixPartLayout
  2521             #label: 'setTopFixPartFrame'
  2522             #itemValue: #setTopFixPartFrame
  2523             #nameKey: #setTopFixPartFrame
  2524             #translateLabel: true
  2525             #isButton: true
  2526             #labelImage: #(#ResourceRetriever nil #setTopFixPartIcon)
  2527           )
  2528          #(#MenuItem
  2529             #activeHelpKey: #horizontalFixPartLayout
  2530             #label: 'setHorizontalFixPartFrame'
  2531             #itemValue: #setHorizontalFixPartFrame
  2532             #nameKey: #setHorizontalFixPartFrame
  2533             #translateLabel: true
  2534             #isButton: true
  2535             #labelImage: #(#ResourceRetriever nil #setHorizontalFixPartIcon)
  2536           )
  2537          #(#MenuItem
  2538             #activeHelpKey: #bottomFixPartLayout
  2539             #label: 'setBottomFixPartFrame'
  2540             #itemValue: #setBottomFixPartFrame
  2541             #nameKey: #setBottomFixPartFrame
  2542             #translateLabel: true
  2543             #isButton: true
  2544             #labelImage: #(#ResourceRetriever nil #setBottomFixPartIcon)
  2545           )
  2546          #(#MenuItem
  2547             #label: ''
  2548           )
  2549          #(#MenuItem
  2550             #activeHelpKey: #leftFixPartLayout
  2551             #label: 'setLeftFixPartFrame'
  2552             #itemValue: #setLeftFixPartFrame
  2553             #nameKey: #setLeftFixPartFrame
  2554             #translateLabel: true
  2555             #isButton: true
  2556             #labelImage: #(#ResourceRetriever nil #setLeftFixPartIcon)
  2557           )
  2558          #(#MenuItem
  2559             #activeHelpKey: #verticalFixPartLayout
  2560             #label: 'setVerticalFixPartFrame'
  2561             #itemValue: #setVerticalFixPartFrame
  2562             #nameKey: #setVerticalFixPartFrame
  2563             #translateLabel: true
  2564             #isButton: true
  2565             #labelImage: #(#ResourceRetriever nil #setVerticalFixPartIcon)
  2566           )
  2567          #(#MenuItem
  2568             #activeHelpKey: #rightFixPartLayout
  2569             #label: 'setRightFixPartFrame'
  2570             #itemValue: #setRightFixPartFrame
  2571             #nameKey: #setRightFixPartFrame
  2572             #translateLabel: true
  2573             #isButton: true
  2574             #labelImage: #(#ResourceRetriever nil #setRightFixPartIcon)
  2575           )
  2576          #(#MenuItem
  2577             #label: ''
  2578           )
  2579          #(#MenuItem
  2580             #activeHelpKey: #bigTopFixPartLayout
  2581             #label: 'setBigTopFixPartFrame'
  2582             #itemValue: #setBigTopFixPartFrame
  2583             #nameKey: #setBigTopFixPartFrame
  2584             #translateLabel: true
  2585             #isButton: true
  2586             #labelImage: #(#ResourceRetriever nil #setBigTopFixPartIcon)
  2587           )
  2588          #(#MenuItem
  2589             #activeHelpKey: #bigHorizontalFixPartLayout
  2590             #label: 'setBigHorizontalFixPartFrame'
  2591             #itemValue: #setBigHorizontalFixPartFrame
  2592             #nameKey: #setBigHorizontalFixPartFrame
  2593             #translateLabel: true
  2594             #isButton: true
  2595             #labelImage: #(#ResourceRetriever nil #setBigHorizontalFixPartIcon)
  2596           )
  2597          #(#MenuItem
  2598             #activeHelpKey: #bigBottomFixPartLayout
  2599             #label: 'setBigBottomFixPartFrame'
  2600             #itemValue: #setBigBottomFixPartFrame
  2601             #nameKey: #setBigBottomFixPartFrame
  2602             #translateLabel: true
  2603             #isButton: true
  2604             #labelImage: #(#ResourceRetriever nil #setBigBottomFixPartIcon)
  2605           )
  2606          )
  2607         nil
  2608         nil
  2609       )
  2610 !
  2611 
  2612 commonFrameLayoutsMenu3
  2613     "This resource specification was automatically generated
  2614      by the MenuEditor of ST/X."
  2615 
  2616     "Do not manually edit this!! If it is corrupted,
  2617      the MenuEditor may not be able to read the specification."
  2618 
  2619     "
  2620      MenuEditor new openOnClass:UILayoutTool::LayoutFrame andSelector:#commonFrameLayoutsMenu3
  2621      (Menu new fromLiteralArrayEncoding:(UILayoutTool::LayoutFrame commonFrameLayoutsMenu3)) startUp
  2622     "
  2623 
  2624     <resource: #menu>
  2625 
  2626     ^ 
  2627      #(Menu
  2628         (
  2629          (MenuItem
  2630             activeHelpKey: screenFrameLayout
  2631             label: 'setScreenFrame'
  2632             itemValue: setScreenFrame
  2633             nameKey: setScreenFrame
  2634             translateLabel: true
  2635             isButton: true
  2636             isVisible: false
  2637             labelImage: (ResourceRetriever #'UILayoutTool::LayoutFrame' setScreenIcon)
  2638           )
  2639          )
  2640         nil
  2641         nil
  2642       )
  2643 ! !
  2644 
  2645 !UILayoutTool::LayoutFrame methodsFor:'accessing'!
  2646 
  2647 fetch:aView spec:aSpec
  2648     |layout|
  2649 
  2650     aSpec class == WindowSpec ifTrue:[
  2651          (layout := aSpec layout) isNil ifTrue:[
  2652              layout := aSpec bounds asLayout.
  2653          ] 
  2654     ] ifFalse: [
  2655          layout  := UIPainterView asLayoutFrameFromView:aView.
  2656     ].
  2657     (self aspectFor:#leftOffset)     value:(layout leftOffset).
  2658     (self aspectFor:#leftFraction)   value:(layout leftFraction).
  2659     (self aspectFor:#topOffset)      value:(layout topOffset).
  2660     (self aspectFor:#topFraction)    value:(layout topFraction).
  2661     (self aspectFor:#rightOffset)    value:(layout rightOffset value).  "take care of blocks"
  2662     (self aspectFor:#bottomOffset)   value:(layout bottomOffset value). "take care of blocks"
  2663     (self aspectFor:#rightFraction)  value:(layout rightFraction).
  2664     (self aspectFor:#bottomFraction) value:(layout bottomFraction).
  2665 
  2666     (self aspectFor:#usePreferredWidth) value:(aSpec usePreferredWidth).
  2667     (self aspectFor:#usePreferredHeight) value:(aSpec usePreferredHeight).
  2668     (self aspectFor:#useDynamicPreferredWidth) value:(aSpec useDynamicPreferredWidth).
  2669     (self aspectFor:#useDynamicPreferredHeight) value:(aSpec useDynamicPreferredHeight).
  2670 !
  2671 
  2672 layout
  2673     "returns the current layout as layoutFrame
  2674     "
  2675     |layout|
  2676 
  2677     layout  := Smalltalk::LayoutFrame new.
  2678 
  2679     layout 
  2680         leftFraction:(((self aspectFor:#leftFraction)   value) ? 0)
  2681               offset:(((self aspectFor:#leftOffset)     value) ? 0)
  2682         rightFraction:(((self aspectFor:#rightFraction)  value) ? 0)
  2683               offset:(((self aspectFor:#rightOffset)    value) ? 0)
  2684         topFraction:(((self aspectFor:#topFraction)    value) ? 0)
  2685               offset:(((self aspectFor:#topOffset)      value) ? 0)
  2686         bottomFraction:(((self aspectFor:#bottomFraction) value) ? 0)
  2687               offset:(((self aspectFor:#bottomOffset)   value) ? 0).
  2688 
  2689   ^ layout
  2690 ! !
  2691 
  2692 !UILayoutTool::LayoutFrame methodsFor:'common frames'!
  2693 
  2694 setBigBottomFixPartFrame
  2695     self
  2696         setFrameLeft:0   offset:0 
  2697         right:1          offset:0 
  2698         top:0            offset:(self class defaultFixPartHeight) 
  2699         bottom:1         offset:0
  2700 !
  2701 
  2702 setBigHorizontalFixPartFrame
  2703     self
  2704         setFrameLeft:0   offset:0 
  2705         right:1          offset:0 
  2706         top:0            offset:(self class defaultFixPartHeight) 
  2707         bottom:1         offset:(self class defaultFixPartHeight negated)
  2708 !
  2709 
  2710 setBigTopFixPartFrame
  2711     self
  2712         setFrameLeft:0   offset:0 
  2713         right:1          offset:0 
  2714         top:0            offset:0 
  2715         bottom:1         offset:(self class defaultFixPartHeight negated)
  2716 !
  2717 
  2718 setBottomFixPartFrame
  2719     self
  2720         setFrameLeft:0   offset:0 
  2721         right:1          offset:0 
  2722         top:1            offset:(self class defaultFixPartHeight negated) 
  2723         bottom:1         offset:0
  2724 !
  2725 
  2726 setBottomHalfFrame
  2727     self
  2728         setFrameLeft:0  offset:0 
  2729         right:1         offset:0 
  2730         top:0.5         offset:0 
  2731         bottom:1        offset:0
  2732 !
  2733 
  2734 setBottomLeftQuarterFrame
  2735     self
  2736         setFrameLeft:0   offset:0 
  2737         right:0.5        offset:0 
  2738         top:0.5          offset:0 
  2739         bottom:1         offset:0
  2740 !
  2741 
  2742 setBottomRightQuarterFrame
  2743     self
  2744         setFrameLeft:0.5 offset:0 
  2745         right:1          offset:0 
  2746         top:0.5          offset:0 
  2747         bottom:1         offset:0
  2748 !
  2749 
  2750 setFrameLeft:lF offset:lO right:rF offset:rO top:tF offset:tO bottom:bF offset:bO
  2751     (self aspectFor:#leftOffset)     value:lO.
  2752     (self aspectFor:#rightOffset)    value:rO value.
  2753     (self aspectFor:#topOffset)      value:tO.
  2754     (self aspectFor:#bottomOffset)   value:bO value.
  2755 
  2756     (self aspectFor:#leftFraction)   value:lF.
  2757     (self aspectFor:#rightFraction)  value:rF.
  2758     (self aspectFor:#topFraction)    value:tF.
  2759     (self aspectFor:#bottomFraction) value:bF.
  2760 !
  2761 
  2762 setFullFrame
  2763     self
  2764         setFrameLeft:0   offset:0 
  2765         right:1          offset:0 
  2766         top:0            offset:0 
  2767         bottom:1         offset:0
  2768 !
  2769 
  2770 setHorizontalFixPartFrame
  2771     self
  2772         setFrameLeft:0   offset:0 
  2773         right:1          offset:0 
  2774         top:0.5          offset:(self class defaultFixPartHeight negated // 2) 
  2775         bottom:0.5       offset:(self class defaultFixPartHeight // 2)
  2776 !
  2777 
  2778 setLeftFixPartFrame
  2779     self
  2780         setFrameLeft:0   offset:0 
  2781         right:0          offset:(self class defaultFixPartHeight) 
  2782         top:0            offset:0 
  2783         bottom:1         offset:0
  2784 !
  2785 
  2786 setLeftHalfFrame
  2787     self
  2788         setFrameLeft:0  offset:0 
  2789         right:0.5       offset:0 
  2790         top:0           offset:0 
  2791         bottom:1        offset:0
  2792 !
  2793 
  2794 setRightFixPartFrame
  2795     self
  2796         setFrameLeft:1   offset:(self class defaultFixPartHeight negated) 
  2797         right:1          offset:0 
  2798         top:0            offset:0 
  2799         bottom:1         offset:0
  2800 !
  2801 
  2802 setRightHalfFrame
  2803     self
  2804         setFrameLeft:0.5 offset:0 
  2805         right:1          offset:0 
  2806         top:0            offset:0 
  2807         bottom:1         offset:0
  2808 !
  2809 
  2810 setTopFixPartFrame
  2811     self
  2812         setFrameLeft:0   offset:0 
  2813         right:1          offset:0 
  2814         top:0            offset:0 
  2815         bottom:0         offset:(self class defaultFixPartHeight)
  2816 !
  2817 
  2818 setTopHalfFrame
  2819     self
  2820         setFrameLeft:0   offset:0 
  2821         right:1          offset:0 
  2822         top:0            offset:0 
  2823         bottom:0.5       offset:0
  2824 !
  2825 
  2826 setTopLeftQuarterFrame
  2827     self
  2828         setFrameLeft:0   offset:0 
  2829         right:0.5        offset:0 
  2830         top:0            offset:0 
  2831         bottom:0.5       offset:0
  2832 !
  2833 
  2834 setTopRightQuarterFrame
  2835     self
  2836         setFrameLeft:0.5 offset:0 
  2837         right:1          offset:0 
  2838         top:0            offset:0 
  2839         bottom:0.5       offset:0
  2840 !
  2841 
  2842 setVerticalFixPartFrame
  2843     self
  2844         setFrameLeft:0.5   offset:(self class defaultFixPartHeight negated // 2 )
  2845         right:0.5          offset:(self class defaultFixPartHeight // 2 ) 
  2846         top:0          offset:0 
  2847         bottom:1       offset:0
  2848 ! !
  2849 
  2850 !UILayoutTool::LayoutOrigin class methodsFor:'interface specs'!
  2851 
  2852 windowSpec
  2853     "This resource specification was automatically generated
  2854      by the UIPainter of ST/X."
  2855 
  2856     "Do not manually edit this!! If it is corrupted,
  2857      the UIPainter may not be able to read the specification."
  2858 
  2859     "
  2860      UIPainter new openOnClass:UILayoutTool::LayoutOrigin andSelector:#windowSpec
  2861      UILayoutTool::LayoutOrigin new openInterface:#windowSpec
  2862      UILayoutTool::LayoutOrigin open
  2863     "
  2864 
  2865     <resource: #canvas>
  2866 
  2867     ^ 
  2868      #(FullSpec
  2869         name: windowSpec
  2870         window: 
  2871        (WindowSpec
  2872           label: 'UILayoutTool-LayoutOrigin'
  2873           name: 'UILayoutTool-LayoutOrigin'
  2874           min: (Point 10 10)
  2875           bounds: (Rectangle 14 46 372 192)
  2876         )
  2877         component: 
  2878        (SpecCollection
  2879           collection: (
  2880            (UISubSpecification
  2881               name: 'layoutOriginSpec'
  2882               layout: (LayoutFrame 1 0.0 6 0 0 1.0 110 0)
  2883               majorKey: UILayoutTool
  2884               minorKey: layoutOriginSpec
  2885             )
  2886            )
  2887          
  2888         )
  2889       )
  2890 ! !
  2891 
  2892 !UILayoutTool::LayoutOrigin methodsFor:'accessing'!
  2893 
  2894 fetch:aView spec:aSpec
  2895     "fetch layoutOrigin
  2896     "
  2897     |layout|
  2898 
  2899     layout  := UIPainterView asLayoutFrameFromView:aView.
  2900 
  2901     (self aspectFor:#leftOffset)   value:(layout leftOffset).
  2902     (self aspectFor:#leftFraction) value:(layout leftFraction).
  2903     (self aspectFor:#topOffset)    value:(layout topOffset).
  2904     (self aspectFor:#topFraction)  value:(layout topFraction).
  2905 
  2906 
  2907 !
  2908 
  2909 layout
  2910     "returns current layout as layoutOrigin
  2911     "
  2912     |layout|
  2913 
  2914     layout  := Smalltalk::LayoutOrigin new.
  2915 
  2916     layout 
  2917         leftFraction:(((self aspectFor:#leftFraction) value) ? 0)
  2918               offset:(((self aspectFor:#leftOffset)   value) ? 0)
  2919         topFraction:(((self aspectFor:#topFraction)  value) ? 0)
  2920              offset:(((self aspectFor:#topOffset)    value) ? 0).
  2921 
  2922   ^ layout
  2923 ! !
  2924 
  2925 !UILayoutTool::Point class methodsFor:'interface specs'!
  2926 
  2927 windowSpec
  2928     "This resource specification was automatically generated
  2929      by the UIPainter of ST/X."
  2930 
  2931     "Do not manually edit this!! If it is corrupted,
  2932      the UIPainter may not be able to read the specification."
  2933 
  2934     "
  2935      UIPainter new openOnClass:UILayoutTool::Point andSelector:#windowSpec
  2936      UILayoutTool::Point new openInterface:#windowSpec
  2937      UILayoutTool::Point open
  2938     "
  2939 
  2940     <resource: #canvas>
  2941 
  2942     ^ 
  2943      #(FullSpec
  2944         name: windowSpec
  2945         window: 
  2946        (WindowSpec
  2947           label: 'UILayoutTool-Point'
  2948           name: 'UILayoutTool-Point'
  2949           min: (Point 10 10)
  2950           bounds: (Rectangle 14 46 309 184)
  2951         )
  2952         component: 
  2953        (SpecCollection
  2954           collection: (
  2955            (UISubSpecification
  2956               name: 'layoutPointSpec'
  2957               layout: (LayoutFrame 1 0.0 6 0 0 1.0 100 0)
  2958               majorKey: UILayoutTool
  2959               minorKey: layoutPointSpec
  2960             )
  2961            )
  2962          
  2963         )
  2964       )
  2965 ! !
  2966 
  2967 !UILayoutTool::Point methodsFor:'accessing'!
  2968 
  2969 fetch:aView spec:aSpec
  2970     "fetch point
  2971     "
  2972     |origin|
  2973 
  2974     origin  := aView computeOrigin.
  2975 
  2976     (self aspectFor:#leftOffset) value:(origin x).
  2977     (self aspectFor:#topOffset)  value:(origin y).
  2978 
  2979 
  2980 !
  2981 
  2982 layout
  2983     "returns current layout as point
  2984     "
  2985   ^ Smalltalk::Point x:(((self aspectFor:#leftOffset) value) ? 0)
  2986                      y:(((self aspectFor:#topOffset)  value) ? 0)
  2987 
  2988 ! !
  2989 
  2990 !UILayoutTool::Rectangle class methodsFor:'interface specs'!
  2991 
  2992 windowSpec
  2993     "This resource specification was automatically generated
  2994      by the UIPainter of ST/X."
  2995 
  2996     "Do not manually edit this!! If it is corrupted,
  2997      the UIPainter may not be able to read the specification."
  2998 
  2999     "
  3000      UIPainter new openOnClass:UILayoutTool::Rectangle andSelector:#windowSpec
  3001      UILayoutTool::Rectangle new openInterface:#windowSpec
  3002      UILayoutTool::Rectangle open
  3003     "
  3004 
  3005     <resource: #canvas>
  3006 
  3007     ^ 
  3008      #(FullSpec
  3009         name: windowSpec
  3010         window: 
  3011        (WindowSpec
  3012           label: 'UILayoutTool-Rectangle'
  3013           name: 'UILayoutTool-Rectangle'
  3014           min: (Point 10 10)
  3015           bounds: (Rectangle 14 46 356 245)
  3016         )
  3017         component: 
  3018        (SpecCollection
  3019           collection: (
  3020            (UISubSpecification
  3021               name: 'subSpecification'
  3022               layout: (LayoutFrame 1 0.0 6 0 0 1.0 96 0)
  3023               majorKey: UILayoutTool
  3024               minorKey: layoutPointSpec
  3025             )
  3026            (FramedBoxSpec
  3027               label: 'Corner'
  3028               name: 'FramedBox'
  3029               layout: (LayoutFrame 1 0.0 99 0 0 1.0 194 0)
  3030               labelPosition: topLeft
  3031                     translateLabel: true
  3032               component: 
  3033              (SpecCollection
  3034                 collection: (
  3035                  (LabelSpec
  3036                     label: 'Right:'
  3037                     name: 'labelCornerY'
  3038                     layout: (AlignmentOrigin 83 0 16 0 1 0)
  3039                     adjust: left
  3040                     translateLabel: true
  3041                   )
  3042                  (InputFieldSpec
  3043                     name: 'fieldCornerX'
  3044                     layout: (LayoutFrame 85 0 13 0 135 0 35 0)
  3045                     activeHelpKey: cornerX
  3046                     tabable: true
  3047                     model: rightOffset
  3048                     group: inputGroup
  3049                     type: numberOrNil
  3050                     acceptOnLostFocus: true
  3051                     acceptChannel: acceptChannel
  3052                     modifiedChannel: modifiedChannel
  3053                     acceptOnPointerLeave: false
  3054                   )
  3055                  (LabelSpec
  3056                     label: 'Bottom:'
  3057                     name: 'labelCornerX'
  3058                     layout: (AlignmentOrigin 83 0 41 0 1 0)
  3059                     adjust: left
  3060                     translateLabel: true
  3061                   )
  3062                  (InputFieldSpec
  3063                     name: 'fieldCornerY'
  3064                     layout: (LayoutFrame 85 0 38 0 135 0 60 0)
  3065                     activeHelpKey: cornerY
  3066                     tabable: true
  3067                     model: bottomOffset
  3068                     group: inputGroup
  3069                     type: numberOrNil
  3070                     acceptOnLostFocus: true
  3071                     acceptChannel: acceptChannel
  3072                     modifiedChannel: modifiedChannel
  3073                     acceptOnPointerLeave: false
  3074                   )
  3075                  )
  3076                
  3077               )
  3078             )
  3079            )
  3080          
  3081         )
  3082       )
  3083 ! !
  3084 
  3085 !UILayoutTool::Rectangle methodsFor:'accessing'!
  3086 
  3087 fetch:aView spec:aSpec
  3088     "fetch rectangle
  3089     "
  3090     |origin corner|
  3091 
  3092     origin := aView computeOrigin.
  3093     corner := aView computeCorner.
  3094 
  3095     (self aspectFor:#leftOffset)   value:(origin x).
  3096     (self aspectFor:#rightOffset)  value:(corner x).
  3097     (self aspectFor:#topOffset)    value:(origin y).
  3098     (self aspectFor:#bottomOffset) value:(corner y).
  3099 
  3100 
  3101 !
  3102 
  3103 layout
  3104     "returns current layout as rectangle"
  3105 
  3106     ^ Smalltalk::Rectangle 
  3107         left:(((self aspectFor:#leftOffset)   value) ? 0)
  3108         top:(((self aspectFor:#topOffset)    value) ? 0)
  3109         right:(((self aspectFor:#rightOffset)  value) ? 0)
  3110         bottom:(((self aspectFor:#bottomOffset) value) ? 0)
  3111 ! !
  3112 
  3113 !UILayoutTool class methodsFor:'documentation'!
  3114 
  3115 version
  3116     ^ '$Header$'
  3117 ! !