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