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