UILayoutTool.st
author Claus Gittinger <cg@exept.de>
Mon, 28 Jul 1997 10:34:25 +0200
changeset 243 ae6608b760bf
parent 235 4e6c0d0c6ba5
child 252 c7ee94ff51c1
permissions -rw-r--r--
nicer images
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
     1
"
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
     2
 COPYRIGHT (c) 1995 by eXept Software AG
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
     3
              All Rights Reserved
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
     4
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
     5
 This software is furnished under a license and may be used
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    10
 hereby transferred.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    11
"
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    12
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    13
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    14
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    15
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    16
ApplicationModel subclass:#UILayoutTool
221
319a24a1df06 slow grow operation on array removed
ca
parents: 201
diff changeset
    17
	instanceVariableNames:'modifiedHolder aspects selection layoutView tabList'
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    18
	classVariableNames:''
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    19
	poolDictionaries:''
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    20
	category:'Interface-UIPainter'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    21
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    22
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
    23
ApplicationModel subclass:#AlignmentOrigin
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    24
	instanceVariableNames:''
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    25
	classVariableNames:''
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    26
	poolDictionaries:''
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    27
	privateIn:UILayoutTool
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    28
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    29
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
    30
ApplicationModel subclass:#Extent
700f2ee9911e add help for components
ca
parents: 163
diff changeset
    31
	instanceVariableNames:''
700f2ee9911e add help for components
ca
parents: 163
diff changeset
    32
	classVariableNames:''
700f2ee9911e add help for components
ca
parents: 163
diff changeset
    33
	poolDictionaries:''
700f2ee9911e add help for components
ca
parents: 163
diff changeset
    34
	privateIn:UILayoutTool
700f2ee9911e add help for components
ca
parents: 163
diff changeset
    35
!
700f2ee9911e add help for components
ca
parents: 163
diff changeset
    36
700f2ee9911e add help for components
ca
parents: 163
diff changeset
    37
ApplicationModel subclass:#LayoutFrame
700f2ee9911e add help for components
ca
parents: 163
diff changeset
    38
	instanceVariableNames:''
700f2ee9911e add help for components
ca
parents: 163
diff changeset
    39
	classVariableNames:''
700f2ee9911e add help for components
ca
parents: 163
diff changeset
    40
	poolDictionaries:''
700f2ee9911e add help for components
ca
parents: 163
diff changeset
    41
	privateIn:UILayoutTool
700f2ee9911e add help for components
ca
parents: 163
diff changeset
    42
!
700f2ee9911e add help for components
ca
parents: 163
diff changeset
    43
700f2ee9911e add help for components
ca
parents: 163
diff changeset
    44
ApplicationModel subclass:#LayoutOrigin
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    45
	instanceVariableNames:''
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    46
	classVariableNames:''
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    47
	poolDictionaries:''
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    48
	privateIn:UILayoutTool
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    49
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    50
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    51
ApplicationModel subclass:#Point
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    52
	instanceVariableNames:''
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    53
	classVariableNames:''
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    54
	poolDictionaries:''
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    55
	privateIn:UILayoutTool
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    56
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    57
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
    58
ApplicationModel subclass:#Rectangle
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    59
	instanceVariableNames:''
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    60
	classVariableNames:''
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    61
	poolDictionaries:''
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    62
	privateIn:UILayoutTool
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    63
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    64
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    65
!UILayoutTool class methodsFor:'documentation'!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    66
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    67
copyright
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    68
"
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    69
 COPYRIGHT (c) 1995 by eXept Software AG
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    70
              All Rights Reserved
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    71
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    72
 This software is furnished under a license and may be used
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    73
 only in accordance with the terms of that license and with the
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    74
 inclusion of the above copyright notice.   This software may not
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    75
 be provided or otherwise made available to, or used by, any
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    76
 other person.  No title to or ownership of the software is
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    77
 hereby transferred.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    78
"
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    79
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    80
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    81
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    82
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    83
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    84
documentation
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    85
"
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    86
    used by the UIPainter to manipulate the layout of the selected component
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    87
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    88
    [author:]
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    89
        Claus Atzkern
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    90
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    91
    [see also:]
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    92
        UIPainter
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    93
        UIHelpTool
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    94
        UISpecificationTool
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    95
"
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    96
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    97
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    98
! !
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
    99
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   100
!UILayoutTool class methodsFor:'constants'!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   101
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   102
label
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   103
    ^ 'Layout'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   104
! !
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   105
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   106
!UILayoutTool class methodsFor:'help specs'!
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   107
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   108
helpSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   109
    "return a dictionary filled with helpKey -> helptext associations.
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   110
     These are used by the activeHelp tool.
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   111
    "
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   112
  ^ super helpSpec addPairsFrom:#(
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   113
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   114
#leftAbsolute
185
10b797de4c2d update help text
ca
parents: 184
diff changeset
   115
'offset of the left edge; positive
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   116
is to the right, negative to the left'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   117
201
b10f071028cb *** empty log message ***
ca
parents: 186
diff changeset
   118
#originY
b10f071028cb *** empty log message ***
ca
parents: 186
diff changeset
   119
'absolute origin y'
b10f071028cb *** empty log message ***
ca
parents: 186
diff changeset
   120
b10f071028cb *** empty log message ***
ca
parents: 186
diff changeset
   121
#cornerY
b10f071028cb *** empty log message ***
ca
parents: 186
diff changeset
   122
'absolute corner y'
b10f071028cb *** empty log message ***
ca
parents: 186
diff changeset
   123
b10f071028cb *** empty log message ***
ca
parents: 186
diff changeset
   124
#makeLeftAbsolute
b10f071028cb *** empty log message ***
ca
parents: 186
diff changeset
   125
'compute current left offset and relative
b10f071028cb *** empty log message ***
ca
parents: 186
diff changeset
   126
origin x to an absolute origin x'
b10f071028cb *** empty log message ***
ca
parents: 186
diff changeset
   127
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   128
#topAbsolute
185
10b797de4c2d update help text
ca
parents: 184
diff changeset
   129
'offset of the top edge; positive
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   130
is to the bottom, negative to the top'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   131
201
b10f071028cb *** empty log message ***
ca
parents: 186
diff changeset
   132
#makeTopRelative
b10f071028cb *** empty log message ***
ca
parents: 186
diff changeset
   133
'compute current relative origin y and offset
b10f071028cb *** empty log message ***
ca
parents: 186
diff changeset
   134
of the top edge to a relative origin y'
b10f071028cb *** empty log message ***
ca
parents: 186
diff changeset
   135
b10f071028cb *** empty log message ***
ca
parents: 186
diff changeset
   136
#leftRelative
b10f071028cb *** empty log message ***
ca
parents: 186
diff changeset
   137
'relative origin x'
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   138
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   139
#makeLeftRelative
185
10b797de4c2d update help text
ca
parents: 184
diff changeset
   140
'compute current relative origin x and offset
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   141
of the left edge to a relative origin x'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   142
201
b10f071028cb *** empty log message ***
ca
parents: 186
diff changeset
   143
#topRelative
b10f071028cb *** empty log message ***
ca
parents: 186
diff changeset
   144
'relative origin y'
b10f071028cb *** empty log message ***
ca
parents: 186
diff changeset
   145
b10f071028cb *** empty log message ***
ca
parents: 186
diff changeset
   146
#originX
b10f071028cb *** empty log message ***
ca
parents: 186
diff changeset
   147
'absolute origin x'
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   148
201
b10f071028cb *** empty log message ***
ca
parents: 186
diff changeset
   149
#cornerX
b10f071028cb *** empty log message ***
ca
parents: 186
diff changeset
   150
'absolute corner x'
b10f071028cb *** empty log message ***
ca
parents: 186
diff changeset
   151
b10f071028cb *** empty log message ***
ca
parents: 186
diff changeset
   152
#layoutTool
b10f071028cb *** empty log message ***
ca
parents: 186
diff changeset
   153
'tool to set the layout of the component'
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   154
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   155
#makeTopAbsolute
185
10b797de4c2d update help text
ca
parents: 184
diff changeset
   156
'compute current top offset and relative
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   157
origin y to an absolute origin y'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   158
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   159
)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   160
! !
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   161
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   162
!UILayoutTool class methodsFor:'interface specs'!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   163
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   164
layoutOriginSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   165
    "this window spec was automatically generated by the ST/X UIPainter"
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   166
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   167
    "do not manually edit this - the painter/builder may not be able to
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   168
     handle the specification if its corrupted."
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   169
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   170
    "
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   171
     UIPainter new openOnClass:self andSelector:#layoutOriginSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   172
     self new openInterface:#layoutOriginSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   173
    "
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   174
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   175
    <resource: #canvas>
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   176
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   177
    ^
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   178
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   179
       #(#FullSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   180
          #'window:' 
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   181
           #(#WindowSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   182
              #'name:' 'uIPainterView'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   183
              #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   184
              #'label:' 'unnamed'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   185
              #'bounds:' #(#Rectangle 0 0 258 93)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   186
          )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   187
          #'component:' 
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   188
           #(#SpecCollection
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   189
              #'collection:' 
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   190
               #(
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   191
                 #(#LabelSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   192
                    #'name:' 'labelRelative'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   193
                    #'layout:' #(#Point 57 12)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   194
                    #'label:' 'relative'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   195
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   196
                 #(#LabelSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   197
                    #'name:' 'labelAbsolute'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   198
                    #'layout:' #(#Point 154 13)
185
10b797de4c2d update help text
ca
parents: 184
diff changeset
   199
                    #'label:' 'offset'
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   200
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   201
                 #(#LabelSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   202
                    #'name:' 'labelLeft'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   203
                    #'layout:' #(#AlignmentOrigin 52 0 44 0 1 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   204
                    #'label:' 'left'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   205
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   206
                 #(#InputFieldSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   207
                    #'name:' 'fieldLeftFraction'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   208
                    #'layout:' #(#LayoutFrame 57 0 44 0 114 0 62 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   209
                    #'activeHelpKey:' #leftRelative
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   210
                    #'tabable:' true
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   211
                    #'model:' #leftFraction
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   212
                    #'type:' #numberOrNil
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   213
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   214
                 #(#ActionButtonSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   215
                    #'name:' 'actionRelativeLeft'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   216
                    #'layout:' #(#LayoutFrame 119 0 44 0 138 0 62 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   217
                    #'activeHelpKey:' #makeLeftRelative
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   218
                    #'model:' #relativeLeft
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   219
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   220
                 #(#InputFieldSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   221
                    #'name:' 'fieldLeftOffset'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   222
                    #'layout:' #(#LayoutFrame 154 0 44 0 212 0 62 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   223
                    #'activeHelpKey:' #leftAbsolute
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   224
                    #'tabable:' true
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   225
                    #'model:' #leftOffset
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   226
                    #'type:' #numberOrNil
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   227
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   228
                 #(#ActionButtonSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   229
                    #'name:' 'actionAbsoluteLeft'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   230
                    #'layout:' #(#LayoutFrame 216 0 44 0 235 0 62 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   231
                    #'activeHelpKey:' #makeLeftAbsolute
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   232
                    #'model:' #absoluteLeft
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   233
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   234
                 #(#LabelSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   235
                    #'name:' 'labelTop'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   236
                    #'layout:' #(#AlignmentOrigin 52 0 71 0 1 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   237
                    #'label:' 'top'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   238
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   239
                 #(#InputFieldSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   240
                    #'name:' 'fieldTopFraction'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   241
                    #'layout:' #(#LayoutFrame 57 0 71 0 114 0 89 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   242
                    #'activeHelpKey:' #topRelative
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   243
                    #'tabable:' true
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   244
                    #'model:' #topFraction
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   245
                    #'type:' #numberOrNil
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   246
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   247
                 #(#ActionButtonSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   248
                    #'name:' 'actionRelativeTop'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   249
                    #'layout:' #(#LayoutFrame 119 0 71 0 138 0 89 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   250
                    #'activeHelpKey:' #makeTopRelative
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   251
                    #'model:' #relativeTop
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   252
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   253
                 #(#InputFieldSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   254
                    #'name:' 'fieldTopOffset'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   255
                    #'layout:' #(#LayoutFrame 154 0 71 0 212 0 89 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   256
                    #'activeHelpKey:' #topAbsolute
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   257
                    #'tabable:' true
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   258
                    #'model:' #topOffset
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   259
                    #'type:' #numberOrNil
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   260
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   261
                 #(#ActionButtonSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   262
                    #'name:' 'actionAbsoluteTop'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   263
                    #'layout:' #(#LayoutFrame 216 0 71 0 235 0 89 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   264
                    #'activeHelpKey:' #makeTopAbsolute
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   265
                    #'model:' #absoluteTop
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   266
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   267
              )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   268
          )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   269
      )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   270
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   271
!
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   272
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   273
layoutPointSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   274
    "this window spec was automatically generated by the ST/X UIPainter"
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   275
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   276
    "do not manually edit this - the painter/builder may not be able to
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   277
     handle the specification if its corrupted."
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   278
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   279
    "
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   280
     UIPainter new openOnClass:self andSelector:#layoutPointSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   281
     self new openInterface:#layoutPointSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   282
    "
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   283
    <resource: #canvas>
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   284
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   285
    ^
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   286
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   287
       #(#FullSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   288
          #'window:' 
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   289
           #(#WindowSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   290
              #'name:' 'uIPainterView'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   291
              #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   292
              #'label:' 'unnamed'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   293
              #'bounds:' #(#Rectangle 0 0 194 66)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   294
          )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   295
          #'component:' 
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   296
           #(#SpecCollection
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   297
              #'collection:' 
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   298
               #(
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   299
                 #(#LabelSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   300
                    #'name:' 'labelOriginX'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   301
                    #'layout:' #(#AlignmentOrigin 75 0 19 0 1 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   302
                    #'label:' 'origin x:'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   303
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   304
                 #(#InputFieldSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   305
                    #'name:' 'fieldOriginX'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   306
                    #'layout:' #(#LayoutFrame 77 0 19 0 170 0 37 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   307
                    #'activeHelpKey:' #originX
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   308
                    #'tabable:' true
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   309
                    #'model:' #leftOffset
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   310
                    #'type:' #numberOrNil
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   311
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   312
                 #(#LabelSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   313
                    #'name:' 'labelOriginY'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   314
                    #'layout:' #(#AlignmentOrigin 75 0 46 0 1 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   315
                    #'label:' 'origin y:'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   316
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   317
                 #(#InputFieldSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   318
                    #'name:' 'fieldOriginY'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   319
                    #'layout:' #(#LayoutFrame 77 0 46 0 170 0 64 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   320
                    #'activeHelpKey:' #originY
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   321
                    #'tabable:' true
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   322
                    #'model:' #topOffset
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   323
                    #'type:' #numberOrNil
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   324
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   325
              )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   326
          )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   327
      )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   328
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   329
!
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   330
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   331
slices
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   332
    ^ #(
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   333
        ( 'Frame'          LayoutFrame)
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   334
        ( 'Origin'         LayoutOrigin)
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   335
        ( 'Alig.Origin'    AlignmentOrigin)
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   336
        ( 'Point'          Point)
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   337
        ( 'Rectangle'      Rectangle)
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   338
        ( 'Extent'         Extent)
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   339
       ) 
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   340
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   341
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   342
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   343
windowSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   344
    "this window spec was automatically generated by the ST/X UIPainter"
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   345
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   346
    "do not manually edit this - the painter/builder may not be able to
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   347
     handle the specification if its corrupted."
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   348
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   349
    "
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   350
     UIPainter new openOnClass:UILayoutTool andSelector:#windowSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   351
     UILayoutTool new openInterface:#windowSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   352
    "
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   353
    "UILayoutTool open"
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   354
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   355
    <resource: #canvas>
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   356
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   357
    ^
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   358
     
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   359
       #(#FullSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   360
          #'window:' 
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   361
           #(#WindowSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   362
              #'name:' 'uIPainterView'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   363
              #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   364
              #'label:' 'unnamed canvas'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   365
              #'bounds:' #(#Rectangle 0 0 300 300)
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   366
          )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   367
          #'component:' 
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   368
           #(#SpecCollection
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   369
              #'collection:' 
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   370
               #(
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   371
                 #(#NoteBookViewSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   372
                    #'name:' 'NoteBook'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   373
                    #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   374
                    #'activeHelpKey:' #layoutTool
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   375
                    #'enableChannel:' #enableChannel
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   376
                    #'tabable:' true
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   377
                    #'menu:' #noteBookList
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   378
                    #'style:' 
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   379
                     #(#FontDescription
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   380
                        #helvetica #medium
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   381
                        #roman #'10'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   382
                    )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   383
                    #'model:' #noteBookModel
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   384
                    #'tabWidget:' #Window
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   385
                    #'direction:' #bottom
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   386
                    #'canvas:' #noteBookView
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   387
                )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   388
              )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   389
          )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   390
      )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   391
! !
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   392
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   393
!UILayoutTool methodsFor:'accessing'!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   394
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   395
layout
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   396
    "returns configued layout or nil
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   397
    "
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   398
    |appl|
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   399
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   400
    (appl := self noteBookView application) notNil ifTrue:[
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   401
        ^ appl layout
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   402
    ].
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   403
  ^ nil
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   404
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   405
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   406
layoutType
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   407
    "returns current layout type or nil
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   408
    "
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   409
    |slice|
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   410
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   411
    (slice := self selectedSlice) notNil ifTrue:[
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   412
        ^ slice last
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   413
    ].
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   414
  ^ nil
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   415
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   416
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   417
layoutView
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   418
    "returns current edited view
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   419
    "
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   420
    ^ layoutView
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   421
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   422
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   423
layoutView:aView
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   424
    "change current edited view
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   425
    "
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   426
    |type name list|
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   427
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   428
    layoutView := aView.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   429
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   430
    (type := UIPainterView layoutType:layoutView) notNil ifTrue:[
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   431
        self class slices findFirst:[:e|
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   432
            e last == type ifTrue:[name := e first. true]
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   433
        ].
235
4e6c0d0c6ba5 in case of layout container set extent otherwise all
ca
parents: 221
diff changeset
   434
        list := tabList.
4e6c0d0c6ba5 in case of layout container set extent otherwise all
ca
parents: 221
diff changeset
   435
4e6c0d0c6ba5 in case of layout container set extent otherwise all
ca
parents: 221
diff changeset
   436
        type == #Extent ifTrue:[
4e6c0d0c6ba5 in case of layout container set extent otherwise all
ca
parents: 221
diff changeset
   437
            aView superView specClass isLayoutContainer ifTrue:[
4e6c0d0c6ba5 in case of layout container set extent otherwise all
ca
parents: 221
diff changeset
   438
                list := Array with:name
4e6c0d0c6ba5 in case of layout container set extent otherwise all
ca
parents: 221
diff changeset
   439
            ] ifFalse:[
4e6c0d0c6ba5 in case of layout container set extent otherwise all
ca
parents: 221
diff changeset
   440
                list := list copyWith:name
4e6c0d0c6ba5 in case of layout container set extent otherwise all
ca
parents: 221
diff changeset
   441
            ]
4e6c0d0c6ba5 in case of layout container set extent otherwise all
ca
parents: 221
diff changeset
   442
        ]
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   443
    ].
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   444
    self noteBookList  value:list.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   445
    self noteBookModel value:name.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   446
    self update.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   447
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   448
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   449
modifiedHolder:aValueHolder
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   450
    "set the value holder set to true in case of modifying attributes
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   451
    "
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   452
    modifiedHolder notNil ifTrue:[
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   453
        modifiedHolder removeDependent:self. 
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   454
    ].
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   455
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   456
    (modifiedHolder := aValueHolder) notNil ifTrue:[
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   457
        modifiedHolder addDependent:self.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   458
    ].
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   459
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   460
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   461
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   462
update
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   463
    "update from view
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   464
    "
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   465
    |view appl|
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   466
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   467
    selection notNil ifTrue:[
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   468
        (view := self layoutView) notNil ifTrue:[
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   469
            (appl := self noteBookView application) notNil ifTrue:[
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   470
                appl fetch:view
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   471
            ]
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   472
        ]
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   473
    ].
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   474
        
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   475
! !
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   476
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   477
!UILayoutTool methodsFor:'aspects'!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   478
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   479
aspectFor:aKey
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   480
    "returns aspect for a key or nil
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   481
    "
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   482
  ^ aspects at:aKey ifAbsent:[ super aspectFor:aKey ]
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   483
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   484
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   485
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   486
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   487
noteBookList
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   488
    "returns list of tab labels
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   489
    "
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   490
    |holder|
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   491
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   492
    (holder := builder bindingAt:#noteBookList) isNil ifTrue:[
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   493
        holder := nil asValue.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   494
        builder aspectAt:#noteBookList put:holder
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   495
    ].
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   496
  ^ holder
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   497
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   498
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   499
noteBookModel
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   500
    "automatically generated by UIPainter ..."
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   501
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   502
    |holder|
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   503
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   504
    (holder := builder bindingAt:#noteBookModel) isNil ifTrue:[
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   505
        holder := AspectAdaptor new subject:self; forAspect:#selection.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   506
        builder aspectAt:#noteBookModel put:holder.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   507
    ].
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   508
    ^ holder
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   509
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   510
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   511
noteBookView
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   512
    "automatically generated by UIPainter ...
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   513
    "
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   514
    |holder|
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   515
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   516
    (holder := builder bindingAt:#noteBookView) isNil ifTrue:[
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   517
        holder := SubCanvas new.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   518
        builder aspectAt:#noteBookView put:holder
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   519
    ].
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   520
  ^ holder
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   521
! !
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   522
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   523
!UILayoutTool methodsFor:'change & update'!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   524
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   525
update:something with:aParameter from:changedObject
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   526
    "one of my models changed its value
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   527
    "
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   528
    changedObject ~~ modifiedHolder ifTrue:[
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   529
        modifiedHolder value ~~ true ifTrue:[
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   530
            modifiedHolder isNil ifFalse:[
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   531
                modifiedHolder value:true
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   532
            ]
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   533
        ]
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   534
    ]
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   535
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   536
! !
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   537
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   538
!UILayoutTool methodsFor:'converting absolute'!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   539
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   540
absolute:what xOrY:xOrY
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   541
    |extent fraction offset fractSymb offsetSymb|
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   542
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   543
    extent     := (self layoutView superView computeExtent) perform:xOrY.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   544
    fractSymb  := (what, 'Fraction') asSymbol.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   545
    offsetSymb := (what,   'Offset') asSymbol.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   546
    fraction   := (self aspectFor:fractSymb)  value.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   547
    offset     := (self aspectFor:offsetSymb) value.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   548
    offset     := offset + ((fraction * extent) asInteger).
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   549
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   550
    (self aspectFor:offsetSymb) value:offset.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   551
    (self aspectFor:fractSymb)  value:0.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   552
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   553
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   554
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   555
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   556
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   557
absoluteBottom
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   558
    self absolute:'bottom' xOrY:#y
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   559
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   560
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   561
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   562
absoluteLeft
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   563
    self absolute:'left' xOrY:#x
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   564
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   565
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   566
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   567
absoluteRight
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   568
    self absolute:'right' xOrY:#x
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   569
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   570
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   571
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   572
absoluteTop
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   573
    self absolute:'top' xOrY:#y
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   574
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   575
! !
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   576
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   577
!UILayoutTool methodsFor:'converting relative'!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   578
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   579
relative:what xOrY:xOrY
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   580
    |extent fraction offset fractSymb offsetSymb|
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   581
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   582
    extent     := (self layoutView superView computeExtent) perform:xOrY.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   583
    fractSymb  := (what, 'Fraction') asSymbol.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   584
    offsetSymb := (what,   'Offset') asSymbol.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   585
    fraction   := (self aspectFor:fractSymb)  value.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   586
    offset     := (self aspectFor:offsetSymb) value.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   587
    fraction   := (fraction + (offset / extent)) asFloat.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   588
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   589
    (fraction > 1.0) ifTrue:[ fraction := 1.0 ].
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   590
    (fraction < 0.0) ifTrue:[ fraction := 0 ].
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   591
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   592
    (self aspectFor:offsetSymb) value:0.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   593
    (self aspectFor:fractSymb)  value:fraction.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   594
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   595
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   596
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   597
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   598
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   599
relativeBottom
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   600
    self relative:'bottom' xOrY:#y
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   601
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   602
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   603
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   604
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   605
relativeLeft
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   606
    self relative:'left' xOrY:#x
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   607
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   608
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   609
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   610
relativeRight
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   611
    self relative:'right' xOrY:#x
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   612
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   613
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   614
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   615
relativeTop
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   616
    self relative:'top' xOrY:#y
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   617
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   618
! !
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   619
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   620
!UILayoutTool methodsFor:'initialization'!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   621
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   622
initialize
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   623
    "initialize channels
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   624
    "
221
319a24a1df06 slow grow operation on array removed
ca
parents: 201
diff changeset
   625
    |slices size|
319a24a1df06 slow grow operation on array removed
ca
parents: 201
diff changeset
   626
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   627
    super initialize.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   628
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   629
    aspects  := IdentityDictionary new.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   630
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   631
    #(  bottomFraction          bottomOffset
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   632
        leftFraction            leftOffset
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   633
        topFraction             topOffset
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   634
        rightFraction           rightOffset
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   635
        leftAlignmentFraction   topAlignmentFraction
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   636
    )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   637
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   638
    do:[:aKey||holder|
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   639
        holder := ValueHolder new.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   640
        holder addDependent:self.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   641
        aspects at:aKey put:holder.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   642
    ].
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   643
221
319a24a1df06 slow grow operation on array removed
ca
parents: 201
diff changeset
   644
    slices  := self class slices.
319a24a1df06 slow grow operation on array removed
ca
parents: 201
diff changeset
   645
    size    := slices size - 1.
319a24a1df06 slow grow operation on array removed
ca
parents: 201
diff changeset
   646
    tabList := Array new:size.
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   647
221
319a24a1df06 slow grow operation on array removed
ca
parents: 201
diff changeset
   648
    1 to:size do:[:i| tabList at:i put:((slices at:i) first) ].
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   649
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   650
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   651
! !
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   652
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   653
!UILayoutTool methodsFor:'selection'!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   654
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   655
selectedSlice
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   656
    "returns slice assigned to selection or nil
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   657
    "
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   658
    selection notNil ifTrue:[
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   659
        self class slices do:[:aSlice|
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   660
            aSlice first = selection ifTrue:[
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   661
                ^ aSlice
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   662
            ]
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   663
        ]
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   664
    ].
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   665
    ^ nil
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   666
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   667
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   668
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   669
selection
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   670
    ^ selection
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   671
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   672
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   673
selection:aSelection
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   674
    |appl view slice|
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   675
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   676
    selection = aSelection ifFalse:[
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   677
        (selection := aSelection) notNil ifTrue:[
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   678
            slice := self selectedSlice.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   679
            appl  := slice last asString.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   680
            appl := Smalltalk classNamed:(self class name asString, '::', appl).
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   681
            appl := appl new.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   682
            appl masterApplication:self.
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   683
            modifiedHolder value:true.
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   684
        ].
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   685
        self noteBookView client:appl.
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   686
    ].
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   687
    self update
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   688
! !
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   689
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   690
!UILayoutTool::AlignmentOrigin class methodsFor:'help specs'!
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   691
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   692
helpSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   693
    "return a dictionary filled with helpKey -> helptext associations.
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   694
     These are used by the activeHelp tool.
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   695
    "
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   696
  ^ super helpSpec addPairsFrom:#(
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   697
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   698
#alignVertical    'vertical inset to the location point of the component'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   699
#alignHorizontal  'horizontal inset to the location point of the component'
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   700
185
10b797de4c2d update help text
ca
parents: 184
diff changeset
   701
#alignTopLeft      'align components topLeft to location'
10b797de4c2d update help text
ca
parents: 184
diff changeset
   702
#alignLeftCenter   'align components leftCenter to location'
10b797de4c2d update help text
ca
parents: 184
diff changeset
   703
#alignBottomLeft   'align components bottomLeft to location'
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   704
185
10b797de4c2d update help text
ca
parents: 184
diff changeset
   705
#alignTopRight     'align components topRight to location'
10b797de4c2d update help text
ca
parents: 184
diff changeset
   706
#alignRightCenter  'align components rightCenter to location'
10b797de4c2d update help text
ca
parents: 184
diff changeset
   707
#alignBottomRight  'align components bottomRight to location'
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   708
185
10b797de4c2d update help text
ca
parents: 184
diff changeset
   709
#alignTopCenter    'align components topCenter to location'
10b797de4c2d update help text
ca
parents: 184
diff changeset
   710
#alignCenter       'align components center to location'
10b797de4c2d update help text
ca
parents: 184
diff changeset
   711
#alignBottomCenter 'align components bottomCenter to location'
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   712
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   713
)
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   714
! !
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   715
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   716
!UILayoutTool::AlignmentOrigin class methodsFor:'interface specs'!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   717
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   718
windowSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   719
    "this window spec was automatically generated by the ST/X UIPainter"
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   720
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   721
    "do not manually edit this - the painter/builder may not be able to
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   722
     handle the specification if its corrupted."
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   723
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   724
    "
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   725
     UIPainter new openOnClass:UILayoutTool::AlignmentOrigin andSelector:#windowSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   726
     UILayoutTool::AlignmentOrigin new openInterface:#windowSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   727
    "
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   728
    "UILayoutTool::AlignmentOrigin open"
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   729
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   730
    <resource: #canvas>
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   731
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   732
    ^
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   733
     
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   734
       #(#FullSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   735
          #'window:' 
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   736
           #(#WindowSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   737
              #'name:' 'uIPainterView'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   738
              #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   739
              #'label:' 'AlignmentOrigin'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   740
              #'bounds:' #(#Rectangle 0 0 268 205)
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   741
          )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   742
          #'component:' 
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   743
           #(#SpecCollection
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   744
              #'collection:' 
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   745
               #(
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   746
                 #(#UISubSpecification
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   747
                    #'name:' 'subSpecification'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   748
                    #'layout:' #(#LayoutOrigin 0 0 0 0)
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   749
                    #'majorKey:' #UILayoutTool
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   750
                    #'minorKey:' #layoutOriginSpec
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   751
                )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   752
                 #(#LabelSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   753
                    #'name:' 'label5'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   754
                    #'layout:' #(#AlignmentOrigin 84 0 106 0 1 0)
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   755
                    #'label:' 'align H'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   756
                    #'adjust:' #right
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   757
                )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   758
                 #(#LabelSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   759
                    #'name:' 'label6'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   760
                    #'layout:' #(#AlignmentOrigin 84 0 132 0 1 0)
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   761
                    #'label:' 'align V'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   762
                    #'adjust:' #right
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   763
                )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   764
                 #(#InputFieldSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   765
                    #'name:' 'editField5'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   766
                    #'layout:' #(#LayoutFrame 89 0 106 0 146 0 124 0)
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   767
                    #'activeHelpKey:' #alignHorizontal
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   768
                    #'tabable:' true
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   769
                    #'model:' #leftAlignmentFraction
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   770
                    #'type:' #numberOrNil
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   771
                )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   772
                 #(#InputFieldSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   773
                    #'name:' 'editField6'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   774
                    #'layout:' #(#LayoutFrame 89 0 132 0 146 0 150 0)
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   775
                    #'activeHelpKey:' #alignVertical
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   776
                    #'tabable:' true
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   777
                    #'model:' #topAlignmentFraction
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   778
                    #'type:' #numberOrNil
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   779
                )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   780
                 #(#DividerSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   781
                    #'name:' 'separator1'
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   782
                    #'layout:' #(#Rectangle 175 108 224 111)
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   783
                    #'orientation:' #horizontal
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   784
                )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   785
                 #(#DividerSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   786
                    #'name:' 'separator2'
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   787
                    #'layout:' #(#Rectangle 175 140 224 143)
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   788
                    #'orientation:' #horizontal
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   789
                )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   790
                 #(#DividerSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   791
                    #'name:' 'separator3'
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   792
                    #'layout:' #(#Rectangle 168 118 171 139)
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   793
                    #'orientation:' #vertical
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   794
                )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   795
                 #(#DividerSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   796
                    #'name:' 'separator4'
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   797
                    #'layout:' #(#Rectangle 223 118 226 139)
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   798
                    #'orientation:' #vertical
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   799
                )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   800
                 #(#ActionButtonSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   801
                    #'name:' 'alignBottomRight'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   802
                    #'layout:' #(#Rectangle 222 138 234 150)
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   803
                    #'activeHelpKey:' #alignBottomRight
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   804
                    #'model:' #alignBottomRight
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   805
                )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   806
                 #(#ActionButtonSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   807
                    #'name:' 'alignTopLeft'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   808
                    #'layout:' #(#Rectangle 166 107 178 119)
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   809
                    #'activeHelpKey:' #alignTopLeft
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   810
                    #'model:' #alignTopLeft
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   811
                )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   812
                 #(#ActionButtonSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   813
                    #'name:' 'alignTopRight'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   814
                    #'layout:' #(#Rectangle 222 107 234 119)
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   815
                    #'activeHelpKey:' #alignTopRight
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   816
                    #'model:' #alignTopRight
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   817
                )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   818
                 #(#ActionButtonSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   819
                    #'name:' 'alignBottomLeft'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   820
                    #'layout:' #(#Rectangle 166 137 178 149)
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   821
                    #'activeHelpKey:' #alignBottomLeft
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   822
                    #'model:' #alignBottomLeft
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   823
                )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   824
                 #(#ActionButtonSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   825
                    #'name:' 'alignTopCenter'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   826
                    #'layout:' #(#Rectangle 194 107 206 119)
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   827
                    #'activeHelpKey:' #alignTopCenter
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   828
                    #'model:' #alignTopCenter
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   829
                )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   830
                 #(#ActionButtonSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   831
                    #'name:' 'alignBottomCenter'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   832
                    #'layout:' #(#Rectangle 194 138 206 150)
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   833
                    #'activeHelpKey:' #alignBottomCenter
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   834
                    #'model:' #alignBottomCenter
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   835
                )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   836
                 #(#ActionButtonSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   837
                    #'name:' 'alignLeftCenter'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   838
                    #'layout:' #(#Rectangle 166 122 178 134)
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   839
                    #'activeHelpKey:' #alignLeftCenter
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   840
                    #'model:' #alignLeftCenter
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   841
                )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   842
                 #(#ActionButtonSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   843
                    #'name:' 'alignRightCenter'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   844
                    #'layout:' #(#Rectangle 222 122 234 134)
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   845
                    #'activeHelpKey:' #alignRightCenter
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   846
                    #'model:' #alignRightCenter
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   847
                )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   848
                 #(#ActionButtonSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   849
                    #'name:' 'alignCenter'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   850
                    #'layout:' #(#Rectangle 194 122 206 134)
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   851
                    #'activeHelpKey:' #alignCenter
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   852
                    #'model:' #alignCenter
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   853
                )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   854
              )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   855
          )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   856
      )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   857
! !
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   858
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   859
!UILayoutTool::AlignmentOrigin methodsFor:'accessing'!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   860
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   861
fetch:aView
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   862
    "fetch alignmentOrigin
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   863
    "
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   864
    |layout type extent|
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   865
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   866
    type   := UIPainterView layoutType:aView.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   867
    layout := aView geometryLayout.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   868
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   869
    layout isLayout ifTrue:[
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   870
        (self aspectFor:#leftOffset)   value:(layout leftOffset).
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   871
        (self aspectFor:#leftFraction) value:(layout leftFraction).
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   872
        (self aspectFor:#topOffset)    value:(layout topOffset).
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   873
        (self aspectFor:#topFraction)  value:(layout topFraction).
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   874
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   875
        type == #AlignmentOrigin ifTrue:[
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   876
            (self aspectFor:#leftAlignmentFraction) value:(layout leftAlignmentFraction).
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   877
            (self aspectFor:#topAlignmentFraction)  value:(layout topAlignmentFraction).
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   878
          ^ self
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   879
        ]
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   880
    ] ifFalse:[
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   881
        layout := aView computeOrigin.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   882
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   883
        (self aspectFor:#leftOffset)   value:(layout x).
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   884
        (self aspectFor:#leftFraction) value:0.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   885
        (self aspectFor:#topOffset)    value:(layout y).
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   886
        (self aspectFor:#topFraction)  value:0.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   887
    ].
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   888
    (self aspectFor:#leftAlignmentFraction) value:0.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   889
    (self aspectFor:#topAlignmentFraction)  value:0.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   890
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   891
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   892
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   893
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   894
layout
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   895
    "returns current layout as alignmentOrigin
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   896
    "
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   897
    |layout|
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   898
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   899
    layout  := Smalltalk::AlignmentOrigin new.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   900
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   901
    layout   leftOffset:((self aspectFor:#leftOffset)   value) ? 0.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   902
    layout    topOffset:((self aspectFor:#topOffset)    value) ? 0.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   903
    layout leftFraction:((self aspectFor:#leftFraction) value) ? 0.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   904
    layout  topFraction:((self aspectFor:#topFraction)  value) ? 0.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   905
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   906
    layout leftAlignmentFraction:((self aspectFor:#leftAlignmentFraction) value) ? 0.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   907
    layout  topAlignmentFraction:((self aspectFor:#topAlignmentFraction)  value) ? 0.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   908
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   909
  ^ layout
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   910
! !
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   911
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   912
!UILayoutTool::AlignmentOrigin methodsFor:'alignment'!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   913
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   914
alignBottomCenter
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   915
    self makeAlignLeft:0.5 top:1
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   916
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   917
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   918
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   919
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   920
alignBottomLeft
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   921
    self makeAlignLeft:0 top:1
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   922
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   923
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   924
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   925
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   926
alignBottomRight
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   927
    self makeAlignLeft:1 top:1
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   928
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   929
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   930
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   931
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   932
alignCenter
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   933
    self makeAlignLeft:0.5 top:0.5
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   934
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   935
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   936
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   937
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   938
alignLeftCenter
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   939
    self makeAlignLeft:0 top:0.5
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   940
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   941
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   942
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   943
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   944
alignRightCenter
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   945
    self makeAlignLeft:1 top:0.5
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   946
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   947
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   948
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   949
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   950
alignTopCenter
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   951
    self makeAlignLeft:0.5 top:0
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   952
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   953
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   954
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   955
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   956
alignTopLeft
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   957
    self makeAlignLeft:0 top:0
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   958
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   959
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   960
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   961
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   962
alignTopRight
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   963
    self makeAlignLeft:1 top:0
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   964
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   965
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   966
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   967
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   968
makeAlignLeft:leftAlignmentFraction top:topAlignmentFraction
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   969
    |lAF tAF lO tO ext|
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   970
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   971
    lAF     := (self aspectFor:#leftAlignmentFraction) value ? 0.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   972
    tAF     := (self aspectFor:#topAlignmentFraction)  value ? 0.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   973
    ext     := (self aspectFor:#layoutView) computeExtent.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   974
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   975
    (self aspectFor:#leftAlignmentFraction) value:leftAlignmentFraction.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   976
    (self aspectFor:#topAlignmentFraction)  value:topAlignmentFraction.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   977
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   978
    lO := (self aspectFor:#leftOffset) value ? 0.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   979
    tO := (self aspectFor:#topOffset)  value ? 0.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   980
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   981
    lO := lO + (ext x * (leftAlignmentFraction - lAF)).
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   982
    tO := tO + (ext y * (topAlignmentFraction  - tAF)).
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   983
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   984
    (self aspectFor:#leftOffset) value:(lO rounded).
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   985
    (self aspectFor:#topOffset)  value:(tO rounded).
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   986
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   987
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   988
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   989
makeAlignTopRight
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   990
    self makeAlignLeft:1 top:0
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   991
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   992
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   993
! !
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
   994
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   995
!UILayoutTool::Extent class methodsFor:'help specs'!
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   996
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   997
helpSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   998
    "return a dictionary filled with helpKey -> helptext associations.
700f2ee9911e add help for components
ca
parents: 163
diff changeset
   999
     These are used by the activeHelp tool.
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1000
    "
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1001
  ^ super helpSpec addPairsFrom:#(
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1002
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1003
#vrtExtent      'vertical extent of the component'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1004
#hrzExtent      'horizontal extent of the component'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1005
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1006
)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1007
! !
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1008
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1009
!UILayoutTool::Extent class methodsFor:'interface specs'!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1010
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1011
windowSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1012
    "this window spec was automatically generated by the ST/X UIPainter"
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1013
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1014
    "do not manually edit this - the painter/builder may not be able to
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1015
     handle the specification if its corrupted."
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1016
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1017
    "
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1018
     UIPainter new openOnClass:UILayoutTool::Extent andSelector:#windowSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1019
     UILayoutTool::Extent new openInterface:#windowSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1020
    "
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1021
    "UILayoutTool::Extent open"
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1022
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1023
    <resource: #canvas>
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1024
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1025
    ^
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1026
     
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1027
       #(#FullSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1028
          #'window:' 
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1029
           #(#WindowSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1030
              #'name:' 'uIPainterView'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1031
              #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1032
              #'label:' 'unnamed'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1033
              #'bounds:' #(#Rectangle 0 0 226 86)
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1034
          )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1035
          #'component:' 
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1036
           #(#SpecCollection
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1037
              #'collection:' 
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1038
               #(
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1039
                 #(#LabelSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1040
                    #'name:' 'labelHorizontal'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1041
                    #'layout:' #(#AlignmentOrigin 73 0 25 0 1 0)
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1042
                    #'label:' 'horizontal:'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1043
                    #'adjust:' #left
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1044
                )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1045
                 #(#InputFieldSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1046
                    #'name:' 'fieldLeftOffset'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1047
                    #'layout:' #(#LayoutFrame 78 0 25 0 171 0 43 0)
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1048
                    #'activeHelpKey:' #hrzExtent
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1049
                    #'tabable:' true
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1050
                    #'model:' #leftOffset
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1051
                    #'type:' #numberOrNil
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1052
                )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1053
                 #(#LabelSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1054
                    #'name:' 'labelVertical'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1055
                    #'layout:' #(#AlignmentOrigin 73 0 52 0 1 0)
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1056
                    #'label:' 'vertical:'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1057
                    #'adjust:' #left
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1058
                )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1059
                 #(#InputFieldSpec
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1060
                    #'name:' 'fieldRightOffset'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1061
                    #'layout:' #(#LayoutFrame 78 0 52 0 171 0 70 0)
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1062
                    #'activeHelpKey:' #vrtExtent
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1063
                    #'tabable:' true
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1064
                    #'model:' #rightOffset
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1065
                    #'type:' #numberOrNil
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1066
                )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1067
              )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1068
          )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1069
      )
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1070
! !
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1071
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1072
!UILayoutTool::Extent methodsFor:'accessing'!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1073
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1074
fetch:aView
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1075
    "fetch extent
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1076
    "
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1077
    |extent|
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1078
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1079
    extent  := aView computeExtent.
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1080
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1081
    (self aspectFor:#leftOffset)  value:(extent x).
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1082
    (self aspectFor:#rightOffset) value:(extent y).
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1083
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1084
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1085
!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1086
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1087
layout
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1088
    "returns current extent
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1089
    "
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1090
  ^ Smalltalk::Point x:(((self aspectFor:#leftOffset)   value) ? 0)
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1091
                     y:(((self aspectFor:#rightOffset)  value) ? 0)
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1092
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1093
! !
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1094
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1095
!UILayoutTool::LayoutFrame class methodsFor:'help specs'!
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1096
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1097
helpSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1098
    "return a dictionary filled with helpKey -> helptext associations.
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1099
     These are used by the activeHelp tool.
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1100
    "
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1101
  ^ super helpSpec addPairsFrom:#(
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1102
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1103
#makeRightRelative
185
10b797de4c2d update help text
ca
parents: 184
diff changeset
  1104
'compute current relative corner x and offset
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1105
of the right edge to a relative corner x'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1106
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1107
#makeBottomRelative
185
10b797de4c2d update help text
ca
parents: 184
diff changeset
  1108
'compute current relative corner y and offset
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1109
of the bottom edge to a relative corner y'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1110
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1111
#makeBottomAbsolute
185
10b797de4c2d update help text
ca
parents: 184
diff changeset
  1112
'compute current bottom offset and relative
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1113
corner y to an absolute corner y'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1114
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1115
#makeRightAbsolute
185
10b797de4c2d update help text
ca
parents: 184
diff changeset
  1116
'compute current right offset and relative
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1117
corner x to an absolute corner x'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1118
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1119
#bottomAbsolute
185
10b797de4c2d update help text
ca
parents: 184
diff changeset
  1120
'offset of the bottom edge; positive
10b797de4c2d update help text
ca
parents: 184
diff changeset
  1121
is to the bottom, negative to the top'
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1122
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1123
#rightAbsolute
185
10b797de4c2d update help text
ca
parents: 184
diff changeset
  1124
'offset of the right edge; positive
10b797de4c2d update help text
ca
parents: 184
diff changeset
  1125
is to the right, negative to the left'
184
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1126
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1127
#rightRelative          'relative corner x'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1128
#bottomRelative         'relative corner y'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1129
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1130
)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1131
! !
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1132
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1133
!UILayoutTool::LayoutFrame class methodsFor:'interface specs'!
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1134
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1135
windowSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1136
    "this window spec was automatically generated by the ST/X UIPainter"
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1137
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1138
    "do not manually edit this - the painter/builder may not be able to
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1139
     handle the specification if its corrupted."
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1140
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1141
    "
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1142
     UIPainter new openOnClass:UILayoutTool::LayoutFrame andSelector:#windowSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1143
     UILayoutTool::LayoutFrame new openInterface:#windowSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1144
    "
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1145
    "UILayoutTool::LayoutFrame open"
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1146
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1147
    <resource: #canvas>
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1148
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1149
    ^
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1150
     
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1151
       #(#FullSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1152
          #'window:' 
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1153
           #(#WindowSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1154
              #'name:' 'uIPainterView'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1155
              #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1156
              #'label:' 'unnamed'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1157
              #'bounds:' #(#Rectangle 0 0 250 193)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1158
          )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1159
          #'component:' 
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1160
           #(#SpecCollection
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1161
              #'collection:' 
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1162
               #(
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1163
                 #(#UISubSpecification
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1164
                    #'name:' 'subLayoutSpec'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1165
                    #'layout:' #(#LayoutOrigin 0 0 0 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1166
                    #'majorKey:' #UILayoutTool
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1167
                    #'minorKey:' #layoutOriginSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1168
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1169
                 #(#LabelSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1170
                    #'name:' 'labelRight'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1171
                    #'layout:' #(#AlignmentOrigin 52 0 98 0 1 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1172
                    #'label:' 'right'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1173
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1174
                 #(#InputFieldSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1175
                    #'name:' 'fieldRightFraction'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1176
                    #'layout:' #(#LayoutFrame 57 0 98 0 114 0 116 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1177
                    #'activeHelpKey:' #rightRelative
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1178
                    #'model:' #rightFraction
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1179
                    #'type:' #numberOrNil
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1180
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1181
                 #(#ActionButtonSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1182
                    #'name:' 'actionRelativeRight'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1183
                    #'layout:' #(#LayoutFrame 119 0 98 0 138 0 116 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1184
                    #'activeHelpKey:' #makeRightRelative
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1185
                    #'model:' #relativeRight
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1186
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1187
                 #(#InputFieldSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1188
                    #'name:' 'fieldRightOffset'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1189
                    #'layout:' #(#LayoutFrame 154 0 98 0 212 0 116 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1190
                    #'activeHelpKey:' #rightAbsolute
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1191
                    #'model:' #rightOffset
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1192
                    #'type:' #numberOrNil
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1193
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1194
                 #(#ActionButtonSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1195
                    #'name:' 'actionAbsoluteRight'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1196
                    #'layout:' #(#LayoutFrame 216 0 98 0 235 0 116 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1197
                    #'activeHelpKey:' #makeRightAbsolute
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1198
                    #'model:' #absoluteRight
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1199
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1200
                 #(#LabelSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1201
                    #'name:' 'labelBottom'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1202
                    #'layout:' #(#AlignmentOrigin 52 0 126 0 1 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1203
                    #'label:' 'bottom'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1204
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1205
                 #(#InputFieldSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1206
                    #'name:' 'fieldBottomFraction'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1207
                    #'layout:' #(#LayoutFrame 57 0 126 0 114 0 144 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1208
                    #'activeHelpKey:' #bottomRelative
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1209
                    #'model:' #bottomFraction
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1210
                    #'type:' #numberOrNil
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1211
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1212
                 #(#ActionButtonSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1213
                    #'name:' 'actionRelativeBottom'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1214
                    #'layout:' #(#LayoutFrame 119 0 126 0 138 0 144 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1215
                    #'activeHelpKey:' #makeBottomRelative
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1216
                    #'model:' #relativeBottom
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1217
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1218
                 #(#InputFieldSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1219
                    #'name:' 'fieldBottomOffset'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1220
                    #'layout:' #(#LayoutFrame 154 0 126 0 211 0 144 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1221
                    #'activeHelpKey:' #bottomAbsolute
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1222
                    #'model:' #bottomOffset
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1223
                    #'type:' #numberOrNil
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1224
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1225
                 #(#ActionButtonSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1226
                    #'name:' 'actionAbsoluteBottom'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1227
                    #'layout:' #(#LayoutFrame 216 0 126 0 235 0 144 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1228
                    #'activeHelpKey:' #makeBottomAbsolute
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1229
                    #'model:' #absoluteBottom
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1230
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1231
              )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1232
          )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1233
      )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1234
! !
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1235
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1236
!UILayoutTool::LayoutFrame methodsFor:'accessing'!
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1237
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1238
fetch:aView
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1239
    |layout|
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1240
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1241
    layout  := UIPainterView asLayoutFrameFromView:aView.
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1242
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1243
    (self aspectFor:#leftOffset)     value:(layout leftOffset).
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1244
    (self aspectFor:#leftFraction)   value:(layout leftFraction).
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1245
    (self aspectFor:#topOffset)      value:(layout topOffset).
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1246
    (self aspectFor:#topFraction)    value:(layout topFraction).
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1247
    (self aspectFor:#rightOffset)    value:(layout rightOffset).
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1248
    (self aspectFor:#bottomOffset)   value:(layout bottomOffset).
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1249
    (self aspectFor:#rightFraction)  value:(layout rightFraction).
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1250
    (self aspectFor:#bottomFraction) value:(layout bottomFraction).
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1251
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1252
!
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1253
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1254
layout
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1255
    "returns current layout as layoutFrame
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1256
    "
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1257
    |layout|
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1258
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1259
    layout  := Smalltalk::LayoutFrame new.
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1260
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1261
    layout     leftOffset:((self aspectFor:#leftOffset)     value) ? 0.
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1262
    layout    rightOffset:((self aspectFor:#rightOffset)    value) ? 0.
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1263
    layout      topOffset:((self aspectFor:#topOffset)      value) ? 0.
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1264
    layout   bottomOffset:((self aspectFor:#bottomOffset)   value) ? 0.
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1265
    layout   leftFraction:((self aspectFor:#leftFraction)   value) ? 0.
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1266
    layout  rightFraction:((self aspectFor:#rightFraction)  value) ? 0.
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1267
    layout    topFraction:((self aspectFor:#topFraction)    value) ? 0.
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1268
    layout bottomFraction:((self aspectFor:#bottomFraction) value) ? 0.
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1269
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1270
  ^ layout
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1271
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1272
! !
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1273
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1274
!UILayoutTool::LayoutOrigin class methodsFor:'interface specs'!
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1275
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1276
windowSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1277
    "this window spec was automatically generated by the ST/X UIPainter"
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1278
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1279
    "do not manually edit this - the painter/builder may not be able to
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1280
     handle the specification if its corrupted."
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1281
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1282
    "
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1283
     UIPainter new openOnClass:UILayoutTool::LayoutOrigin andSelector:#windowSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1284
     UILayoutTool::LayoutOrigin new openInterface:#windowSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1285
    "
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1286
    "UILayoutTool::LayoutOrigin open"
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1287
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1288
    <resource: #canvas>
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1289
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1290
    ^
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1291
     
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1292
       #(#FullSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1293
          #'window:' 
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1294
           #(#WindowSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1295
              #'name:' 'uIPainterView'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1296
              #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1297
              #'label:' 'unnamed'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1298
              #'bounds:' #(#Rectangle 0 0 258 93)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1299
          )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1300
          #'component:' 
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1301
           #(#SpecCollection
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1302
              #'collection:' 
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1303
               #(
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1304
                 #(#UISubSpecification
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1305
                    #'name:' 'subSpecification'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1306
                    #'layout:' #(#LayoutOrigin 0 0 0 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1307
                    #'majorKey:' #UILayoutTool
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1308
                    #'minorKey:' #layoutOriginSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1309
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1310
              )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1311
          )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1312
      )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1313
! !
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1314
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1315
!UILayoutTool::LayoutOrigin methodsFor:'accessing'!
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1316
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1317
fetch:aView
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1318
    "fetch layoutOrigin
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1319
    "
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1320
    |layout|
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1321
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1322
    layout  := UIPainterView asLayoutFrameFromView:aView.
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1323
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1324
    (self aspectFor:#leftOffset)   value:(layout leftOffset).
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1325
    (self aspectFor:#leftFraction) value:(layout leftFraction).
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1326
    (self aspectFor:#topOffset)    value:(layout topOffset).
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1327
    (self aspectFor:#topFraction)  value:(layout topFraction).
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1328
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1329
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1330
!
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1331
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1332
layout
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1333
    "returns current layout as layoutOrigin
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1334
    "
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1335
    |layout|
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1336
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1337
    layout  := Smalltalk::LayoutOrigin new.
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1338
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1339
    layout   leftOffset:((self aspectFor:#leftOffset)   value) ? 0.
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1340
    layout    topOffset:((self aspectFor:#topOffset)    value) ? 0.
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1341
    layout leftFraction:((self aspectFor:#leftFraction) value) ? 0.
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1342
    layout  topFraction:((self aspectFor:#topFraction)  value) ? 0.
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1343
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1344
  ^ layout
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1345
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1346
! !
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1347
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1348
!UILayoutTool::Point class methodsFor:'interface specs'!
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1349
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1350
windowSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1351
    "this window spec was automatically generated by the ST/X UIPainter"
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1352
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1353
    "do not manually edit this - the painter/builder may not be able to
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1354
     handle the specification if its corrupted."
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1355
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1356
    "
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1357
     UIPainter new openOnClass:UILayoutTool::Point andSelector:#windowSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1358
     UILayoutTool::Point new openInterface:#windowSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1359
    "
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1360
    "UILayoutTool::Point open"
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1361
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1362
    <resource: #canvas>
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1363
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1364
    ^
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1365
     
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1366
       #(#FullSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1367
          #'window:' 
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1368
           #(#WindowSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1369
              #'name:' 'uIPainterView'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1370
              #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1371
              #'label:' 'unnamed'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1372
              #'bounds:' #(#Rectangle 0 0 194 66)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1373
          )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1374
          #'component:' 
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1375
           #(#SpecCollection
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1376
              #'collection:' 
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1377
               #(
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1378
                 #(#UISubSpecification
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1379
                    #'name:' 'subSpecification'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1380
                    #'layout:' #(#LayoutOrigin 0 0 0 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1381
                    #'majorKey:' #UILayoutTool
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1382
                    #'minorKey:' #layoutPointSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1383
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1384
              )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1385
          )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1386
      )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1387
! !
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1388
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1389
!UILayoutTool::Point methodsFor:'accessing'!
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1390
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1391
fetch:aView
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1392
    "fetch point
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1393
    "
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1394
    |origin|
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1395
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1396
    origin  := aView computeOrigin.
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1397
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1398
    (self aspectFor:#leftOffset) value:(origin x).
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1399
    (self aspectFor:#topOffset)  value:(origin y).
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1400
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1401
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1402
!
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1403
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1404
layout
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1405
    "returns current layout as point
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1406
    "
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1407
  ^ Smalltalk::Point x:(((self aspectFor:#leftOffset) value) ? 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1408
                     y:(((self aspectFor:#topOffset)  value) ? 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1409
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1410
! !
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1411
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1412
!UILayoutTool::Rectangle class methodsFor:'interface specs'!
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1413
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1414
windowSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1415
    "this window spec was automatically generated by the ST/X UIPainter"
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1416
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1417
    "do not manually edit this - the painter/builder may not be able to
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1418
     handle the specification if its corrupted."
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1419
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1420
    "
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1421
     UIPainter new openOnClass:UILayoutTool::Rectangle andSelector:#windowSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1422
     UILayoutTool::Rectangle new openInterface:#windowSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1423
    "
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1424
    "UILayoutTool::Rectangle open"
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1425
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1426
    <resource: #canvas>
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1427
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1428
    ^
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1429
     
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1430
       #(#FullSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1431
          #'window:' 
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1432
           #(#WindowSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1433
              #'name:' 'uIPainterView'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1434
              #'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1435
              #'label:' 'unnamed'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1436
              #'bounds:' #(#Rectangle 0 0 224 146)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1437
          )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1438
          #'component:' 
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1439
           #(#SpecCollection
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1440
              #'collection:' 
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1441
               #(
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1442
                 #(#UISubSpecification
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1443
                    #'name:' 'subSpecification'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1444
                    #'layout:' #(#LayoutOrigin 0 0 0 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1445
                    #'majorKey:' #UILayoutTool
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1446
                    #'minorKey:' #layoutPointSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1447
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1448
                 #(#LabelSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1449
                    #'name:' 'labelCornerX'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1450
                    #'layout:' #(#AlignmentOrigin 75 0 74 0 1 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1451
                    #'label:' 'corner x:'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1452
                    #'adjust:' #left
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1453
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1454
                 #(#InputFieldSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1455
                    #'name:' 'fieldCornerX'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1456
                    #'layout:' #(#LayoutFrame 77 0 74 0 170 0 92 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1457
                    #'activeHelpKey:' #cornerX
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1458
                    #'tabable:' true
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1459
                    #'model:' #rightOffset
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1460
                    #'type:' #numberOrNil
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1461
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1462
                 #(#LabelSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1463
                    #'name:' 'labelCornerY'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1464
                    #'layout:' #(#AlignmentOrigin 75 0 101 0 1 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1465
                    #'label:' 'corner y:'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1466
                    #'adjust:' #left
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1467
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1468
                 #(#InputFieldSpec
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1469
                    #'name:' 'fieldCornerY'
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1470
                    #'layout:' #(#LayoutFrame 77 0 101 0 170 0 119 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1471
                    #'activeHelpKey:' #cornerY
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1472
                    #'tabable:' true
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1473
                    #'model:' #bottomOffset
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1474
                    #'type:' #numberOrNil
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1475
                )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1476
              )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1477
          )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1478
      )
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1479
! !
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1480
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1481
!UILayoutTool::Rectangle methodsFor:'accessing'!
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1482
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1483
fetch:aView
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1484
    "fetch rectangle
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1485
    "
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1486
    |origin corner|
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1487
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1488
    origin := aView computeOrigin.
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1489
    corner := aView computeCorner.
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1490
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1491
    (self aspectFor:#leftOffset)   value:(origin x).
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1492
    (self aspectFor:#rightOffset)  value:(corner x).
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1493
    (self aspectFor:#topOffset)    value:(origin y).
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1494
    (self aspectFor:#bottomOffset) value:(corner y).
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1495
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1496
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1497
!
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1498
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1499
layout
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1500
    "returns current layout as rectangle
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1501
    "
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1502
  ^ Smalltalk::Rectangle left:(((self aspectFor:#leftOffset)   value) ? 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1503
                          top:(((self aspectFor:#topOffset)    value) ? 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1504
                        right:(((self aspectFor:#rightOffset)  value) ? 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1505
                       bottom:(((self aspectFor:#bottomOffset) value) ? 0)
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1506
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1507
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1508
! !
700f2ee9911e add help for components
ca
parents: 163
diff changeset
  1509
163
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1510
!UILayoutTool class methodsFor:'documentation'!
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1511
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1512
version
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1513
    ^ '$Header$'
dff48b7ca574 intitial checkin
ca
parents:
diff changeset
  1514
! !