author | ca |
Sun, 20 Jul 1997 12:24:32 +0200 | |
changeset 224 | c1d7bffe73f1 |
parent 222 | dd2688307d90 |
child 229 | cabe3bd6fd74 |
permissions | -rw-r--r-- |
156 | 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 |
||
60 | 14 |
ApplicationModel subclass:#UIPainter |
222 | 15 |
instanceVariableNames:'activeHelpTool layoutTool specTool treeView selectionPanel |
166 | 16 |
tabSelection specClass specSelector specSuperclass aspects' |
222 | 17 |
classVariableNames:'IconStepUp IconStepOut IconStepIn IconStepDown' |
60 | 18 |
poolDictionaries:'' |
19 |
category:'Interface-UIPainter' |
|
20 |
! |
|
21 |
||
222 | 22 |
SelectionInTreeView subclass:#TreeView |
23 |
instanceVariableNames:'lastDrawnMaster cvsEventsDisabled imageMasterParent |
|
24 |
imageMasterChild' |
|
25 |
classVariableNames:'ImageMasterParent ImageMasterChild' |
|
26 |
poolDictionaries:'' |
|
27 |
privateIn:UIPainter |
|
28 |
! |
|
29 |
||
60 | 30 |
!UIPainter class methodsFor:'documentation'! |
31 |
||
156 | 32 |
copyright |
33 |
" |
|
34 |
COPYRIGHT (c) 1995 by eXept Software AG |
|
35 |
All Rights Reserved |
|
36 |
||
37 |
This software is furnished under a license and may be used |
|
38 |
only in accordance with the terms of that license and with the |
|
39 |
inclusion of the above copyright notice. This software may not |
|
40 |
be provided or otherwise made available to, or used by, any |
|
41 |
other person. No title to or ownership of the software is |
|
42 |
hereby transferred. |
|
43 |
" |
|
44 |
||
45 |
! |
|
46 |
||
60 | 47 |
documentation |
48 |
" |
|
127 | 49 |
GUI-Builder: |
50 |
this class allows the user to build its own applications providing a graphical |
|
51 |
user interface to buildin components and to define the behavior of the components |
|
52 |
during runtime. The resulting specifications can be installed as methods on |
|
53 |
classes, typically subclasses of an ApplicationModel. These specifications |
|
54 |
are used by the UIBuilder to generate the application window and its component |
|
55 |
structues when open the application. |
|
60 | 56 |
|
57 |
[start with:] |
|
58 |
UIPainter open |
|
127 | 59 |
|
156 | 60 |
[author:] |
183 | 61 |
Claus Gittinger |
156 | 62 |
Claus Atzkern |
63 |
||
127 | 64 |
[see also:] |
65 |
UIBuilder |
|
66 |
ApplicationModel |
|
67 |
UISpecification |
|
60 | 68 |
" |
109 | 69 |
|
70 |
! ! |
|
71 |
||
72 |
!UIPainter class methodsFor:'instance creation'! |
|
73 |
||
74 |
listHolder:aListHolder |
|
75 |
|application| |
|
76 |
||
77 |
application := self new. |
|
78 |
application objectList:aListHolder. |
|
79 |
^ application open |
|
80 |
! |
|
81 |
||
195
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
82 |
openOnClass:aClass andSelector:aSelector |
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
83 |
^ self new openOnClass:aClass andSelector:aSelector |
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
84 |
|
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
85 |
"Created: 1.7.1997 / 19:16:59 / cg" |
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
86 |
! |
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
87 |
|
109 | 88 |
painter:aBuilderView |
89 |
|application| |
|
90 |
||
91 |
application := self new. |
|
92 |
application painter:aBuilderView. |
|
93 |
^ application open |
|
60 | 94 |
! ! |
95 |
||
87 | 96 |
!UIPainter class methodsFor:'ST-80 queries'! |
97 |
||
98 |
preferenceFor:aSymbol |
|
99 |
^ false |
|
109 | 100 |
|
101 |
||
102 |
! ! |
|
103 |
||
193 | 104 |
!UIPainter class methodsFor:'help specs'! |
105 |
||
106 |
helpSpec |
|
107 |
"return a dictionary filled with helpKey -> helptext associations. |
|
108 |
These are used by the activeHelp tool. |
|
109 |
" |
|
110 |
^ super helpSpec addPairsFrom:#( |
|
111 |
||
112 |
#alignSelectionCenterVer |
|
113 |
'align selection vertical' |
|
114 |
||
115 |
#alignSelectionLeft |
|
116 |
'align selected components to the left edge of the |
|
117 |
dominant component ( underlined )' |
|
118 |
||
119 |
#alignSelectionRight |
|
120 |
'align selected components to the right edge of the |
|
121 |
dominant component ( underlined )' |
|
122 |
||
123 |
#alignSelectionLeftAndRight |
|
124 |
'align selected components to the right and left edge |
|
125 |
of the dominant component ( underlined )' |
|
126 |
||
127 |
#alignSelectionTop |
|
128 |
'align selected components to the top edge of the |
|
129 |
dominant component ( underlined )' |
|
130 |
||
131 |
#alignSelectionBottom |
|
132 |
'align selected components to the bottom edge of the |
|
133 |
dominant component ( underlined )' |
|
134 |
||
135 |
#alignSelectionTopAndBottom |
|
136 |
'align selected components to the top and bottom edge |
|
137 |
of the dominant component ( underlined )' |
|
138 |
||
139 |
#alignSelectionCenterVer |
|
140 |
'align selected components horizontal to the center of |
|
141 |
the dominant component ( underlined )' |
|
142 |
||
143 |
#alignSelectionCenterHor |
|
144 |
'align selected components vertical to the center of |
|
145 |
the dominant component ( underlined )' |
|
146 |
||
194 | 147 |
#spreadSelectionVer |
148 |
'vertical spacing between selected components is made the same' |
|
149 |
||
150 |
#spreadSelectionHor |
|
151 |
'horizontal spacing between selected components is made the same' |
|
152 |
||
153 |
#centerSelectionHor |
|
154 |
'center components horizontal in contained view' |
|
155 |
||
156 |
#centerSelectionVer |
|
157 |
'center vertical horizontal in contained view' |
|
158 |
||
159 |
#setToDefaultExtent |
|
160 |
'set selected components to their default extent' |
|
161 |
||
162 |
#setToDefaultWidth |
|
163 |
'set selected components to their default width' |
|
164 |
||
165 |
#setToDefaultHeight |
|
166 |
'set selected components to their default height' |
|
167 |
||
168 |
#copyExtent |
|
169 |
'copy extent of the selected component' |
|
170 |
||
171 |
#pasteExtent |
|
172 |
'change extent of all selected components to the |
|
173 |
last copied extent' |
|
174 |
||
175 |
#pasteWidth |
|
176 |
'change width of all selected components to the |
|
177 |
last copied extent width' |
|
178 |
||
179 |
#pasteHeight |
|
180 |
'change height of all selected components to the |
|
181 |
last copied extent height' |
|
182 |
||
183 |
#copyLayout |
|
184 |
'copy layout of the selected component' |
|
185 |
||
186 |
#pasteLayout |
|
187 |
'change layout of all selected components to the |
|
188 |
last copied layout' |
|
189 |
||
190 |
#pasteBuffer |
|
191 |
'paste components at current mouse position' |
|
192 |
||
193 |
#pasteWithLayout |
|
194 |
'paste components without changing their layouts' |
|
195 |
||
193 | 196 |
) |
197 |
||
198 |
||
199 |
||
200 |
||
201 |
! ! |
|
202 |
||
118 | 203 |
!UIPainter class methodsFor:'icons'! |
204 |
||
205 |
iconAlignB |
|
206 |
^ Image fromFile:'b_alignB.xbm' |
|
207 |
||
208 |
! |
|
209 |
||
210 |
iconAlignCenterH |
|
211 |
^ Image fromFile:'b_alignCH.xbm' |
|
212 |
||
213 |
! |
|
214 |
||
215 |
iconAlignCenterV |
|
216 |
^ Image fromFile:'b_alignCV.xbm' |
|
217 |
||
218 |
! |
|
219 |
||
220 |
iconAlignL |
|
221 |
^ Image fromFile:'b_alignL.xbm' |
|
222 |
! |
|
223 |
||
224 |
iconAlignLR |
|
225 |
^ Image fromFile:'b_alignLR.xbm' |
|
226 |
||
227 |
! |
|
228 |
||
229 |
iconAlignR |
|
230 |
^ Image fromFile:'b_alignR.xbm' |
|
231 |
||
232 |
! |
|
233 |
||
234 |
iconAlignT |
|
235 |
^ Image fromFile:'b_alignT.xbm' |
|
236 |
||
237 |
! |
|
238 |
||
239 |
iconAlignTB |
|
240 |
^ Image fromFile:'b_alignTB.xbm' |
|
241 |
||
222 | 242 |
! |
243 |
||
244 |
iconStepDown |
|
245 |
IconStepDown isNil ifTrue:[ |
|
246 |
IconStepDown := self iconStepUp flipHorizontal |
|
247 |
]. |
|
248 |
^ IconStepDown |
|
249 |
||
250 |
! |
|
251 |
||
252 |
iconStepIn |
|
253 |
IconStepIn isNil ifTrue:[ |
|
254 |
IconStepIn := ((Image fromFile:'stepIn.xpm') rotated:90) flipHorizontal |
|
255 |
]. |
|
256 |
^ IconStepIn |
|
257 |
||
258 |
! |
|
259 |
||
260 |
iconStepOut |
|
261 |
IconStepOut isNil ifTrue:[ |
|
262 |
IconStepOut := ((Image fromFile:'stepOut.xpm') rotated:90) flipHorizontal |
|
263 |
]. |
|
264 |
^ IconStepOut |
|
265 |
! |
|
266 |
||
267 |
iconStepUp |
|
268 |
IconStepUp isNil ifTrue:[ |
|
269 |
IconStepUp := ((Image fromFile:'stepOver.xpm') rotated:90) flipHorizontal flipVertical |
|
270 |
]. |
|
271 |
^ IconStepUp |
|
272 |
||
118 | 273 |
! ! |
274 |
||
60 | 275 |
!UIPainter class methodsFor:'interface specs'! |
276 |
||
222 | 277 |
nameAndSelectorSpec |
278 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
279 |
||
280 |
"do not manually edit this - the painter/builder may not be able to |
|
281 |
handle the specification if its corrupted." |
|
282 |
||
283 |
" |
|
284 |
UIPainter new openOnClass:UIPainter andSelector:#nameAndSelectorSpec |
|
285 |
UIPainter new openInterface:#nameAndSelectorSpec |
|
286 |
" |
|
287 |
||
288 |
<resource: #canvas> |
|
289 |
||
290 |
^ |
|
291 |
||
292 |
#(#FullSpec |
|
293 |
#'window:' |
|
294 |
#(#WindowSpec |
|
295 |
#'name:' 'uIPainterView' |
|
296 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
297 |
#'label:' 'Painter' |
|
298 |
#'bounds:' #(#Rectangle 0 0 391 170) |
|
299 |
) |
|
300 |
#'component:' |
|
301 |
#(#SpecCollection |
|
302 |
#'collection:' |
|
303 |
#( |
|
304 |
#(#LabelSpec |
|
305 |
#'name:' 'classLabel' |
|
306 |
#'layout:' #(#AlignmentOrigin 45 0.11 51 0 1 0.5) |
|
307 |
#'label:' 'class:' |
|
308 |
#'adjust:' #right |
|
309 |
#'resizeForLabel:' true |
|
310 |
) |
|
311 |
#(#LabelSpec |
|
312 |
#'name:' 'superClassLabel' |
|
313 |
#'layout:' #(#AlignmentOrigin 45 0.11 77 0 1 0.5) |
|
314 |
#'label:' 'superclass:' |
|
315 |
#'adjust:' #right |
|
316 |
#'resizeForLabel:' true |
|
317 |
) |
|
318 |
#(#LabelSpec |
|
319 |
#'name:' 'selectorLabel' |
|
320 |
#'layout:' #(#AlignmentOrigin 45 0.11 105 0 1 0.5) |
|
321 |
#'label:' 'selector:' |
|
322 |
#'adjust:' #right |
|
323 |
#'resizeForLabel:' true |
|
324 |
) |
|
325 |
#(#InputFieldSpec |
|
326 |
#'name:' 'methodNameField' |
|
327 |
#'layout:' #(#LayoutFrame 47 0.11 95 0 -5 1.0 117 0) |
|
328 |
#'tabable:' true |
|
329 |
#'model:' #methodNameChannel |
|
330 |
) |
|
331 |
#(#LabelSpec |
|
332 |
#'name:' 'boxLabel' |
|
333 |
#'layout:' #(#Point 5 10) |
|
334 |
#'label:' 'class & selector for code:' |
|
335 |
#'adjust:' #left |
|
336 |
#'resizeForLabel:' true |
|
337 |
) |
|
338 |
#(#InputFieldSpec |
|
339 |
#'name:' 'classNameField' |
|
340 |
#'layout:' #(#LayoutFrame 47 0.11 39 0 -5 1.0 61 0) |
|
341 |
#'tabable:' true |
|
342 |
#'model:' #classNameChannel |
|
343 |
) |
|
344 |
#(#ComboBoxSpec |
|
345 |
#'name:' 'comboBox1' |
|
346 |
#'layout:' #(#LayoutFrame 47 0.11 67 0 -5 1.0 89 0) |
|
347 |
#'tabable:' true |
|
348 |
#'model:' #superclassNameChannel |
|
349 |
#'comboList:' #superclassNameDefaults |
|
350 |
) |
|
351 |
#(#HorizontalPanelViewSpec |
|
352 |
#'name:' 'commitPanel' |
|
353 |
#'layout:' #(#LayoutFrame 0 0.0 -24 1.0 0 1.0 0 1.0) |
|
354 |
#'component:' |
|
355 |
#(#SpecCollection |
|
356 |
#'collection:' |
|
357 |
#( |
|
358 |
#(#ActionButtonSpec |
|
359 |
#'name:' 'button1' |
|
360 |
#'label:' 'cancel' |
|
361 |
#'tabable:' true |
|
362 |
#'model:' #cancel |
|
363 |
#'extent:' #(#Point 191 24) |
|
364 |
) |
|
365 |
#(#ActionButtonSpec |
|
366 |
#'name:' 'button2' |
|
367 |
#'label:' 'ok' |
|
368 |
#'tabable:' true |
|
369 |
#'isDefault:' true |
|
370 |
#'model:' #accept |
|
371 |
#'extent:' #(#Point 191 24) |
|
372 |
) |
|
373 |
) |
|
374 |
) |
|
375 |
#'horizontalLayout:' #fitSpace |
|
376 |
#'verticalLayout:' #fit |
|
377 |
#'horizontalSpace:' 3 |
|
378 |
#'verticalSpace:' 3 |
|
379 |
) |
|
380 |
) |
|
381 |
) |
|
382 |
) |
|
383 |
||
384 |
"Modified: 24.6.1997 / 18:50:14 / cg" |
|
385 |
! |
|
386 |
||
387 |
windowSpec |
|
388 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
389 |
||
390 |
"do not manually edit this - the painter/builder may not be able to |
|
391 |
handle the specification if its corrupted." |
|
392 |
||
393 |
" |
|
394 |
UIPainter new openOnClass:UIPainter andSelector:#windowSpec |
|
395 |
UIPainter new openInterface:#windowSpec |
|
396 |
" |
|
397 |
"UIPainter open" |
|
398 |
||
399 |
<resource: #canvas> |
|
400 |
||
401 |
^ |
|
402 |
||
403 |
#(#FullSpec |
|
404 |
#'window:' |
|
405 |
#(#WindowSpec |
|
406 |
#'name:' 'uIPainterView' |
|
407 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
408 |
#'label:' 'Tree-View' |
|
409 |
#'bounds:' #(#Rectangle 0 0 561 450) |
|
410 |
) |
|
411 |
#'component:' |
|
412 |
#(#SpecCollection |
|
413 |
#'collection:' |
|
414 |
#( |
|
415 |
#(#MenuPanelSpec |
|
416 |
#'name:' 'menuPullDown' |
|
417 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 25 0) |
|
418 |
#'tabable:' true |
|
419 |
#'menu:' #menuPullDown |
|
420 |
) |
|
421 |
#(#NoteBookViewSpec |
|
422 |
#'name:' 'noteBook' |
|
423 |
#'layout:' #(#LayoutFrame 0 0.4 59 0.0 0 1.0 -55 1.0) |
|
424 |
#'enableChannel:' #enableChannel |
|
425 |
#'tabable:' true |
|
426 |
#'menu:' #tabList |
|
427 |
#'style:' |
|
428 |
#(#FontDescription |
|
429 |
#helvetica #medium |
|
430 |
#roman #'10' |
|
431 |
) |
|
432 |
#'model:' #tabModel |
|
433 |
#'tabWidget:' #Window |
|
434 |
#'canvas:' #noteBookView |
|
435 |
) |
|
436 |
#(#HorizontalPanelViewSpec |
|
437 |
#'name:' 'modifyPanel' |
|
438 |
#'layout:' #(#LayoutFrame 0 0.4 -55 1.0 0 1.0 -25 1.0) |
|
439 |
#'component:' |
|
440 |
#(#SpecCollection |
|
441 |
#'collection:' |
|
442 |
#( |
|
443 |
#(#ActionButtonSpec |
|
444 |
#'name:' 'cancelButton' |
|
445 |
#'label:' 'cancel' |
|
446 |
#'tabable:' true |
|
447 |
#'model:' #cancel |
|
448 |
#'enableChannel:' #modifiedChannel |
|
449 |
#'extent:' #(#Point 164 24) |
|
450 |
) |
|
451 |
#(#ActionButtonSpec |
|
452 |
#'name:' 'acceptButton' |
|
453 |
#'label:' 'ok' |
|
454 |
#'tabable:' true |
|
455 |
#'model:' #accept |
|
456 |
#'enableChannel:' #modifiedChannel |
|
457 |
#'extent:' #(#Point 164 24) |
|
458 |
) |
|
459 |
) |
|
460 |
) |
|
461 |
#'level:' 0 |
|
462 |
#'horizontalLayout:' #fitSpace |
|
463 |
#'verticalLayout:' #fitSpace |
|
464 |
#'horizontalSpace:' 3 |
|
465 |
#'verticalSpace:' 3 |
|
466 |
) |
|
467 |
#(#LabelSpec |
|
468 |
#'name:' 'helpInfo' |
|
469 |
#'layout:' #(#LayoutFrame 2 0.0 -25 1.0 -2 1.0 -2 1.0) |
|
470 |
#'level:' -1 |
|
471 |
#'adjust:' #left |
|
472 |
) |
|
473 |
#(#ToggleSpec |
|
474 |
#'name:' 'galleryLabel' |
|
475 |
#'layout:' #(#LayoutFrame -162 1.0 1 0 -82 1.0 23 0) |
|
476 |
#'label:' 'Gallery' |
|
477 |
#'model:' #galleryShown |
|
478 |
#'isTriggerOnDown:' true |
|
479 |
#'showLamp:' true |
|
480 |
#'lampColor:' #(#Color 100.0 100.0 0.0) |
|
481 |
) |
|
482 |
#(#ToggleSpec |
|
483 |
#'name:' 'painterLabel' |
|
484 |
#'layout:' #(#LayoutFrame -81 1.0 1 0 -1 1.0 23 0) |
|
485 |
#'label:' 'Painter' |
|
486 |
#'model:' #painterShown |
|
487 |
#'isTriggerOnDown:' true |
|
488 |
#'showLamp:' true |
|
489 |
#'lampColor:' #(#Color 100.0 100.0 0.0) |
|
490 |
) |
|
491 |
#(#ArbitraryComponentSpec |
|
492 |
#'name:' 'treeView' |
|
493 |
#'layout:' #(#LayoutFrame 0 0.0 59 0 0 0.4 -25 1.0) |
|
494 |
#'menu:' #menuCanvas |
|
495 |
#'hasHorizontalScrollBar:' true |
|
496 |
#'hasVerticalScrollBar:' true |
|
497 |
#'miniScrollerHorizontal:' true |
|
498 |
#'miniScrollerVertical:' true |
|
499 |
#'component:' #treeView |
|
500 |
#'hasBorder:' false |
|
501 |
) |
|
502 |
#(#HorizontalPanelViewSpec |
|
503 |
#'name:' 'menuContainer' |
|
504 |
#'layout:' #(#LayoutFrame 0 0.0 26 0 0 1.0 58 0) |
|
505 |
#'component:' |
|
506 |
#(#SpecCollection |
|
507 |
#'collection:' |
|
508 |
#( |
|
509 |
#(#MenuPanelSpec |
|
510 |
#'name:' 'menuMove' |
|
511 |
#'menu:' #menuMove |
|
512 |
#'showSeparatingLines:' true |
|
513 |
#'extent:' #(#Point 123 32) |
|
514 |
) |
|
515 |
#(#MenuPanelSpec |
|
516 |
#'name:' 'menuAlignment' |
|
517 |
#'tabable:' true |
|
518 |
#'menu:' #menuAlignment |
|
519 |
#'showSeparatingLines:' true |
|
520 |
#'extent:' #(#Point 233 32) |
|
521 |
) |
|
522 |
#(#HorizontalPanelViewSpec |
|
523 |
#'name:' 'panelViewButtons' |
|
524 |
#'component:' |
|
525 |
#(#SpecCollection |
|
526 |
#'collection:' |
|
527 |
#( |
|
528 |
#(#ArrowButtonSpec |
|
529 |
#'name:' 'moveLeft' |
|
530 |
#'tabable:' true |
|
531 |
#'model:' #moveSelectionLeft |
|
532 |
#'isTriggerOnDown:' true |
|
533 |
#'enableChannel:' #hasValidSelection |
|
534 |
#'direction:' #left |
|
535 |
#'extent:' #(#Point 25 24) |
|
536 |
) |
|
537 |
#(#ArrowButtonSpec |
|
538 |
#'name:' 'moveRight' |
|
539 |
#'model:' #moveSelectionRight |
|
540 |
#'isTriggerOnDown:' true |
|
541 |
#'enableChannel:' #hasValidSelection |
|
542 |
#'direction:' #right |
|
543 |
#'extent:' #(#Point 26 24) |
|
544 |
) |
|
545 |
#(#ArrowButtonSpec |
|
546 |
#'name:' 'moveDown' |
|
547 |
#'model:' #moveSelectionDown |
|
548 |
#'isTriggerOnDown:' true |
|
549 |
#'enableChannel:' #hasValidSelection |
|
550 |
#'direction:' #down |
|
551 |
#'extent:' #(#Point 26 24) |
|
552 |
) |
|
553 |
#(#ArrowButtonSpec |
|
554 |
#'name:' 'moveUp' |
|
555 |
#'model:' #moveSelectionUp |
|
556 |
#'isTriggerOnDown:' true |
|
557 |
#'enableChannel:' #hasValidSelection |
|
558 |
#'direction:' #up |
|
559 |
#'extent:' #(#Point 22 24) |
|
560 |
) |
|
561 |
) |
|
562 |
) |
|
563 |
#'level:' 1 |
|
564 |
#'horizontalLayout:' #spreadSpace |
|
565 |
#'verticalLayout:' #fitSpace |
|
566 |
#'horizontalSpace:' 4 |
|
567 |
#'verticalSpace:' 4 |
|
568 |
#'extent:' #(#Point 125 32) |
|
569 |
) |
|
570 |
) |
|
571 |
) |
|
572 |
#'horizontalLayout:' #spread |
|
573 |
#'verticalLayout:' #fit |
|
574 |
#'horizontalSpace:' 3 |
|
575 |
#'verticalSpace:' 3 |
|
576 |
) |
|
577 |
) |
|
578 |
) |
|
579 |
) |
|
580 |
! ! |
|
581 |
||
582 |
!UIPainter class methodsFor:'menu specs'! |
|
583 |
||
118 | 584 |
menuAlignment |
217 | 585 |
"this window spec was automatically generated by the ST/X MenuEditor" |
586 |
||
587 |
"do not manually edit this - the builder may not be able to |
|
588 |
handle the specification if its corrupted." |
|
589 |
||
590 |
" |
|
591 |
MenuEditor new openOnClass:UIPainter andSelector:#menuAlignment |
|
592 |
(Menu new fromLiteralArrayEncoding:(UIPainter menuAlignment)) startUp |
|
593 |
" |
|
594 |
||
595 |
<resource: #menu> |
|
596 |
||
597 |
^ |
|
598 |
||
599 |
#(#Menu |
|
600 |
||
601 |
#( |
|
602 |
#(#MenuItem |
|
603 |
#'label:' 'align left' |
|
604 |
#'value:' #alignSelectionLeft |
|
222 | 605 |
#'enabled:' #hasValidSelection |
217 | 606 |
#'activeHelpKey:' #alignSelectionLeft |
607 |
#'labelImage:' |
|
608 |
#(#ResourceRetriever |
|
609 |
nil #iconAlignL |
|
610 |
) |
|
611 |
) |
|
612 |
#(#MenuItem |
|
613 |
#'label:' 'align right' |
|
614 |
#'value:' #alignSelectionRight |
|
222 | 615 |
#'enabled:' #hasValidSelection |
217 | 616 |
#'activeHelpKey:' #alignSelectionRight |
617 |
#'labelImage:' |
|
618 |
#(#ResourceRetriever |
|
619 |
nil #iconAlignR |
|
620 |
) |
|
621 |
) |
|
622 |
#(#MenuItem |
|
623 |
#'label:' 'align left & right' |
|
624 |
#'value:' #alignSelectionLeftAndRight |
|
222 | 625 |
#'enabled:' #hasValidSelection |
217 | 626 |
#'activeHelpKey:' #alignSelectionLeftAndRight |
627 |
#'labelImage:' |
|
628 |
#(#ResourceRetriever |
|
629 |
nil #iconAlignLR |
|
118 | 630 |
) |
217 | 631 |
) |
632 |
#(#MenuItem |
|
633 |
#'label:' 'align top' |
|
634 |
#'value:' #alignSelectionTop |
|
222 | 635 |
#'enabled:' #hasValidSelection |
217 | 636 |
#'activeHelpKey:' #alignSelectionTop |
637 |
#'labelImage:' |
|
638 |
#(#ResourceRetriever |
|
639 |
nil #iconAlignT |
|
640 |
) |
|
641 |
) |
|
642 |
#(#MenuItem |
|
643 |
#'label:' 'align bottom' |
|
644 |
#'value:' #alignSelectionBottom |
|
222 | 645 |
#'enabled:' #hasValidSelection |
217 | 646 |
#'activeHelpKey:' #alignSelectionBottom |
647 |
#'labelImage:' |
|
648 |
#(#ResourceRetriever |
|
649 |
nil #iconAlignB |
|
650 |
) |
|
651 |
) |
|
652 |
#(#MenuItem |
|
653 |
#'label:' 'align top & bottom' |
|
654 |
#'value:' #alignSelectionTopAndBottom |
|
222 | 655 |
#'enabled:' #hasValidSelection |
217 | 656 |
#'activeHelpKey:' #alignSelectionTopAndBottom |
657 |
#'labelImage:' |
|
658 |
#(#ResourceRetriever |
|
659 |
nil #iconAlignTB |
|
660 |
) |
|
661 |
) |
|
662 |
#(#MenuItem |
|
663 |
#'label:' 'align centered horizontal' |
|
664 |
#'value:' #alignSelectionCenterHor |
|
222 | 665 |
#'enabled:' #hasValidSelection |
217 | 666 |
#'activeHelpKey:' #alignSelectionCenterHor |
667 |
#'labelImage:' |
|
668 |
#(#ResourceRetriever |
|
669 |
nil #iconAlignCenterH |
|
670 |
) |
|
671 |
) |
|
672 |
#(#MenuItem |
|
673 |
#'label:' 'align centered vertical' |
|
674 |
#'value:' #alignSelectionCenterVer |
|
222 | 675 |
#'enabled:' #hasValidSelection |
217 | 676 |
#'activeHelpKey:' #alignSelectionCenterVer |
677 |
#'labelImage:' |
|
678 |
#(#ResourceRetriever |
|
679 |
nil #iconAlignCenterV |
|
680 |
) |
|
681 |
) |
|
682 |
) |
|
683 |
#( 3 3 ) |
|
684 |
nil |
|
685 |
) |
|
118 | 686 |
! |
687 |
||
222 | 688 |
menuCanvas |
689 |
"this window spec was automatically generated by the ST/X MenuEditor" |
|
690 |
||
691 |
"do not manually edit this - the builder may not be able to |
|
692 |
handle the specification if its corrupted." |
|
693 |
||
694 |
" |
|
695 |
MenuEditor new openOnClass:UIPainter andSelector:#menuCanvas |
|
696 |
(Menu new fromLiteralArrayEncoding:(UIPainter menuCanvas)) startUp |
|
697 |
" |
|
698 |
||
699 |
<resource: #menu> |
|
700 |
||
701 |
^ |
|
702 |
||
703 |
#(#Menu |
|
704 |
||
705 |
#( |
|
706 |
#(#MenuItem |
|
707 |
#'label:' 'copy' |
|
708 |
#'value:' #copySelection |
|
709 |
#'shortcutKeyCharacter:' #Copy |
|
710 |
) |
|
711 |
#(#MenuItem |
|
712 |
#'label:' 'cut' |
|
713 |
#'value:' #deleteSelection |
|
714 |
#'shortcutKeyCharacter:' #Cut |
|
715 |
) |
|
716 |
#(#MenuItem |
|
717 |
#'label:' 'paste' |
|
718 |
#'nameKey:' #paste |
|
719 |
#'value:' #paste |
|
720 |
#'submenu:' |
|
721 |
#(#Menu |
|
722 |
||
723 |
#( |
|
724 |
#(#MenuItem |
|
725 |
#'label:' 'paste' |
|
726 |
#'value:' #pasteBuffer |
|
727 |
#'activeHelpKey:' #pasteBuffer |
|
728 |
#'shortcutKeyCharacter:' #Paste |
|
729 |
) |
|
730 |
#(#MenuItem |
|
731 |
#'label:' 'keep layout' |
|
732 |
#'value:' #pasteWithLayout |
|
733 |
#'activeHelpKey:' #pasteWithLayout |
|
734 |
) |
|
735 |
) nil |
|
736 |
nil |
|
737 |
) |
|
738 |
) |
|
739 |
#(#MenuItem |
|
740 |
#'label:' '-' |
|
741 |
) |
|
742 |
#(#MenuItem |
|
743 |
#'label:' 'undo' |
|
744 |
#'nameKey:' #undo |
|
745 |
#'value:' #undoLast |
|
746 |
) |
|
747 |
#(#MenuItem |
|
748 |
#'label:' '-' |
|
749 |
) |
|
750 |
#(#MenuItem |
|
751 |
#'label:' 'dimension' |
|
752 |
#'value:' #dimension |
|
753 |
#'submenu:' |
|
754 |
#(#Menu |
|
755 |
||
756 |
#( |
|
757 |
#(#MenuItem |
|
758 |
#'label:' 'default extent' |
|
759 |
#'value:' #setToDefaultExtent |
|
760 |
#'activeHelpKey:' #setToDefaultExtent |
|
761 |
) |
|
762 |
#(#MenuItem |
|
763 |
#'label:' 'default width' |
|
764 |
#'value:' #setToDefaultWidth |
|
765 |
#'activeHelpKey:' #setToDefaultWidth |
|
766 |
) |
|
767 |
#(#MenuItem |
|
768 |
#'label:' 'default height' |
|
769 |
#'value:' #setToDefaultHeight |
|
770 |
#'activeHelpKey:' #setToDefaultHeight |
|
771 |
) |
|
772 |
#(#MenuItem |
|
773 |
#'label:' 'copy extent' |
|
774 |
#'value:' #copyExtent |
|
775 |
#'activeHelpKey:' #copyExtent |
|
776 |
) |
|
777 |
#(#MenuItem |
|
778 |
#'label:' 'paste extent' |
|
779 |
#'value:' #pasteExtent |
|
780 |
#'activeHelpKey:' #pasteExtent |
|
781 |
) |
|
782 |
#(#MenuItem |
|
783 |
#'label:' 'paste width' |
|
784 |
#'value:' #pasteWidth |
|
785 |
#'activeHelpKey:' #pasteWidth |
|
786 |
) |
|
787 |
#(#MenuItem |
|
788 |
#'label:' 'paste height' |
|
789 |
#'value:' #pasteHeight |
|
790 |
#'activeHelpKey:' #pasteHeight |
|
791 |
) |
|
792 |
#(#MenuItem |
|
793 |
#'label:' 'copy layout' |
|
794 |
#'value:' #copyLayout |
|
795 |
#'activeHelpKey:' #copyLayout |
|
796 |
) |
|
797 |
#(#MenuItem |
|
798 |
#'label:' 'paste layout' |
|
799 |
#'value:' #pasteLayout |
|
800 |
#'activeHelpKey:' #pasteLayout |
|
801 |
) |
|
802 |
) |
|
803 |
#(3 1 3) |
|
804 |
nil |
|
805 |
) |
|
806 |
) |
|
807 |
#(#MenuItem |
|
808 |
#'label:' 'align' |
|
809 |
#'value:' #align |
|
810 |
#'submenu:' |
|
811 |
#(#Menu |
|
812 |
||
813 |
#( |
|
814 |
#(#MenuItem |
|
815 |
#'label:' 'align left' |
|
816 |
#'value:' #alignSelectionLeft |
|
817 |
#'activeHelpKey:' #alignSelectionLeft |
|
818 |
#'labelImage:' |
|
819 |
#(#ResourceRetriever |
|
820 |
#UIPainter #iconAlignL |
|
821 |
'align left' |
|
822 |
) |
|
823 |
) |
|
824 |
#(#MenuItem |
|
825 |
#'label:' 'align right' |
|
826 |
#'value:' #alignSelectionRight |
|
827 |
#'activeHelpKey:' #alignSelectionRight |
|
828 |
#'labelImage:' |
|
829 |
#(#ResourceRetriever |
|
830 |
#UIPainter #iconAlignR |
|
831 |
'align right' |
|
832 |
) |
|
833 |
) |
|
834 |
#(#MenuItem |
|
835 |
#'label:' 'align left & right' |
|
836 |
#'value:' #alignSelectionLeftAndRight |
|
837 |
#'activeHelpKey:' #alignSelectionLeftAndRight |
|
838 |
#'labelImage:' |
|
839 |
#(#ResourceRetriever |
|
840 |
#UIPainter #iconAlignLR |
|
841 |
'align left & right' |
|
842 |
) |
|
843 |
) |
|
844 |
#(#MenuItem |
|
845 |
#'label:' 'align top' |
|
846 |
#'value:' #alignSelectionTop |
|
847 |
#'activeHelpKey:' #alignSelectionTop |
|
848 |
#'labelImage:' |
|
849 |
#(#ResourceRetriever |
|
850 |
#UIPainter #iconAlignT |
|
851 |
'align top' |
|
852 |
) |
|
853 |
) |
|
854 |
#(#MenuItem |
|
855 |
#'label:' 'align bottom' |
|
856 |
#'value:' #alignSelectionBottom |
|
857 |
#'activeHelpKey:' #alignSelectionBottom |
|
858 |
#'labelImage:' |
|
859 |
#(#ResourceRetriever |
|
860 |
#UIPainter #iconAlignB |
|
861 |
'align bottom' |
|
862 |
) |
|
863 |
) |
|
864 |
#(#MenuItem |
|
865 |
#'label:' 'align top & bottom' |
|
866 |
#'value:' #alignSelectionTopAndBottom |
|
867 |
#'activeHelpKey:' #alignSelectionTopAndBottom |
|
868 |
#'labelImage:' |
|
869 |
#(#ResourceRetriever |
|
870 |
#UIPainter #iconAlignTB |
|
871 |
'align top & bottom' |
|
872 |
) |
|
873 |
) |
|
874 |
#(#MenuItem |
|
875 |
#'label:' 'align centered horizontal' |
|
876 |
#'value:' #alignSelectionCenterHor |
|
877 |
#'activeHelpKey:' #alignSelectionCenterHor |
|
878 |
#'labelImage:' |
|
879 |
#(#ResourceRetriever |
|
880 |
#UIPainter #iconAlignCenterH |
|
881 |
'align centered horizontal' |
|
882 |
) |
|
883 |
) |
|
884 |
#(#MenuItem |
|
885 |
#'label:' 'align centered vertical' |
|
886 |
#'value:' #alignSelectionCenterVer |
|
887 |
#'activeHelpKey:' #alignSelectionCenterVer |
|
888 |
#'labelImage:' |
|
889 |
#(#ResourceRetriever |
|
890 |
#UIPainter #iconAlignCenterV |
|
891 |
'align centered vertical' |
|
892 |
) |
|
893 |
) |
|
894 |
#(#MenuItem |
|
895 |
#'label:' 'spread horizontal' |
|
896 |
#'value:' #spreadSelectionHor |
|
897 |
#'activeHelpKey:' #spreadSelectionHor |
|
898 |
) |
|
899 |
#(#MenuItem |
|
900 |
#'label:' 'spread vertical' |
|
901 |
#'value:' #spreadSelectionVer |
|
902 |
#'activeHelpKey:' #spreadSelectionVer |
|
903 |
) |
|
904 |
#(#MenuItem |
|
905 |
#'label:' 'center horizontal in frame' |
|
906 |
#'value:' #centerSelectionHor |
|
907 |
#'activeHelpKey:' #centerSelectionHor |
|
908 |
) |
|
909 |
#(#MenuItem |
|
910 |
#'label:' 'center vertical in frame' |
|
911 |
#'value:' #centerSelectionVer |
|
912 |
#'activeHelpKey:' #centerSelectionVer |
|
913 |
) |
|
914 |
) |
|
915 |
#(8 2) |
|
916 |
nil |
|
917 |
) |
|
918 |
) |
|
919 |
) nil |
|
920 |
nil |
|
921 |
) |
|
922 |
||
923 |
||
924 |
! |
|
925 |
||
926 |
menuMove |
|
927 |
"this window spec was automatically generated by the ST/X MenuEditor" |
|
928 |
||
929 |
"do not manually edit this - the builder may not be able to |
|
930 |
handle the specification if its corrupted." |
|
931 |
||
932 |
" |
|
933 |
MenuEditor new openOnClass:UIPainter andSelector:#menuMove |
|
934 |
(Menu new fromLiteralArrayEncoding:(UIPainter menuMove)) startUp |
|
935 |
" |
|
936 |
||
937 |
<resource: #menu> |
|
938 |
||
939 |
^ |
|
940 |
||
941 |
#(#Menu |
|
942 |
||
943 |
#( |
|
944 |
#(#MenuItem |
|
945 |
#'label:' 'stepUp' |
|
946 |
#'value:' #doStepUp |
|
947 |
#'enabled:' #hasSingleSelection |
|
948 |
#'labelImage:' |
|
949 |
#(#ResourceRetriever |
|
950 |
#UIPainter #iconStepUp |
|
951 |
) |
|
952 |
) |
|
953 |
#(#MenuItem |
|
954 |
#'label:' 'stepDown' |
|
955 |
#'value:' #doStepDown |
|
956 |
#'enabled:' #hasSingleSelection |
|
957 |
#'labelImage:' |
|
958 |
#(#ResourceRetriever |
|
959 |
#UIPainter #iconStepDown |
|
960 |
) |
|
961 |
) |
|
962 |
#(#MenuItem |
|
963 |
#'label:' '' |
|
964 |
) |
|
965 |
#(#MenuItem |
|
966 |
#'label:' 'stepIn' |
|
967 |
#'value:' #doStepIn |
|
968 |
#'enabled:' #canStepIn |
|
969 |
#'labelImage:' |
|
970 |
#(#ResourceRetriever |
|
971 |
#UIPainter #iconStepIn |
|
972 |
) |
|
973 |
) |
|
974 |
#(#MenuItem |
|
975 |
#'label:' 'stepOut' |
|
976 |
#'value:' #doStepOut |
|
977 |
#'enabled:' #canStepOut |
|
978 |
#'labelImage:' |
|
979 |
#(#ResourceRetriever |
|
980 |
#UIPainter #iconStepOut |
|
981 |
) |
|
982 |
) |
|
983 |
) nil |
|
984 |
nil |
|
985 |
) |
|
986 |
! |
|
987 |
||
118 | 988 |
menuPullDown |
217 | 989 |
"this window spec was automatically generated by the ST/X MenuEditor" |
990 |
||
991 |
"do not manually edit this - the builder may not be able to |
|
992 |
handle the specification if its corrupted." |
|
993 |
||
994 |
" |
|
995 |
MenuEditor new openOnClass:UIPainter andSelector:#menuPullDown |
|
996 |
(Menu new fromLiteralArrayEncoding:(UIPainter menuPullDown)) startUp |
|
997 |
" |
|
998 |
||
999 |
<resource: #menu> |
|
1000 |
||
1001 |
^ |
|
1002 |
||
1003 |
#(#Menu |
|
1004 |
||
1005 |
#( |
|
1006 |
#(#MenuItem |
|
109 | 1007 |
#'label:' 'file' |
114 | 1008 |
#'value:' #file |
217 | 1009 |
#'enabled:' #enableChannel |
1010 |
#'submenu:' |
|
1011 |
#(#Menu |
|
1012 |
||
1013 |
#( |
|
1014 |
#(#MenuItem |
|
1015 |
#'label:' 'new' |
|
1016 |
#'value:' #doNew |
|
1017 |
) |
|
1018 |
#(#MenuItem |
|
1019 |
#'label:' 'from class ...' |
|
1020 |
#'value:' #doFromClass |
|
1021 |
) |
|
1022 |
#(#MenuItem |
|
1023 |
#'label:' 'pick a view ' |
|
1024 |
#'value:' #doPickAView |
|
1025 |
) |
|
1026 |
#(#MenuItem |
|
1027 |
#'label:' '-' |
|
1028 |
) |
|
1029 |
#(#MenuItem |
|
1030 |
#'label:' 'quit' |
|
1031 |
#'value:' #closeRequest |
|
1032 |
) |
|
1033 |
) nil |
|
1034 |
nil |
|
1035 |
) |
|
1036 |
) |
|
1037 |
#(#MenuItem |
|
109 | 1038 |
#'label:' 'misc' |
114 | 1039 |
#'value:' #misc |
217 | 1040 |
#'enabled:' #enableChannel |
1041 |
#'submenu:' |
|
1042 |
#(#Menu |
|
1043 |
||
1044 |
#( |
|
1045 |
#(#MenuItem |
|
1046 |
#'label:' 'grid' |
|
1047 |
#'value:' #grid |
|
1048 |
#'submenu:' |
|
1049 |
#(#Menu |
|
1050 |
||
1051 |
#( |
|
1052 |
#(#MenuItem |
|
1053 |
#'label:' 'show' |
|
1054 |
#'indication:' #'gridShown:' |
|
1055 |
) |
|
1056 |
#(#MenuItem |
|
1057 |
#'label:' 'align' |
|
1058 |
#'indication:' #'gridAlign:' |
|
109 | 1059 |
) |
217 | 1060 |
) nil |
1061 |
nil |
|
1062 |
) |
|
1063 |
) |
|
1064 |
#(#MenuItem |
|
1065 |
#'label:' 'undo' |
|
1066 |
#'value:' #undo |
|
1067 |
#'submenu:' |
|
1068 |
#(#Menu |
|
1069 |
||
1070 |
#( |
|
1071 |
#(#MenuItem |
|
1072 |
#'label:' 'last' |
|
1073 |
#'value:' #undoLast |
|
1074 |
) |
|
1075 |
#(#MenuItem |
|
1076 |
#'label:' 'menu' |
|
1077 |
#'value:' #openUndoMenu |
|
1078 |
) |
|
1079 |
#(#MenuItem |
|
1080 |
#'label:' '-' |
|
1081 |
) |
|
1082 |
#(#MenuItem |
|
1083 |
#'label:' 'delete' |
|
1084 |
#'value:' #removeUndoHistory |
|
1085 |
) |
|
1086 |
) nil |
|
1087 |
nil |
|
1088 |
) |
|
1089 |
) |
|
1090 |
) nil |
|
1091 |
nil |
|
1092 |
) |
|
1093 |
) |
|
1094 |
#(#MenuItem |
|
109 | 1095 |
#'label:' 'code' |
114 | 1096 |
#'value:' #code |
217 | 1097 |
#'enabled:' #enableChannel |
1098 |
#'submenu:' |
|
1099 |
#(#Menu |
|
1100 |
||
1101 |
#( |
|
1102 |
#(#MenuItem |
|
1103 |
#'label:' 'class && method ...' |
|
1104 |
#'value:' #defineClassAndSelector |
|
1105 |
) |
|
1106 |
#(#MenuItem |
|
1107 |
#'label:' '=' |
|
1108 |
) |
|
1109 |
#(#MenuItem |
|
1110 |
#'label:' 'install window spec.' |
|
1111 |
#'value:' #doInstallSpec |
|
1112 |
#'enabled:' #hasSpecClassAndSelector |
|
1113 |
) |
|
1114 |
#(#MenuItem |
|
1115 |
#'label:' 'install help spec.' |
|
1116 |
#'value:' #doInstallHelp |
|
1117 |
#'enabled:' #hasSpecClass |
|
1118 |
) |
|
1119 |
#(#MenuItem |
|
1120 |
#'label:' '-' |
|
1121 |
) |
|
1122 |
#(#MenuItem |
|
1123 |
#'label:' 'install aspects' |
|
1124 |
#'value:' #doInstallAspects |
|
1125 |
#'enabled:' #hasSpecClass |
|
1126 |
) |
|
1127 |
#(#MenuItem |
|
1128 |
#'label:' '=' |
|
1129 |
) |
|
1130 |
#(#MenuItem |
|
1131 |
#'label:' 'show window spec.' |
|
1132 |
#'value:' #doWindowSpec |
|
1133 |
) |
|
1134 |
#(#MenuItem |
|
1135 |
#'label:' '=' |
|
1136 |
) |
|
1137 |
#(#MenuItem |
|
1138 |
#'label:' 'browse application' |
|
1139 |
#'value:' #doBrowseAppClass |
|
1140 |
#'enabled:' #hasSpecClass |
|
1141 |
) |
|
1142 |
#(#MenuItem |
|
1143 |
#'label:' 'start application' |
|
1144 |
#'value:' #doStartApplication |
|
1145 |
#'enabled:' #hasSpecClass |
|
1146 |
) |
|
1147 |
) nil |
|
1148 |
nil |
|
1149 |
) |
|
1150 |
) |
|
1151 |
#(#MenuItem |
|
109 | 1152 |
#'label:' 'test' |
118 | 1153 |
#'nameKey:' #test |
114 | 1154 |
#'value:' #test |
217 | 1155 |
#'submenu:' |
1156 |
#(#Menu |
|
1157 |
||
1158 |
#( |
|
1159 |
#(#MenuItem |
|
1160 |
#'label:' 'test mode' |
|
1161 |
#'indication:' #'testMode:' |
|
1162 |
) |
|
1163 |
) nil |
|
1164 |
nil |
|
1165 |
) |
|
1166 |
) |
|
1167 |
) nil |
|
1168 |
nil |
|
109 | 1169 |
) |
222 | 1170 |
! ! |
1171 |
||
1172 |
!UIPainter methodsFor:'accessing menu'! |
|
1173 |
||
1174 |
menuCanvas |
|
1175 |
^ [ treeView canvas showMiddleButtonMenu ] |
|
109 | 1176 |
! |
1177 |
||
222 | 1178 |
menuMove |
1179 |
"this window spec was automatically generated by the ST/X MenuEditor" |
|
1180 |
||
1181 |
^ self class menuMove |
|
1182 |
||
1183 |
||
1184 |
! |
|
1185 |
||
1186 |
menuPullDown |
|
1187 |
"this window spec was automatically generated by the ST/X MenuEditor" |
|
1188 |
||
1189 |
^ self class menuPullDown |
|
1190 |
||
1191 |
||
60 | 1192 |
! ! |
1193 |
||
109 | 1194 |
!UIPainter methodsFor:'actions'! |
60 | 1195 |
|
109 | 1196 |
accept |
1197 |
|layout| |
|
60 | 1198 |
|
166 | 1199 |
self isLayoutToolSelected ifTrue:[ |
144 | 1200 |
(layout := layoutTool layout) notNil ifTrue:[ |
1201 |
layoutTool layoutType == #Extent ifTrue:[ |
|
1202 |
self painter setExtent:layout |
|
1203 |
] ifFalse:[ |
|
149 | 1204 |
self painter setLayout:layout |
109 | 1205 |
] |
144 | 1206 |
] |
1207 |
] ifFalse:[ |
|
166 | 1208 |
self isHelpToolSelected ifTrue:[ |
149 | 1209 |
activeHelpTool accept |
1210 |
]. |
|
171 | 1211 |
self painter updateFromSpec:(specTool specification). |
144 | 1212 |
]. |
166 | 1213 |
self modifiedChannel value:false. |
109 | 1214 |
|
1215 |
! |
|
1216 |
||
1217 |
cancel |
|
1218 |
"cancel all changes and read back attributes from current view |
|
1219 |
" |
|
166 | 1220 |
self modifiedChannel value ifTrue:[ |
171 | 1221 |
specTool specification:(self painter specForSelection). |
166 | 1222 |
layoutTool layoutView:(layoutTool layoutView). |
1223 |
self modifiedChannel value:false. |
|
1224 |
] |
|
137 | 1225 |
! |
1226 |
||
217 | 1227 |
openEditMenu |
1228 |
|cls aspect editor| |
|
1229 |
||
1230 |
specClass isNil ifTrue:[ |
|
1231 |
^ self information:'no class yet'. |
|
1232 |
]. |
|
1233 |
(cls := specClass) isBehavior ifFalse:[ |
|
1234 |
cls := Smalltalk at:specClass asSymbol. |
|
1235 |
cls isNil ifTrue:[ |
|
1236 |
^ self information:'no class yet' |
|
1237 |
] |
|
1238 |
]. |
|
1239 |
||
1240 |
cls notNil ifTrue:[ |
|
1241 |
(aspect := specTool specification menu) notNil ifTrue:[ |
|
1242 |
aspect := aspect asSymbol |
|
1243 |
]. |
|
1244 |
editor := MenuEditor new. |
|
1245 |
editor masterApplication:self. |
|
1246 |
editor activeHelpTool:(self activeHelpTool). |
|
1247 |
editor openModalOnClass:cls andSelector:aspect |
|
1248 |
] |
|
1249 |
||
1250 |
||
60 | 1251 |
! ! |
1252 |
||
149 | 1253 |
!UIPainter methodsFor:'active help'! |
1254 |
||
197 | 1255 |
activeHelpTool |
1256 |
"setup help tool |
|
171 | 1257 |
" |
149 | 1258 |
activeHelpTool isNil ifTrue:[ |
152 | 1259 |
activeHelpTool := UIHelpTool new. |
197 | 1260 |
activeHelpTool helpSpecFrom:specClass. |
217 | 1261 |
activeHelpTool masterApplication:self. |
149 | 1262 |
]. |
1263 |
^ activeHelpTool |
|
1264 |
! |
|
1265 |
||
1266 |
showHelp:aHelpText for:view |
|
1267 |
"hook to allow an application to display active help |
|
1268 |
texts in its own info area. |
|
1269 |
This method may be redefined in a concrete application. |
|
1270 |
If it returns false, the ActiveHelp manager will popup a |
|
1271 |
bubble with the help text." |
|
1272 |
||
1273 |
|l| |
|
1274 |
||
1275 |
(l := self builder componentAt:#helpInfo) notNil ifTrue:[ |
|
152 | 1276 |
aHelpText replaceAll:(Character cr) by:(Character space). |
149 | 1277 |
l label:aHelpText. |
152 | 1278 |
^ true. |
149 | 1279 |
]. |
1280 |
^ false |
|
1281 |
||
1282 |
||
1283 |
! ! |
|
1284 |
||
60 | 1285 |
!UIPainter methodsFor:'aspects'! |
1286 |
||
222 | 1287 |
canStepIn |
1288 |
|holder| |
|
1289 |
||
1290 |
(holder := builder bindingAt:#canStepIn) isNil ifTrue:[ |
|
1291 |
builder aspectAt:#canStepIn put:(holder := false asValue). |
|
1292 |
]. |
|
1293 |
^ holder |
|
1294 |
||
1295 |
! |
|
1296 |
||
1297 |
canStepOut |
|
1298 |
|holder| |
|
1299 |
||
1300 |
(holder := builder bindingAt:#canStepOut) isNil ifTrue:[ |
|
1301 |
builder aspectAt:#canStepOut put:(holder := false asValue). |
|
1302 |
]. |
|
1303 |
^ holder |
|
1304 |
||
1305 |
! |
|
1306 |
||
118 | 1307 |
enableChannel |
1308 |
"true if modifications are allowed otherwise running test |
|
1309 |
" |
|
1310 |
^ self painter enableChannel |
|
109 | 1311 |
! |
1312 |
||
173 | 1313 |
galleryShown |
1314 |
|holder| |
|
1315 |
||
1316 |
(holder := builder bindingAt:#galleryShown) isNil ifTrue:[ |
|
1317 |
builder aspectAt:#galleryShown put:(holder := true asValue). |
|
1318 |
holder addDependent:self |
|
1319 |
]. |
|
1320 |
^ holder |
|
1321 |
||
1322 |
! |
|
1323 |
||
222 | 1324 |
hasSingleSelection |
1325 |
|holder| |
|
1326 |
||
1327 |
(holder := builder bindingAt:#hasSingleSelection) isNil ifTrue:[ |
|
1328 |
builder aspectAt:#hasSingleSelection put:(holder := false asValue). |
|
1329 |
]. |
|
1330 |
^ holder |
|
1331 |
||
1332 |
! |
|
1333 |
||
1334 |
hasValidSelection |
|
1335 |
|holder| |
|
1336 |
||
1337 |
(holder := builder bindingAt:#hasValidSelection) isNil ifTrue:[ |
|
1338 |
builder aspectAt:#hasValidSelection put:(holder := false asValue). |
|
1339 |
]. |
|
1340 |
^ holder |
|
1341 |
||
1342 |
! |
|
1343 |
||
109 | 1344 |
modifiedChannel |
1345 |
||
1346 |
|holder| |
|
1347 |
||
1348 |
(holder := builder bindingAt:#modifiedChannel) isNil ifTrue:[ |
|
1349 |
builder aspectAt:#modifiedChannel put:(holder := false asValue). |
|
1350 |
]. |
|
1351 |
^ holder |
|
1352 |
! |
|
1353 |
||
1354 |
noteBookView |
|
1355 |
"automatically generated by UIPainter ..." |
|
1356 |
||
166 | 1357 |
|noteBook channel n1 n2| |
109 | 1358 |
|
1359 |
(noteBook := builder bindingAt:#noteBookView) isNil ifTrue:[ |
|
166 | 1360 |
noteBook := View new. |
1361 |
layoutTool := UILayoutTool new. |
|
1362 |
specTool := UISpecificationTool new. |
|
144 | 1363 |
channel := self modifiedChannel. |
166 | 1364 |
|
152 | 1365 |
layoutTool masterApplication:self. |
166 | 1366 |
specTool masterApplication:self. |
1367 |
||
1368 |
n1 := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook. |
|
1369 |
n2 := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook. |
|
1370 |
||
1371 |
n1 client:layoutTool. |
|
1372 |
specTool builder:(n2 client:specTool). |
|
1373 |
||
1374 |
layoutTool masterApplication:self. |
|
1375 |
specTool masterApplication:self. |
|
109 | 1376 |
layoutTool modifiedHolder:channel. |
166 | 1377 |
specTool modifiedHolder:channel. |
109 | 1378 |
builder aspectAt:#noteBookView put:noteBook. |
1379 |
]. |
|
1380 |
^ noteBook |
|
1381 |
! |
|
1382 |
||
1383 |
objectList |
|
222 | 1384 |
^ nil |
1385 |
" |
|
1386 |
|holder| |
|
1387 |
||
1388 |
(holder := builder bindingAt:#objectList) isNil ifTrue:[ |
|
1389 |
builder aspectAt:#objectList put:(holder := SelectionInList). |
|
1390 |
]. |
|
1391 |
^ holder |
|
1392 |
||
1393 |
" |
|
109 | 1394 |
! |
1395 |
||
1396 |
objectListMenu |
|
1397 |
"returns a block which returns the menu |
|
114 | 1398 |
!!hack!! |
109 | 1399 |
" |
121 | 1400 |
^ [ self painter showMiddleButtonMenu ]. |
109 | 1401 |
|
1402 |
||
1403 |
||
1404 |
! |
|
1405 |
||
173 | 1406 |
painterShown |
1407 |
|holder| |
|
1408 |
||
1409 |
(holder := builder bindingAt:#painterShown) isNil ifTrue:[ |
|
1410 |
builder aspectAt:#painterShown put:(holder := true asValue). |
|
1411 |
holder addDependent:self |
|
1412 |
]. |
|
1413 |
^ holder |
|
1414 |
||
1415 |
! |
|
1416 |
||
109 | 1417 |
tabList |
1418 |
"automatically generated by UIPainter ..." |
|
1419 |
||
1420 |
|holder| |
|
1421 |
||
1422 |
(holder := builder bindingAt:#tabList) isNil ifTrue:[ |
|
1423 |
builder aspectAt:#tabList put:(holder := ValueHolder new). |
|
144 | 1424 |
holder value:#( 'Properties' ). |
109 | 1425 |
]. |
1426 |
^ holder |
|
1427 |
! |
|
1428 |
||
1429 |
tabModel |
|
1430 |
"automatically generated by UIPainter ..." |
|
1431 |
||
1432 |
|holder| |
|
1433 |
||
1434 |
(holder := builder bindingAt:#tabModel) isNil ifTrue:[ |
|
1435 |
holder := AspectAdaptor new subject:self; forAspect:#tabSelection. |
|
1436 |
builder aspectAt:#tabModel put:holder. |
|
1437 |
]. |
|
1438 |
^ holder |
|
222 | 1439 |
! |
1440 |
||
1441 |
treeView |
|
1442 |
^ treeView |
|
60 | 1443 |
! ! |
1444 |
||
109 | 1445 |
!UIPainter methodsFor:'binding access'! |
1446 |
||
1447 |
aspectFor:aKey |
|
222 | 1448 |
"aspect for a key |
109 | 1449 |
" |
222 | 1450 |
^ aspects at:aKey ifAbsent:[ super aspectFor:aKey ] |
109 | 1451 |
! ! |
1452 |
||
1453 |
!UIPainter methodsFor:'change & update'! |
|
1454 |
||
222 | 1455 |
layoutChanged |
1456 |
self modifiedChannel value ifFalse:[ |
|
1457 |
layoutTool update. |
|
1458 |
self modifiedChannel value:false |
|
1459 |
] |
|
1460 |
! |
|
1461 |
||
1462 |
treeViewChanged |
|
1463 |
"property or selection in the treeView changed |
|
1464 |
" |
|
1465 |
|oldSelection view slices list spec props size nameOfSpec| |
|
1466 |
||
1467 |
props := treeView propertySelected. |
|
1468 |
oldSelection := tabSelection. |
|
1469 |
tabSelection := nil. |
|
1470 |
||
1471 |
self hasValidSelection value:(treeView hasValidSelection). |
|
1472 |
self canStepIn value:(treeView canStepIn). |
|
1473 |
self canStepOut value:(treeView canStepOut). |
|
1474 |
||
1475 |
props isNil ifFalse:[ |
|
1476 |
self hasSingleSelection value:true. |
|
1477 |
view := props view. |
|
1478 |
spec := props spec copy. |
|
1479 |
||
1480 |
layoutTool layoutView == view ifFalse:[ |