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