UILayoutTool.st
changeset 690 a1033b88a8e8
parent 296 e542c6fb0de7
child 714 61d4a7df2574
equal deleted inserted replaced
689:ff099c344dd6 690:a1033b88a8e8
   173     <resource: #canvas>
   173     <resource: #canvas>
   174 
   174 
   175     ^
   175     ^
   176      
   176      
   177        #(#FullSpec
   177        #(#FullSpec
   178           #'window:' 
   178           #window: 
   179            #(#WindowSpec
   179            #(#WindowSpec
   180               #'name:' 'uIPainterView'
   180               #name: 'uIPainterView'
   181               #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
   181               #layout: #(#LayoutFrame 31 0 423 0 293 0 525 0)
   182               #'label:' 'unnamed'
   182               #label: 'unnamed'
   183               #'bounds:' #(#Rectangle 0 0 258 93)
   183               #min: #(#Point 10 10)
   184           )
   184               #max: #(#Point 1152 900)
   185           #'component:' 
   185               #bounds: #(#Rectangle 31 423 294 526)
       
   186               #usePreferredExtent: false
       
   187           )
       
   188           #component: 
   186            #(#SpecCollection
   189            #(#SpecCollection
   187               #'collection:' 
   190               #collection: 
   188                #(
   191                #(
   189                  #(#LabelSpec
   192                  #(#LabelSpec
   190                     #'name:' 'labelRelative'
   193                     #name: 'labelRelative'
   191                     #'layout:' #(#Point 57 12)
   194                     #layout: #(#Point 80 12)
   192                     #'label:' 'relative'
   195                     #label: 'Relative:'
   193                 )
   196                 )
   194                  #(#LabelSpec
   197                  #(#LabelSpec
   195                     #'name:' 'labelAbsolute'
   198                     #name: 'labelAbsolute'
   196                     #'layout:' #(#Point 154 13)
   199                     #layout: #(#Point 177 13)
   197                     #'label:' 'offset'
   200                     #label: 'Offset:'
   198                 )
   201                 )
   199                  #(#LabelSpec
   202                  #(#LabelSpec
   200                     #'name:' 'labelLeft'
   203                     #name: 'labelLeft'
   201                     #'layout:' #(#AlignmentOrigin 52 0 44 0 1 0)
   204                     #layout: #(#AlignmentOrigin 78 0 39 0 1 0)
   202                     #'label:' 'left'
   205                     #label: 'Left:'
   203                 )
   206                 )
   204                  #(#InputFieldSpec
   207                  #(#InputFieldSpec
   205                     #'name:' 'fieldLeftFraction'
   208                     #name: 'fieldLeftFraction'
   206                     #'layout:' #(#LayoutFrame 57 0 44 0 114 0 66 0)
   209                     #layout: #(#LayoutFrame 80 0 36 0 137 0 58 0)
   207                     #'activeHelpKey:' #leftRelative
   210                     #activeHelpKey: #leftRelative
   208                     #'tabable:' true
   211                     #tabable: true
   209                     #'model:' #leftFraction
   212                     #model: #leftFraction
   210                     #'type:' #numberOrNil
   213                     #type: #numberOrNil
   211                 )
   214                 )
   212                  #(#ActionButtonSpec
   215                  #(#ActionButtonSpec
   213                     #'name:' 'actionRelativeLeft'
   216                     #name: 'actionRelativeLeft'
   214                     #'layout:' #(#LayoutFrame 119 0 44 0 138 0 62 0)
   217                     #layout: #(#LayoutFrame 142 0 36 0 161 0 54 0)
   215                     #'activeHelpKey:' #makeLeftRelative
   218                     #activeHelpKey: #makeLeftRelative
   216                     #'model:' #relativeLeft
   219                     #model: #relativeLeft
   217                 )
   220                 )
   218                  #(#InputFieldSpec
   221                  #(#InputFieldSpec
   219                     #'name:' 'fieldLeftOffset'
   222                     #name: 'fieldLeftOffset'
   220                     #'layout:' #(#LayoutFrame 154 0 44 0 212 0 66 0)
   223                     #layout: #(#LayoutFrame 177 0 36 0 235 0 58 0)
   221                     #'activeHelpKey:' #leftAbsolute
   224                     #activeHelpKey: #leftAbsolute
   222                     #'tabable:' true
   225                     #tabable: true
   223                     #'model:' #leftOffset
   226                     #model: #leftOffset
   224                     #'type:' #numberOrNil
   227                     #type: #numberOrNil
   225                 )
   228                 )
   226                  #(#ActionButtonSpec
   229                  #(#ActionButtonSpec
   227                     #'name:' 'actionAbsoluteLeft'
   230                     #name: 'actionAbsoluteLeft'
   228                     #'layout:' #(#LayoutFrame 216 0 44 0 235 0 62 0)
   231                     #layout: #(#LayoutFrame 239 0 36 0 258 0 54 0)
   229                     #'activeHelpKey:' #makeLeftAbsolute
   232                     #activeHelpKey: #makeLeftAbsolute
   230                     #'model:' #absoluteLeft
   233                     #model: #absoluteLeft
   231                 )
   234                 )
   232                  #(#LabelSpec
   235                  #(#LabelSpec
   233                     #'name:' 'labelTop'
   236                     #name: 'labelTop'
   234                     #'layout:' #(#AlignmentOrigin 52 0 71 0 1 0)
   237                     #layout: #(#AlignmentOrigin 78 0 66 0 1 0)
   235                     #'label:' 'top'
   238                     #label: 'Top:'
   236                 )
   239                 )
   237                  #(#InputFieldSpec
   240                  #(#InputFieldSpec
   238                     #'name:' 'fieldTopFraction'
   241                     #name: 'fieldTopFraction'
   239                     #'layout:' #(#LayoutFrame 57 0 71 0 114 0 93 0)
   242                     #layout: #(#LayoutFrame 80 0 63 0 137 0 85 0)
   240                     #'activeHelpKey:' #topRelative
   243                     #activeHelpKey: #topRelative
   241                     #'tabable:' true
   244                     #tabable: true
   242                     #'model:' #topFraction
   245                     #model: #topFraction
   243                     #'type:' #numberOrNil
   246                     #type: #numberOrNil
   244                 )
   247                 )
   245                  #(#ActionButtonSpec
   248                  #(#ActionButtonSpec
   246                     #'name:' 'actionRelativeTop'
   249                     #name: 'actionRelativeTop'
   247                     #'layout:' #(#LayoutFrame 119 0 71 0 138 0 89 0)
   250                     #layout: #(#LayoutFrame 142 0 63 0 161 0 81 0)
   248                     #'activeHelpKey:' #makeTopRelative
   251                     #activeHelpKey: #makeTopRelative
   249                     #'model:' #relativeTop
   252                     #model: #relativeTop
   250                 )
   253                 )
   251                  #(#InputFieldSpec
   254                  #(#InputFieldSpec
   252                     #'name:' 'fieldTopOffset'
   255                     #name: 'fieldTopOffset'
   253                     #'layout:' #(#LayoutFrame 154 0 71 0 212 0 93 0)
   256                     #layout: #(#LayoutFrame 177 0 63 0 235 0 85 0)
   254                     #'activeHelpKey:' #topAbsolute
   257                     #activeHelpKey: #topAbsolute
   255                     #'tabable:' true
   258                     #tabable: true
   256                     #'model:' #topOffset
   259                     #model: #topOffset
   257                     #'type:' #numberOrNil
   260                     #type: #numberOrNil
   258                 )
   261                 )
   259                  #(#ActionButtonSpec
   262                  #(#ActionButtonSpec
   260                     #'name:' 'actionAbsoluteTop'
   263                     #name: 'actionAbsoluteTop'
   261                     #'layout:' #(#LayoutFrame 216 0 71 0 235 0 89 0)
   264                     #layout: #(#LayoutFrame 239 0 63 0 258 0 81 0)
   262                     #'activeHelpKey:' #makeTopAbsolute
   265                     #activeHelpKey: #makeTopAbsolute
   263                     #'model:' #absoluteTop
   266                     #model: #absoluteTop
   264                 )
   267                 )
   265               )
   268               )
   266           )
   269           )
   267       )
   270       )
   268 
       
   269     "Modified: 28.7.1997 / 13:50:23 / cg"
       
   270 !
   271 !
   271 
   272 
   272 layoutPointSpec
   273 layoutPointSpec
   273     "this window spec was automatically generated by the ST/X UIPainter"
   274     "this window spec was automatically generated by the ST/X UIPainter"
   274 
   275 
   283     <resource: #canvas>
   284     <resource: #canvas>
   284 
   285 
   285     ^
   286     ^
   286      
   287      
   287        #(#FullSpec
   288        #(#FullSpec
   288           #'window:' 
   289           #window: 
   289            #(#WindowSpec
   290            #(#WindowSpec
   290               #'name:' 'uIPainterView'
   291               #name: 'uIPainterView'
   291               #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
   292               #layout: #(#LayoutFrame 31 0 423 0 220 0 499 0)
   292               #'label:' 'unnamed'
   293               #label: 'unnamed'
   293               #'bounds:' #(#Rectangle 0 0 194 66)
   294               #min: #(#Point 10 10)
   294           )
   295               #max: #(#Point 1152 900)
   295           #'component:' 
   296               #bounds: #(#Rectangle 31 423 221 500)
       
   297               #usePreferredExtent: false
       
   298           )
       
   299           #component: 
   296            #(#SpecCollection
   300            #(#SpecCollection
   297               #'collection:' 
   301               #collection: 
   298                #(
   302                #(
   299                  #(#LabelSpec
   303                  #(#LabelSpec
   300                     #'name:' 'labelOriginX'
   304                     #name: 'labelOriginX'
   301                     #'layout:' #(#AlignmentOrigin 75 0 19 0 1 0)
   305                     #layout: #(#AlignmentOrigin 78 0 23 0 1 0)
   302                     #'label:' 'origin x:'
   306                     #label: 'Origin x:'
   303                 )
   307                 )
   304                  #(#InputFieldSpec
   308                  #(#InputFieldSpec
   305                     #'name:' 'fieldOriginX'
   309                     #name: 'fieldOriginX'
   306                     #'layout:' #(#LayoutFrame 77 0 19 0 170 0 41 0)
   310                     #layout: #(#LayoutFrame 80 0 20 0 173 0 42 0)
   307                     #'activeHelpKey:' #originX
   311                     #activeHelpKey: #originX
   308                     #'tabable:' true
   312                     #tabable: true
   309                     #'model:' #leftOffset
   313                     #model: #leftOffset
   310                     #'type:' #numberOrNil
   314                     #type: #numberOrNil
   311                 )
   315                 )
   312                  #(#LabelSpec
   316                  #(#LabelSpec
   313                     #'name:' 'labelOriginY'
   317                     #name: 'labelOriginY'
   314                     #'layout:' #(#AlignmentOrigin 75 0 46 0 1 0)
   318                     #layout: #(#AlignmentOrigin 78 0 50 0 1 0)
   315                     #'label:' 'origin y:'
   319                     #label: 'Origin y:'
   316                 )
   320                 )
   317                  #(#InputFieldSpec
   321                  #(#InputFieldSpec
   318                     #'name:' 'fieldOriginY'
   322                     #name: 'fieldOriginY'
   319                     #'layout:' #(#LayoutFrame 77 0 46 0 170 0 68 0)
   323                     #layout: #(#LayoutFrame 80 0 47 0 173 0 69 0)
   320                     #'activeHelpKey:' #originY
   324                     #activeHelpKey: #originY
   321                     #'tabable:' true
   325                     #tabable: true
   322                     #'model:' #topOffset
   326                     #model: #topOffset
   323                     #'type:' #numberOrNil
   327                     #type: #numberOrNil
   324                 )
   328                 )
   325               )
   329               )
   326           )
   330           )
   327       )
   331       )
   328 
       
   329     "Modified: 28.7.1997 / 14:12:22 / cg"
       
   330 !
   332 !
   331 
   333 
   332 slices
   334 slices
   333     ^ #(
   335     ^ #(
   334         ( 'Frame'          LayoutFrame)
   336         ( 'Frame'          LayoutFrame)
   777     <resource: #canvas>
   779     <resource: #canvas>
   778 
   780 
   779     ^
   781     ^
   780      
   782      
   781        #(#FullSpec
   783        #(#FullSpec
       
   784           #window: 
       
   785            #(#WindowSpec
       
   786               #name: 'uIPainterView'
       
   787               #layout: #(#LayoutFrame 31 0 423 0 298 0 627 0)
       
   788               #label: 'AlignmentOrigin'
       
   789               #min: #(#Point 10 10)
       
   790               #max: #(#Point 1152 900)
       
   791               #bounds: #(#Rectangle 31 423 299 628)
       
   792               #usePreferredExtent: false
       
   793           )
       
   794           #component: 
       
   795            #(#SpecCollection
       
   796               #collection: 
       
   797                #(
       
   798                  #(#UISubSpecification
       
   799                     #name: 'subSpecification'
       
   800                     #layout: #(#LayoutOrigin 0 0 0 0)
       
   801                     #majorKey: #UILayoutTool
       
   802                     #minorKey: #layoutOriginSpec
       
   803                 )
       
   804                  #(#LabelSpec
       
   805                     #name: 'label5'
       
   806                     #layout: #(#AlignmentOrigin 78 0 102 0 1 0)
       
   807                     #label: 'Align H:'
       
   808                     #adjust: #right
       
   809                 )
       
   810                  #(#LabelSpec
       
   811                     #name: 'label6'
       
   812                     #layout: #(#AlignmentOrigin 78 0 128 0 1 0)
       
   813                     #label: 'Align V:'
       
   814                     #adjust: #right
       
   815                 )
       
   816                  #(#InputFieldSpec
       
   817                     #name: 'editField5'
       
   818                     #layout: #(#LayoutFrame 80 0 99 0 137 0 121 0)
       
   819                     #activeHelpKey: #alignHorizontal
       
   820                     #tabable: true
       
   821                     #model: #leftAlignmentFraction
       
   822                     #type: #numberOrNil
       
   823                 )
       
   824                  #(#InputFieldSpec
       
   825                     #name: 'editField6'
       
   826                     #layout: #(#LayoutFrame 80 0 125 0 137 0 147 0)
       
   827                     #activeHelpKey: #alignVertical
       
   828                     #tabable: true
       
   829                     #model: #topAlignmentFraction
       
   830                     #type: #numberOrNil
       
   831                 )
       
   832                  #(#DividerSpec
       
   833                     #name: 'separator1'
       
   834                     #layout: #(#Rectangle 166 103 215 106)
       
   835                     #orientation: #horizontal
       
   836                 )
       
   837                  #(#DividerSpec
       
   838                     #name: 'separator2'
       
   839                     #layout: #(#Rectangle 166 133 215 136)
       
   840                     #orientation: #horizontal
       
   841                 )
       
   842                  #(#DividerSpec
       
   843                     #name: 'separator3'
       
   844                     #layout: #(#Rectangle 161 111 164 132)
       
   845                     #orientation: #vertical
       
   846                 )
       
   847                  #(#DividerSpec
       
   848                     #name: 'separator4'
       
   849                     #layout: #(#Rectangle 217 111 220 132)
       
   850                     #orientation: #vertical
       
   851                 )
       
   852                  #(#ActionButtonSpec
       
   853                     #name: 'alignBottomRight'
       
   854                     #layout: #(#Rectangle 213 131 225 143)
       
   855                     #activeHelpKey: #alignBottomRight
       
   856                     #model: #alignBottomRight
       
   857                 )
       
   858                  #(#ActionButtonSpec
       
   859                     #name: 'alignTopLeft'
       
   860                     #layout: #(#Rectangle 157 100 169 112)
       
   861                     #activeHelpKey: #alignTopLeft
       
   862                     #model: #alignTopLeft
       
   863                 )
       
   864                  #(#ActionButtonSpec
       
   865                     #name: 'alignTopRight'
       
   866                     #layout: #(#Rectangle 213 100 225 112)
       
   867                     #activeHelpKey: #alignTopRight
       
   868                     #model: #alignTopRight
       
   869                 )
       
   870                  #(#ActionButtonSpec
       
   871                     #name: 'alignBottomLeft'
       
   872                     #layout: #(#Rectangle 157 130 169 142)
       
   873                     #activeHelpKey: #alignBottomLeft
       
   874                     #model: #alignBottomLeft
       
   875                 )
       
   876                  #(#ActionButtonSpec
       
   877                     #name: 'alignTopCenter'
       
   878                     #layout: #(#Rectangle 185 100 197 112)
       
   879                     #activeHelpKey: #alignTopCenter
       
   880                     #model: #alignTopCenter
       
   881                 )
       
   882                  #(#ActionButtonSpec
       
   883                     #name: 'alignBottomCenter'
       
   884                     #layout: #(#Rectangle 185 131 197 143)
       
   885                     #activeHelpKey: #alignBottomCenter
       
   886                     #model: #alignBottomCenter
       
   887                 )
       
   888                  #(#ActionButtonSpec
       
   889                     #name: 'alignLeftCenter'
       
   890                     #layout: #(#Rectangle 157 115 169 127)
       
   891                     #activeHelpKey: #alignLeftCenter
       
   892                     #model: #alignLeftCenter
       
   893                 )
       
   894                  #(#ActionButtonSpec
       
   895                     #name: 'alignRightCenter'
       
   896                     #layout: #(#Rectangle 213 115 225 127)
       
   897                     #activeHelpKey: #alignRightCenter
       
   898                     #model: #alignRightCenter
       
   899                 )
       
   900                  #(#ActionButtonSpec
       
   901                     #name: 'alignCenter'
       
   902                     #layout: #(#Rectangle 185 115 197 127)
       
   903                     #activeHelpKey: #alignCenter
       
   904                     #model: #alignCenter
       
   905                 )
       
   906               )
       
   907           )
       
   908       )
       
   909 ! !
       
   910 
       
   911 !UILayoutTool::AlignmentOrigin methodsFor:'accessing'!
       
   912 
       
   913 fetch:aView
       
   914     "fetch alignmentOrigin
       
   915     "
       
   916     |layout type|
       
   917 
       
   918     type   := UIPainterView layoutType:aView.
       
   919     layout := aView geometryLayout.
       
   920 
       
   921     layout isLayout ifTrue:[
       
   922         (self aspectFor:#leftOffset)   value:(layout leftOffset).
       
   923         (self aspectFor:#leftFraction) value:(layout leftFraction).
       
   924         (self aspectFor:#topOffset)    value:(layout topOffset).
       
   925         (self aspectFor:#topFraction)  value:(layout topFraction).
       
   926 
       
   927         type == #AlignmentOrigin ifTrue:[
       
   928             (self aspectFor:#leftAlignmentFraction) value:(layout leftAlignmentFraction).
       
   929             (self aspectFor:#topAlignmentFraction)  value:(layout topAlignmentFraction).
       
   930           ^ self
       
   931         ]
       
   932     ] ifFalse:[
       
   933         layout := aView computeOrigin.
       
   934 
       
   935         (self aspectFor:#leftOffset)   value:(layout x).
       
   936         (self aspectFor:#leftFraction) value:0.
       
   937         (self aspectFor:#topOffset)    value:(layout y).
       
   938         (self aspectFor:#topFraction)  value:0.
       
   939     ].
       
   940     (self aspectFor:#leftAlignmentFraction) value:0.
       
   941     (self aspectFor:#topAlignmentFraction)  value:0.
       
   942 
       
   943 
       
   944 !
       
   945 
       
   946 layout
       
   947     "returns current layout as alignmentOrigin
       
   948     "
       
   949     |layout|
       
   950 
       
   951     layout  := Smalltalk::AlignmentOrigin new.
       
   952 
       
   953     layout   leftOffset:((self aspectFor:#leftOffset)   value) ? 0.
       
   954     layout    topOffset:((self aspectFor:#topOffset)    value) ? 0.
       
   955     layout leftFraction:((self aspectFor:#leftFraction) value) ? 0.
       
   956     layout  topFraction:((self aspectFor:#topFraction)  value) ? 0.
       
   957 
       
   958     layout leftAlignmentFraction:((self aspectFor:#leftAlignmentFraction) value) ? 0.
       
   959     layout  topAlignmentFraction:((self aspectFor:#topAlignmentFraction)  value) ? 0.
       
   960 
       
   961   ^ layout
       
   962 ! !
       
   963 
       
   964 !UILayoutTool::AlignmentOrigin methodsFor:'alignment'!
       
   965 
       
   966 alignBottomCenter
       
   967     self makeAlignLeft:0.5 top:1
       
   968 
       
   969 
       
   970 !
       
   971 
       
   972 alignBottomLeft
       
   973     self makeAlignLeft:0 top:1
       
   974 
       
   975 
       
   976 !
       
   977 
       
   978 alignBottomRight
       
   979     self makeAlignLeft:1 top:1
       
   980 
       
   981 
       
   982 !
       
   983 
       
   984 alignCenter
       
   985     self makeAlignLeft:0.5 top:0.5
       
   986 
       
   987 
       
   988 !
       
   989 
       
   990 alignLeftCenter
       
   991     self makeAlignLeft:0 top:0.5
       
   992 
       
   993 
       
   994 !
       
   995 
       
   996 alignRightCenter
       
   997     self makeAlignLeft:1 top:0.5
       
   998 
       
   999 
       
  1000 !
       
  1001 
       
  1002 alignTopCenter
       
  1003     self makeAlignLeft:0.5 top:0
       
  1004 
       
  1005 
       
  1006 !
       
  1007 
       
  1008 alignTopLeft
       
  1009     self makeAlignLeft:0 top:0
       
  1010 
       
  1011 
       
  1012 !
       
  1013 
       
  1014 alignTopRight
       
  1015     self makeAlignLeft:1 top:0
       
  1016 
       
  1017 
       
  1018 !
       
  1019 
       
  1020 makeAlignLeft:leftAlignmentFraction top:topAlignmentFraction
       
  1021     |lAF tAF lO tO ext|
       
  1022 
       
  1023     lAF     := (self aspectFor:#leftAlignmentFraction) value ? 0.
       
  1024     tAF     := (self aspectFor:#topAlignmentFraction)  value ? 0.
       
  1025     ext     := (self aspectFor:#layoutView) computeExtent.
       
  1026 
       
  1027     (self aspectFor:#leftAlignmentFraction) value:leftAlignmentFraction.
       
  1028     (self aspectFor:#topAlignmentFraction)  value:topAlignmentFraction.
       
  1029 
       
  1030     lO := (self aspectFor:#leftOffset) value ? 0.
       
  1031     tO := (self aspectFor:#topOffset)  value ? 0.
       
  1032 
       
  1033     lO := lO + (ext x * (leftAlignmentFraction - lAF)).
       
  1034     tO := tO + (ext y * (topAlignmentFraction  - tAF)).
       
  1035 
       
  1036     (self aspectFor:#leftOffset) value:(lO rounded).
       
  1037     (self aspectFor:#topOffset)  value:(tO rounded).
       
  1038 
       
  1039 !
       
  1040 
       
  1041 makeAlignTopRight
       
  1042     self makeAlignLeft:1 top:0
       
  1043 
       
  1044 
       
  1045 ! !
       
  1046 
       
  1047 !UILayoutTool::Extent class methodsFor:'help specs'!
       
  1048 
       
  1049 helpSpec
       
  1050     "return a dictionary filled with helpKey -> helptext associations.
       
  1051      These are used by the activeHelp tool."
       
  1052 
       
  1053     "
       
  1054     UIHelpTool openOnClass:UILayoutTool::Extent    
       
  1055     "
       
  1056 
       
  1057   ^ super helpSpec addPairsFrom:#(
       
  1058 
       
  1059 #vrtExtent
       
  1060 'vertical extent of the component'
       
  1061 
       
  1062 #hrzExtent
       
  1063 'horizontal extent of the component'
       
  1064 
       
  1065 )
       
  1066 ! !
       
  1067 
       
  1068 !UILayoutTool::Extent class methodsFor:'interface specs'!
       
  1069 
       
  1070 windowSpec
       
  1071     "this window spec was automatically generated by the ST/X UIPainter"
       
  1072 
       
  1073     "do not manually edit this - the painter/builder may not be able to
       
  1074      handle the specification if its corrupted."
       
  1075 
       
  1076     "
       
  1077      UIPainter new openOnClass:UILayoutTool::Extent andSelector:#windowSpec
       
  1078      UILayoutTool::Extent new openInterface:#windowSpec
       
  1079     "
       
  1080     "UILayoutTool::Extent open"
       
  1081 
       
  1082     <resource: #canvas>
       
  1083 
       
  1084     ^
       
  1085      
       
  1086        #(#FullSpec
       
  1087           #window: 
       
  1088            #(#WindowSpec
       
  1089               #name: 'uIPainterView'
       
  1090               #layout: #(#LayoutFrame 31 0 423 0 256 0 508 0)
       
  1091               #label: 'unnamed'
       
  1092               #min: #(#Point 10 10)
       
  1093               #max: #(#Point 1152 900)
       
  1094               #bounds: #(#Rectangle 31 423 257 509)
       
  1095               #usePreferredExtent: false
       
  1096           )
       
  1097           #component: 
       
  1098            #(#SpecCollection
       
  1099               #collection: 
       
  1100                #(
       
  1101                  #(#LabelSpec
       
  1102                     #name: 'labelWidth'
       
  1103                     #layout: #(#AlignmentOrigin 79 0 31 0 1 0.5)
       
  1104                     #label: 'Width:'
       
  1105                     #adjust: #right
       
  1106                 )
       
  1107                  #(#InputFieldSpec
       
  1108                     #name: 'fieldLeftOffset'
       
  1109                     #layout: #(#LayoutFrame 80 0 20 0 173 0 42 0)
       
  1110                     #activeHelpKey: #hrzExtent
       
  1111                     #tabable: true
       
  1112                     #model: #leftOffset
       
  1113                     #type: #numberOrNil
       
  1114                 )
       
  1115                  #(#LabelSpec
       
  1116                     #name: 'labelHeight'
       
  1117                     #layout: #(#AlignmentOrigin 79 0 58 0 1 0.5)
       
  1118                     #label: 'Height:'
       
  1119                     #adjust: #right
       
  1120                 )
       
  1121                  #(#InputFieldSpec
       
  1122                     #name: 'fieldRightOffset'
       
  1123                     #layout: #(#LayoutFrame 80 0 47 0 173 0 69 0)
       
  1124                     #activeHelpKey: #vrtExtent
       
  1125                     #tabable: true
       
  1126                     #model: #rightOffset
       
  1127                     #type: #numberOrNil
       
  1128                 )
       
  1129               )
       
  1130           )
       
  1131       )
       
  1132 ! !
       
  1133 
       
  1134 !UILayoutTool::Extent methodsFor:'accessing'!
       
  1135 
       
  1136 fetch:aView
       
  1137     "fetch extent
       
  1138     "
       
  1139     |extent|
       
  1140 
       
  1141     extent  := aView computeExtent.
       
  1142 
       
  1143     (self aspectFor:#leftOffset)  value:(extent x).
       
  1144     (self aspectFor:#rightOffset) value:(extent y).
       
  1145 
       
  1146 
       
  1147 !
       
  1148 
       
  1149 layout
       
  1150     "returns current extent
       
  1151     "
       
  1152   ^ Smalltalk::Point x:(((self aspectFor:#leftOffset)   value) ? 0)
       
  1153                      y:(((self aspectFor:#rightOffset)  value) ? 0)
       
  1154 
       
  1155 ! !
       
  1156 
       
  1157 !UILayoutTool::LayoutFrame class methodsFor:'help specs'!
       
  1158 
       
  1159 helpSpec
       
  1160     "return a dictionary filled with helpKey -> helptext associations.
       
  1161      These are used by the activeHelp tool."
       
  1162 
       
  1163     "
       
  1164     UIHelpTool openOnClass:UILayoutTool::LayoutFrame    
       
  1165     "
       
  1166 
       
  1167   ^ super helpSpec addPairsFrom:#(
       
  1168 
       
  1169 #makeRightRelative
       
  1170 'compute current relative corner x and offset of the right edge to a relative corner x'
       
  1171 
       
  1172 #makeBottomAbsolute
       
  1173 'compute current bottom offset and relative corner y to an absolute corner y'
       
  1174 
       
  1175 #bottomAbsolute
       
  1176 'offset of the bottom edge; positive is to the bottom, negative to the top'
       
  1177 
       
  1178 #rightRelative
       
  1179 'relative corner x'
       
  1180 
       
  1181 #makeBottomRelative
       
  1182 'compute current relative corner y and offset of the bottom edge to a relative corner y'
       
  1183 
       
  1184 #makeRightAbsolute
       
  1185 'compute current right offset and relative corner x to an absolute corner x'
       
  1186 
       
  1187 #bottomRelative
       
  1188 'relative corner y'
       
  1189 
       
  1190 #rightAbsolute
       
  1191 'offset of the right edge; positive is to the right, negative to the left'
       
  1192 
       
  1193 )
       
  1194 ! !
       
  1195 
       
  1196 !UILayoutTool::LayoutFrame class methodsFor:'interface specs'!
       
  1197 
       
  1198 windowSpec
       
  1199     "this window spec was automatically generated by the ST/X UIPainter"
       
  1200 
       
  1201     "do not manually edit this - the painter/builder may not be able to
       
  1202      handle the specification if its corrupted."
       
  1203 
       
  1204     "
       
  1205      UIPainter new openOnClass:UILayoutTool::LayoutFrame andSelector:#windowSpec
       
  1206      UILayoutTool::LayoutFrame new openInterface:#windowSpec
       
  1207     "
       
  1208     "UILayoutTool::LayoutFrame open"
       
  1209 
       
  1210     <resource: #canvas>
       
  1211 
       
  1212     ^
       
  1213      
       
  1214        #(#FullSpec
       
  1215           #window: 
       
  1216            #(#WindowSpec
       
  1217               #name: 'uIPainterView'
       
  1218               #layout: #(#LayoutFrame 31 0 423 0 280 0 615 0)
       
  1219               #label: 'unnamed'
       
  1220               #min: #(#Point 10 10)
       
  1221               #max: #(#Point 1152 900)
       
  1222               #bounds: #(#Rectangle 31 423 281 616)
       
  1223               #usePreferredExtent: false
       
  1224           )
       
  1225           #component: 
       
  1226            #(#SpecCollection
       
  1227               #collection: 
       
  1228                #(
       
  1229                  #(#UISubSpecification
       
  1230                     #name: 'subLayoutSpec'
       
  1231                     #layout: #(#LayoutOrigin 0 0 0 0)
       
  1232                     #majorKey: #UILayoutTool
       
  1233                     #minorKey: #layoutOriginSpec
       
  1234                 )
       
  1235                  #(#LabelSpec
       
  1236                     #name: 'labelRight'
       
  1237                     #layout: #(#AlignmentOrigin 78 0 101 0 1 0)
       
  1238                     #label: 'Right:'
       
  1239                 )
       
  1240                  #(#InputFieldSpec
       
  1241                     #name: 'fieldRightFraction'
       
  1242                     #layout: #(#LayoutFrame 80 0 98 0 137 0 120 0)
       
  1243                     #activeHelpKey: #rightRelative
       
  1244                     #model: #rightFraction
       
  1245                     #type: #numberOrNil
       
  1246                 )
       
  1247                  #(#ActionButtonSpec
       
  1248                     #name: 'actionRelativeRight'
       
  1249                     #layout: #(#LayoutFrame 142 0 98 0 161 0 116 0)
       
  1250                     #activeHelpKey: #makeRightRelative
       
  1251                     #model: #relativeRight
       
  1252                 )
       
  1253                  #(#InputFieldSpec
       
  1254                     #name: 'fieldRightOffset'
       
  1255                     #layout: #(#LayoutFrame 177 0 98 0 235 0 120 0)
       
  1256                     #activeHelpKey: #rightAbsolute
       
  1257                     #model: #rightOffset
       
  1258                     #type: #numberOrNil
       
  1259                 )
       
  1260                  #(#ActionButtonSpec
       
  1261                     #name: 'actionAbsoluteRight'
       
  1262                     #layout: #(#LayoutFrame 239 0 98 0 258 0 116 0)
       
  1263                     #activeHelpKey: #makeRightAbsolute
       
  1264                     #model: #absoluteRight
       
  1265                 )
       
  1266                  #(#LabelSpec
       
  1267                     #name: 'labelBottom'
       
  1268                     #layout: #(#AlignmentOrigin 78 0 129 0 1 0)
       
  1269                     #label: 'Bottom:'
       
  1270                 )
       
  1271                  #(#InputFieldSpec
       
  1272                     #name: 'fieldBottomFraction'
       
  1273                     #layout: #(#LayoutFrame 80 0 126 0 137 0 148 0)
       
  1274                     #activeHelpKey: #bottomRelative
       
  1275                     #model: #bottomFraction
       
  1276                     #type: #numberOrNil
       
  1277                 )
       
  1278                  #(#ActionButtonSpec
       
  1279                     #name: 'actionRelativeBottom'
       
  1280                     #layout: #(#LayoutFrame 142 0 126 0 161 0 144 0)
       
  1281                     #activeHelpKey: #makeBottomRelative
       
  1282                     #model: #relativeBottom
       
  1283                 )
       
  1284                  #(#InputFieldSpec
       
  1285                     #name: 'fieldBottomOffset'
       
  1286                     #layout: #(#LayoutFrame 177 0 126 0 234 0 148 0)
       
  1287                     #activeHelpKey: #bottomAbsolute
       
  1288                     #model: #bottomOffset
       
  1289                     #type: #numberOrNil
       
  1290                 )
       
  1291                  #(#ActionButtonSpec
       
  1292                     #name: 'actionAbsoluteBottom'
       
  1293                     #layout: #(#LayoutFrame 239 0 126 0 258 0 144 0)
       
  1294                     #activeHelpKey: #makeBottomAbsolute
       
  1295                     #model: #absoluteBottom
       
  1296                 )
       
  1297               )
       
  1298           )
       
  1299       )
       
  1300 ! !
       
  1301 
       
  1302 !UILayoutTool::LayoutFrame methodsFor:'accessing'!
       
  1303 
       
  1304 fetch:aView
       
  1305     |layout|
       
  1306 
       
  1307     layout  := UIPainterView asLayoutFrameFromView:aView.
       
  1308 
       
  1309     (self aspectFor:#leftOffset)     value:(layout leftOffset).
       
  1310     (self aspectFor:#leftFraction)   value:(layout leftFraction).
       
  1311     (self aspectFor:#topOffset)      value:(layout topOffset).
       
  1312     (self aspectFor:#topFraction)    value:(layout topFraction).
       
  1313     (self aspectFor:#rightOffset)    value:(layout rightOffset).
       
  1314     (self aspectFor:#bottomOffset)   value:(layout bottomOffset).
       
  1315     (self aspectFor:#rightFraction)  value:(layout rightFraction).
       
  1316     (self aspectFor:#bottomFraction) value:(layout bottomFraction).
       
  1317 
       
  1318 !
       
  1319 
       
  1320 layout
       
  1321     "returns current layout as layoutFrame
       
  1322     "
       
  1323     |layout|
       
  1324 
       
  1325     layout  := Smalltalk::LayoutFrame new.
       
  1326 
       
  1327     layout     leftOffset:((self aspectFor:#leftOffset)     value) ? 0.
       
  1328     layout    rightOffset:((self aspectFor:#rightOffset)    value) ? 0.
       
  1329     layout      topOffset:((self aspectFor:#topOffset)      value) ? 0.
       
  1330     layout   bottomOffset:((self aspectFor:#bottomOffset)   value) ? 0.
       
  1331     layout   leftFraction:((self aspectFor:#leftFraction)   value) ? 0.
       
  1332     layout  rightFraction:((self aspectFor:#rightFraction)  value) ? 0.
       
  1333     layout    topFraction:((self aspectFor:#topFraction)    value) ? 0.
       
  1334     layout bottomFraction:((self aspectFor:#bottomFraction) value) ? 0.
       
  1335 
       
  1336   ^ layout
       
  1337 
       
  1338 ! !
       
  1339 
       
  1340 !UILayoutTool::LayoutOrigin class methodsFor:'interface specs'!
       
  1341 
       
  1342 windowSpec
       
  1343     "this window spec was automatically generated by the ST/X UIPainter"
       
  1344 
       
  1345     "do not manually edit this - the painter/builder may not be able to
       
  1346      handle the specification if its corrupted."
       
  1347 
       
  1348     "
       
  1349      UIPainter new openOnClass:UILayoutTool::LayoutOrigin andSelector:#windowSpec
       
  1350      UILayoutTool::LayoutOrigin new openInterface:#windowSpec
       
  1351     "
       
  1352     "UILayoutTool::LayoutOrigin open"
       
  1353 
       
  1354     <resource: #canvas>
       
  1355 
       
  1356     ^
       
  1357      
       
  1358        #(#FullSpec
   782           #'window:' 
  1359           #'window:' 
   783            #(#WindowSpec
  1360            #(#WindowSpec
   784               #'name:' 'uIPainterView'
  1361               #'name:' 'uIPainterView'
   785               #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
  1362               #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
   786               #'label:' 'AlignmentOrigin'
  1363               #'label:' 'unnamed'
   787               #'bounds:' #(#Rectangle 0 0 268 205)
  1364               #'bounds:' #(#Rectangle 0 0 258 93)
   788           )
  1365           )
   789           #'component:' 
  1366           #'component:' 
   790            #(#SpecCollection
  1367            #(#SpecCollection
   791               #'collection:' 
  1368               #'collection:' 
   792                #(
  1369                #(
   794                     #'name:' 'subSpecification'
  1371                     #'name:' 'subSpecification'
   795                     #'layout:' #(#LayoutOrigin 0 0 0 0)
  1372                     #'layout:' #(#LayoutOrigin 0 0 0 0)
   796                     #'majorKey:' #UILayoutTool
  1373                     #'majorKey:' #UILayoutTool
   797                     #'minorKey:' #layoutOriginSpec
  1374                     #'minorKey:' #layoutOriginSpec
   798                 )
  1375                 )
   799                  #(#LabelSpec
       
   800                     #'name:' 'label5'
       
   801                     #'layout:' #(#AlignmentOrigin 84 0 106 0 1 0)
       
   802                     #'label:' 'align H'
       
   803                     #'adjust:' #right
       
   804                 )
       
   805                  #(#LabelSpec
       
   806                     #'name:' 'label6'
       
   807                     #'layout:' #(#AlignmentOrigin 84 0 132 0 1 0)
       
   808                     #'label:' 'align V'
       
   809                     #'adjust:' #right
       
   810                 )
       
   811                  #(#InputFieldSpec
       
   812                     #'name:' 'editField5'
       
   813                     #'layout:' #(#LayoutFrame 89 0 106 0 146 0 128 0)
       
   814                     #'activeHelpKey:' #alignHorizontal
       
   815                     #'tabable:' true
       
   816                     #'model:' #leftAlignmentFraction
       
   817                     #'type:' #numberOrNil
       
   818                 )
       
   819                  #(#InputFieldSpec
       
   820                     #'name:' 'editField6'
       
   821                     #'layout:' #(#LayoutFrame 89 0 132 0 146 0 154 0)
       
   822                     #'activeHelpKey:' #alignVertical
       
   823                     #'tabable:' true
       
   824                     #'model:' #topAlignmentFraction
       
   825                     #'type:' #numberOrNil
       
   826                 )
       
   827                  #(#DividerSpec
       
   828                     #'name:' 'separator1'
       
   829                     #'layout:' #(#Rectangle 175 110 224 115)
       
   830                     #'orientation:' #horizontal
       
   831                 )
       
   832                  #(#DividerSpec
       
   833                     #'name:' 'separator2'
       
   834                     #'layout:' #(#Rectangle 175 140 224 145)
       
   835                     #'orientation:' #horizontal
       
   836                 )
       
   837                  #(#DividerSpec
       
   838                     #'name:' 'separator3'
       
   839                     #'layout:' #(#Rectangle 170 118 175 139)
       
   840                     #'orientation:' #vertical
       
   841                 )
       
   842                  #(#DividerSpec
       
   843                     #'name:' 'separator4'
       
   844                     #'layout:' #(#Rectangle 226 118 231 139)
       
   845                     #'orientation:' #vertical
       
   846                 )
       
   847                  #(#ActionButtonSpec
       
   848                     #'name:' 'alignBottomRight'
       
   849                     #'layout:' #(#Rectangle 222 138 234 150)
       
   850                     #'activeHelpKey:' #alignBottomRight
       
   851                     #'model:' #alignBottomRight
       
   852                 )
       
   853                  #(#ActionButtonSpec
       
   854                     #'name:' 'alignTopLeft'
       
   855                     #'layout:' #(#Rectangle 166 107 178 119)
       
   856                     #'activeHelpKey:' #alignTopLeft
       
   857                     #'model:' #alignTopLeft
       
   858                 )
       
   859                  #(#ActionButtonSpec
       
   860                     #'name:' 'alignTopRight'
       
   861                     #'layout:' #(#Rectangle 222 107 234 119)
       
   862                     #'activeHelpKey:' #alignTopRight
       
   863                     #'model:' #alignTopRight
       
   864                 )
       
   865                  #(#ActionButtonSpec
       
   866                     #'name:' 'alignBottomLeft'
       
   867                     #'layout:' #(#Rectangle 166 137 178 149)
       
   868                     #'activeHelpKey:' #alignBottomLeft
       
   869                     #'model:' #alignBottomLeft
       
   870                 )
       
   871                  #(#ActionButtonSpec
       
   872                     #'name:' 'alignTopCenter'
       
   873                     #'layout:' #(#Rectangle 194 107 206 119)
       
   874                     #'activeHelpKey:' #alignTopCenter
       
   875                     #'model:' #alignTopCenter
       
   876                 )
       
   877                  #(#ActionButtonSpec
       
   878                     #'name:' 'alignBottomCenter'
       
   879                     #'layout:' #(#Rectangle 194 138 206 150)
       
   880                     #'activeHelpKey:' #alignBottomCenter
       
   881                     #'model:' #alignBottomCenter
       
   882                 )
       
   883                  #(#ActionButtonSpec
       
   884                     #'name:' 'alignLeftCenter'
       
   885                     #'layout:' #(#Rectangle 166 122 178 134)
       
   886                     #'activeHelpKey:' #alignLeftCenter
       
   887                     #'model:' #alignLeftCenter
       
   888                 )
       
   889                  #(#ActionButtonSpec
       
   890                     #'name:' 'alignRightCenter'
       
   891                     #'layout:' #(#Rectangle 222 122 234 134)
       
   892                     #'activeHelpKey:' #alignRightCenter
       
   893                     #'model:' #alignRightCenter
       
   894                 )
       
   895                  #(#ActionButtonSpec
       
   896                     #'name:' 'alignCenter'
       
   897                     #'layout:' #(#Rectangle 194 122 206 134)
       
   898                     #'activeHelpKey:' #alignCenter
       
   899                     #'model:' #alignCenter
       
   900                 )
       
   901               )
       
   902           )
       
   903       )
       
   904 
       
   905     "Modified: 28.7.1997 / 15:12:25 / cg"
       
   906 ! !
       
   907 
       
   908 !UILayoutTool::AlignmentOrigin methodsFor:'accessing'!
       
   909 
       
   910 fetch:aView
       
   911     "fetch alignmentOrigin
       
   912     "
       
   913     |layout type|
       
   914 
       
   915     type   := UIPainterView layoutType:aView.
       
   916     layout := aView geometryLayout.
       
   917 
       
   918     layout isLayout ifTrue:[
       
   919         (self aspectFor:#leftOffset)   value:(layout leftOffset).
       
   920         (self aspectFor:#leftFraction) value:(layout leftFraction).
       
   921         (self aspectFor:#topOffset)    value:(layout topOffset).
       
   922         (self aspectFor:#topFraction)  value:(layout topFraction).
       
   923 
       
   924         type == #AlignmentOrigin ifTrue:[
       
   925             (self aspectFor:#leftAlignmentFraction) value:(layout leftAlignmentFraction).
       
   926             (self aspectFor:#topAlignmentFraction)  value:(layout topAlignmentFraction).
       
   927           ^ self
       
   928         ]
       
   929     ] ifFalse:[
       
   930         layout := aView computeOrigin.
       
   931 
       
   932         (self aspectFor:#leftOffset)   value:(layout x).
       
   933         (self aspectFor:#leftFraction) value:0.
       
   934         (self aspectFor:#topOffset)    value:(layout y).
       
   935         (self aspectFor:#topFraction)  value:0.
       
   936     ].
       
   937     (self aspectFor:#leftAlignmentFraction) value:0.
       
   938     (self aspectFor:#topAlignmentFraction)  value:0.
       
   939 
       
   940 
       
   941 !
       
   942 
       
   943 layout
       
   944     "returns current layout as alignmentOrigin
       
   945     "
       
   946     |layout|
       
   947 
       
   948     layout  := Smalltalk::AlignmentOrigin new.
       
   949 
       
   950     layout   leftOffset:((self aspectFor:#leftOffset)   value) ? 0.
       
   951     layout    topOffset:((self aspectFor:#topOffset)    value) ? 0.
       
   952     layout leftFraction:((self aspectFor:#leftFraction) value) ? 0.
       
   953     layout  topFraction:((self aspectFor:#topFraction)  value) ? 0.
       
   954 
       
   955     layout leftAlignmentFraction:((self aspectFor:#leftAlignmentFraction) value) ? 0.
       
   956     layout  topAlignmentFraction:((self aspectFor:#topAlignmentFraction)  value) ? 0.
       
   957 
       
   958   ^ layout
       
   959 ! !
       
   960 
       
   961 !UILayoutTool::AlignmentOrigin methodsFor:'alignment'!
       
   962 
       
   963 alignBottomCenter
       
   964     self makeAlignLeft:0.5 top:1
       
   965 
       
   966 
       
   967 !
       
   968 
       
   969 alignBottomLeft
       
   970     self makeAlignLeft:0 top:1
       
   971 
       
   972 
       
   973 !
       
   974 
       
   975 alignBottomRight
       
   976     self makeAlignLeft:1 top:1
       
   977 
       
   978 
       
   979 !
       
   980 
       
   981 alignCenter
       
   982     self makeAlignLeft:0.5 top:0.5
       
   983 
       
   984 
       
   985 !
       
   986 
       
   987 alignLeftCenter
       
   988     self makeAlignLeft:0 top:0.5
       
   989 
       
   990 
       
   991 !
       
   992 
       
   993 alignRightCenter
       
   994     self makeAlignLeft:1 top:0.5
       
   995 
       
   996 
       
   997 !
       
   998 
       
   999 alignTopCenter
       
  1000     self makeAlignLeft:0.5 top:0
       
  1001 
       
  1002 
       
  1003 !
       
  1004 
       
  1005 alignTopLeft
       
  1006     self makeAlignLeft:0 top:0
       
  1007 
       
  1008 
       
  1009 !
       
  1010 
       
  1011 alignTopRight
       
  1012     self makeAlignLeft:1 top:0
       
  1013 
       
  1014 
       
  1015 !
       
  1016 
       
  1017 makeAlignLeft:leftAlignmentFraction top:topAlignmentFraction
       
  1018     |lAF tAF lO tO ext|
       
  1019 
       
  1020     lAF     := (self aspectFor:#leftAlignmentFraction) value ? 0.
       
  1021     tAF     := (self aspectFor:#topAlignmentFraction)  value ? 0.
       
  1022     ext     := (self aspectFor:#layoutView) computeExtent.
       
  1023 
       
  1024     (self aspectFor:#leftAlignmentFraction) value:leftAlignmentFraction.
       
  1025     (self aspectFor:#topAlignmentFraction)  value:topAlignmentFraction.
       
  1026 
       
  1027     lO := (self aspectFor:#leftOffset) value ? 0.
       
  1028     tO := (self aspectFor:#topOffset)  value ? 0.
       
  1029 
       
  1030     lO := lO + (ext x * (leftAlignmentFraction - lAF)).
       
  1031     tO := tO + (ext y * (topAlignmentFraction  - tAF)).
       
  1032 
       
  1033     (self aspectFor:#leftOffset) value:(lO rounded).
       
  1034     (self aspectFor:#topOffset)  value:(tO rounded).
       
  1035 
       
  1036 !
       
  1037 
       
  1038 makeAlignTopRight
       
  1039     self makeAlignLeft:1 top:0
       
  1040 
       
  1041 
       
  1042 ! !
       
  1043 
       
  1044 !UILayoutTool::Extent class methodsFor:'help specs'!
       
  1045 
       
  1046 helpSpec
       
  1047     "return a dictionary filled with helpKey -> helptext associations.
       
  1048      These are used by the activeHelp tool."
       
  1049 
       
  1050     "
       
  1051     UIHelpTool openOnClass:UILayoutTool::Extent    
       
  1052     "
       
  1053 
       
  1054   ^ super helpSpec addPairsFrom:#(
       
  1055 
       
  1056 #vrtExtent
       
  1057 'vertical extent of the component'
       
  1058 
       
  1059 #hrzExtent
       
  1060 'horizontal extent of the component'
       
  1061 
       
  1062 )
       
  1063 ! !
       
  1064 
       
  1065 !UILayoutTool::Extent class methodsFor:'interface specs'!
       
  1066 
       
  1067 windowSpec
       
  1068     "this window spec was automatically generated by the ST/X UIPainter"
       
  1069 
       
  1070     "do not manually edit this - the painter/builder may not be able to
       
  1071      handle the specification if its corrupted."
       
  1072 
       
  1073     "
       
  1074      UIPainter new openOnClass:UILayoutTool::Extent andSelector:#windowSpec
       
  1075      UILayoutTool::Extent new openInterface:#windowSpec
       
  1076     "
       
  1077     "UILayoutTool::Extent open"
       
  1078 
       
  1079     <resource: #canvas>
       
  1080 
       
  1081     ^
       
  1082      
       
  1083        #(#FullSpec
       
  1084           #'window:' 
       
  1085            #(#WindowSpec
       
  1086               #'name:' 'uIPainterView'
       
  1087               #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
       
  1088               #'label:' 'unnamed'
       
  1089               #'bounds:' #(#Rectangle 0 0 226 86)
       
  1090           )
       
  1091           #'component:' 
       
  1092            #(#SpecCollection
       
  1093               #'collection:' 
       
  1094                #(
       
  1095                  #(#LabelSpec
       
  1096                     #'name:' 'labelHorizontal'
       
  1097                     #'layout:' #(#AlignmentOrigin 84 0 36 0 1 0.5)
       
  1098                     #'label:' 'horizontal:'
       
  1099                     #'adjust:' #right
       
  1100                 )
       
  1101                  #(#InputFieldSpec
       
  1102                     #'name:' 'fieldLeftOffset'
       
  1103                     #'layout:' #(#LayoutFrame 85 0 25 0 178 0 43 0)
       
  1104                     #'activeHelpKey:' #hrzExtent
       
  1105                     #'tabable:' true
       
  1106                     #'model:' #leftOffset
       
  1107                     #'type:' #numberOrNil
       
  1108                 )
       
  1109                  #(#LabelSpec
       
  1110                     #'name:' 'labelVertical'
       
  1111                     #'layout:' #(#AlignmentOrigin 84 0 63 0 1 0.5)
       
  1112                     #'label:' 'vertical:'
       
  1113                     #'adjust:' #right
       
  1114                 )
       
  1115                  #(#InputFieldSpec
       
  1116                     #'name:' 'fieldRightOffset'
       
  1117                     #'layout:' #(#LayoutFrame 85 0 52 0 178 0 70 0)
       
  1118                     #'activeHelpKey:' #vrtExtent
       
  1119                     #'tabable:' true
       
  1120                     #'model:' #rightOffset
       
  1121                     #'type:' #numberOrNil
       
  1122                 )
       
  1123               )
       
  1124           )
       
  1125       )
       
  1126 
       
  1127     "Modified: 28.7.1997 / 16:43:21 / cg"
       
  1128 ! !
       
  1129 
       
  1130 !UILayoutTool::Extent methodsFor:'accessing'!
       
  1131 
       
  1132 fetch:aView
       
  1133     "fetch extent
       
  1134     "
       
  1135     |extent|
       
  1136 
       
  1137     extent  := aView computeExtent.
       
  1138 
       
  1139     (self aspectFor:#leftOffset)  value:(extent x).
       
  1140     (self aspectFor:#rightOffset) value:(extent y).
       
  1141 
       
  1142 
       
  1143 !
       
  1144 
       
  1145 layout
       
  1146     "returns current extent
       
  1147     "
       
  1148   ^ Smalltalk::Point x:(((self aspectFor:#leftOffset)   value) ? 0)
       
  1149                      y:(((self aspectFor:#rightOffset)  value) ? 0)
       
  1150 
       
  1151 ! !
       
  1152 
       
  1153 !UILayoutTool::LayoutFrame class methodsFor:'help specs'!
       
  1154 
       
  1155 helpSpec
       
  1156     "return a dictionary filled with helpKey -> helptext associations.
       
  1157      These are used by the activeHelp tool."
       
  1158 
       
  1159     "
       
  1160     UIHelpTool openOnClass:UILayoutTool::LayoutFrame    
       
  1161     "
       
  1162 
       
  1163   ^ super helpSpec addPairsFrom:#(
       
  1164 
       
  1165 #makeRightRelative
       
  1166 'compute current relative corner x and offset of the right edge to a relative corner x'
       
  1167 
       
  1168 #makeBottomAbsolute
       
  1169 'compute current bottom offset and relative corner y to an absolute corner y'
       
  1170 
       
  1171 #bottomAbsolute
       
  1172 'offset of the bottom edge; positive is to the bottom, negative to the top'
       
  1173 
       
  1174 #rightRelative
       
  1175 'relative corner x'
       
  1176 
       
  1177 #makeBottomRelative
       
  1178 'compute current relative corner y and offset of the bottom edge to a relative corner y'
       
  1179 
       
  1180 #makeRightAbsolute
       
  1181 'compute current right offset and relative corner x to an absolute corner x'
       
  1182 
       
  1183 #bottomRelative
       
  1184 'relative corner y'
       
  1185 
       
  1186 #rightAbsolute
       
  1187 'offset of the right edge; positive is to the right, negative to the left'
       
  1188 
       
  1189 )
       
  1190 ! !
       
  1191 
       
  1192 !UILayoutTool::LayoutFrame class methodsFor:'interface specs'!
       
  1193 
       
  1194 windowSpec
       
  1195     "this window spec was automatically generated by the ST/X UIPainter"
       
  1196 
       
  1197     "do not manually edit this - the painter/builder may not be able to
       
  1198      handle the specification if its corrupted."
       
  1199 
       
  1200     "
       
  1201      UIPainter new openOnClass:UILayoutTool::LayoutFrame andSelector:#windowSpec
       
  1202      UILayoutTool::LayoutFrame new openInterface:#windowSpec
       
  1203     "
       
  1204     "UILayoutTool::LayoutFrame open"
       
  1205 
       
  1206     <resource: #canvas>
       
  1207 
       
  1208     ^
       
  1209      
       
  1210        #(#FullSpec
       
  1211           #'window:' 
       
  1212            #(#WindowSpec
       
  1213               #'name:' 'uIPainterView'
       
  1214               #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
       
  1215               #'label:' 'unnamed'
       
  1216               #'bounds:' #(#Rectangle 0 0 250 193)
       
  1217           )
       
  1218           #'component:' 
       
  1219            #(#SpecCollection
       
  1220               #'collection:' 
       
  1221                #(
       
  1222                  #(#UISubSpecification
       
  1223                     #'name:' 'subLayoutSpec'
       
  1224                     #'layout:' #(#LayoutOrigin 0 0 0 0)
       
  1225                     #'majorKey:' #UILayoutTool
       
  1226                     #'minorKey:' #layoutOriginSpec
       
  1227                 )
       
  1228                  #(#LabelSpec
       
  1229                     #'name:' 'labelRight'
       
  1230                     #'layout:' #(#AlignmentOrigin 52 0 98 0 1 0)
       
  1231                     #'label:' 'right'
       
  1232                 )
       
  1233                  #(#InputFieldSpec
       
  1234                     #'name:' 'fieldRightFraction'
       
  1235                     #'layout:' #(#LayoutFrame 57 0 98 0 114 0 120 0)
       
  1236                     #'activeHelpKey:' #rightRelative
       
  1237                     #'model:' #rightFraction
       
  1238                     #'type:' #numberOrNil
       
  1239                 )
       
  1240                  #(#ActionButtonSpec
       
  1241                     #'name:' 'actionRelativeRight'
       
  1242                     #'layout:' #(#LayoutFrame 119 0 98 0 138 0 116 0)
       
  1243                     #'activeHelpKey:' #makeRightRelative
       
  1244                     #'model:' #relativeRight
       
  1245                 )
       
  1246                  #(#InputFieldSpec
       
  1247                     #'name:' 'fieldRightOffset'
       
  1248                     #'layout:' #(#LayoutFrame 154 0 98 0 212 0 120 0)
       
  1249                     #'activeHelpKey:' #rightAbsolute
       
  1250                     #'model:' #rightOffset
       
  1251                     #'type:' #numberOrNil
       
  1252                 )
       
  1253                  #(#ActionButtonSpec
       
  1254                     #'name:' 'actionAbsoluteRight'
       
  1255                     #'layout:' #(#LayoutFrame 216 0 98 0 235 0 116 0)
       
  1256                     #'activeHelpKey:' #makeRightAbsolute
       
  1257                     #'model:' #absoluteRight
       
  1258                 )
       
  1259                  #(#LabelSpec
       
  1260                     #'name:' 'labelBottom'
       
  1261                     #'layout:' #(#AlignmentOrigin 52 0 126 0 1 0)
       
  1262                     #'label:' 'bott'
       
  1263                 )
       
  1264                  #(#InputFieldSpec
       
  1265                     #'name:' 'fieldBottomFraction'
       
  1266                     #'layout:' #(#LayoutFrame 57 0 126 0 114 0 148 0)
       
  1267                     #'activeHelpKey:' #bottomRelative
       
  1268                     #'model:' #bottomFraction
       
  1269                     #'type:' #numberOrNil
       
  1270                 )
       
  1271                  #(#ActionButtonSpec
       
  1272                     #'name:' 'actionRelativeBottom'
       
  1273                     #'layout:' #(#LayoutFrame 119 0 126 0 138 0 144 0)
       
  1274                     #'activeHelpKey:' #makeBottomRelative
       
  1275                     #'model:' #relativeBottom
       
  1276                 )
       
  1277                  #(#InputFieldSpec
       
  1278                     #'name:' 'fieldBottomOffset'
       
  1279                     #'layout:' #(#LayoutFrame 154 0 126 0 211 0 148 0)
       
  1280                     #'activeHelpKey:' #bottomAbsolute
       
  1281                     #'model:' #bottomOffset
       
  1282                     #'type:' #numberOrNil
       
  1283                 )
       
  1284                  #(#ActionButtonSpec
       
  1285                     #'name:' 'actionAbsoluteBottom'
       
  1286                     #'layout:' #(#LayoutFrame 216 0 126 0 235 0 144 0)
       
  1287                     #'activeHelpKey:' #makeBottomAbsolute
       
  1288                     #'model:' #absoluteBottom
       
  1289                 )
       
  1290               )
       
  1291           )
       
  1292       )
       
  1293 
       
  1294     "Modified: 28.7.1997 / 14:13:44 / cg"
       
  1295 ! !
       
  1296 
       
  1297 !UILayoutTool::LayoutFrame methodsFor:'accessing'!
       
  1298 
       
  1299 fetch:aView
       
  1300     |layout|
       
  1301 
       
  1302     layout  := UIPainterView asLayoutFrameFromView:aView.
       
  1303 
       
  1304     (self aspectFor:#leftOffset)     value:(layout leftOffset).
       
  1305     (self aspectFor:#leftFraction)   value:(layout leftFraction).
       
  1306     (self aspectFor:#topOffset)      value:(layout topOffset).
       
  1307     (self aspectFor:#topFraction)    value:(layout topFraction).
       
  1308     (self aspectFor:#rightOffset)    value:(layout rightOffset).
       
  1309     (self aspectFor:#bottomOffset)   value:(layout bottomOffset).
       
  1310     (self aspectFor:#rightFraction)  value:(layout rightFraction).
       
  1311     (self aspectFor:#bottomFraction) value:(layout bottomFraction).
       
  1312 
       
  1313 !
       
  1314 
       
  1315 layout
       
  1316     "returns current layout as layoutFrame
       
  1317     "
       
  1318     |layout|
       
  1319 
       
  1320     layout  := Smalltalk::LayoutFrame new.
       
  1321 
       
  1322     layout     leftOffset:((self aspectFor:#leftOffset)     value) ? 0.
       
  1323     layout    rightOffset:((self aspectFor:#rightOffset)    value) ? 0.
       
  1324     layout      topOffset:((self aspectFor:#topOffset)      value) ? 0.
       
  1325     layout   bottomOffset:((self aspectFor:#bottomOffset)   value) ? 0.
       
  1326     layout   leftFraction:((self aspectFor:#leftFraction)   value) ? 0.
       
  1327     layout  rightFraction:((self aspectFor:#rightFraction)  value) ? 0.
       
  1328     layout    topFraction:((self aspectFor:#topFraction)    value) ? 0.
       
  1329     layout bottomFraction:((self aspectFor:#bottomFraction) value) ? 0.
       
  1330 
       
  1331   ^ layout
       
  1332 
       
  1333 ! !
       
  1334 
       
  1335 !UILayoutTool::LayoutOrigin class methodsFor:'interface specs'!
       
  1336 
       
  1337 windowSpec
       
  1338     "this window spec was automatically generated by the ST/X UIPainter"
       
  1339 
       
  1340     "do not manually edit this - the painter/builder may not be able to
       
  1341      handle the specification if its corrupted."
       
  1342 
       
  1343     "
       
  1344      UIPainter new openOnClass:UILayoutTool::LayoutOrigin andSelector:#windowSpec
       
  1345      UILayoutTool::LayoutOrigin new openInterface:#windowSpec
       
  1346     "
       
  1347     "UILayoutTool::LayoutOrigin open"
       
  1348 
       
  1349     <resource: #canvas>
       
  1350 
       
  1351     ^
       
  1352      
       
  1353        #(#FullSpec
       
  1354           #'window:' 
       
  1355            #(#WindowSpec
       
  1356               #'name:' 'uIPainterView'
       
  1357               #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
       
  1358               #'label:' 'unnamed'
       
  1359               #'bounds:' #(#Rectangle 0 0 258 93)
       
  1360           )
       
  1361           #'component:' 
       
  1362            #(#SpecCollection
       
  1363               #'collection:' 
       
  1364                #(
       
  1365                  #(#UISubSpecification
       
  1366                     #'name:' 'subSpecification'
       
  1367                     #'layout:' #(#LayoutOrigin 0 0 0 0)
       
  1368                     #'majorKey:' #UILayoutTool
       
  1369                     #'minorKey:' #layoutOriginSpec
       
  1370                 )
       
  1371               )
  1376               )
  1372           )
  1377           )
  1373       )
  1378       )
  1374 ! !
  1379 ! !
  1375 
  1380 
  1487     <resource: #canvas>
  1492     <resource: #canvas>
  1488 
  1493 
  1489     ^
  1494     ^
  1490      
  1495      
  1491        #(#FullSpec
  1496        #(#FullSpec
  1492           #'window:' 
  1497           #window: 
  1493            #(#WindowSpec
  1498            #(#WindowSpec
  1494               #'name:' 'uIPainterView'
  1499               #name: 'uIPainterView'
  1495               #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
  1500               #layout: #(#LayoutFrame 31 0 423 0 254 0 568 0)
  1496               #'label:' 'unnamed'
  1501               #label: 'unnamed'
  1497               #'bounds:' #(#Rectangle 0 0 224 146)
  1502               #min: #(#Point 10 10)
  1498           )
  1503               #max: #(#Point 1152 900)
  1499           #'component:' 
  1504               #bounds: #(#Rectangle 31 423 255 569)
       
  1505               #usePreferredExtent: false
       
  1506           )
       
  1507           #component: 
  1500            #(#SpecCollection
  1508            #(#SpecCollection
  1501               #'collection:' 
  1509               #collection: 
  1502                #(
  1510                #(
  1503                  #(#UISubSpecification
  1511                  #(#UISubSpecification
  1504                     #'name:' 'subSpecification'
  1512                     #name: 'subSpecification'
  1505                     #'layout:' #(#LayoutOrigin 0 0 0 0)
  1513                     #layout: #(#LayoutOrigin 0 0 0 0)
  1506                     #'majorKey:' #UILayoutTool
  1514                     #majorKey: #UILayoutTool
  1507                     #'minorKey:' #layoutPointSpec
  1515                     #minorKey: #layoutPointSpec
  1508                 )
  1516                 )
  1509                  #(#LabelSpec
  1517                  #(#LabelSpec
  1510                     #'name:' 'labelCornerX'
  1518                     #name: 'labelCornerX'
  1511                     #'layout:' #(#AlignmentOrigin 75 0 74 0 1 0)
  1519                     #layout: #(#AlignmentOrigin 78 0 77 0 1 0)
  1512                     #'label:' 'corner x:'
  1520                     #label: 'Corner x:'
  1513                     #'adjust:' #left
  1521                     #adjust: #left
  1514                 )
  1522                 )
  1515                  #(#InputFieldSpec
  1523                  #(#InputFieldSpec
  1516                     #'name:' 'fieldCornerX'
  1524                     #name: 'fieldCornerX'
  1517                     #'layout:' #(#LayoutFrame 77 0 74 0 170 0 96 0)
  1525                     #layout: #(#LayoutFrame 80 0 74 0 173 0 96 0)
  1518                     #'activeHelpKey:' #cornerX
  1526                     #activeHelpKey: #cornerX
  1519                     #'tabable:' true
  1527                     #tabable: true
  1520                     #'model:' #rightOffset
  1528                     #model: #rightOffset
  1521                     #'type:' #numberOrNil
  1529                     #type: #numberOrNil
  1522                 )
  1530                 )
  1523                  #(#LabelSpec
  1531                  #(#LabelSpec
  1524                     #'name:' 'labelCornerY'
  1532                     #name: 'labelCornerY'
  1525                     #'layout:' #(#AlignmentOrigin 75 0 101 0 1 0)
  1533                     #layout: #(#AlignmentOrigin 78 0 104 0 1 0)
  1526                     #'label:' 'corner y:'
  1534                     #label: 'Corner y:'
  1527                     #'adjust:' #left
  1535                     #adjust: #left
  1528                 )
  1536                 )
  1529                  #(#InputFieldSpec
  1537                  #(#InputFieldSpec
  1530                     #'name:' 'fieldCornerY'
  1538                     #name: 'fieldCornerY'
  1531                     #'layout:' #(#LayoutFrame 77 0 101 0 170 0 123 0)
  1539                     #layout: #(#LayoutFrame 80 0 101 0 173 0 123 0)
  1532                     #'activeHelpKey:' #cornerY
  1540                     #activeHelpKey: #cornerY
  1533                     #'tabable:' true
  1541                     #tabable: true
  1534                     #'model:' #bottomOffset
  1542                     #model: #bottomOffset
  1535                     #'type:' #numberOrNil
  1543                     #type: #numberOrNil
  1536                 )
  1544                 )
  1537               )
  1545               )
  1538           )
  1546           )
  1539       )
  1547       )
  1540 
       
  1541     "Modified: 28.7.1997 / 14:12:46 / cg"
       
  1542 ! !
  1548 ! !
  1543 
  1549 
  1544 !UILayoutTool::Rectangle methodsFor:'accessing'!
  1550 !UILayoutTool::Rectangle methodsFor:'accessing'!
  1545 
  1551 
  1546 fetch:aView
  1552 fetch:aView