author | tz |
Fri, 30 Jan 1998 15:05:54 +0100 | |
changeset 535 | 1caf545614c5 |
parent 533 | dde823aeca4c |
child 538 | 3d75219adb32 |
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 |
||
368 | 13 |
|
446 | 14 |
ToolApplicationModel subclass:#UIPainter |
287 | 15 |
instanceVariableNames:'treeView selectionPanel tabSelection specClass specSelector |
297 | 16 |
specSuperclass aspects layoutCanvas helpCanvas specCanvas |
17 |
transcript' |
|
446 | 18 |
classVariableNames:'' |
60 | 19 |
poolDictionaries:'' |
20 |
category:'Interface-UIPainter' |
|
21 |
! |
|
22 |
||
222 | 23 |
SelectionInTreeView subclass:#TreeView |
491
c3af7854dbe8
image instance variables removed + release all widget icons while snap shoting
tz
parents:
490
diff
changeset
|
24 |
instanceVariableNames:'lastDrawnMaster cvsEventsDisabled windowSpec' |
440 | 25 |
classVariableNames:'Images' |
222 | 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 |
||
195
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
74 |
openOnClass:aClass andSelector:aSelector |
282 | 75 |
"open up an interface builder, fetching a spec from aClass |
76 |
via some selector |
|
77 |
" |
|
195
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
78 |
^ self new openOnClass:aClass andSelector:aSelector |
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
79 |
! |
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
80 |
|
109 | 81 |
painter:aBuilderView |
282 | 82 |
"set the painter |
83 |
" |
|
109 | 84 |
|application| |
85 |
||
86 |
application := self new. |
|
87 |
application painter:aBuilderView. |
|
88 |
^ application open |
|
60 | 89 |
! ! |
90 |
||
87 | 91 |
!UIPainter class methodsFor:'ST-80 queries'! |
92 |
||
93 |
preferenceFor:aSymbol |
|
282 | 94 |
"ST-80 compatible; always returns false |
95 |
" |
|
87 | 96 |
^ false |
109 | 97 |
|
98 |
||
99 |
! ! |
|
100 |
||
446 | 101 |
!UIPainter class methodsFor:'accessing'! |
102 |
||
103 |
label |
|
104 |
||
105 |
^'GUI Builder' |
|
106 |
! ! |
|
107 |
||
193 | 108 |
!UIPainter class methodsFor:'help specs'! |
109 |
||
110 |
helpSpec |
|
111 |
"return a dictionary filled with helpKey -> helptext associations. |
|
295 | 112 |
These are used by the activeHelp tool." |
113 |
||
193 | 114 |
" |
295 | 115 |
UIHelpTool openOnClass:UIPainter |
116 |
" |
|
117 |
||
193 | 118 |
^ super helpSpec addPairsFrom:#( |
119 |
||
466 | 120 |
#accept |
498 | 121 |
'Writes back changes.' |
466 | 122 |
|
123 |
#alignSelectionBottom |
|
498 | 124 |
'Aligns selected widgets to the bottom edge of the dominant widget.' |
466 | 125 |
|
126 |
#alignSelectionCenterHor |
|
498 | 127 |
'Aligns selected widgets vertical to the center of the dominant widget.' |
466 | 128 |
|
129 |
#alignSelectionCenterVer |
|
498 | 130 |
'Aligns selected widgets horizontal to the center of the dominant widget.' |
466 | 131 |
|
132 |
#alignSelectionLeft |
|
498 | 133 |
'Aligns selected widgets to the left edge of the dominant widget.' |
466 | 134 |
|
135 |
#alignSelectionLeftAndRight |
|
498 | 136 |
'Aligns selected widgets to the right and left edge of the dominant widget.' |
466 | 137 |
|
138 |
#alignSelectionRight |
|
498 | 139 |
'Aligns selected widgets to the right edge of the dominant widget.' |
466 | 140 |
|
141 |
#alignSelectionTop |
|
498 | 142 |
'Aligns selected widgets to the top edge of the dominant widget.' |
466 | 143 |
|
144 |
#alignSelectionTopAndBottom |
|
498 | 145 |
'Aligns selected widgets to the top and bottom edge of the dominant widget.' |
466 | 146 |
|
147 |
#cancel |
|
498 | 148 |
'Rereads specification and layout.' |
466 | 149 |
|
150 |
#centerSelectionHor |
|
498 | 151 |
'Centers widgets horizontal to their top widget.' |
466 | 152 |
|
153 |
#centerSelectionVer |
|
498 | 154 |
'Centers vertical horizontal in contained view.' |
466 | 155 |
|
156 |
#copyExtent |
|
498 | 157 |
'Copies extent of the selected widget.' |
466 | 158 |
|
159 |
#copyLayout |
|
498 | 160 |
'Copies layout of the selected widget.' |
161 |
||
162 |
#fileLoad |
|
163 |
'Opens dialog to load an interface from a class.' |
|
164 |
||
533 | 165 |
#fileLoadSubspec |
166 |
'Opens dialog to load an subspec interface from a class.' |
|
167 |
||
498 | 168 |
#fileNew |
169 |
'Creates new interface.' |
|
170 |
||
171 |
#filePickAnInterface |
|
172 |
'Changes the cursor for moving it over another view to load its interface.' |
|
173 |
||
174 |
#fileSave |
|
175 |
'Saves current interface.' |
|
295 | 176 |
|
282 | 177 |
#galleryShown |
498 | 178 |
'Shows or hide gallery view.' |
282 | 179 |
|
466 | 180 |
#menuAlignment |
498 | 181 |
'Provides a set of alignment operation on the current selected widgets.' |
282 | 182 |
|
466 | 183 |
#moveSelectionDown |
498 | 184 |
'Moves selected widgets down.' |
466 | 185 |
|
186 |
#moveSelectionLeft |
|
498 | 187 |
'Moves selected widgets out of parent widget.' |
287 | 188 |
|
189 |
#moveSelectionRight |
|
498 | 190 |
'Moves selected widgets into next widget as child.' |
287 | 191 |
|
466 | 192 |
#moveSelectionUp |
498 | 193 |
'Moves selected widgets up.' |
287 | 194 |
|
195 |
#painterShown |
|
498 | 196 |
'Shows or hide painter view.' |
287 | 197 |
|
466 | 198 |
#pasteBuffer |
498 | 199 |
'Pastes widgets at current mouse position.' |
466 | 200 |
|
287 | 201 |
#pasteExtent |
498 | 202 |
'Changes extent of all selected widgets to the last copied extent.' |
287 | 203 |
|
204 |
#pasteHeight |
|
498 | 205 |
'Changes height of all selected widgets to the last copied extent height.' |
287 | 206 |
|
207 |
#pasteLayout |
|
498 | 208 |
'Changes layout of all selected widgets to the last copied layout.' |
287 | 209 |
|
466 | 210 |
#pasteWidth |
498 | 211 |
'Changes width of all selected widgets to the last copied extent width.' |
466 | 212 |
|
213 |
#pasteWithLayout |
|
498 | 214 |
'Pastes widgets without changing their layouts.' |
466 | 215 |
|
216 |
#setToDefaultExtent |
|
498 | 217 |
'Sets selected widgets to their default extent.' |
466 | 218 |
|
219 |
#setToDefaultHeight |
|
498 | 220 |
'Sets selected widgets to their default height.' |
466 | 221 |
|
222 |
#setToDefaultWidth |
|
498 | 223 |
'Sets selected widgets to their default width.' |
287 | 224 |
|
225 |
#spreadSelectionHor |
|
498 | 226 |
'Sets horizontal spaces between selected widgets as the same.' |
287 | 227 |
|
466 | 228 |
#spreadSelectionVer |
498 | 229 |
'Sets vertical spaces between selected widgets as the same.' |
230 |
||
231 |
#testStartApplication |
|
232 |
'Starts current application on loaded interface.' |
|
194 | 233 |
|
193 | 234 |
) |
235 |
! ! |
|
236 |
||
297 | 237 |
!UIPainter class methodsFor:'helpers'! |
238 |
||
368 | 239 |
convertString:aString maxLineSize:maxCharactersPerLine skipLineFeed:skipLineFeed |
297 | 240 |
"converts a string to a string collection with maximum characters |
241 |
per line |
|
242 |
" |
|
243 |
|stream |
|
244 |
max "{ Class:SmallInteger }" |
|
245 |
size "{ Class:SmallInteger }" |
|
246 |
start "{ Class:SmallInteger }" |
|
247 |
stop "{ Class:SmallInteger }" |
|
248 |
cpySz "{ Class:SmallInteger }" |
|
249 |
lnSz "{ Class:SmallInteger }"| |
|
250 |
||
251 |
maxCharactersPerLine < 20 ifFalse:[max := maxCharactersPerLine - 1] |
|
252 |
ifTrue:[max := 20]. |
|
253 |
||
254 |
(size := aString size) <= max ifTrue:[ |
|
255 |
^ aString |
|
256 |
]. |
|
257 |
start := 1. |
|
258 |
lnSz := 0. |
|
259 |
stream := (String new:size) writeStream. |
|
260 |
||
261 |
[start <= size] whileTrue:[ |
|
262 |
(start := aString indexOfNonSeparatorStartingAt:start) == 0 ifTrue:[ |
|
263 |
^ stream contents |
|
264 |
]. |
|
368 | 265 |
(aString at:start) == $\ ifTrue:[ |
266 |
skipLineFeed ifFalse:[ |
|
267 |
stream nextPut:$\ |
|
268 |
]. |
|
269 |
start := start + 1. |
|
270 |
stream cr. |
|
271 |
start := start + 1. |
|
272 |
lnSz := 0. |
|
273 |
] ifFalse:[ |
|
274 |
(stop := aString indexOfSeparatorStartingAt:start) == 0 ifTrue:[ |
|
275 |
stop := size + 1 |
|
276 |
]. |
|
277 |
(aString at:(stop - 1)) == $\ ifTrue:[ |
|
278 |
stop := stop - 1 |
|
279 |
]. |
|
280 |
cpySz := stop - start. |
|
281 |
||
282 |
lnSz == 0 ifFalse:[ |
|
283 |
(lnSz := lnSz + cpySz) >= max ifTrue:[stream cr. lnSz := cpySz ] |
|
284 |
ifFalse:[stream space. lnSz := lnSz + 1] |
|
285 |
] ifTrue:[ |
|
286 |
lnSz := cpySz |
|
287 |
]. |
|
288 |
stream nextPutAll:aString startingAt:start to:(stop - 1). |
|
289 |
start := stop. |
|
290 |
] |
|
297 | 291 |
]. |
292 |
^ stream contents |
|
293 |
! ! |
|
294 |
||
60 | 295 |
!UIPainter class methodsFor:'interface specs'! |
296 |
||
366 | 297 |
gridParametersSpec |
298 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
299 |
||
300 |
"do not manually edit this - the painter/builder may not be able to |
|
301 |
handle the specification if its corrupted." |
|
302 |
||
303 |
" |
|
304 |
UIPainter new openOnClass:UIPainter andSelector:#gridParametersSpec |
|
305 |
UIPainter new openInterface:#gridParametersSpec |
|
306 |
" |
|
307 |
||
308 |
<resource: #canvas> |
|
309 |
||
310 |
^ |
|
446 | 311 |
|
366 | 312 |
#(#FullSpec |
313 |
#'window:' |
|
314 |
#(#WindowSpec |
|
527 | 315 |
#'name:' 'GUI Builder' |
316 |
#'layout:' #(#LayoutFrame 44 0 416 0 325 0 613 0) |
|
317 |
#'label:' 'GUI Builder' |
|
366 | 318 |
#'min:' #(#Point 10 10) |
319 |
#'max:' #(#Point 1280 1024) |
|
527 | 320 |
#'bounds:' #(#Rectangle 44 416 326 614) |
446 | 321 |
#'usePreferredExtent:' false |
366 | 322 |
) |
323 |
#'component:' |
|
324 |
#(#SpecCollection |
|
325 |
#'collection:' |
|
326 |
#( |
|
527 | 327 |
#(#FramedBoxSpec |
328 |
#'name:' 'framedBox' |
|
329 |
#'layout:' #(#LayoutFrame 0 0.0 3 0.0 0 1.0 -35 1.0) |
|
330 |
#'component:' |
|
331 |
#(#SpecCollection |
|
332 |
#'collection:' |
|
333 |
#( |
|
334 |
#(#CheckBoxSpec |
|
335 |
#'name:' 'show' |
|
336 |
#'layout:' #(#Point 23 24) |
|
337 |
#'model:' #showGrid |
|
338 |
#'label:' 'Show grid' |
|
339 |
) |
|
340 |
#(#CheckBoxSpec |
|
341 |
#'name:' 'align' |
|
342 |
#'layout:' #(#Point 23 52) |
|
343 |
#'model:' #alignToGrid |
|
344 |
#'label:' 'Align to Grid' |
|
345 |
) |
|
346 |
#(#LabelSpec |
|
347 |
#'name:' 'hrzLabel' |
|
348 |
#'layout:' #(#AlignmentOrigin 148 0 99 0 1 0.5) |
|
349 |
#'label:' 'Horizontal Pixels:' |
|
350 |
#'adjust:' #right |
|
351 |
#'resizeForLabel:' true |
|
352 |
) |
|
353 |
#(#InputFieldSpec |
|
354 |
#'name:' 'hrzField' |
|
355 |
#'layout:' #(#LayoutFrame 154 0 87 0 207 0 109 0) |
|
356 |
#'model:' #hspace |
|
357 |
#'type:' #numberOrNil |
|
358 |
) |
|
359 |
#(#LabelSpec |
|
360 |
#'name:' 'vrtLabel' |
|
361 |
#'layout:' #(#AlignmentOrigin 149 0 124 0 1 0.5) |
|
362 |
#'label:' 'Vertical Pixels:' |
|
363 |
#'adjust:' #right |
|
364 |
#'resizeForLabel:' true |
|
365 |
) |
|
366 |
#(#InputFieldSpec |
|
367 |
#'name:' 'vrtField' |
|
368 |
#'layout:' #(#LayoutFrame 154 0 112 0 207 0 134 0) |
|
369 |
#'model:' #vspace |
|
370 |
#'type:' #numberOrNil |
|
371 |
) |
|
372 |
) |
|
373 |
) |
|
374 |
#'label:' 'Grid Parameter' |
|
375 |
#'labelPosition:' #topLeft |
|
366 | 376 |
) |
446 | 377 |
#(#UISubSpecification |
378 |
#'name:' 'uISubSpecifica1' |
|
379 |
#'layout:' #(#LayoutFrame 0 0.0 -29 1 0 1.0 -5 1) |
|
380 |
#'majorKey:' #ToolApplicationModel |
|
381 |
#'minorKey:' #windowSpecForCommitWithoutChannels |
|
366 | 382 |
) |
383 |
) |
|
384 |
) |
|
385 |
) |
|
386 |
! |
|
387 |
||
222 | 388 |
nameAndSelectorSpec |
389 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
390 |
||
391 |
"do not manually edit this - the painter/builder may not be able to |
|
392 |
handle the specification if its corrupted." |
|
393 |
||
394 |
" |
|
395 |
UIPainter new openOnClass:UIPainter andSelector:#nameAndSelectorSpec |
|
396 |
UIPainter new openInterface:#nameAndSelectorSpec |
|
397 |
" |
|
398 |
||
399 |
<resource: #canvas> |
|
400 |
||
401 |
^ |
|
402 |
||
403 |
#(#FullSpec |
|
404 |
#'window:' |
|
405 |
#(#WindowSpec |
|
527 | 406 |
#'name:' 'GUI Builder' |
407 |
#'layout:' #(#LayoutFrame 44 0 416 0 357 0 575 0) |
|
408 |
#'label:' 'GUI Builder' |
|
446 | 409 |
#'min:' #(#Point 10 10) |
410 |
#'max:' #(#Point 1152 900) |
|
527 | 411 |
#'bounds:' #(#Rectangle 44 416 358 576) |
446 | 412 |
#'usePreferredExtent:' false |
222 | 413 |
) |
414 |
#'component:' |
|
415 |
#(#SpecCollection |
|
416 |
#'collection:' |
|
417 |
#( |
|
527 | 418 |
#(#FramedBoxSpec |
419 |
#'name:' 'framedBox1' |
|
420 |
#'layout:' #(#LayoutFrame 0 0.0 3 0.0 0 1.0 -35 1.0) |
|
421 |
#'component:' |
|
422 |
#(#SpecCollection |
|
423 |
#'collection:' |
|
424 |
#( |
|
425 |
#(#LabelSpec |
|
426 |
#'name:' 'selectorLabel' |
|
427 |
#'layout:' #(#AlignmentOrigin 63 0.11 39 0 1 0.5) |
|
428 |
#'label:' 'Selector:' |
|
429 |
#'adjust:' #right |
|
430 |
#'resizeForLabel:' true |
|
431 |
) |
|
432 |
#(#InputFieldSpec |
|
433 |
#'name:' 'methodNameField' |
|
434 |
#'layout:' #(#LayoutFrame 67 0.11 28 0 14 1.0 50 0) |
|
435 |
#'tabable:' true |
|
436 |
#'model:' #methodNameChannel |
|
437 |
) |
|
438 |
#(#LabelSpec |
|
439 |
#'name:' 'classLabel' |
|
440 |
#'layout:' #(#AlignmentOrigin 63 0.11 64 0 1 0.5) |
|
441 |
#'label:' 'Class:' |
|
442 |
#'adjust:' #right |
|
443 |
#'resizeForLabel:' true |
|
444 |
) |
|
445 |
#(#InputFieldSpec |
|
446 |
#'name:' 'classNameField' |
|
447 |
#'layout:' #(#LayoutFrame 67 0.11 53 0 14 1.0 75 0) |
|
448 |
#'tabable:' true |
|
449 |
#'model:' #classNameChannel |
|
450 |
) |
|
451 |
#(#LabelSpec |
|
452 |
#'name:' 'superClassLabel' |
|
453 |
#'layout:' #(#AlignmentOrigin 63 0.11 89 0 1 0.5) |
|
454 |
#'label:' 'Superclass:' |
|
455 |
#'adjust:' #right |
|
456 |
#'resizeForLabel:' true |
|
457 |
) |
|
458 |
#(#ComboBoxSpec |
|
459 |
#'name:' 'superclassNameComboBox' |
|
460 |
#'layout:' #(#LayoutFrame 67 0.11 78 0 14 1.0 100 0) |
|
461 |
#'tabable:' true |
|
462 |
#'model:' #superclassNameChannel |
|
463 |
#'comboList:' #superclassNameDefaults |
|
464 |
) |
|
465 |
) |
|
466 |
) |
|
467 |
#'label:' 'Class and selector for interface' |
|
468 |
#'labelPosition:' #topLeft |
|
222 | 469 |
) |
446 | 470 |
#(#UISubSpecification |
471 |
#'name:' 'uISubSpecifica1' |
|
472 |
#'layout:' #(#LayoutFrame 0 0.0 -29 1 0 1.0 -5 1) |
|
473 |
#'majorKey:' #ToolApplicationModel |
|
474 |
#'minorKey:' #windowSpecForCommitWithoutChannels |
|
222 | 475 |
) |
476 |
) |
|
477 |
) |
|
478 |
) |
|
479 |
! |
|
480 |
||
481 |
windowSpec |
|
482 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
483 |
||
484 |
"do not manually edit this - the painter/builder may not be able to |
|
485 |
handle the specification if its corrupted." |
|
486 |
||
487 |
" |
|
488 |
UIPainter new openOnClass:UIPainter andSelector:#windowSpec |
|
489 |
UIPainter new openInterface:#windowSpec |
|
490 |
" |
|
491 |
"UIPainter open" |
|
492 |
||
493 |
<resource: #canvas> |
|
494 |
||
495 |
^ |
|
496 |
||
497 |
#(#FullSpec |
|
498 |
#'window:' |
|
499 |
#(#WindowSpec |
|
282 | 500 |
#'name:' 'Tree-View' |
512
1648b541aab5
made it a bit larger for all notbook specs to fit
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
501 |
#'layout:' #(#LayoutFrame 18 0 64 0 570 0 589 0) |
222 | 502 |
#'label:' 'Tree-View' |
282 | 503 |
#'min:' #(#Point 10 10) |
504 |
#'max:' #(#Point 1160 870) |
|
512
1648b541aab5
made it a bit larger for all notbook specs to fit
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
505 |
#'bounds:' #(#Rectangle 18 64 571 590) |
446 | 506 |
#'menu:' #menu |
375 | 507 |
#'usePreferredExtent:' false |
222 | 508 |
) |
509 |
#'component:' |
|
510 |
#(#SpecCollection |
|
511 |
#'collection:' |
|
512 |
#( |
|
513 |
#(#MenuPanelSpec |
|
446 | 514 |
#'name:' 'menuToolbarView' |
515 |
#'layout:' #(#LayoutFrame -1 0.0 0 0 -1 1.0 32 0) |
|
222 | 516 |
#'tabable:' true |
446 | 517 |
#'menu:' #menuToolbar |
518 |
#'showSeparatingLines:' true |
|
222 | 519 |
) |
297 | 520 |
#(#VariableVerticalPanelSpec |
521 |
#'name:' 'vpanel' |
|
448 | 522 |
#'layout:' #(#LayoutFrame 0 0.0 34 0.0 0 1.0 -22 1.0) |
297 | 523 |
#'component:' |
524 |
#(#SpecCollection |
|
525 |
#'collection:' |
|
526 |
#( |
|
527 |
#(#VariableHorizontalPanelSpec |
|
528 |
#'name:' 'hpanel' |
|
529 |
#'component:' |
|
530 |
#(#SpecCollection |
|
531 |
#'collection:' |
|
532 |
#( |
|
533 |
#(#ArbitraryComponentSpec |
|
534 |
#'name:' 'treeView' |
|
375 | 535 |
#'tabable:' true |
446 | 536 |
#'menu:' #menuEdit |
297 | 537 |
#'hasHorizontalScrollBar:' true |
538 |
#'hasVerticalScrollBar:' true |
|
539 |
#'miniScrollerHorizontal:' true |
|
540 |
#'miniScrollerVertical:' true |
|
541 |
#'component:' #treeView |
|
542 |
#'hasBorder:' false |
|
543 |
) |
|
544 |
#(#ViewSpec |
|
545 |
#'name:' 'specHolderView' |
|
546 |
#'component:' |
|
547 |
#(#SpecCollection |
|
548 |
#'collection:' |
|
549 |
#( |
|
550 |
#(#NoteBookViewSpec |
|
551 |
#'name:' 'noteBook' |
|
446 | 552 |
#'layout:' #(#LayoutFrame 0 0.0 26 0.0 0 1.0 -30 1.0) |
297 | 553 |
#'enableChannel:' #enableChannel |
554 |
#'tabable:' true |
|
345 | 555 |
#'model:' #tabModel |
297 | 556 |
#'menu:' #tabList |
345 | 557 |
#'style:' #(#FontDescription #helvetica #medium #roman 10) |
297 | 558 |
#'canvas:' #noteBookView |
559 |
) |
|
560 |
#(#HorizontalPanelViewSpec |
|
561 |
#'name:' 'modifyPanel' |
|
562 |
#'layout:' #(#LayoutFrame 0 0.0 -30 1.0 0 1.0 0 1.0) |
|
563 |
#'component:' |
|
564 |
#(#SpecCollection |
|
565 |
#'collection:' |
|
566 |
#( |
|
567 |
#(#ActionButtonSpec |
|
568 |
#'name:' 'cancelButton' |
|
569 |
#'activeHelpKey:' #cancel |
|
446 | 570 |
#'label:' 'Cancel' |
297 | 571 |
#'tabable:' true |
572 |
#'model:' #cancel |
|
573 |
#'enableChannel:' #modifiedChannel |
|
527 | 574 |
#'extent:' #(#Point 79 24) |
297 | 575 |
) |
576 |
#(#ActionButtonSpec |
|
577 |
#'name:' 'acceptButton' |
|
578 |
#'activeHelpKey:' #accept |
|
446 | 579 |
#'label:' 'OK' |
297 | 580 |
#'tabable:' true |
581 |
#'model:' #accept |
|
582 |
#'enableChannel:' #modifiedChannel |
|
527 | 583 |
#'extent:' #(#Point 79 24) |
297 | 584 |
) |
585 |
) |
|
586 |
) |
|
587 |
#'horizontalLayout:' #fitSpace |
|
588 |
#'verticalLayout:' #fitSpace |
|
589 |
#'horizontalSpace:' 3 |
|
590 |
#'verticalSpace:' 3 |
|
591 |
) |
|
446 | 592 |
#(#HorizontalPanelViewSpec |
593 |
#'name:' 'panelViewButtons' |
|
594 |
#'layout:' #(#LayoutFrame 0 0.0 0 0 0 1.0 24 0) |
|
595 |
#'component:' |
|
596 |
#(#SpecCollection |
|
597 |
#'collection:' |
|
598 |
#( |
|
599 |
#(#ArrowButtonSpec |
|
600 |
#'name:' 'moveLeft' |
|
601 |
#'activeHelpKey:' #moveSelectionLeft |
|
602 |
#'tabable:' true |
|
603 |
#'model:' #moveSelectionLeft |
|
604 |
#'enableChannel:' #canMoveOrAlignSelection |
|
605 |
#'isTriggerOnDown:' true |
|
606 |
#'direction:' #left |
|
607 |
#'extent:' #(#Point 22 22) |
|
608 |
) |
|
609 |
#(#ArrowButtonSpec |
|
610 |
#'name:' 'moveRight' |
|
611 |
#'activeHelpKey:' #moveSelectionRight |
|
612 |
#'model:' #moveSelectionRight |
|
613 |
#'enableChannel:' #canMoveOrAlignSelection |
|
614 |
#'isTriggerOnDown:' true |
|
615 |
#'direction:' #right |
|
616 |
#'extent:' #(#Point 22 22) |
|
617 |
) |
|
618 |
#(#ArrowButtonSpec |
|
619 |
#'name:' 'moveDown' |
|
620 |
#'activeHelpKey:' #moveSelectionDown |
|
621 |
#'model:' #moveSelectionDown |
|
622 |
#'enableChannel:' #canMoveOrAlignSelection |
|
623 |
#'isTriggerOnDown:' true |
|
624 |
#'direction:' #down |
|
625 |
#'extent:' #(#Point 22 22) |
|
626 |
) |
|
627 |
#(#ArrowButtonSpec |
|
628 |
#'name:' 'moveUp' |
|
629 |
#'activeHelpKey:' #moveSelectionUp |
|
630 |
#'model:' #moveSelectionUp |
|
631 |
#'enableChannel:' #canMoveOrAlignSelection |
|
632 |
#'isTriggerOnDown:' true |
|
633 |
#'direction:' #up |
|
634 |
#'extent:' #(#Point 22 22) |
|
635 |
) |
|
636 |
) |
|
637 |
) |
|
638 |
#'level:' 1 |
|
639 |
#'horizontalLayout:' #left |
|
640 |
#'verticalLayout:' #fit |
|
641 |
#'horizontalSpace:' 4 |
|
642 |
#'verticalSpace:' 4 |
|
643 |
) |
|
297 | 644 |
) |
645 |
) |
|
646 |
#'borderWidth:' 1 |
|
647 |
) |
|
648 |
) |
|
649 |
) |
|
650 |
#'level:' 1 |
|
651 |
#'handles:' #(#Any 0.329435 1.0) |
|
652 |
) |
|
653 |
#(#TextEditorSpec |
|
654 |
#'name:' 'Transcript' |
|
655 |
#'hasHorizontalScrollBar:' true |
|
656 |
#'hasVerticalScrollBar:' true |
|
657 |
#'miniScrollerHorizontal:' true |
|
658 |
#'miniScrollerVertical:' true |
|
659 |
) |
|
660 |
) |
|
661 |
) |
|
662 |
#'handles:' #(#Any 0.880597 1.0) |
|
663 |
) |
|
486 | 664 |
#(#UISubSpecification |
665 |
#'name:' 'infoBarSubSpec' |
|
666 |
#'layout:' #(#LayoutFrame 0 0.0 -22 1 0 1.0 0 1.0) |
|
667 |
#'majorKey:' #ToolApplicationModel |
|
533 | 668 |
#'minorKey:' #windowSpecForInfoBarWithClock |
448 | 669 |
) |
222 | 670 |
) |
671 |
) |
|
672 |
) |
|
673 |
! ! |
|
674 |
||
675 |
!UIPainter class methodsFor:'menu specs'! |
|
676 |
||
446 | 677 |
menu |
217 | 678 |
"this window spec was automatically generated by the ST/X MenuEditor" |
679 |
||
680 |
"do not manually edit this - the builder may not be able to |
|
681 |
handle the specification if its corrupted." |
|
682 |
||
683 |
" |
|
446 | 684 |
MenuEditor new openOnClass:UIPainter andSelector:#menu |
685 |
(Menu new fromLiteralArrayEncoding:(UIPainter menu)) startUp |
|
686 |
" |
|
687 |
||
688 |
<resource: #menu> |
|
689 |
||
690 |
^ |
|
691 |
||
692 |
#(#Menu |
|
693 |
||
694 |
#( |
|
695 |
#(#MenuItem |
|
696 |
#'label:' 'About' |
|
697 |
#'labelImage:' #(#ResourceRetriever nil #icon) |
|
698 |
#'submenuChannel:' #menuAbout |
|
699 |
) |
|
700 |
#(#MenuItem |
|
701 |
#'label:' 'File' |
|
702 |
#'value:' #file |
|
703 |
#'enabled:' #enableChannel |
|
704 |
#'submenu:' |
|
705 |
#(#Menu |
|
706 |
||
707 |
#( |
|
708 |
#(#MenuItem |
|
709 |
#'label:' 'New' |
|
710 |
#'value:' #doNew |
|
498 | 711 |
#'activeHelpKey:' #fileNew |
446 | 712 |
) |
713 |
#(#MenuItem |
|
714 |
#'label:' '-' |
|
715 |
) |
|
716 |
#(#MenuItem |
|
498 | 717 |
#'label:' 'Load...' |
446 | 718 |
#'value:' #doFromClass |
498 | 719 |
#'activeHelpKey:' #fileLoad |
446 | 720 |
) |
721 |
#(#MenuItem |
|
533 | 722 |
#'label:' 'Load Subspec...' |
723 |
#'value:' #loadSubspec |
|
724 |
#'activeHelpKey:' #fileLoadSubspec |
|
725 |
) |
|
726 |
#(#MenuItem |
|
446 | 727 |
#'label:' '-' |
728 |
) |
|
729 |
#(#MenuItem |
|
466 | 730 |
#'label:' 'Save' |
731 |
#'value:' #doInstallSpec |
|
498 | 732 |
#'activeHelpKey:' #fileSave |
446 | 733 |
) |
734 |
#(#MenuItem |
|
735 |
#'label:' '-' |
|
736 |
) |
|
737 |
#(#MenuItem |
|
466 | 738 |
#'label:' 'Define Class And Selector...' |
739 |
#'value:' #defineClassAndSelector |
|
446 | 740 |
) |
741 |
#(#MenuItem |
|
742 |
#'label:' '-' |
|
743 |
) |
|
744 |
#(#MenuItem |
|
745 |
#'label:' 'Create Aspect Methods' |
|
746 |
#'value:' #doInstallAspects |
|
747 |
#'enabled:' #hasSpecClass |
|
748 |
) |
|
749 |
#(#MenuItem |
|
750 |
#'label:' 'Create Hook Methods' |
|
751 |
#'value:' #doInstallHooks |
|
495
f356a6636eef
disable hook & browse menu items, if there is no class yet.
Claus Gittinger <cg@exept.de>
parents:
491
diff
changeset
|
752 |
#'enabled:' #hasSpecClass |
446 | 753 |
) |
754 |
#(#MenuItem |
|
755 |
#'label:' '-' |
|
756 |
) |
|
757 |
#(#MenuItem |
|
498 | 758 |
#'label:' 'Pick An Interface' |
759 |
#'value:' #doPickAView |
|
760 |
#'activeHelpKey:' #filePickAnInterface |
|
761 |
) |
|
762 |
#(#MenuItem |
|
763 |
#'label:' '-' |
|
764 |
) |
|
765 |
#(#MenuItem |
|
766 |
#'label:' 'Show Interface Spec' |
|
446 | 767 |
#'value:' #doWindowSpec |
768 |
) |
|
769 |
#(#MenuItem |
|
498 | 770 |
#'label:' 'Browse Interface Class' |
446 | 771 |
#'value:' #doBrowseAppClass |
772 |
#'enabled:' #hasSpecClass |
|
773 |
) |
|
774 |
#(#MenuItem |
|
775 |
#'label:' 'Browse Aspect Methods' |
|
776 |
#'value:' #doBrowseAspectMethods |
|
495
f356a6636eef
disable hook & browse menu items, if there is no class yet.
Claus Gittinger <cg@exept.de>
parents:
491
diff
changeset
|
777 |
#'enabled:' #hasSpecClass |
446 | 778 |
) |
779 |
#(#MenuItem |
|
780 |
#'label:' '-' |
|
781 |
) |
|
782 |
#(#MenuItem |
|
783 |
#'label:' 'Exit' |
|
784 |
#'value:' #closeRequest |
|
498 | 785 |
#'activeHelpKey:' #fileExit |
446 | 786 |
) |
787 |
) nil |
|
788 |
nil |
|
789 |
) |
|
790 |
) |
|
791 |
#(#MenuItem |
|
792 |
#'label:' 'Edit' |
|
793 |
#'submenuChannel:' #menuEdit |
|
794 |
) |
|
795 |
#(#MenuItem |
|
796 |
#'label:' 'Align' |
|
797 |
#'submenuChannel:' #menuAlign |
|
798 |
) |
|
799 |
#(#MenuItem |
|
800 |
#'label:' 'Test' |
|
801 |
#'submenu:' |
|
802 |
#(#Menu |
|
803 |
||
804 |
#( |
|
805 |
#(#MenuItem |
|
466 | 806 |
#'label:' 'Start Application' |
807 |
#'value:' #doStartApplication |
|
498 | 808 |
#'activeHelpKey:' #testStartApplication |
466 | 809 |
) |
810 |
#(#MenuItem |
|
811 |
#'label:' '-' |
|
812 |
) |
|
813 |
#(#MenuItem |
|
446 | 814 |
#'label:' 'Geometry Test Mode' |
815 |
#'indication:' #'testMode:' |
|
816 |
) |
|
817 |
) nil |
|
818 |
nil |
|
819 |
) |
|
820 |
) |
|
821 |
#(#MenuItem |
|
822 |
#'label:' 'Settings' |
|
823 |
#'submenu:' |
|
824 |
#(#Menu |
|
825 |
||
826 |
#( |
|
827 |
#(#MenuItem |
|
828 |
#'label:' 'Undo Manager' |
|
829 |
#'value:' #openUndoMenu |
|
830 |
) |
|
831 |
#(#MenuItem |
|
832 |
#'label:' '-' |
|
833 |
) |
|
834 |
#(#MenuItem |
|
835 |
#'label:' 'Grid Manager' |
|
836 |
#'value:' #gridMenu |
|
837 |
) |
|
838 |
) nil |
|
839 |
nil |
|
840 |
) |
|
841 |
) |
|
842 |
#(#MenuItem |
|
843 |
#'label:' 'History' |
|
844 |
#'submenuChannel:' #menuHistory |
|
845 |
) |
|
846 |
#(#MenuItem |
|
498 | 847 |
#'label:' 'Help' |
848 |
#'submenuChannel:' #menuHelp |
|
849 |
) |
|
850 |
#(#MenuItem |
|
446 | 851 |
#'label:' '' |
852 |
) |
|
853 |
#(#MenuItem |
|
854 |
#'label:' 'Gallery' |
|
855 |
#'indication:' #galleryShown |
|
856 |
) |
|
857 |
#(#MenuItem |
|
858 |
#'label:' 'Canvas' |
|
859 |
#'indication:' #painterShown |
|
860 |
) |
|
861 |
) nil |
|
862 |
nil |
|
863 |
) |
|
864 |
! |
|
865 |
||
866 |
menuAlign |
|
867 |
"this window spec was automatically generated by the ST/X MenuEditor" |
|
868 |
||
869 |
"do not manually edit this - the builder may not be able to |
|
870 |
handle the specification if its corrupted." |
|
871 |
||
872 |
" |
|
873 |
MenuEditor new openOnClass:UIPainter andSelector:#menuAlign |
|
874 |
(Menu new fromLiteralArrayEncoding:(UIPainter menuAlign)) startUp |
|
217 | 875 |
" |
876 |
||
877 |
<resource: #menu> |
|
878 |
||
879 |
^ |
|
880 |
||
881 |
#(#Menu |
|
882 |
||
883 |
#( |
|
884 |
#(#MenuItem |
|
446 | 885 |
#'label:' 'Align Left' |
886 |
#'value:' #alignSelectionLeft |
|
887 |
#'activeHelpKey:' #alignSelectionLeft |
|
495
f356a6636eef
disable hook & browse menu items, if there is no class yet.
Claus Gittinger <cg@exept.de>
parents:
491
diff
changeset
|
888 |
#'enabled:' #hasSelection |
446 | 889 |
#'labelImage:' #(#ResourceRetriever #UIPainter #iconAlignL 'Align Left') |
890 |
) |
|
891 |
#(#MenuItem |
|
892 |
#'label:' 'Align Right' |
|
893 |
#'value:' #alignSelectionRight |
|
894 |
#'activeHelpKey:' #alignSelectionRight |
|
495
f356a6636eef
disable hook & browse menu items, if there is no class yet.
Claus Gittinger <cg@exept.de>
parents:
491
diff
changeset
|
895 |
#'enabled:' #hasSelection |
446 | 896 |
#'labelImage:' #(#ResourceRetriever #UIPainter #iconAlignR 'Align Right') |
897 |
) |
|
898 |
#(#MenuItem |
|
899 |
#'label:' 'Align Left & Right' |
|
900 |
#'value:' #alignSelectionLeftAndRight |
|
901 |
#'activeHelpKey:' #alignSelectionLeftAndRight |
|
495
f356a6636eef
disable hook & browse menu items, if there is no class yet.
Claus Gittinger <cg@exept.de>
parents:
491
diff
changeset
|
902 |
#'enabled:' #hasSelection |
446 | 903 |
#'labelImage:' #(#ResourceRetriever #UIPainter #iconAlignLR 'Align Left & Right') |
904 |
) |
|
905 |
#(#MenuItem |
|
906 |
#'label:' 'Align top' |
|
907 |
#'value:' #alignSelectionTop |
|
908 |
#'activeHelpKey:' #alignSelectionTop |
|
495
f356a6636eef
disable hook & browse menu items, if there is no class yet.
Claus Gittinger <cg@exept.de>
parents:
491
diff
changeset
|
909 |
#'enabled:' #hasSelection |
446 | 910 |
#'labelImage:' #(#ResourceRetriever #UIPainter #iconAlignT 'Align top') |
911 |
) |
|
912 |
#(#MenuItem |
|
913 |
#'label:' 'Align Bottom' |
|
914 |
#'value:' #alignSelectionBottom |
|
915 |
#'activeHelpKey:' #alignSelectionBottom |
|
495
f356a6636eef
disable hook & browse menu items, if there is no class yet.
Claus Gittinger <cg@exept.de>
parents:
491
diff
changeset
|
916 |
#'enabled:' #hasSelection |
446 | 917 |
#'labelImage:' #(#ResourceRetriever #UIPainter #iconAlignB 'Align Bottom') |
918 |
) |
|
919 |
#(#MenuItem |
|
920 |
#'label:' 'Align Top & Bottom' |
|
921 |
#'value:' #alignSelectionTopAndBottom |
|
922 |
#'activeHelpKey:' #alignSelectionTopAndBottom |
|
495
f356a6636eef
disable hook & browse menu items, if there is no class yet.
Claus Gittinger <cg@exept.de>
parents:
491
diff
changeset
|
923 |
#'enabled:' #hasSelection |
446 | 924 |
#'labelImage:' #(#ResourceRetriever #UIPainter #iconAlignTB 'Align Top & Bottom') |
925 |
) |
|
926 |
#(#MenuItem |
|
927 |
#'label:' 'Align Centered Horizontal' |
|
928 |
#'value:' #alignSelectionCenterHor |
|
929 |
#'activeHelpKey:' #alignSelectionCenterHor |
|
495
f356a6636eef
disable hook & browse menu items, if there is no class yet.
Claus Gittinger <cg@exept.de>
parents:
491
diff
changeset
|
930 |
#'enabled:' #hasSelection |
446 | 931 |
#'labelImage:' #(#ResourceRetriever #UIPainter #iconAlignCenterH 'Align Centered Horizontal') |
932 |
) |
|
933 |
#(#MenuItem |
|
934 |
#'label:' 'Align Centered Vertical' |
|
935 |
#'value:' #alignSelectionCenterVer |
|
936 |
#'activeHelpKey:' #alignSelectionCenterVer |
|
495
f356a6636eef
disable hook & browse menu items, if there is no class yet.
Claus Gittinger <cg@exept.de>
parents:
491
diff
changeset
|
937 |
#'enabled:' #hasSelection |
446 | 938 |
#'labelImage:' #(#ResourceRetriever #UIPainter #iconAlignCenterV 'Align Centered Vertical') |
939 |
) |
|
940 |
#(#MenuItem |
|
941 |
#'label:' '-' |
|
942 |
) |
|
943 |
#(#MenuItem |
|
944 |
#'label:' 'Spread Horizontal' |
|
945 |
#'value:' #spreadSelectionHor |
|
946 |
#'activeHelpKey:' #spreadSelectionHor |
|
495
f356a6636eef
disable hook & browse menu items, if there is no class yet.
Claus Gittinger <cg@exept.de>
parents:
491
diff
changeset
|
947 |
#'enabled:' #hasSelection |
446 | 948 |
) |
949 |
#(#MenuItem |
|
950 |
#'label:' 'Spread Vertical' |
|
951 |
#'value:' #spreadSelectionVer |
|
952 |
#'activeHelpKey:' #spreadSelectionVer |
|
495
f356a6636eef
disable hook & browse menu items, if there is no class yet.
Claus Gittinger <cg@exept.de>
parents:
491
diff
changeset
|
953 |
#'enabled:' #hasSelection |
446 | 954 |
) |
955 |
#(#MenuItem |
|
956 |
#'label:' '-' |
|
957 |
) |
|
958 |
#(#MenuItem |
|
959 |
#'label:' 'Center Horizontal In Frame' |
|
960 |
#'value:' #centerSelectionHor |
|
961 |
#'activeHelpKey:' #centerSelectionHor |
|
495
f356a6636eef
disable hook & browse menu items, if there is no class yet.
Claus Gittinger <cg@exept.de>
parents:
491
diff
changeset
|
962 |
#'enabled:' #hasSelection |
446 | 963 |
) |
964 |
#(#MenuItem |
|
965 |
#'label:' 'Center Vertical In Frame' |
|
966 |
#'value:' #centerSelectionVer |
|
967 |
#'activeHelpKey:' #centerSelectionVer |
|
495
f356a6636eef
disable hook & browse menu items, if there is no class yet.
Claus Gittinger <cg@exept.de>
parents:
491
diff
changeset
|
968 |
#'enabled:' #hasSelection |
446 | 969 |
) |
970 |
) nil |
|
971 |
nil |
|
972 |
) |
|
495
f356a6636eef
disable hook & browse menu items, if there is no class yet.
Claus Gittinger <cg@exept.de>
parents:
491
diff
changeset
|
973 |
|
f356a6636eef
disable hook & browse menu items, if there is no class yet.
Claus Gittinger <cg@exept.de>
parents:
491
diff
changeset
|
974 |
"Modified: / 27.1.1998 / 21:27:33 / cg" |
446 | 975 |
! |
976 |
||
977 |
menuEdit |
|
978 |
"this window spec was automatically generated by the ST/X MenuEditor" |
|
979 |
||
980 |
"do not manually edit this - the builder may not be able to |
|
981 |
handle the specification if its corrupted." |
|
982 |
||
983 |
" |
|
984 |
MenuEditor new openOnClass:UIPainter andSelector:#menuEdit |
|
985 |
(Menu new fromLiteralArrayEncoding:(UIPainter menuEdit)) startUp |
|
986 |
" |
|
987 |
||
988 |
<resource: #menu> |
|
989 |
||
990 |
^ |
|
991 |
||
992 |
#(#Menu |
|
993 |
||
994 |
#( |
|
995 |
#(#MenuItem |
|
996 |
#'label:' 'Cut' |
|
997 |
#'value:' #deleteSelection |
|
498 | 998 |
#'activeHelpKey:' #editCut |
446 | 999 |
#'enabled:' #hasSelection |
1000 |
#'shortcutKeyCharacter:' #Cut |
|
1001 |
) |
|
1002 |
#(#MenuItem |
|
1003 |
#'label:' 'Copy' |
|
1004 |
#'value:' #copySelection |
|
498 | 1005 |
#'activeHelpKey:' #editCopy |
446 | 1006 |
#'enabled:' #hasSelection |
1007 |
#'shortcutKeyCharacter:' #Copy |
|
1008 |
) |
|
1009 |
#(#MenuItem |
|
1010 |
#'label:' 'Paste' |
|
1011 |
#'nameKey:' #paste |
|
1012 |
#'value:' #paste |
|
498 | 1013 |
#'activeHelpKey:' #editPaste |
446 | 1014 |
#'enabled:' #canPaste |
1015 |
#'submenu:' |
|
1016 |
#(#Menu |
|
1017 |
||
1018 |
#( |
|
1019 |
#(#MenuItem |
|
1020 |
#'label:' 'Paste' |
|
1021 |
#'value:' #pasteBuffer |
|
1022 |
#'activeHelpKey:' #pasteBuffer |
|
1023 |
#'shortcutKeyCharacter:' #Paste |
|
1024 |
) |
|
1025 |
#(#MenuItem |
|
1026 |
#'label:' 'Keep Layout' |
|
1027 |
#'value:' #pasteWithLayout |
|
1028 |
#'activeHelpKey:' #pasteWithLayout |
|
1029 |
#'enabled:' #canKeepLayoutInSelection |
|
1030 |
) |
|
1031 |
) nil |
|
1032 |
nil |
|
1033 |
) |
|
1034 |
) |
|
1035 |
#(#MenuItem |
|
1036 |
#'label:' '-' |
|
1037 |
) |
|
1038 |
#(#MenuItem |
|
1039 |
#'label:' 'Undo' |
|
1040 |
#'nameKey:' #undo |
|
1041 |
#'value:' #undoLast |
|
498 | 1042 |
#'activeHelpKey:' #editUndo |
446 | 1043 |
#'enabled:' #hasUndoHistory |
1044 |
#'shortcutKeyCharacter:' #Cmdu |
|
1045 |
) |
|
1046 |
#(#MenuItem |
|
1047 |
#'label:' '-' |
|
1048 |
) |
|
1049 |
#(#MenuItem |
|
498 | 1050 |
#'label:' 'Align' |
1051 |
#'submenuChannel:' #menuAlign |
|
1052 |
) |
|
1053 |
#(#MenuItem |
|
1054 |
#'label:' 'Move' |
|
1055 |
#'submenuChannel:' #menuMove |
|
1056 |
) |
|
1057 |
#(#MenuItem |
|
446 | 1058 |
#'label:' 'Dimension' |
1059 |
#'value:' #dimension |
|
1060 |
#'enabled:' #hasSelection |
|
1061 |
#'submenu:' |
|
1062 |
#(#Menu |
|
1063 |
||
1064 |
#( |
|
1065 |
#(#MenuItem |
|
1066 |
#'label:' 'Default Extent' |
|
1067 |
#'value:' #setToDefaultExtent |
|
1068 |
#'activeHelpKey:' #setToDefaultExtent |
|
1069 |
#'enabled:' #canMoveOrAlignSelection |
|
1070 |
) |
|
1071 |
#(#MenuItem |
|
1072 |
#'label:' 'Default Width' |
|
1073 |
#'value:' #setToDefaultWidth |
|
1074 |
#'activeHelpKey:' #setToDefaultWidth |
|
1075 |
#'enabled:' #canMoveOrAlignSelection |
|
1076 |
) |
|
1077 |
#(#MenuItem |
|
1078 |
#'label:' 'Default Height' |
|
1079 |
#'value:' #setToDefaultHeight |
|
1080 |
#'activeHelpKey:' #setToDefaultHeight |
|
1081 |
#'enabled:' #canMoveOrAlignSelection |
|
1082 |
) |
|
1083 |
#(#MenuItem |
|
1084 |
#'label:' '-' |
|
1085 |
) |
|
1086 |
#(#MenuItem |
|
1087 |
#'label:' 'Copy Extent' |
|
1088 |
#'value:' #copyExtent |
|
1089 |
#'activeHelpKey:' #copyExtent |
|
1090 |
#'enabled:' #hasSingleSelection |
|
1091 |
) |
|
1092 |
#(#MenuItem |
|
1093 |
#'label:' '-' |
|
1094 |
) |
|
1095 |
#(#MenuItem |
|
1096 |
#'label:' 'Paste Extent' |
|
1097 |
#'value:' #pasteExtent |
|
1098 |
#'activeHelpKey:' #pasteExtent |
|
1099 |
#'enabled:' #canMoveOrAlignSelection |
|
1100 |
) |
|
1101 |
#(#MenuItem |
|
1102 |
#'label:' 'Paste Width' |
|
1103 |
#'value:' #pasteWidth |
|
1104 |
#'activeHelpKey:' #pasteWidth |
|
1105 |
#'enabled:' #canMoveOrAlignSelection |
|
1106 |
) |
|
1107 |
#(#MenuItem |
|
1108 |
#'label:' 'Paste Height' |
|
1109 |
#'value:' #pasteHeight |
|
1110 |
#'activeHelpKey:' #pasteHeight |
|
1111 |
#'enabled:' #canMoveOrAlignSelection |
|
1112 |
) |
|
1113 |
#(#MenuItem |
|
1114 |
#'label:' '-' |
|
1115 |
) |
|
1116 |
#(#MenuItem |
|
1117 |
#'label:' 'Copy Layout' |
|
1118 |
#'value:' #copyLayout |
|
1119 |
#'activeHelpKey:' #copyLayout |
|
1120 |
#'enabled:' #hasSingleSelection |
|
1121 |
) |
|
1122 |
#(#MenuItem |
|
1123 |
#'label:' 'Paste Layout' |
|
1124 |
#'value:' #pasteLayout |
|
1125 |
#'activeHelpKey:' #pasteLayout |
|
1126 |
#'enabled:' #canMoveOrAlignSelection |
|
1127 |
) |
|
1128 |
) nil |
|
1129 |
nil |
|
1130 |
) |
|
1131 |
) |
|
498 | 1132 |
) nil |
1133 |
nil |
|
1134 |
) |
|
1135 |
! |
|
1136 |
||
1137 |
menuMove |
|
1138 |
"this window spec was automatically generated by the ST/X MenuEditor" |
|
1139 |
||
1140 |
"do not manually edit this - the builder may not be able to |
|
1141 |
handle the specification if its corrupted." |
|
1142 |
||
1143 |
" |
|
1144 |
MenuEditor new openOnClass:UIPainter andSelector:#menuMove |
|
1145 |
(Menu new fromLiteralArrayEncoding:(UIPainter menuMove)) startUp |
|
1146 |
" |
|
1147 |
||
1148 |
<resource: #menu> |
|
1149 |
||
1150 |
^ |
|
1151 |
||
1152 |
#(#Menu |
|
1153 |
||
1154 |
#( |
|
446 | 1155 |
#(#MenuItem |
498 | 1156 |
#'label:' 'Move Up' |
1157 |
#'value:' #doStepUp |
|
1158 |
#'activeHelpKey:' #moveSelectionUp |
|
1159 |
#'enabled:' #canMoveOrAlignSelection |
|
1160 |
#'labelImage:' #(#ResourceRetriever #ToolApplicationModel #upIcon 'Move Up') |
|
1161 |
) |
|
1162 |
#(#MenuItem |
|
1163 |
#'label:' 'Move Down' |
|
1164 |
#'value:' #doStepDown |
|
1165 |
#'activeHelpKey:' #moveSelectionDown |
|
1166 |
#'enabled:' #canMoveOrAlignSelection |
|
1167 |
#'labelImage:' #(#ResourceRetriever #ToolApplicationModel #downIcon 'Move Down') |
|
1168 |
) |
|
1169 |
#(#MenuItem |
|
1170 |
#'label:' 'Move In' |
|
1171 |
#'value:' #doStepIn |
|
1172 |
#'activeHelpKey:' #moveSelectionRight |
|
1173 |
#'enabled:' #canMoveSelectionIntoContainer |
|
1174 |
#'labelImage:' #(#ResourceRetriever #ToolApplicationModel #downRightIcon 'Move In') |
|
1175 |
) |
|
1176 |
#(#MenuItem |
|
1177 |
#'label:' 'Move Out' |
|
1178 |
#'value:' #doStepOut |
|
1179 |
#'activeHelpKey:' #moveSelectionLeft |
|
1180 |
#'enabled:' #canMoveSelectionOutOfContainer |
|
1181 |
#'labelImage:' #(#ResourceRetriever #ToolApplicationModel #leftDownIcon 'Move Out') |
|
446 | 1182 |
) |
1183 |
) nil |
|
1184 |
nil |
|
1185 |
) |
|
1186 |
! |
|
1187 |
||
1188 |
menuToolbar |
|
1189 |
"this window spec was automatically generated by the ST/X MenuEditor" |
|
1190 |
||
1191 |
"do not manually edit this - the builder may not be able to |
|
1192 |
handle the specification if its corrupted." |
|
1193 |
||
1194 |
" |
|
1195 |
MenuEditor new openOnClass:UIPainter andSelector:#menuToolbar |
|
1196 |
(Menu new fromLiteralArrayEncoding:(UIPainter menuToolbar)) startUp |
|
1197 |
" |
|
1198 |
||
1199 |
<resource: #menu> |
|
1200 |
||
1201 |
^ |
|
1202 |
||
1203 |
#(#Menu |
|
1204 |
||
1205 |
#( |
|
1206 |
#(#MenuItem |
|
498 | 1207 |
#'label:' 'Start' |
446 | 1208 |
#'isButton:' true |
1209 |
#'value:' #doStartApplication |
|
498 | 1210 |
#'activeHelpKey:' #testStartApplication |
1211 |
#'labelImage:' #(#ResourceRetriever nil #startIcon) |
|
446 | 1212 |
) |
1213 |
#(#MenuItem |
|
518 | 1214 |
#'label:' '' |
446 | 1215 |
) |
1216 |
#(#MenuItem |
|
1217 |
#'label:' 'New' |
|
1218 |
#'isButton:' true |
|
1219 |
#'value:' #doNew |
|
498 | 1220 |
#'activeHelpKey:' #fileNew |
446 | 1221 |
#'labelImage:' #(#ResourceRetriever nil #newIcon) |
1222 |
) |
|
1223 |
#(#MenuItem |
|
1224 |
#'label:' 'Load' |
|
1225 |
#'isButton:' true |
|
1226 |
#'value:' #doFromClass |
|
498 | 1227 |
#'activeHelpKey:' #fileLoad |
446 | 1228 |
#'labelImage:' #(#ResourceRetriever nil #loadIcon) |
1229 |
) |
|
1230 |
#(#MenuItem |
|
1231 |
#'label:' 'Save' |
|
1232 |
#'isButton:' true |
|
1233 |
#'value:' #doInstallSpec |
|
498 | 1234 |
#'activeHelpKey:' #fileSave |
446 | 1235 |
#'labelImage:' #(#ResourceRetriever nil #saveIcon) |
1236 |
) |
|
1237 |
#(#MenuItem |
|
518 | 1238 |
#'label:' '' |
446 | 1239 |
) |
1240 |
#(#MenuItem |
|
498 | 1241 |
#'label:' 'Move Up' |
446 | 1242 |
#'isButton:' true |
1243 |
#'value:' #doStepUp |
|
498 | 1244 |
#'activeHelpKey:' #moveSelectionUp |
1245 |
#'enabled:' #canMoveOrAlignSelection |
|
446 | 1246 |
#'labelImage:' #(#ResourceRetriever nil #upIcon) |
1247 |
) |
|
1248 |
#(#MenuItem |
|
498 | 1249 |
#'label:' 'Move Down' |
446 | 1250 |
#'isButton:' true |
1251 |
#'value:' #doStepDown |
|
498 | 1252 |
#'activeHelpKey:' #moveSelectionDown |
1253 |
#'enabled:' #canMoveOrAlignSelection |
|
446 | 1254 |
#'labelImage:' #(#ResourceRetriever nil #downIcon) |
1255 |
) |
|
1256 |
#(#MenuItem |
|
498 | 1257 |
#'label:' 'Move In' |
446 | 1258 |
#'isButton:' true |
1259 |
#'value:' #doStepIn |
|
498 | 1260 |
#'activeHelpKey:' #moveSelectionRight |
1261 |
#'enabled:' #canMoveSelectionIntoContainer |
|
446 | 1262 |
#'labelImage:' #(#ResourceRetriever nil #downRightIcon) |
1263 |
) |
|
1264 |
#(#MenuItem |
|
498 | 1265 |
#'label:' 'Move Out' |
446 | 1266 |
#'isButton:' true |
1267 |
#'value:' #doStepOut |
|
498 | 1268 |
#'activeHelpKey:' #moveSelectionLeft |
1269 |
#'enabled:' #canMoveSelectionOutOfContainer |
|
446 | 1270 |
#'labelImage:' #(#ResourceRetriever nil #leftDownIcon) |
1271 |
) |
|
1272 |
#(#MenuItem |
|
518 | 1273 |
#'label:' '' |
446 | 1274 |
) |
1275 |
#(#MenuItem |
|
498 | 1276 |
#'label:' 'Align left' |
437 | 1277 |
#'isButton:' true |
217 | 1278 |
#'value:' #alignSelectionLeft |
287 | 1279 |
#'activeHelpKey:' #alignSelectionLeft |
437 | 1280 |
#'labelImage:' #(#ResourceRetriever nil #iconAlignL) |
217 | 1281 |
) |
1282 |
#(#MenuItem |
|
498 | 1283 |
#'label:' 'Align right' |
437 | 1284 |
#'isButton:' true |
217 | 1285 |
#'value:' #alignSelectionRight |
1286 |
#'activeHelpKey:' #alignSelectionRight |
|
437 | 1287 |
#'labelImage:' #(#ResourceRetriever nil #iconAlignR) |
217 | 1288 |
) |
1289 |
#(#MenuItem |
|
498 | 1290 |
#'label:' 'Align left & right' |
437 | 1291 |
#'isButton:' true |
217 | 1292 |
#'value:' #alignSelectionLeftAndRight |
1293 |
#'activeHelpKey:' #alignSelectionLeftAndRight |
|
437 | 1294 |
#'labelImage:' #(#ResourceRetriever nil #iconAlignLR) |
1295 |
) |
|
1296 |
#(#MenuItem |
|
498 | 1297 |
#'label:' 'Align top' |
437 | 1298 |
#'isButton:' true |
217 | 1299 |
#'value:' #alignSelectionTop |
1300 |
#'activeHelpKey:' #alignSelectionTop |
|
437 | 1301 |
#'labelImage:' #(#ResourceRetriever nil #iconAlignT) |
217 | 1302 |
) |
1303 |
#(#MenuItem |
|
498 | 1304 |
#'label:' 'Align bottom' |
437 | 1305 |
#'isButton:' true |
217 | 1306 |
#'value:' #alignSelectionBottom |
1307 |
#'activeHelpKey:' #alignSelectionBottom |
|
437 | 1308 |
#'labelImage:' #(#ResourceRetriever nil #iconAlignB) |
217 | 1309 |
) |
1310 |
#(#MenuItem |
|
498 | 1311 |
#'label:' 'Align top & bottom' |
437 | 1312 |
#'isButton:' true |
217 | 1313 |
#'value:' #alignSelectionTopAndBottom |
1314 |
#'activeHelpKey:' #alignSelectionTopAndBottom |
|
437 | 1315 |
#'labelImage:' #(#ResourceRetriever nil #iconAlignTB) |
1316 |
) |
|
1317 |
#(#MenuItem |
|
518 | 1318 |
#'label:' '' |
217 | 1319 |
) |
1320 |
#(#MenuItem |
|
498 | 1321 |
#'label:' 'Align centered horizontal' |
437 | 1322 |
#'isButton:' true |
217 | 1323 |
#'value:' #alignSelectionCenterHor |
1324 |
#'activeHelpKey:' #alignSelectionCenterHor |
|
437 | 1325 |
#'labelImage:' #(#ResourceRetriever nil #iconAlignCenterH) |
217 | 1326 |
) |
1327 |
#(#MenuItem |
|
498 | 1328 |
#'label:' 'Align centered vertical' |
437 | 1329 |
#'isButton:' true |
217 | 1330 |
#'value:' #alignSelectionCenterVer |
1331 |
#'activeHelpKey:' #alignSelectionCenterVer |
|
437 | 1332 |
#'labelImage:' #(#ResourceRetriever nil #iconAlignCenterV) |
217 | 1333 |
) |
437 | 1334 |
) nil |
217 | 1335 |
nil |
1336 |
) |
|
446 | 1337 |
! ! |
1338 |
||
1339 |
!UIPainter class methodsFor:'resources'! |
|
1340 |
||
1341 |
iconAlignB |
|
490 | 1342 |
"Generated by the Image Editor" |
1343 |
" |
|
1344 |
ImageEditor openOnClass:self andSelector:#iconAlignB |
|
1345 |
" |
|
446 | 1346 |
|
1347 |
<resource: #image> |
|
490 | 1348 |
|
1349 |
^Icon |
|
1350 |
constantNamed:#'UIPainter iconAlignB' |
|
1351 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@E@@@@@@@G@@@@@@@G@E@@@@@G@G@@@@@G@G@@@@@G@G@@@E@G@G@@@G@G@G@K@G@G@G@@@G@G@G@A@G@G@G@@@G@G@G@K@@@@@@@@B*****(@B*****(@@@@@@@@@@@@@@@@@@@@@@@@@'); colorMap:(((Array new:4) at:1 put:((Color black)); at:2 put:((Color white)); at:3 put:((Color red:0.0 green:0.0 blue:49.9962)); at:4 put:((Color grey:66.9978)); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@G C@G @@G'' @G'' @G'' @G'' G'''' G'''' G'''' G''''!!G'''' G'''' G'''' G'''' O??0O??0@@@@@@@C@@@@'); yourself); yourself]! |
|
446 | 1352 |
|
1353 |
iconAlignCenterH |
|
490 | 1354 |
"Generated by the Image Editor" |
1355 |
" |
|
1356 |
ImageEditor openOnClass:self andSelector:#iconAlignCenterH |
|
1357 |
" |
|
446 | 1358 |
|
1359 |
<resource: #image> |
|
490 | 1360 |
|
1361 |
^Icon |
|
1362 |
constantNamed:#'UIPainter iconAlignCenterH' |
|
1363 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUUPUUUUUUUPUUUUUUUPV*****)PV*****)PUUUMUUUPUUT?UUUPUUS?5UU\UUO?=UUWUT???UUPUTUUUUUPUUUUUUUPV*****)PV*****)PUUUMUUUPUUT?UUUPUUS?5UUPUUO?=UUPUT???UUWUTUUUUUPUUUUUUUPUUUUUUUP'); colorMap:(((Array new:4) at:1 put:((Color white)); at:2 put:((Color black)); at:3 put:((Color red:0.0 green:0.0 blue:49.9962)); at:4 put:((Color grey:49.9962)); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@BO??0O??0@G@@@O @@_0@@?8@A?<@A?<@@@@@O??0O??3@G@@@O @@_0@@?8@A?<@A?<@@@@@@@@@'); yourself); yourself]! |
|
446 | 1364 |
|
1365 |
iconAlignCenterV |
|
490 | 1366 |
"Generated by the Image Editor" |
1367 |
" |
|
1368 |
ImageEditor openOnClass:self andSelector:#iconAlignCenterV |
|
1369 |
" |
|
446 | 1370 |
|
1371 |
<resource: #image> |
|
490 | 1372 |
|
1373 |
^Icon |
|
1374 |
constantNamed:#'UIPainter iconAlignCenterV' |
|
1375 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUUPUUUUUUUPUUV%UV%PUUV%UV%PUUV%UV%PTEV$EV%PT=V$=V%PT?V$?V%PT?6$?6%WT?>$?>%PT?>$?>%_T?6$?6%PT?V$?V%PT=V$=V%PT5V$5V%WUUV%UV%PUUV%UV%PUUV%UV%_UUV%UV%WUUV%UV%PUUUUUUUPUUUUUUUQ'); colorMap:(((Array new:4) at:1 put:((Color white)); at:2 put:((Color black)); at:3 put:((Color red:0.0 green:0.0 blue:49.9962)); at:4 put:((Color grey:49.9962)); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@LA!!@LA @LA LM!! NM1 OM9 O-= O=? O=? O=? O-= OM9 NM1 DL!!#@LA @LA @LA @LA @@@C@@@@'); yourself); yourself]! |
|
446 | 1376 |
|
1377 |
iconAlignL |
|
490 | 1378 |
"Generated by the Image Editor" |
1379 |
" |
|
1380 |
ImageEditor openOnClass:self andSelector:#iconAlignL |
|
1381 |
" |
|
446 | 1382 |
|
1383 |
<resource: #image> |
|
490 | 1384 |
|
1385 |
^Icon |
|
1386 |
constantNamed:#'UIPainter iconAlignL' |
|
1387 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@(@@@@@@@(@@@@@@@(UUUP@I@(_??0@@@(@@@@@@@(@@@@@@@(@@@@@@@(@@@@@@@(UUUU@@@(_???@@@(@@@@@E@(@@@@@@@(@@@@@@@(@@@@@@@(UU@@@@@(_?@@@@@(@@@@@@@(@@@@@@@@@@@@@E@@@@@@@@'); colorMap:(((Array new:4) at:1 put:((Color black)); at:2 put:((Color white)); at:3 put:((Color red:0.0 green:0.0 blue:49.9977)); at:4 put:((Color grey:66.9978)); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@F@@@G?>@G?>@G?>@G?>@F@@@F@@@G?? G?? G?? G?? F@@@F@@@G? @G? @G? @G? @F@@@@@@@@@@@'); yourself); yourself]! |
|
446 | 1388 |
|
1389 |
iconAlignLR |
|
490 | 1390 |
"Generated by the Image Editor" |
1391 |
" |
|
1392 |
ImageEditor openOnClass:self andSelector:#iconAlignLR |
|
1393 |
" |
|
446 | 1394 |
|
1395 |
<resource: #image> |
|
490 | 1396 |
|
1397 |
^Icon |
|
1398 |
constantNamed:#'UIPainter iconAlignLR' |
|
1399 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@(@@@B @@(@@@B @@(UUUR I@(_??2 @@(@@@B @@(@@@B @@(@@@B @@(@@@B @@(UUUR @@(_??2 @@(@@@B E@(@@@B @@(@@@B @@(@@@B @@(UUUR @@(_??B @@(@@@B @@(@@@B @@@@@@@@E@@@@@@@@'); colorMap:(((Array new:4) at:1 put:((Color black)); at:2 put:((Color white)); at:3 put:((Color red:0.0 green:0.0 blue:49.9977)); at:4 put:((Color grey:66.9978)); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@F@A G?? G?? G?? G?? F@A F@A G?? G?? G?? G?? F@A F@A G?? G?? G?; G?? F@A @@@@@@@@'); yourself); yourself]! |
|
446 | 1400 |
|
1401 |
iconAlignR |
|
490 | 1402 |
"Generated by the Image Editor" |
1403 |
" |
|
1404 |
ImageEditor openOnClass:self andSelector:#iconAlignR |
|
1405 |
" |
|
446 | 1406 |
|
1407 |
<resource: #image> |
|
490 | 1408 |
|
1409 |
^Icon |
|
1410 |
constantNamed:#'UIPainter iconAlignR' |
|
1411 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@B @@@@@@B @@@UUUR I@@_??2 @@@@@@B @@@@@@B @@@@@@B @@@@@@B @@EUUUR @@G???2 @@@@@@B E@@@@@B @@@@@@B @@@@@@B @@@@EUR @@@@G?2 @@@@@@B @@@@@@B @@@@@@@@E@@@@@@@@'); colorMap:(((Array new:4) at:1 put:((Color black)); at:2 put:((Color white)); at:3 put:((Color red:0.0 green:0.0 blue:49.9977)); at:4 put:((Color grey:66.9978)); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@A A?? A?? A?? A?? @@A @@A G?? G?? G?? G?? @@A @@A @G? @G? @G? @G? @@A @@@@@@@@'); yourself); yourself]! |
|
446 | 1412 |
|
1413 |
iconAlignT |
|
490 | 1414 |
"Generated by the Image Editor" |
1415 |
" |
|
1416 |
ImageEditor openOnClass:self andSelector:#iconAlignT |
|
1417 |
" |
|
446 | 1418 |
|
1419 |
<resource: #image> |
|
490 | 1420 |
|
1421 |
^Icon |
|
1422 |
constantNamed:#'UIPainter iconAlignT' |
|
1423 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@B*****(@B*****(@@@@@@@@@@E@E@E@K@G@G@G@@@G@G@G@A@G@G@G@@@G@G@G@K@G@G@G@@@@@G@G@@@@@G@G@@@@@G@G@@@@@G@G@@@@@G@@@@@@@G@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'); colorMap:(((Array new:4) at:1 put:((Color black)); at:2 put:((Color white)); at:3 put:((Color red:0.0 green:0.0 blue:49.9962)); at:4 put:((Color grey:66.9978)); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@C@@@@O??0O??0G'''' G'''' G'''' G'''' G''''!!G'''' G'''' G'''' @G'' @G'' @G'' @G'' @G @@G C@@@@@@@@@@@@'); yourself); yourself]! |
|
446 | 1424 |
|
1425 |
iconAlignTB |
|
490 | 1426 |
"Generated by the Image Editor" |
1427 |
" |
|
1428 |
ImageEditor openOnClass:self andSelector:#iconAlignTB |
|
1429 |
" |
|
446 | 1430 |
|
1431 |
<resource: #image> |
|
490 | 1432 |
|
1433 |
^Icon |
|
1434 |
constantNamed:#'UIPainter iconAlignTB' |
|
1435 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@A@@@@@@@@@@@@@@@@B*****(@B*****(@@@@@@@@@@E@E@E@G@G@G@G@@@G@G@G@@@G@G@G@@@G@G@G@H@G@G@G@@@G@G@G@A@G@G@G@@@G@G@G@@@G@G@D@@@@@@@@@@B*****(@B*****(@@@@@@@@@@@@@@@@H@@@@@@@@'); colorMap:(((Array new:4) at:1 put:((Color black)); at:2 put:((Color white)); at:3 put:((Color red:0.0 green:0.0 blue:49.9962)); at:4 put:((Color grey:66.9978)); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@C@@@@O??0O??0G'''' G''''!!G'''' G'''' G'''' G'''' G'''' G'''' G''''!!G''''!!G''& G'''' O??0O??2@@@@@@@@@@@@'); yourself); yourself]! ! |
|
222 | 1436 |
|
109 | 1437 |
!UIPainter methodsFor:'actions'! |
60 | 1438 |
|
109 | 1439 |
accept |
282 | 1440 |
"accept changes done to the specification. The component assigned to the |
1441 |
specification will change immediately dependant on the attributes derived |
|
1442 |
from the specification. |
|
1443 |
" |
|
287 | 1444 |
|layout spec prop key layoutTool| |
60 | 1445 |
|
166 | 1446 |
self isLayoutToolSelected ifTrue:[ |
287 | 1447 |
layoutTool := self layoutTool. |
1448 |
||
144 | 1449 |
(layout := layoutTool layout) notNil ifTrue:[ |
1450 |
layoutTool layoutType == #Extent ifTrue:[ |
|
282 | 1451 |
layoutTool layoutView == self painter topView ifTrue:[ |
1452 |
layoutTool layoutView extent:layout |
|
1453 |
] ifFalse:[ |
|
1454 |
self painter setExtent:layout |
|
1455 |
] |
|
144 | 1456 |
] ifFalse:[ |
149 | 1457 |
self painter setLayout:layout |
109 | 1458 |
] |
144 | 1459 |
] |
1460 |
] ifFalse:[ |
|
287 | 1461 |
spec := self specTool specification. |
1462 |
||
166 | 1463 |
self isHelpToolSelected ifTrue:[ |
287 | 1464 |
self helpTool accept. |
1465 |
key := self helpTool helpKey. |
|
1466 |
prop := treeView propertySelected. |
|
1467 |
||
1468 |
prop notNil ifTrue:[ |
|
1469 |
prop spec activeHelpKey:key |
|
1470 |
]. |
|
1471 |
spec activeHelpKey:key. |
|
1472 |
] ifFalse:[ |
|
1473 |
self painter updateFromSpec:spec. |
|
1474 |
] |
|
144 | 1475 |
]. |
166 | 1476 |
self modifiedChannel value:false. |
109 | 1477 |
! |
1478 |
||
533 | 1479 |
addWidgetOfSpec: aSpec |
1480 |
||
1481 |
|newSel| |
|
1482 |
(newSel := self pasteSpecifications:aSpec keepLayout:false at:0@0) notNil |
|
1483 |
ifTrue: |
|
1484 |
[ |
|
1485 |
self select: newSel |
|
1486 |
] |
|
1487 |
ifFalse: |
|
1488 |
[ |
|
1489 |
treeView selection size = 0 |
|
1490 |
ifTrue: |
|
1491 |
[ |
|
1492 |
treeView selection: #(1). |
|
1493 |
] |
|
1494 |
ifFalse: |
|
1495 |
[ |
|
1496 |
treeView selectNode: (treeView detectNode: [:n| n = treeView selectedNode parent]) |
|
1497 |
]. |
|
1498 |
self addWidgetOfSpec: aSpec |
|
1499 |
] |
|
1500 |
||
1501 |
! |
|
1502 |
||
109 | 1503 |
cancel |
282 | 1504 |
"cancel all changes done to the specification; reread attributes from the |
1505 |
assigned component |
|
109 | 1506 |
" |
328 | 1507 |
|spec key view| |
287 | 1508 |
|
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
1509 |
self isModified ifTrue:[ |
287 | 1510 |
(spec := self painter specForSelection) notNil ifTrue:[ |
1511 |
key := spec activeHelpKey. |
|
1512 |
]. |
|
1513 |
self helpTool helpKey:key. |
|
1514 |
self specTool specification:spec. |
|
328 | 1515 |
view := self layoutTool layoutView. |
1516 |
||
1517 |
self setViewInLayoutTool:view. |
|
1518 |
spec class == DataSetSpec ifTrue:[ |
|
1519 |
view columnDescriptors:(spec columns) |
|
1520 |
]. |
|
166 | 1521 |
self modifiedChannel value:false. |
1522 |
] |
|
137 | 1523 |
! |
1524 |
||
282 | 1525 |
moveSelectionDown |
1526 |
"move selected components down |
|
1527 |
" |
|
1528 |
self painter moveSelectionDown |
|
1529 |
! |
|
1530 |
||
1531 |
moveSelectionLeft |
|
1532 |
"move selected components left |
|
1533 |
" |
|
1534 |
self painter moveSelectionLeft |
|
1535 |
||
1536 |
! |
|
1537 |
||
1538 |
moveSelectionRight |
|
1539 |
"move selected components right |
|
1540 |
" |
|
1541 |
self painter moveSelectionRight |
|
1542 |
||
1543 |
! |
|
1544 |
||
1545 |
moveSelectionUp |
|
1546 |
"move selected components up |
|
1547 |
" |
|
1548 |
self painter moveSelectionUp |
|
1549 |
||
60 | 1550 |
! ! |
1551 |
||
365
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1552 |
!UIPainter methodsFor:'active help'! |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1553 |
|
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1554 |
showHelp:aHelpText for:view |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1555 |
"display active help texts in my own info area." |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1556 |
|
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1557 |
|txt| |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1558 |
|
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1559 |
aHelpText isNil ifTrue:[ |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1560 |
txt := nil |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1561 |
] ifFalse:[ |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1562 |
txt := self class |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1563 |
convertString:(aHelpText asString) |
368 | 1564 |
maxLineSize:(transcript width // transcript font width) |
1565 |
skipLineFeed:true |
|
365
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1566 |
]. |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1567 |
transcript hideCursor. |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1568 |
transcript contents:txt. |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1569 |
^ true |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1570 |
|
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1571 |
"Modified: / 29.10.1997 / 22:33:55 / cg" |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1572 |
! ! |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1573 |
|
60 | 1574 |
!UIPainter methodsFor:'aspects'! |
1575 |
||
282 | 1576 |
canMoveOrAlignSelection |
1577 |
"returns a boolean value holder which is true in case that any selection exists |
|
1578 |
and all widgets in the selection can change its layout through to a move or |
|
1579 |
align operation |
|
1580 |
" |
|
1581 |
^ builder booleanValueAspectFor:#canMoveOrAlignSelection |
|
222 | 1582 |
! |
1583 |
||
282 | 1584 |
canMoveSelectionIntoContainer |
1585 |
"returns a boolean value holder which is true in case that one component is selected |
|
1586 |
and can change its container widget to the next element in the list which will have |
|
1587 |
the same container. |
|
1588 |
" |
|
1589 |
^ builder booleanValueAspectFor:#canMoveSelectionIntoContainer |
|
1590 |
! |
|
1591 |
||
1592 |
canMoveSelectionOutOfContainer |
|
1593 |
"returns a boolean value holder which is true in case that one component is selected |
|
1594 |
which is contained within another component |
|
1595 |
" |
|
1596 |
^ builder booleanValueAspectFor:#canMoveSelectionOutOfContainer |
|
222 | 1597 |
! |
1598 |
||
118 | 1599 |
enableChannel |
1600 |
"true if modifications are allowed otherwise running test |
|
1601 |
" |
|
1602 |
^ self painter enableChannel |
|
109 | 1603 |
! |
1604 |
||
173 | 1605 |
galleryShown |
282 | 1606 |
"returns a boolean value holder which is set to true if the gallery is shown |
1607 |
" |
|
173 | 1608 |
|holder| |
1609 |
||
1610 |
(holder := builder bindingAt:#galleryShown) isNil ifTrue:[ |
|
1611 |
builder aspectAt:#galleryShown put:(holder := true asValue). |
|
1612 |
holder addDependent:self |
|
1613 |
]. |
|
1614 |
^ holder |
|
1615 |
||
1616 |
! |
|
1617 |
||
282 | 1618 |
hasOneSelectionOtherThanCanvas |
1619 |
"returns a value holder which is true in case that one component is selected |
|
1620 |
other than the canvas. |
|
1621 |
" |
|
1622 |
^ builder booleanValueAspectFor:#hasOneSelectionOtherThanCanvas |
|
222 | 1623 |
! |
1624 |
||
109 | 1625 |
modifiedChannel |
282 | 1626 |
"returns a boolean value holder which is set to true if something is modified |
1627 |
and not accepted |
|
1628 |
" |
|
256 | 1629 |
^ builder booleanValueAspectFor:#modifiedChannel |
109 | 1630 |
! |
1631 |
||
1632 |
noteBookView |
|
282 | 1633 |
"returns the notebook view; initialize components within the notebook |
1634 |
" |
|
287 | 1635 |
|noteBook channel helpTool layoutTool specTool| |
109 | 1636 |
|
1637 |
(noteBook := builder bindingAt:#noteBookView) isNil ifTrue:[ |
|
166 | 1638 |
noteBook := View new. |
1639 |
layoutTool := UILayoutTool new. |
|
287 | 1640 |
helpTool := UIHelpTool new. |
1641 |
helpTool helpSpecFrom:specClass. |
|
166 | 1642 |
specTool := UISpecificationTool new. |
144 | 1643 |
channel := self modifiedChannel. |
166 | 1644 |
|
152 | 1645 |
layoutTool masterApplication:self. |
166 | 1646 |
specTool masterApplication:self. |
287 | 1647 |
helpTool masterApplication:self. |
1648 |
||
1649 |
layoutCanvas := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook. |
|
1650 |
helpCanvas := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook. |
|
1651 |
specCanvas := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook. |
|
1652 |
||
1653 |
layoutCanvas client:layoutTool. |
|
1654 |
helpCanvas client:helpTool. |
|
1655 |
specTool builder:(specCanvas client:specTool). |
|
166 | 1656 |
|
1657 |
layoutTool masterApplication:self. |
|
1658 |
specTool masterApplication:self. |
|
287 | 1659 |
helpTool masterApplication:self. |
1660 |
||
109 | 1661 |
layoutTool modifiedHolder:channel. |
287 | 1662 |
helpTool modifiedHolder:channel. |
166 | 1663 |
specTool modifiedHolder:channel. |
287 | 1664 |
|
109 | 1665 |
builder aspectAt:#noteBookView put:noteBook. |
1666 |
]. |
|
1667 |
^ noteBook |
|
1668 |
! |
|
1669 |
||
282 | 1670 |
painterShown |
1671 |
"returns a boolean value holder which is set to true if the painter is shown |
|
109 | 1672 |
" |
173 | 1673 |
|holder| |
1674 |
||
1675 |
(holder := builder bindingAt:#painterShown) isNil ifTrue:[ |
|
1676 |
builder aspectAt:#painterShown put:(holder := true asValue). |
|
1677 |
holder addDependent:self |
|
1678 |
]. |
|
1679 |
^ holder |
|
1680 |
||
1681 |
! |
|
1682 |
||
109 | 1683 |
tabList |
282 | 1684 |
"returns a value holder which keeps a list of labels assigned to the tabs |
1685 |
" |
|
109 | 1686 |
|holder| |
1687 |
||
1688 |
(holder := builder bindingAt:#tabList) isNil ifTrue:[ |
|
1689 |
builder aspectAt:#tabList put:(holder := ValueHolder new). |
|
144 | 1690 |
holder value:#( 'Properties' ). |
109 | 1691 |
]. |
1692 |
^ holder |
|
1693 |
! |
|
1694 |
||
1695 |
tabModel |
|
282 | 1696 |
"returns a value holder which keeps the current name of the tab selected |
1697 |
" |
|
109 | 1698 |
|holder| |
1699 |
||
1700 |
(holder := builder bindingAt:#tabModel) isNil ifTrue:[ |
|
1701 |
holder := AspectAdaptor new subject:self; forAspect:#tabSelection. |
|
1702 |
builder aspectAt:#tabModel put:holder. |
|
1703 |
]. |
|
1704 |
^ holder |
|
222 | 1705 |
! |
1706 |
||
1707 |
treeView |
|
282 | 1708 |
"returns the selection tree view which holds all widget identifiers |
1709 |
" |
|
222 | 1710 |
^ treeView |
60 | 1711 |
! ! |
1712 |
||
109 | 1713 |
!UIPainter methodsFor:'binding access'! |
1714 |
||
1715 |
aspectFor:aKey |
|
222 | 1716 |
"aspect for a key |
109 | 1717 |
" |
222 | 1718 |
^ aspects at:aKey ifAbsent:[ super aspectFor:aKey ] |
109 | 1719 |
! ! |
1720 |
||
513 | 1721 |
!UIPainter methodsFor:'buildin editors'! |
1722 |
||
1723 |
openDataSetColumnEditor |
|
1724 |
"opens a column editor |
|
1725 |
" |
|
1726 |
|cls aspect editor columns| |
|
1727 |
||
1728 |
cls := self resolveName:specClass. |
|
1729 |
||
1730 |
cls isNil ifTrue:[ |
|
1731 |
^ self information:'No application class defined yet!!' |
|
1732 |
]. |
|
1733 |
aspect := self specTool specification columns. |
|
1734 |
editor := DataSetBuilder new. |
|
1735 |
editor masterApplication:self. |
|
1736 |
editor columns:aspect fromView:(self layoutTool layoutView). |
|
1737 |
editor rowClassName:(self specTool specification rowClassName). |
|
1738 |
editor openModal. |
|
1739 |
||
1740 |
editor hasChanged ifTrue:[ |
|
1741 |
self specTool specification columns:(editor columns). |
|
1742 |
self specTool specification rowClassName:(editor rowClassName). |
|
1743 |
self modifiedChannel value:true. |
|
1744 |
]. |
|
1745 |
! |
|
1746 |
||
1747 |
openEditMenu |
|
1748 |
"opens a menu editor on current widget |
|
1749 |
" |
|
1750 |
|cls aspect editor| |
|
1751 |
||
1752 |
cls := self resolveName:specClass. |
|
1753 |
||
1754 |
cls isNil ifTrue:[ |
|
1755 |
^ self information:'No application class defined yet!!' |
|
1756 |
]. |
|
1757 |
||
1758 |
cls notNil ifTrue:[ |
|
1759 |
(aspect := self specTool specification menuSelector) notNil ifTrue:[ |
|
1760 |
aspect := aspect asSymbol |
|
1761 |
] ifFalse:[ |
|
1762 |
"/ cg: q&d hack ... |
|
1763 |
||
1764 |
aspect := treeView propertySelected. |
|
1765 |
aspect notNil ifTrue:[ |
|
1766 |
Object errorSignal handle:[:ex | |
|
1767 |
aspect := nil. |
|
1768 |
] do:[ |
|
1769 |
aspect := aspect view asMenu. |
|
1770 |
] |
|
1771 |
]. |
|
1772 |
]. |
|
1773 |
||
1774 |
editor := MenuEditor new. |
|
1775 |
editor masterApplication:self. |
|
1776 |
editor useHelpDictionary:(self helpTool dictionary). |
|
1777 |
editor openModalOnClass:cls andSelector:aspect. |
|
1778 |
self helpTool updateList. |
|
1779 |
||
1780 |
editor selectorName ~= aspect ifTrue:[ |
|
1781 |
editor didInstall ifTrue:[ |
|
1782 |
self specTool specification menuSelector:editor selectorName asSymbol. |
|
1783 |
self modifiedChannel value:true. |
|
1784 |
self accept |
|
1785 |
] |
|
1786 |
]. |
|
1787 |
] |
|
1788 |
||
1789 |
"Modified: 31.7.1997 / 14:26:13 / cg" |
|
1790 |
! |
|
1791 |
||
1792 |
openHierarchicalListEditor |
|
1793 |
"opens a hierarchical list editor editor on current widget |
|
1794 |
" |
|
1795 |
|cls aspect editor| |
|
1796 |
||
1797 |
cls := self resolveName:specClass. |
|
1798 |
||
1799 |
cls isNil ifTrue:[ |
|
1800 |
^ self information:'No application class defined yet!!' |
|
1801 |
]. |
|
1802 |
||
1803 |
(aspect := self specTool specification hierarchicalList) notNil ifTrue:[ |
|
1804 |
aspect := aspect asSymbol |
|
1805 |
] ifFalse:[ |
|
1806 |
"/ cg: q&d hack ... |
|
1807 |
||
1808 |
aspect := treeView propertySelected. |
|
1809 |
aspect notNil ifTrue:[ |
|
1810 |
Object errorSignal handle:[:ex | |
|
1811 |
aspect := nil. |
|
1812 |
] do:[ |
|
1813 |
aspect := aspect view asMenu. |
|
1814 |
] |
|
1815 |
]. |
|
1816 |
]. |
|
1817 |
||
1818 |
editor := HierarchicalListEditor new. |
|
1819 |
editor masterApplication:self. |
|
1820 |
editor openModalOnClass:cls andSelector:aspect. |
|
1821 |
||
1822 |
editor selectorName ~= aspect ifTrue:[ |
|
1823 |
editor didInstall ifTrue:[ |
|
1824 |
self specTool specification hierarchicalList:editor selectorName asSymbol. |
|
1825 |
self modifiedChannel value:true. |
|
1826 |
self accept |
|
1827 |
] |
|
1828 |
] |
|
1829 |
! |
|
1830 |
||
1831 |
openTabItemEditor |
|
1832 |
"opens a column editor |
|
1833 |
" |
|
1834 |
|cls aspect editor columns| |
|
1835 |
||
1836 |
cls := self resolveName:specClass. |
|
1837 |
||
1838 |
cls isNil ifTrue:[ |
|
1839 |
^ self information:'no application class defined yet' |
|
1840 |
]. |
|
1841 |
aspect := self specTool specification listSelector. |
|
1842 |
editor := TabItemEditor new. |
|
1843 |
editor masterApplication:self. |
|
1844 |
||
1845 |
editor openModalOnClass:cls andSelector:aspect. |
|
1846 |
||
1847 |
editor selector ~= aspect ifTrue:[ |
|
1848 |
editor didInstall ifTrue:[ |
|
1849 |
self specTool specification listSelector:(editor selector). |
|
1850 |
self modifiedChannel value:true. |
|
1851 |
self accept. |
|
1852 |
] |
|
1853 |
] |
|
1854 |
! ! |
|
1855 |
||
109 | 1856 |
!UIPainter methodsFor:'change & update'! |
1857 |
||
222 | 1858 |
layoutChanged |
282 | 1859 |
"called by the painter/canvas whenever the layout of the current selected |
1860 |
widget changed |
|
1861 |
" |
|
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
1862 |
self isModified ifFalse:[ |
287 | 1863 |
self layoutTool update. |
222 | 1864 |
self modifiedChannel value:false |
1865 |
] |
|
1866 |
! |
|
1867 |
||
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
1868 |
propertyChanged |
282 | 1869 |
"called by the painter/canvas whenever the property of the current selected |
1870 |
widget changed |
|
222 | 1871 |
" |
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
1872 |
|p| |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
1873 |
|
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
1874 |
(p := treeView propertySelected) notNil ifTrue:[ |
287 | 1875 |
self specTool specification:(p spec copy). |
282 | 1876 |
self setViewInLayoutTool:(p view). |
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
1877 |
self modifiedChannel value:false |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
1878 |
] ifFalse:[ |
287 | 1879 |
self layoutTool layoutView notNil ifTrue:[ |
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
1880 |
self modifiedChannel value:false. |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
1881 |
self treeSelection |
222 | 1882 |
] |
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
1883 |
] |
222 | 1884 |
! |
1885 |
||
1886 |
update:something with:aParameter from:someObject |
|
282 | 1887 |
"catch change notifications |
1888 |
" |
|
222 | 1889 |
someObject == treeView model ifTrue:[ |
362 | 1890 |
(something == #selection |
1891 |
or:[something == #selectionIndex]) ifTrue:[self treeSelection]. |
|
222 | 1892 |
^ self |
173 | 1893 |
]. |
1894 |
||
1895 |
self galleryShown == someObject ifTrue:[ |
|
1896 |
(self galleryShown value) ifTrue:[ |
|
1897 |
self raiseUIView:(selectionPanel window) |
|
1898 |
] ifFalse:[ |
|
1899 |
self hideUIView:(selectionPanel window) |
|
1900 |
]. |
|
1901 |
^ self |
|
1902 |
]. |
|
1903 |
||
1904 |
self painterShown == someObject ifTrue:[ |
|
1905 |
(self painterShown value) ifTrue:[ |
|
1906 |
self raiseUIView:(self painter topView) |
|
1907 |
] ifFalse:[ |
|
1908 |
self hideUIView:(self painter topView) |
|
1909 |
]. |
|
1910 |
^ self |
|
1911 |
]. |
|
1912 |
||
362 | 1913 |
"Modified: / 29.10.1997 / 17:48:19 / cg" |
109 | 1914 |
! ! |
1915 |
||
1916 |
!UIPainter methodsFor:'event handling'! |
|
1917 |
||
1918 |
doesNotUnderstand:aMessage |
|
282 | 1919 |
|
1920 |
|painter| |
|
1921 |
||
1922 |
painter := self painter. |
|
1923 |
||
1924 |
(painter respondsTo:(aMessage selector)) ifTrue:[ |
|
109 | 1925 |
^ aMessage sendTo:painter |
282 | 1926 |
]. |
1927 |
super doesNotUnderstand:aMessage |
|
1928 |
||
1929 |
! ! |
|
1930 |
||
297 | 1931 |
!UIPainter methodsFor:'printing'! |
1932 |
||
1933 |
show:aText |
|
1934 |
transcript hideCursor. |
|
1935 |
transcript contents:aText. |
|
1936 |
||
1937 |
! ! |
|
1938 |
||
109 | 1939 |
!UIPainter methodsFor:'private'! |
1940 |
||
446 | 1941 |
checkModified |
1942 |
"check interface modification |
|
1943 |
" |
|
1944 |
self painter isModified |
|
1945 |
ifTrue: |
|
1946 |
[ |
|
1947 |
((YesNoBox title:'Interface was modified!!') |
|
1948 |
noText:'Cancel'; |
|
1949 |
yesText:'Waste it and proceed'; |
|
1950 |
showAtPointer; |
|
1951 |
accepted) ifFalse: [^false]. |
|
1952 |
self painter resetModification |
|
1953 |
]. |
|
1954 |
^true |
|
1955 |
! |
|
1956 |
||
173 | 1957 |
hideUIView:aView |
282 | 1958 |
"hide the view which is an application or top view |
1959 |
" |
|
173 | 1960 |
aView beIndependent. |
1961 |
aView unmap. |
|
1962 |
! |
|
1963 |
||
287 | 1964 |
raiseTabView |
1965 |
||
1966 |
self isLayoutToolSelected ifTrue:[ |
|
1967 |
layoutCanvas raise |
|
1968 |
] ifFalse:[ |
|
1969 |
self isHelpToolSelected ifTrue:[ |
|
1970 |
helpCanvas raise |
|
1971 |
] ifFalse:[ |
|
1972 |
self specTool selection:tabSelection. |
|
1973 |
specCanvas raise |
|
1974 |
] |
|
1975 |
] |
|
173 | 1976 |
! |
1977 |
||
1978 |
raiseUIView:aView |
|
282 | 1979 |
"raise the view which is an application or top view |
1980 |
" |
|
173 | 1981 |
aView map. |
1982 |
aView bePartner. |
|
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1983 |
! |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1984 |
|
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1985 |
setClass:cls selector:selector |
282 | 1986 |
"set the application class and the selector under which the |
1987 |
window specification should be stored |
|
1988 |
" |
|
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1989 |
|clsName superClassName| |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1990 |
|
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1991 |
clsName := cls name. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1992 |
superClassName := cls superclass name. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1993 |
|
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1994 |
(self aspectFor:#classNameChannel) value:clsName. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1995 |
(self aspectFor:#methodNameChannel) value:(selector ? ''). |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1996 |
(self aspectFor:#superclassNameChannel) value:superClassName. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1997 |
|
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1998 |
self painter |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
1999 |
className:clsName |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2000 |
superclassName:superClassName |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2001 |
selector:(selector ? ''). |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2002 |
|
287 | 2003 |
self specClass:clsName. |
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2004 |
specSelector := (selector ? ''). |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2005 |
specSuperclass := superClassName. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2006 |
|
446 | 2007 |
specClass notNil & selector notNil |
2008 |
ifTrue: |
|
2009 |
[ |
|
2010 |
|className message| |
|
2011 |
specClass isClass ifTrue: [className := specClass name]. |
|
2012 |
specClass isString ifTrue: [className := specClass]. |
|
2013 |
message := className, ' ', specSelector. |
|
2014 |
self addToHistory: message -> #loadFromMessage:. |
|
448 | 2015 |
self valueOfInfoLabel value: className, ' >> ', specSelector |
446 | 2016 |
]. |
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2017 |
"Modified: 24.6.1997 / 19:07:01 / cg" |
282 | 2018 |
! |
2019 |
||
2020 |
setViewInLayoutTool:aView |
|
2021 |
"set view for layout tool |
|
2022 |
" |
|
287 | 2023 |
|type| |
2024 |
||
2025 |
self painter topView == aView ifTrue:[ |
|
2026 |
type := #Extent |
|
2027 |
]. |
|
2028 |
self layoutTool layoutView:aView type:type |
|
2029 |
||
2030 |
! |
|
2031 |
||
2032 |
specClass:aClass |
|
2033 |
specClass := aClass. |
|
2034 |
self helpTool helpSpecFrom:specClass. |
|
2035 |
! ! |
|
2036 |
||
2037 |
!UIPainter methodsFor:'private tools'! |
|
2038 |
||
2039 |
helpTool |
|
2040 |
"returns the help tool |
|
2041 |
" |
|
2042 |
helpCanvas isNil ifTrue:[ |
|
2043 |
self noteBookView |
|
282 | 2044 |
]. |
287 | 2045 |
^ helpCanvas application |
2046 |
! |
|
2047 |
||
2048 |
layoutTool |
|
2049 |
"returns the layout tool |
|
2050 |
" |
|
2051 |
layoutCanvas isNil ifTrue:[ |
|
2052 |
self noteBookView |
|
2053 |
]. |
|
2054 |
^ layoutCanvas application |
|
2055 |
! |
|
2056 |
||
2057 |
painter |
|
2058 |
"returns the painter/canvas view |
|
2059 |
" |
|
2060 |
^ treeView canvas |
|
2061 |
! |
|
2062 |
||
2063 |
specTool |
|
2064 |
"returns the spec tool |
|
2065 |
" |
|
2066 |
specCanvas isNil ifTrue:[ |
|
2067 |
self noteBookView |
|
2068 |
]. |
|
2069 |
^ specCanvas application |
|
109 | 2070 |
! ! |
2071 |
||
166 | 2072 |
!UIPainter methodsFor:'queries'! |
2073 |
||
217 | 2074 |
hasSpecClass |
282 | 2075 |
"checks whether an application class is defined |
2076 |
" |
|
328 | 2077 |
^ (self resolveName:specClass) notNil |
217 | 2078 |
! |
2079 |
||
2080 |
hasSpecClassAndSelector |
|
282 | 2081 |
"checks whether an application class and a selector under which |
2082 |
the window specification is stored is defined. |
|
2083 |
" |
|
217 | 2084 |
specSelector size > 1 ifTrue:[ |
2085 |
^ self hasSpecClass |
|
2086 |
]. |
|
2087 |
^ false |
|
2088 |
! |
|
2089 |
||
166 | 2090 |
isHelpToolSelected |
282 | 2091 |
"returns true if current selected tab in the noteBook is assigned |
2092 |
to the 'Help' tool |
|
2093 |
" |
|
287 | 2094 |
^ tabSelection = UIHelpTool label |
2095 |
||
166 | 2096 |
! |
2097 |
||
2098 |
isLayoutToolSelected |
|
282 | 2099 |
"returns true if current selected tab in the noteBook is assigned |
2100 |
to the 'Layout' tool |
|
2101 |
" |
|
287 | 2102 |
^ tabSelection = UILayoutTool label |
217 | 2103 |
! |
2104 |
||
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2105 |
isModified |
282 | 2106 |
"returns true if current specification or layout is modified |
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2107 |
" |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2108 |
^ self modifiedChannel value |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2109 |
! |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2110 |
|
217 | 2111 |
isPainterEnabled |
282 | 2112 |
"returns true if not running in test mode |
2113 |
" |
|
217 | 2114 |
^ self painter enabled |
166 | 2115 |
! ! |
2116 |
||
109 | 2117 |
!UIPainter methodsFor:'selection'! |
2118 |
||
2119 |
tabSelection |
|
282 | 2120 |
"returns name of current selected tab in the notebook. |
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2121 |
" |
109 | 2122 |
^ tabSelection |
2123 |
! |
|
2124 |
||
2125 |
tabSelection:something |
|
282 | 2126 |
"the tab selection of the notebook changed |
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2127 |
" |
351 | 2128 |
|
2129 |
|whatToDo| |
|
2130 |
||
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2131 |
(something isNil or:[tabSelection = something]) ifTrue:[ |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2132 |
^ self |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2133 |
]. |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2134 |
|
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2135 |
self isModified ifTrue:[ |
351 | 2136 |
whatToDo := DialogBox |
446 | 2137 |
confirmWithCancel:'Accept change made in ' , tabSelection printString , ' section?' |
2138 |
labels:#('Cancel' 'Ignore' 'Accept') |
|
351 | 2139 |
default:3. |
2140 |
whatToDo isNil ifTrue:[^self]. |
|
2141 |
whatToDo == true ifTrue:[ |
|
2142 |
self accept |
|
2143 |
] ifFalse:[ |
|
2144 |
self cancel |
|
2145 |
] |
|
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2146 |
]. |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2147 |
|
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2148 |
tabSelection := something. |
287 | 2149 |
self raiseTabView. |
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2150 |
self cancel. |
351 | 2151 |
|
2152 |
"Modified: / 26.10.1997 / 15:54:15 / cg" |
|
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2153 |
! |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2154 |
|
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2155 |
treeSelection |
282 | 2156 |
"called whenever the selection of the treeview changed |
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2157 |
" |
295 | 2158 |
|view list spec slices size property tabComponent| |
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2159 |
|
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2160 |
self isModified ifTrue:[ |
446 | 2161 |
(self confirm:'Accept change made in ' , tabSelection printString , ' section ?') ifTrue:[ |
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2162 |
self accept |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2163 |
] |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2164 |
]. |
282 | 2165 |
self canMoveOrAlignSelection value:(treeView canMoveOrAlignSelection). |
2166 |
self canMoveSelectionIntoContainer value:(treeView canMoveSelectionIntoContainer). |
|
2167 |
self canMoveSelectionOutOfContainer value:(treeView canMoveSelectionOutOfContainer). |
|
2168 |
self hasOneSelectionOtherThanCanvas value:(treeView hasOneSelectionOtherThanCanvas). |
|
2169 |
||
281 | 2170 |
treeView isCanvasSelected ifTrue:[ |
282 | 2171 |
spec := treeView canvasSpec. |
2172 |
view := self painter topView. |
|
2173 |
] ifFalse:[ |
|
2174 |
(property := treeView propertySelected) notNil ifTrue:[ |
|
301 | 2175 |
treeView canResizeSelectedWidget ifTrue:[ |
2176 |
view := property view. |
|
2177 |
]. |
|
282 | 2178 |
spec := property spec copy. |
2179 |
] |
|
281 | 2180 |
]. |
282 | 2181 |
tabComponent := builder componentAt:#noteBook. |
2182 |
self setViewInLayoutTool:view. |
|
287 | 2183 |
self specTool specification:spec. |
282 | 2184 |
|
2185 |
spec notNil ifTrue:[ |
|
287 | 2186 |
self helpTool helpKey:(spec activeHelpKey). |
295 | 2187 |
slices := spec class slices. |
2188 |
size := slices size. |
|
301 | 2189 |
|
2190 |
view notNil ifTrue:[ |
|
2191 |
list := Array new:(size + 2). |
|
2192 |
list at:(size + 2) put:(UILayoutTool label). |
|
2193 |
] ifFalse:[ |
|
2194 |
list := Array new:(size + 1). |
|
2195 |
]. |
|
295 | 2196 |
1 to:size do:[:i| list at:i put:((slices at:i) first asString)]. |
2197 |
list at:(size + 1) put:(UIHelpTool label). |
|
301 | 2198 |
|
282 | 2199 |
self tabList value:list. |
297 | 2200 |
self show:(spec class name). |
282 | 2201 |
tabComponent enabled:true. |
2202 |
||
2203 |
(tabSelection := tabComponent selection) isNil ifTrue:[ |
|
2204 |
tabComponent setSelection:(tabSelection := list first) |
|
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2205 |
]. |
287 | 2206 |
self raiseTabView |
282 | 2207 |
] ifFalse:[ |
287 | 2208 |
self helpTool helpKey:nil. |
282 | 2209 |
tabComponent enabled:false. |
297 | 2210 |
self show:nil. |
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2211 |
]. |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2212 |
self modifiedChannel value:false. |
60 | 2213 |
! ! |
2214 |
||
109 | 2215 |
!UIPainter methodsFor:'startup / release'! |
2216 |
||
2217 |
closeRequest |
|
2218 |
"close all windows open by builder |
|
2219 |
" |
|
446 | 2220 |
self checkModified ifFalse:[^self]. |
133 | 2221 |
|
222 | 2222 |
treeView model removeDependent:self. |
2223 |
self painter release. |
|
366 | 2224 |
ColorMenu releaseResources. |
60 | 2225 |
|
109 | 2226 |
selectionPanel notNil ifTrue:[ |
183 | 2227 |
selectionPanel masterApplication:nil. |
109 | 2228 |
selectionPanel closeRequest |
2229 |
]. |
|
149 | 2230 |
selectionPanel := nil. |
222 | 2231 |
treeView := nil. |
149 | 2232 |
|
351 | 2233 |
ActiveHelp stopFor:self. |
2234 |
||
109 | 2235 |
super closeRequest. |
2236 |
||
351 | 2237 |
"Modified: / 27.10.1997 / 00:01:30 / cg" |
109 | 2238 |
! |
2239 |
||
2240 |
closeRequestFor:aTopView |
|
2241 |
"handle a close request for a specific view |
|
2242 |
" |
|
173 | 2243 |
|topView| |
60 | 2244 |
|
109 | 2245 |
topView := self window. |
60 | 2246 |
|
109 | 2247 |
topView == aTopView ifTrue:[ |
2248 |
super closeRequestFor:aTopView |
|
2249 |
] ifFalse:[ |
|
173 | 2250 |
aTopView = selectionPanel window ifTrue:[ |
2251 |
self galleryShown value:false |
|
2252 |
] ifFalse:[ |
|
513 | 2253 |
aTopView == (self painter topView) ifTrue:[ |
2254 |
self painterShown value:false |
|
2255 |
] ifFalse:[ |
|
2256 |
aTopView closeRequest |
|
2257 |
] |
|
173 | 2258 |
]. |
133 | 2259 |
topView raise. |
109 | 2260 |
]. |
60 | 2261 |
! |
2262 |
||
345 | 2263 |
openInterface:aSymbol |
109 | 2264 |
"open interfaces |
2265 |
" |
|
345 | 2266 |
|painterView painter cls topView| |
60 | 2267 |
|
2268 |
aspects := IdentityDictionary new. |
|
2269 |
||
2270 |
aspects at:#classNameChannel put:( |
|
2271 |
(specClass notNil ifTrue:[specClass] |
|
2272 |
ifFalse:['NewApplication']) asValue |
|
2273 |
). |
|
2274 |
specSuperclass isNil ifTrue:[ |
|
2275 |
specClass notNil ifTrue:[ |
|
328 | 2276 |
(cls := self resolveName:specClass) notNil ifTrue:[ |
60 | 2277 |
specSuperclass := cls superclass name. |
2278 |
] |
|
2279 |
] |
|
2280 |
]. |
|
2281 |
aspects at:#superclassNameChannel put:( |
|
2282 |
(specSuperclass notNil ifTrue:[specSuperclass] |
|
2283 |
ifFalse:['ApplicationModel']) asValue |
|
2284 |
). |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
2285 |
aspects at:#superclassNameDefaults put:#('ApplicationModel' 'SimpleDialog') asValue. |
60 | 2286 |
aspects at:#methodNameChannel put:( |
161 | 2287 |
(specSelector notNil ifTrue:[specSelector asValue] |
60 | 2288 |
ifFalse:[#windowSpec]) asValue |
2289 |
). |
|
136 | 2290 |
|
222 | 2291 |
treeView := TreeView new. |
136 | 2292 |
painterView := StandardSystemView new. |
2293 |
painterView label:'unnamed canvas'. |
|
2294 |
painterView extent:300@300. |
|
2295 |
||
2296 |
painter := UIPainterView in:painterView. |
|
109 | 2297 |
painter layout:(0.0 @ 0.0 corner:1.0 @ 1.0) asLayout. |
136 | 2298 |
|
222 | 2299 |
treeView := treeView canvas:painter. |
2300 |
painter treeView:treeView. |
|
2301 |
treeView model addDependent:self. |
|
136 | 2302 |
|
345 | 2303 |
super openInterface:aSymbol. |
2304 |
||
297 | 2305 |
transcript := (self builder componentAt:#Transcript) scrolledView. |
136 | 2306 |
topView := self window. |
2307 |
topView bePartner. |
|
345 | 2308 |
topView label:'GUI Painter'. |
136 | 2309 |
|
2310 |
painterView openInGroup:(topView windowGroup). |
|
2311 |
painterView bePartner. |
|
2312 |
painterView application:self. |
|
2313 |
painterView open. |
|
2314 |
||
2315 |
painterView application:self. |
|
183 | 2316 |
selectionPanel := UISelectionPanel new. |
136 | 2317 |
selectionPanel allButOpenInterface:#windowSpec. |
345 | 2318 |
selectionPanel window openInGroup:(topView windowGroup). |
2319 |
selectionPanel window bePartner. |
|
136 | 2320 |
selectionPanel openWindow. |
183 | 2321 |
selectionPanel masterApplication:self. |
274 | 2322 |
|
345 | 2323 |
topView iconLabel:'GUI Painter'. |
2324 |
topView icon:(Image fromFile:'bitmaps/UIPainter.xbm' resolution:100). |
|
2325 |
||
2326 |
painterView iconLabel:'GUI Painter'. |
|
2327 |
painterView icon:(Image fromFile:'bitmaps/UIPainter.xbm' resolution:100). |
|
2328 |
||
2329 |
selectionPanel window iconLabel:'GUI Painter'. |
|
2330 |
selectionPanel window icon:(Image fromFile:'bitmaps/UIPainter.xbm' resolution:100). |
|
2331 |
||
351 | 2332 |
ActiveHelp startFor:self. |
2333 |
||
2334 |
"Modified: / 27.10.1997 / 00:01:12 / cg" |
|
60 | 2335 |
! |
2336 |
||
2337 |
openNewWindowCanvas |
|
109 | 2338 |
"open new |
2339 |
" |
|
60 | 2340 |
self open. |
2341 |
||
2342 |
||
2343 |
! |
|
2344 |
||
109 | 2345 |
openOnClass:aClass |
2346 |
"open up an interface builder |
|
2347 |
" |
|
2348 |
self openOnClass:aClass andSelector:#windowSpec |
|
2349 |
! |
|
2350 |
||
60 | 2351 |
openOnClass:aClass andSelector:aSelector |
2352 |
"open up an interface builder, fetching a spec from someClass |
|
109 | 2353 |
via some selector |
2354 |
" |
|
2355 |
|painter| |
|
60 | 2356 |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
2357 |
aClass isNil ifTrue:[ |
351 | 2358 |
(self confirm:'nil class given to UIPainter (class was probably renamed ?)\\Open anyway (to create a new interface) ?' withCRs) |
2359 |
ifFalse:[^ nil]. |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
2360 |
]. |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
2361 |
|
109 | 2362 |
self openInterface. |
60 | 2363 |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
2364 |
aClass notNil ifTrue:[ |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
2365 |
painter := self painter. |
60 | 2366 |
|
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2367 |
self setClass:aClass selector:aSelector. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2368 |
"/ specClass := aClass name. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2369 |
"/ specSuperclass := aClass superclass name. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2370 |
"/ specSelector := aSelector. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2371 |
"/ |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2372 |
"/ (aspects at:#classNameChannel) value:specClass. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2373 |
"/ (aspects at:#superclassNameChannel) value:specSuperclass. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2374 |
"/ (aspects at:#methodNameChannel) value:specSelector asSymbol. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2375 |
"/ |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2376 |
"/ painter |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2377 |
"/ className:aClass name |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2378 |
"/ superclassName:aClass superclass name |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2379 |
"/ selector:aSelector. |
60 | 2380 |
|
195
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
2381 |
(aClass respondsTo:aSelector) ifTrue:[ |
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
2382 |
painter setupFromSpec:(aClass perform:aSelector). |
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
2383 |
] |
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
2384 |
] |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
2385 |
|
351 | 2386 |
"Modified: / 25.10.1997 / 19:11:51 / cg" |
60 | 2387 |
! ! |
2388 |
||
446 | 2389 |
!UIPainter methodsFor:'user interactions'! |
2390 |
||
2391 |
doBrowseAppClass |
|
2392 |
"open a browser on the class" |
|
2393 |
||
2394 |
|cls| |
|
2395 |
||
2396 |
self painter isModified ifTrue:[ |
|
2397 |
self warn:'The current interface has not yet been saved.\\The browser will show the code of the old interface.' withCRs. |
|
2398 |
]. |
|
2399 |
cls := self resolveName:specClass. |
|
2400 |
||
2401 |
cls notNil ifTrue:[ |
|
2402 |
SystemBrowser openInClass:cls |
|
2403 |
] ifFalse:[ |
|
2404 |
self information:'No class defined!!'. |
|
2405 |
]. |
|
2406 |
||
2407 |
! |
|
2408 |
||
2409 |
doBrowseAspectMethods |
|
2410 |
"open a browser on the aspect methods" |
|
2411 |
||
2412 |
|cls methods| |
|
2413 |
||
2414 |
self painter isModified ifTrue:[ |
|
2415 |
self warn:'The current interface has not yet been saved.\\The browser may show the code of the old aspect methods.' withCRs. |
|
2416 |
]. |
|
2417 |
cls := self resolveName:specClass. |
|
2418 |
||
2419 |
cls notNil ifTrue:[ |
|
2420 |
methods := self painter aspectMethods. |
|
2421 |
methods isEmpty ifTrue:[ |
|
2422 |
self warn:'No aspect methods have been saved yet!!'. |
|
2423 |
^ self. |
|
2424 |
]. |
|
2425 |
SystemBrowser browseMethods:methods title:'Aspect methods'. |
|
2426 |
] ifFalse:[ |
|
2427 |
self information:'No class defined!!'. |
|
2428 |
]. |
|
2429 |
||
2430 |
"Created: / 25.10.1997 / 19:07:55 / cg" |
|
2431 |
! |
|
2432 |
||
2433 |
doFromClass |
|
2434 |
||
533 | 2435 |
self loadFromMessage: |
2436 |
(ResourceSelectionBrowser |
|
2437 |
request: 'Load Interface From Class' |
|
2438 |
onSuperclass: nil |
|
2439 |
andClass: specClass |
|
2440 |
andSelector: specSelector |
|
2441 |
withResourceTypes: #(canvas)) |
|
446 | 2442 |
! |
2443 |
||
2444 |
doInstallAspects |
|
2445 |
"install aspects and actions |
|
2446 |
" |
|
2447 |
|code| |
|
2448 |
||
2449 |
self hasSpecClassAndSelector ifFalse:[ |
|
2450 |
self defineClassAndSelector |
|
2451 |
]. |
|
2452 |
||
2453 |
self checkClassAndSelector ifFalse:[ |
|
2454 |
^ self |
|
2455 |
]. |
|
2456 |
||
2457 |
self painter className:specClass |
|
2458 |
superclassName:specSuperclass |
|
2459 |
selector:specSelector. |
|
2460 |
||
2461 |
code := self painter generateAspectMethods. |
|
2462 |
(ReadStream on:code) fileIn. |
|
2463 |
||
2464 |
! |
|
2465 |
||
2466 |
doInstallHooks |
|
2467 |
"install application hooks |
|
2468 |
" |
|
2469 |
|code| |
|
2470 |
||
2471 |
self hasSpecClassAndSelector ifFalse:[ |
|
2472 |
self defineClassAndSelector |
|
2473 |
]. |
|
2474 |
||
2475 |
self checkClassAndSelector ifFalse:[ |
|
2476 |
^ self |
|
2477 |
]. |
|
2478 |
||
2479 |
self painter className:specClass |
|
2480 |
superclassName:specSuperclass |
|
2481 |
selector:specSelector. |
|
2482 |
||
2483 |
code := self painter generateHookMethods. |
|
2484 |
(ReadStream on:code) fileIn. |
|
2485 |
||
2486 |
"Created: / 31.10.1997 / 17:37:54 / cg" |
|
2487 |
! |
|
2488 |
||
2489 |
doInstallSpec |
|
2490 |
"install window specification |
|
2491 |
" |
|
2492 |
|code painter| |
|
2493 |
||
2494 |
self hasSpecClassAndSelector ifFalse:[ |
|
2495 |
self defineClassAndSelector |
|
2496 |
]. |
|
2497 |
||
2498 |
self checkClassAndSelector ifFalse:[ |
|
2499 |
^ self |
|
2500 |
]. |
|
2501 |
||
2502 |
self isModified ifTrue:[ |
|
2503 |
(self confirm:'Accept change made in ' , tabSelection printString , ' section?') ifTrue:[ |
|
2504 |
self accept |
|
2505 |
] ifFalse:[ |
|
2506 |
(self confirm:'Load old interface?') ifFalse:[ |
|
2507 |
^ self |
|
2508 |
] |
|
2509 |
] |
|
2510 |
]. |
|
2511 |
||
2512 |
painter := self painter. |
|
2513 |
||
2514 |
painter className:specClass |
|
2515 |
superclassName:specSuperclass |
|
2516 |
selector:specSelector. |
|
2517 |
||
2518 |
code := painter generateWindowSpecMethodSource withCRs. |
|
2519 |
painter resetModification. |
|
2520 |
(ReadStream on:code) fileIn. |
|
2521 |
||
466 | 2522 |
self helpTool installHelpSpecInto:specClass |
446 | 2523 |
! |
2524 |
||
2525 |
doNew |
|
2526 |
"remove all components and associated resources |
|
2527 |
" |
|
2528 |
self painter isModified ifTrue:[ |
|
2529 |
(self confirm:'Edit a new interface without saving current?') ifFalse:[ |
|
2530 |
^ self |
|
2531 |
] |
|
2532 |
]. |
|
2533 |
self painter removeAll |
|
2534 |
! |
|
2535 |
||
2536 |
doPickAView |
|
2537 |
"pick a view and setup specifications |
|
2538 |
" |
|
2539 |
|painter view cls spec app| |
|
2540 |
||
2541 |
self painter isModified ifTrue:[ |
|
2542 |
(self confirm:'pick another interface without saving your modifications ?') ifFalse:[ |
|
2543 |
^ self |
|
2544 |
] |
|
2545 |
]. |
|
2546 |
||
2547 |
(view := Screen current viewFromUser) notNil ifTrue:[ |
|
2548 |
view == Screen current rootView ifFalse:[ |
|
2549 |
painter := self painter. |
|
2550 |
spec := UISpecification fromView:view topView. |
|
2551 |
||
2552 |
"/ ok, got it |
|
2553 |
||
2554 |
(app := view application) notNil ifTrue:[ |
|
2555 |
cls := app class |
|
2556 |
] ifFalse:[ |
|
2557 |
cls := view class |
|
2558 |
]. |
|
2559 |
self setClass:cls selector:nil. |
|
2560 |
||
2561 |
painter setupFromSpec:spec. |
|
2562 |
] |
|
2563 |
] |
|
2564 |
||
2565 |
"Modified: / 1.11.1997 / 13:47:49 / cg" |
|
2566 |
! |
|
2567 |
||
2568 |
doStartApplication |
|
2569 |
"start current edited application |
|
2570 |
" |
|
2571 |
|cls app infoMessage| |
|
2572 |
||
2573 |
self isModified ifTrue:[ |
|
2574 |
(self confirm:'Accept change made in ' , tabSelection printString , ' section?') ifTrue:[ |
|
2575 |
self accept. |
|
2576 |
"/ "XXX must be fixed - canvas changes are not recorded in the history |
|
2577 |
"/ so isModified returns false here |
|
2578 |
"/ |
|
2579 |
"/ self painter isModified ifTrue:[ |
|
2580 |
"/ |
|
2581 |
(self confirm:'Reinstall the new interface?' withCRs) ifTrue:[ |
|
2582 |
self doInstallSpec |
|
2583 |
] |
|
2584 |
"/ ]. |
|
2585 |
] |
|
2586 |
]. |
|
2587 |
self painter isModified ifTrue:[ |
|
2588 |
(self confirm:'The current interface has not yet been reinstalled!!\\Start anyway (based upon the previous interface)?' withCRs) ifFalse:[ |
|
2589 |
^ self |
|
2590 |
] |
|
2591 |
]. |
|
2592 |
||
2593 |
(specClass isNil or:[specSelector size < 2]) ifTrue:[ |
|
466 | 2594 |
infoMessage := 'No class and selector defined!!'. |
446 | 2595 |
] ifFalse:[ |
2596 |
cls := self resolveName:specClass. |
|
2597 |
||
2598 |
cls isNil ifTrue:[ |
|
466 | 2599 |
infoMessage := 'Class does not exist!!'. |
446 | 2600 |
] ifFalse:[ |
2601 |
(cls respondsTo:specSelector) ifFalse:[ |
|
2602 |
infoMessage := ('No method for: #' |
|
2603 |
, specSelector , ' in ' , cls name |
|
2604 |
, '\\(did you install the interface?)') withCRs. |
|
2605 |
] |
|
2606 |
] |
|
2607 |
]. |
|
2608 |
||
2609 |
infoMessage notNil ifTrue:[ |
|
2610 |
^ self information:infoMessage |
|
2611 |
]. |
|
2612 |
app := cls new. |
|
2613 |
(app respondsTo:#openInterface:) ifFalse:[ |
|
2614 |
^ self warn:('The application does not respond to the ''openInterface:'' message.\\(maybe its supposed to be used as subApplication/subCanvas)') withCRs. |
|
2615 |
]. |
|
2616 |
app openInterface:specSelector |
|
2617 |
||
2618 |
"Modified: / 29.10.1997 / 19:01:50 / cg" |
|
2619 |
! |
|
2620 |
||
2621 |
doWindowSpec |
|
2622 |
"create the window specification but do not write to application; instead |
|
2623 |
open a view |
|
2624 |
" |
|
2625 |
|code v| |
|
2626 |
||
2627 |
code := self painter generateWindowSpecMethodSource. |
|
2628 |
||
2629 |
v := CodeView open. |
|
2630 |
v contents:code. |
|
2631 |
v label:'windowSpec'. |
|
2632 |
||
2633 |
! |
|
2634 |
||
2635 |
loadFromMessage: aMessage |
|
2636 |
||
2637 |
((aMessage size > 0) and: [self checkModified]) |
|
2638 |
ifTrue: |
|
2639 |
[ |
|
2640 |
|readStream aClass aSelector| |
|
2641 |
readStream := aMessage readStream. |
|
2642 |
(aClass := Smalltalk at: (readStream upTo: $ ) asSymbol) notNil |
|
2643 |
ifTrue: |
|
2644 |
[ |
|
2645 |
aSelector := readStream upToEnd asSymbol. |
|
2646 |
self setClass: aClass selector: aSelector. |
|
2647 |
(aClass respondsTo:aSelector) |
|
2648 |
ifTrue: |
|
2649 |
[ |
|
2650 |
self painter setupFromSpec:(aClass perform:aSelector). |
|
2651 |
] |
|
2652 |
] |
|
2653 |
] |
|
2654 |
||
533 | 2655 |
! |
2656 |
||
2657 |
loadSubspec |
|
2658 |
||
2659 |
|subSpecMessage| |
|
2660 |
(subSpecMessage := ResourceSelectionBrowser |
|
2661 |
request: 'Load Subspec From Class' |
|
2662 |
onSuperclass: nil |
|
2663 |
andClass: specClass |
|
2664 |
andSelector: specSelector |
|
2665 |
withResourceTypes: #(canvas)) notNil |
|
2666 |
ifTrue: |
|
2667 |
[ |
|
2668 |
|readStream aClass aSelector| |
|
2669 |
readStream := subSpecMessage readStream. |
|
2670 |
(aClass := Smalltalk at: (readStream upTo: $ ) asSymbol) notNil |
|
2671 |
ifTrue: |
|
2672 |
[ |
|
2673 |
aSelector := readStream upToEnd asSymbol. |
|
2674 |
(aClass name == specClass and: [aSelector == specSelector]) ifTrue: [^self warn: 'Current interface as subspec not allowed!!']. |
|
2675 |
(aClass respondsTo:aSelector) |
|
2676 |
ifTrue: |
|
2677 |
[ |
|
2678 |
self addWidgetOfSpec: (Array with: (UISubSpecification new majorKey: aClass name; minorKey: aSelector)) |
|
2679 |
] |
|
2680 |
] |
|
2681 |
] |
|
446 | 2682 |
! ! |
2683 |
||
2684 |
!UIPainter methodsFor:'user interactions - dialog'! |
|
60 | 2685 |
|
2686 |
checkClassAndSelector |
|
2687 |
"check for class & superclass" |
|
2688 |
||
2689 |
|superclass cls| |
|
2690 |
||
2691 |
specClass isNil ifTrue:[^ false]. |
|
2692 |
||
328 | 2693 |
cls := self resolveName:specClass. |
2694 |
||
60 | 2695 |
cls isNil ifTrue:[ |
328 | 2696 |
superclass := self resolveName:specSuperclass. |
2697 |
||
2698 |
superclass isNil ifTrue:[ |
|
446 | 2699 |
self warn:'No class named ' , specSuperclass , ' exists!!'. |
60 | 2700 |
^ false. |
2701 |
]. |
|
446 | 2702 |
(self confirm:'Create ' , specClass , '?') ifTrue:[ |
60 | 2703 |
superclass subclass:(specClass asSymbol) |
2704 |
instanceVariableNames:'' |
|
2705 |
classVariableNames:'' |
|
2706 |
poolDictionaries:'' |
|
280 | 2707 |
category:'Applications'. |
60 | 2708 |
^ true. |
2709 |
]. |
|
2710 |
^ false. |
|
2711 |
]. |
|
2712 |
cls isBehavior ifFalse:[ |
|
446 | 2713 |
self warn:'A global named ' , specClass , ' exists, but is no class.'. |
60 | 2714 |
^ false. |
2715 |
]. |
|
2716 |
||
2717 |
specSuperclass isBehavior ifFalse:[ |
|
179 | 2718 |
specSuperclass isEmpty ifFalse:[ |
328 | 2719 |
superclass := self resolveName:specSuperclass |
179 | 2720 |
] ifTrue:[ |
2721 |
specSuperclass := nil. |
|
2722 |
] |
|
60 | 2723 |
] ifTrue:[ |
2724 |
superclass := specSuperclass |
|
2725 |
]. |
|
179 | 2726 |
|
60 | 2727 |
specSuperclass notNil ifTrue:[ |
2728 |
superclass isNil ifTrue:[ |
|
446 | 2729 |
self warn:'No class named ' , specSuperclass , ' exists!!'. |
60 | 2730 |
^ false. |
2731 |
]. |
|
2732 |
||
2733 |
(cls isSubclassOf:superclass) ifFalse:[ |
|
446 | 2734 |
self information:('A global named ' , specClass , ' exists,\' , |
206 | 2735 |
'but is not a subclass of ' , superclass name , '.\\' , |
2736 |
'Check and try again if that is not what you want.') withCRs. |
|
60 | 2737 |
] |
2738 |
]. |
|
179 | 2739 |
|
2740 |
superclass isNil ifTrue:[ |
|
2741 |
cls notNil ifTrue:[ |
|
2742 |
specSuperclass := cls superclass name |
|
2743 |
] |
|
2744 |
]. |
|
2745 |
||
60 | 2746 |
^ true |
109 | 2747 |
|
280 | 2748 |
"Modified: 12.8.1997 / 23:39:10 / cg" |
60 | 2749 |
! |
2750 |
||
2751 |
defineClassAndSelector |
|
2752 |
"launch a dialog to define class, superclass and method" |
|
2753 |
||
176 | 2754 |
|again tmp| |
60 | 2755 |
|
2756 |
[ |
|
2757 |
again := false. |
|
160 | 2758 |
|
176 | 2759 |
(tmp := specClass) isNil ifTrue:[tmp := 'NewApplication']. |
2760 |
aspects at:#classNameChannel put:tmp asValue. |
|
2761 |
||
2762 |
(tmp := specSelector) isNil ifTrue:[tmp := 'windowSpec']. |
|
2763 |
aspects at:#methodNameChannel put:tmp asValue. |
|
2764 |
||
2765 |
(tmp := specSuperclass) isNil ifTrue:[tmp := 'ApplicationModel']. |
|
2766 |
aspects at:#superclassNameChannel put:tmp asValue. |
|
160 | 2767 |
|
60 | 2768 |
(self openDialogInterface:#nameAndSelectorSpec) ifTrue:[ |
2769 |
||
287 | 2770 |
specClass := (self aspectFor:#classNameChannel) value. |
60 | 2771 |
specSelector := (self aspectFor:#methodNameChannel) value. |
161 | 2772 |
specSelector notNil ifTrue:[specSelector := specSelector asSymbol]. |
60 | 2773 |
specSuperclass := (self aspectFor:#superclassNameChannel) value. |
2774 |
||
109 | 2775 |
(again := self checkClassAndSelector not) ifFalse:[ |
2776 |
self painter className:specClass |
|
2777 |
superclassName:specSuperclass |
|
2778 |
selector:specSelector. |
|
2779 |
] |
|
60 | 2780 |
] |
109 | 2781 |
|
287 | 2782 |
] doWhile:[again]. |
2783 |
||
2784 |
self specClass:specClass. |
|
366 | 2785 |
! |
2786 |
||
2787 |
gridMenu |
|
2788 |
"open a dialog for grip parameters configuration |
|
2789 |
" |
|
2790 |
|hspace vspace bindings painter gridPara| |
|
2791 |
||
2792 |
painter := self painter. |
|
2793 |
bindings := IdentityDictionary new. |
|
2794 |
gridPara := painter gridParameters copy. |
|
2795 |
||
2796 |
bindings at:#showGrid put:(painter gridShown asValue). |
|
2797 |
bindings at:#alignToGrid put:(painter gridAlign asValue). |
|
2798 |
bindings at:#hspace put:((gridPara at:1) asValue). |
|
2799 |
bindings at:#vspace put:((gridPara at:2) asValue). |
|
2800 |
||
2801 |
(self openDialogInterface:#gridParametersSpec withBindings:bindings) ifFalse:[ |
|
2802 |
^ self |
|
2803 |
]. |
|
2804 |
||
2805 |
hspace := (bindings at:#hspace) value ? 5. |
|
2806 |
vspace := (bindings at:#vspace) value ? 5. |
|
2807 |
||
2808 |
gridPara at:1 put:hspace. |
|
2809 |
gridPara at:2 put:vspace. |
|
2810 |
gridPara at:5 put:hspace. |
|
2811 |
gridPara at:6 put:vspace. |
|
2812 |
||
2813 |
painter gridShown:false. |
|
2814 |
painter gridAlign:false. |
|
2815 |
painter gridParameters:gridPara. |
|
2816 |
painter gridAlign:(bindings at:#alignToGrid) value. |
|
2817 |
painter gridShown:(bindings at:#showGrid) value. |
|
2818 |
||
2819 |
||
60 | 2820 |
! ! |
2821 |
||
446 | 2822 |
!UIPainter methodsFor:'user interactions - move'! |
222 | 2823 |
|
2824 |
doStepDown |
|
282 | 2825 |
"move selected component after the next component in the hierarchy of |
2826 |
its container widget |
|
2827 |
" |
|
222 | 2828 |
treeView doStepOver:1 |
2829 |
! |
|
2830 |
||
2831 |
doStepIn |
|
282 | 2832 |
"change the container of the selected widget |
2833 |
" |
|
222 | 2834 |
treeView doStepIn |
2835 |
! |
|
2836 |
||
2837 |
doStepOut |
|
282 | 2838 |
"change the container of the selected widget |
2839 |
" |
|
222 | 2840 |
treeView doStepOut |
2841 |
! |
|
2842 |
||
2843 |
doStepUp |
|
282 | 2844 |
"move selected component before the previous component in the hierarchy of |
2845 |
its container widget |
|
2846 |
" |
|
222 | 2847 |
treeView doStepOver:-1 |
2848 |
! ! |
|
2849 |
||
2850 |
!UIPainter::TreeView class methodsFor:'constants'! |
|
2851 |
||
282 | 2852 |
defaultNameOfCanvas |
2853 |
"returns the default name (id) of the application |
|
2854 |
" |
|
2855 |
^ 'Canvas' |
|
222 | 2856 |
! ! |
2857 |
||
2858 |
!UIPainter::TreeView class methodsFor:'documentation'! |
|
2859 |
||
2860 |
documentation |
|
2861 |
" |
|
2862 |
selection in tree view; only used by the UIPainter |
|
2863 |
||
2864 |
[see also:] |
|
2865 |
SelectionInTreeView |
|
2866 |
SelectionInTree |
|
2867 |
TreeItem |
|
2868 |
UIPainter |
|
2869 |
||
2870 |
[author:] |
|
2871 |
Claus Atzkern |
|
2872 |
" |
|
2873 |
||
2874 |
||
2875 |
! ! |
|
2876 |
||
491
c3af7854dbe8
image instance variables removed + release all widget icons while snap shoting
tz
parents:
490
diff
changeset
|
2877 |
!UIPainter::TreeView class methodsFor:'startup / release'! |
c3af7854dbe8
image instance variables removed + release all widget icons while snap shoting
tz
parents:
490
diff
changeset
|
2878 |
|
c3af7854dbe8
image instance variables removed + release all widget icons while snap shoting
tz
parents:
490
diff
changeset
|
2879 |
preSnapshot |
c3af7854dbe8
image instance variables removed + release all widget icons while snap shoting
tz
parents:
490
diff
changeset
|
2880 |
|
496 | 2881 |
Images notNil ifTrue: [Images removeAll] |
491
c3af7854dbe8
image instance variables removed + release all widget icons while snap shoting
tz
parents:
490
diff
changeset
|
2882 |
! ! |
c3af7854dbe8
image instance variables removed + release all widget icons while snap shoting
tz
parents:
490
diff
changeset
|
2883 |
|
222 | 2884 |
!UIPainter::TreeView methodsFor:'accessing'! |
2885 |
||
2886 |
canvas |
|
2887 |
"returns the canvas( UIPainter ) |
|
2888 |
" |
|
2889 |
^ model root contents view |
|
2890 |
||
2891 |
||
2892 |
! |
|
2893 |
||
2894 |
canvas:aCanvas |
|
2895 |
"install canvas( UIPainter ) |
|
2896 |
" |
|
2897 |
|props| |
|
2898 |
||
2899 |
props := UIPainterView::ViewProperty new. |
|
2900 |
props view:aCanvas. |
|
282 | 2901 |
model root:(TreeItem name:(self class defaultNameOfCanvas) contents:props). |
222 | 2902 |
model root expand. |
2903 |
self enableChannel:(aCanvas enableChannel). |
|
2904 |
||
281 | 2905 |
! |
2906 |
||
2907 |
canvasSpec |
|
2908 |
"returns spec assigned to canvas |
|
2909 |
" |
|
2910 |
|spec| |
|
2911 |
||
2912 |
spec := WindowSpec new. |
|
311 | 2913 |
|
281 | 2914 |
spec fromView:(self canvas topView) callBack:nil. |
2915 |
spec name:(listOfNodes at:1) name. |
|
311 | 2916 |
|
2917 |
windowSpec notNil ifTrue:[ |
|
362 | 2918 |
spec copyValuesFromSpec:windowSpec |
311 | 2919 |
]. |
362 | 2920 |
^ spec |
2921 |
||
2922 |
"Modified: / 29.10.1997 / 18:06:44 / cg" |
|
282 | 2923 |
! |
2924 |
||
311 | 2925 |
canvasSpec:aSpec |
2926 |
"update canvas from spec |
|
2927 |
" |
|
2928 |
|spec| |
|
2929 |
||
2930 |
self setAttributesFromWindowSpec:aSpec. |
|
2931 |
spec := aSpec copy. |
|
2932 |
spec menu:nil. |
|
2933 |
spec flags:nil. |
|
2934 |
||
394 | 2935 |
spec setAttributesIn:(self canvas topView) with:(UIBuilder new isEditing:true). |
311 | 2936 |
! |
2937 |
||
282 | 2938 |
itemOfView:aView |
2939 |
"returns item assigned to view or nil |
|
2940 |
" |
|
2941 |
aView notNil ifTrue:[ |
|
2942 |
self allItemsDo:[:anItem| |
|
2943 |
(anItem contents view == aView) ifTrue:[^ anItem] |
|
2944 |
] |
|
2945 |
]. |
|
2946 |
^ nil |
|
2947 |
||
2948 |
||
222 | 2949 |
! ! |
2950 |
||
2951 |
!UIPainter::TreeView methodsFor:'accessing property'! |
|
2952 |
||
2953 |
propertiesDo:aOneArgBlock |
|
2954 |
"evaluate the argument a block on each property |
|
2955 |
" |
|
2956 |
self allItemsDo:[:anItem| aOneArgBlock value:(anItem contents)] |
|
2957 |
||
2958 |
||
2959 |
! |
|
2960 |
||
2961 |
propertyDetect:aOneArgBlock |
|
2962 |
"evaluate the block on each property |
|
2963 |
" |
|
2964 |
self allItemsDo:[:anItem| |
|
2965 |
(aOneArgBlock value:(anItem contents)) ifTrue:[^ anItem contents] |
|
2966 |
]. |
|
2967 |
^ nil |
|
2968 |
||
2969 |
! |
|
2970 |
||
2971 |
propertySelected |
|
2972 |
"returns current selected property or nil in case of multi selection |
|
2973 |
or empty selection |
|
2974 |
" |
|
2975 |
|idx| |
|
2976 |
||
2977 |
selection size == 1 ifTrue:[ |
|
2978 |
(idx := selection first) ~~ 1 ifTrue:[ "canvas: not yet supported" |
|
2979 |
^ (listOfNodes at:idx) contents |
|
2980 |
] |
|
2981 |
]. |
|
2982 |
^ nil |
|
2983 |
||
2984 |
! ! |
|
2985 |
||
2986 |
!UIPainter::TreeView methodsFor:'adding & removing'! |
|
2987 |
||
2988 |
addProperty:aProperty |
|
2989 |
"add a new item |
|
2990 |
" |
|
533 | 2991 |
|parent| |
295 | 2992 |
|
2993 |
parent := self detectItemRespondsToView:(aProperty view superView). |
|
2994 |
||
2995 |
parent notNil ifTrue:[ |
|
2996 |
model add:(TreeItem name:(aProperty name) contents:aProperty) below:parent |
|
2997 |
] |
|
222 | 2998 |
|
2999 |
! |
|
3000 |
||
3001 |
removeAll |
|
3002 |
"remove all items other than canvas |
|
3003 |
" |
|
3004 |
lastDrawnMaster := nil. |
|
311 | 3005 |
windowSpec := nil. |
222 | 3006 |
|
3007 |
self canvas subViews copy do:[:aView| |
|
3008 |
(aView isKindOf:InputView) ifFalse:[aView destroy] |
|
3009 |
]. |
|
282 | 3010 |
model root name:(self class defaultNameOfCanvas). |
222 | 3011 |
model root children:(OrderedCollection new). |
3012 |
model recomputeList. |
|
3013 |
self selection:nil. |
|
3014 |
||
3015 |
||
3016 |
! |
|
3017 |
||
3018 |
removeView:aView |
|
3019 |
"remove a view |
|
3020 |
" |
|
282 | 3021 |
|item prnt| |
3022 |
||
3023 |
((item := self itemOfView:aView) notNil and:[(prnt := item parent) notNil]) ifTrue:[ |
|
222 | 3024 |
aView destroy. |
282 | 3025 |
prnt contents view sizeChanged:nil. |
222 | 3026 |
model remove:item |
3027 |
] |
|
3028 |
||
3029 |
||
3030 |
! ! |
|
3031 |
||
311 | 3032 |
!UIPainter::TreeView methodsFor:'building'! |
3033 |
||
3034 |
generateFullSpecForComponents:aSpecArray |
|
351 | 3035 |
"generates a full spec for components |
311 | 3036 |
" |
351 | 3037 |
|fullSpec winSpec| |
311 | 3038 |
|
3039 |
fullSpec := FullSpec new. |
|
3040 |
||
3041 |
fullSpec fromBuilder:(self canvas topView) |
|
3042 |
components:(SpecCollection new collection:aSpecArray). |
|
3043 |
||
3044 |
windowSpec notNil ifTrue:[ |
|
351 | 3045 |
winSpec := fullSpec window. |
362 | 3046 |
winSpec copyValuesFromSpec:windowSpec |
311 | 3047 |
]. |
3048 |
^ fullSpec literalArrayEncoding. |
|
351 | 3049 |
|
362 | 3050 |
"Modified: / 29.10.1997 / 18:05:58 / cg" |
311 | 3051 |
! |
3052 |
||
3053 |
setAttributesFromWindowSpec:aWindowSpec |
|
3054 |
"set windowSpec from argument a WindowSpec |
|
3055 |
" |
|
362 | 3056 |
windowSpec := WindowSpec new copyValuesFromSpec:aWindowSpec. |
311 | 3057 |
self canvasNameChanged:aWindowSpec name. |
362 | 3058 |
|
3059 |
"Modified: / 29.10.1997 / 18:06:56 / cg" |
|
311 | 3060 |
! ! |
3061 |
||
222 | 3062 |
!UIPainter::TreeView methodsFor:'canvas selection'! |
3063 |
||
3064 |
cvsSelection:aSelection |
|
3065 |
"canvas changed its selection |
|
3066 |
" |
|
3067 |
|sel list rcLt| |
|
3068 |
||
3069 |
list := OrderedCollection new. |
|
3070 |
||
3071 |
aSelection isNil ifFalse:[ |
|
3072 |
aSelection isCollection ifTrue:[ |
|
3073 |
aSelection notNil ifTrue:[sel := aSelection] |
|
3074 |
] ifFalse:[ |
|
3075 |
sel := Array with:aSelection |
|
3076 |
] |
|
3077 |
]. |
|
3078 |
||
3079 |
sel notNil ifTrue:[ |
|
3080 |
rcLt := false. |
|
3081 |
||
3082 |
sel do:[:aView||item| |
|
3083 |
(item := self itemOfView:aView) notNil ifTrue:[ |
|
3084 |
list add:item. |
|
3085 |
||
3086 |
[(item := item parent) notNil] whileTrue:[ |
|
3087 |
item hidden ifTrue:[ |
|
3088 |
rcLt := true. |
|
3089 |
item expand. |
|
3090 |
] |
|
3091 |
] |
|
3092 |
] |
|
3093 |
]. |
|
3094 |
rcLt ifTrue:[model recomputeList]. |
|
3095 |
sel := list collect:[:anItem| listOfNodes findFirst:[:el| el == anItem]] |
|
3096 |
] ifFalse:[ |
|
3097 |
sel := list |
|
3098 |
]. |
|
3099 |
self cvsEventsDisabledDo:[ self selection:sel ]. |
|
3100 |
||
3101 |
||
3102 |
||
3103 |
||
3104 |
! |
|
3105 |
||
3106 |
cvsSelectionAdd:aView |
|
3107 |
"canvas adds a view to current selection |
|
3108 |
" |
|
3109 |
|parent item rcLt oldSel| |
|
3110 |
||
3111 |
item := self itemOfView:aView. |
|
3112 |
||
3113 |
item notNil ifTrue:[ |
|
3114 |
parent := item. |
|
3115 |
||
3116 |
[ (parent := parent parent) notNil ] whileTrue:[ |
|
3117 |
parent hidden ifTrue:[ |
|
3118 |
rcLt := true. |
|
3119 |
parent expand. |
|
3120 |
] |
|
3121 |
]. |
|
3122 |
rcLt == true ifTrue:[model recomputeList]. |
|
3123 |
||
3124 |
oldSel := selection copy. |
|
3125 |
self addToSelection:(listOfNodes findFirst:[:el| el == item]). |
|
3126 |
self selectionChangedFrom:oldSel |
|
3127 |
]. |
|
3128 |
||
3129 |
||
3130 |
||
3131 |
! |
|
3132 |
||
3133 |
cvsSelectionRemove:aView |
|
3134 |
"canvas removes a view from current selection |
|
3135 |
" |
|
3136 |
|parent item rcLt oldSel| |
|
3137 |
||
3138 |
item := self itemOfView:aView. |
|
3139 |
||
3140 |
item notNil ifTrue:[ |
|
3141 |
parent := item. |
|
3142 |
||
3143 |
[ (parent := parent parent) notNil ] whileTrue:[ |
|
3144 |
parent hidden ifTrue:[ |
|
3145 |
rcLt := true. |
|
3146 |
parent expand. |
|
3147 |
] |
|
3148 |
]. |
|
3149 |
rcLt == true ifTrue:[model recomputeList]. |
|
3150 |
||
3151 |
oldSel := selection copy. |
|
3152 |
self removeFromSelection:(listOfNodes findFirst:[:el| el == item]). |
|
3153 |
self selectionChangedFrom:oldSel |
|
3154 |
]. |
|
3155 |
||
3156 |
||
3157 |
||
3158 |
! ! |
|
3159 |
||
3160 |
!UIPainter::TreeView methodsFor:'change & update'! |
|
3161 |
||
281 | 3162 |
canvasNameChanged:aName |
3163 |
"called if identification name assigned to window (canvas) changed |
|
3164 |
" |
|
3165 |
|name node| |
|
3166 |
||
3167 |
node := listOfNodes at:1. |
|
3168 |
||
3169 |
( aName size ~~ 0 |
|
3170 |
and:[(name := aName string withoutSeparators) size ~~ 0 |
|
3171 |
and:[(self propertyDetect:[:p| p name = name]) isNil |
|
3172 |
and:[node name ~= name]]] |
|
3173 |
) ifTrue:[ |
|
446 | 3174 |
node name: name. |
281 | 3175 |
self redrawLine:1. |
3176 |
]. |
|
3177 |
! |
|
3178 |
||
222 | 3179 |
layoutChanged |
3180 |
"layout of any component changed; in case of single selection, the |
|
3181 |
application will be informed to update its layout |
|
3182 |
" |
|
3183 |
selection size == 1 ifTrue:[ |
|
3184 |
self application layoutChanged |
|
3185 |
] |
|
3186 |
||
3187 |
||
3188 |
! |
|
3189 |
||
3190 |
propertyChanged:aProperty |
|
3191 |
"property of view derived from argument a property changed |
|
3192 |
" |
|
3193 |
|item idx end| |
|
3194 |
||
3195 |
item := self itemOfView:(aProperty view). |
|
3196 |
||
3197 |
item notNil ifTrue:[ |
|
3198 |
item contents:aProperty. |
|
3199 |
||
3200 |
item name = aProperty name ifFalse:[ |
|
3201 |
idx := self firstLineShown. |
|
3202 |
||
3203 |
(end := self lastLineShown) > listOfNodes size ifTrue:[ |
|
3204 |
end := listOfNodes size |
|
446 | 3205 |
]. |
3206 |
item name: aProperty name. |
|
222 | 3207 |
|
3208 |
[idx <= end] whileTrue:[ |
|
3209 |
(listOfNodes at:idx) == item ifTrue:[ |
|
3210 |
self redrawLine:idx. "/ is visible; redraw line |
|
3211 |
end := 0 |
|
3212 |
] ifFalse:[ |
|
3213 |
idx := idx + 1 |
|
3214 |
] |
|
3215 |
] |
|
3216 |
]. |
|
3217 |
||
3218 |
self selectedNode == item ifTrue:[ "/ inform application |
|
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
3219 |
self application propertyChanged |
222 | 3220 |
] |
3221 |
]. |
|
3222 |
||
3223 |
||
3224 |
! ! |
|
3225 |
||
3226 |
!UIPainter::TreeView methodsFor:'drag & drop'! |
|
3227 |
||
3228 |
canDrop:anObjectOrCollection |
|
3229 |
"can drop ? delegate to canvas |
|
3230 |
" |
|
3231 |
^ self canvas canDrop:anObjectOrCollection |
|
3232 |
! |
|
3233 |
||
3234 |
drop:anObjectOrCollection at:aPoint |
|
3235 |
"drop objects ? delegate to canvas |
|
3236 |
" |
|
3237 |
self canvas drop:anObjectOrCollection at:aPoint |
|
3238 |
! ! |
|
3239 |
||
282 | 3240 |
!UIPainter::TreeView methodsFor:'enumerating'! |
3241 |
||
3242 |
allItemsDo:aOneArgBlock |
|
3243 |
"evaluate the argument a block on each item other than the canvas |
|
3244 |
" |
|
3245 |
model root allChildrenDo:aOneArgBlock |
|
3246 |
||
3247 |
||
3248 |
! ! |
|
3249 |
||
222 | 3250 |
!UIPainter::TreeView methodsFor:'event processing'! |
3251 |
||
3252 |
cvsEventsDisabledDo:aBlock |
|
3253 |
"evaluate the block without raising selection changed notifications |
|
3254 |
to canvas |
|
3255 |
" |
|
3256 |
|restoreCvsEvents| |
|
3257 |
||
3258 |
restoreCvsEvents := cvsEventsDisabled. |
|
3259 |
cvsEventsDisabled := true. |
|
3260 |
aBlock value. |
|
3261 |
cvsEventsDisabled := restoreCvsEvents. |
|
3262 |
||
3263 |
||
3264 |
! |
|
3265 |
||
3266 |
cvsSetupListDo:aBlock |
|
3267 |
"evaluate block without handling notifications from model; after evaluation |
|
3268 |
the new list will be recomputed |
|
3269 |
" |
|
3270 |
model removeDependent:self. |
|
3271 |
||
3272 |
self cvsEventsDisabledDo:[ |
|
3273 |
self selection:nil. |
|
3274 |
aBlock value |
|
3275 |
]. |
|
3276 |
model addDependent:self. |
|
3277 |
model recomputeList. |
|
3278 |
||
3279 |
! |
|
3280 |
||
3281 |
doubleClicked |
|
3282 |
"disable collapse of canvas item |
|
3283 |
" |
|
3284 |
self selectedNode == model root ifFalse:[ |
|
3285 |
super doubleClicked |
|
3286 |
] |
|
3287 |
||
3288 |
||
3289 |
! ! |
|
3290 |
||
3291 |
!UIPainter::TreeView methodsFor:'initialization'! |
|
3292 |
||
3293 |
initialize |
|
3294 |
"initialization; set multiple select and model |
|
3295 |
" |
|
440 | 3296 |
Images := Images ? IdentityDictionary new. |
222 | 3297 |
super initialize. |
3298 |
self multipleSelectOk:true. |
|
368 | 3299 |
cvsEventsDisabled := false. |
440 | 3300 |
self showDirectoryIndicator: true. |
3301 |
self showDirectoryIndicatorForRoot: false |
|
222 | 3302 |
! ! |
3303 |
||
3304 |
!UIPainter::TreeView methodsFor:'private'! |
|
3305 |
||
3306 |
figureFor:aNode |
|
440 | 3307 |
"returns image for an spec item" |
3308 |
||
446 | 3309 |
|cls image| |
440 | 3310 |
|
3311 |
cls := aNode contents spec class. |
|
446 | 3312 |
aNode contents spec isNil ifTrue: [cls := WindowSpec]. |
440 | 3313 |
cls := cls withAllSuperclasses detect: [:cls| cls class implements: #icon] ifNone: [^nil]. |
446 | 3314 |
image := Images at: cls name ifAbsent: [Images at: cls name put: cls icon]. |
3315 |
image device ~~ device ifTrue: [image := image onDevice: device]. |
|
3316 |
image extent y > 16 ifTrue: [image := image magnifiedBy: 16/image extent y]. |
|
3317 |
^image |
|
222 | 3318 |
! |
3319 |
||
3320 |
selectionChangedFrom:oldSelection |
|
3321 |
"selection has changed. update master selection and raise notification |
|
3322 |
to canvas in case of enabled cvs events |
|
3323 |
" |
|
282 | 3324 |
|sel size| |
222 | 3325 |
|
3326 |
super selectionChangedFrom:oldSelection. |
|
282 | 3327 |
size := selection size. |
222 | 3328 |
|
3329 |
cvsEventsDisabled ifFalse:[ |
|
282 | 3330 |
(size ~~ 0 and:[size ~~ 1 or:[selection first ~~ 1]]) ifTrue:[ |
3331 |
sel := OrderedCollection new. |
|
3332 |
||
3333 |
selection do:[:i| |
|
3334 |
i ~~ 1 ifTrue:[sel add:(listOfNodes at:i) contents view] |
|
3335 |
] |
|
222 | 3336 |
]. |
282 | 3337 |
self canvas updateSelectionFromModel:sel |
222 | 3338 |
]. |
3339 |
||
282 | 3340 |
size ~~ 0 ifTrue:[ |
222 | 3341 |
sel := selection first. |
3342 |
||
3343 |
(listOfNodes at:sel) == lastDrawnMaster ifFalse:[ |
|
3344 |
self redrawLine:sel |
|
3345 |
] |
|
3346 |
] |
|
3347 |
! ! |
|
3348 |
||
3349 |
!UIPainter::TreeView methodsFor:'queries'! |
|
3350 |
||
282 | 3351 |
canMoveOrAlignSelection |
3352 |
"returns true if any selection exists and all widgets in the selection |
|
3353 |
can change their layout through to a move or align operation. |
|
3354 |
" |
|
3355 |
|canvas| |
|
3356 |
||
3357 |
selection size == 0 ifTrue:[ |
|
3358 |
^ false |
|
3359 |
]. |
|
3360 |
canvas := self canvas. |
|
3361 |
||
3362 |
selection do:[:i| |
|
3363 |
i == 1 ifTrue:[^ false]. |
|
3364 |
||
3365 |
(canvas canChangeLayoutOfView:((listOfNodes at:i) contents view)) ifFalse:[ |
|
3366 |
^ false |
|
3367 |
] |
|
3368 |
]. |
|
3369 |
^ true |
|
3370 |
! |
|
3371 |
||
3372 |
canMoveSelectionIntoContainer |
|
3373 |
"returns true in case that one component is selected and can change its container |
|
3374 |
widget to the next element in the list which will have the same container. |
|
222 | 3375 |
" |
3376 |
|item prnt| |
|
3377 |
||
3378 |
( (item := self selectedNode) isNil |
|
3379 |
or:[(prnt := item parent) isNil |
|
3380 |
or:[(prnt := prnt childAt:((prnt indexOfChild:item) + 1)) isNil |
|
3381 |
or:[prnt contents spec class supportsSubComponents not]]] |
|
3382 |
) ifTrue:[ |
|
3383 |
^ false |
|
3384 |
]. |
|
3385 |
^ true |
|
3386 |
! |
|
3387 |
||
282 | 3388 |
canMoveSelectionOutOfContainer |
3389 |
"returns true in case that one component is selected which is contained within |
|
3390 |
another component. |
|
3391 |
" |
|
222 | 3392 |
|item prnt| |
3393 |
||
3394 |
( (item := self selectedNode) isNil |
|
3395 |
or:[(prnt := item parent) isNil |
|
3396 |
or:[prnt parent isNil]] |
|
3397 |
) ifTrue:[ |
|
3398 |
^ false |
|
3399 |
]. |
|
3400 |
^ true |
|
3401 |
! |
|
3402 |
||
301 | 3403 |
canResizeSelectedWidget |
3404 |
"returns true in case of one widget selected and is contained |
|
3405 |
within a widget which allows to resize sub components |
|
3406 |
" |
|
3407 |
|n| |
|
3408 |
||
3409 |
(n := self selectedNode) notNil ifTrue:[ |
|
3410 |
(n := n parent) notNil ifTrue:[ |
|
3411 |
^ (n parent isNil or:[n contents spec class canResizeSubComponents]) |
|
3412 |
] |
|
3413 |
]. |
|
3414 |
^ false |
|
3415 |
! |
|
3416 |
||
282 | 3417 |
hasOneSelectionOtherThanCanvas |
3418 |
"returns true in case that one selection exists other than the canvas |
|
222 | 3419 |
" |
282 | 3420 |
^ (selection size == 1 and:[selection first ~~ 1]) |
281 | 3421 |
! |
3422 |
||
3423 |
isCanvasSelected |
|
3424 |
"returns true in case of a single selection and the |
|
3425 |
selection is the canvas (index 1) |
|
3426 |
" |
|
3427 |
^ (selection size == 1 and:[self isInSelection:1]) |
|
222 | 3428 |
! ! |
3429 |
||
282 | 3430 |
!UIPainter::TreeView methodsFor:'seraching'! |
3431 |
||
3432 |
detectItemRespondsToView:aView |
|
3433 |
"detect the item responding to the view. The item of the view or the first |
|
3434 |
subview providing the item is returned. If no property is detected nil is |
|
3435 |
returned |
|
3436 |
" |
|
3437 |
|view item| |
|
3438 |
||
3439 |
(view := aView) notNil ifTrue:[ |
|
3440 |
[(item := self itemOfView:view) isNil] whileTrue:[ |
|
3441 |
(view := view superView) isNil ifTrue:[^ listOfNodes at:1] |
|
3442 |
]. |
|
3443 |
]. |
|
3444 |
^ item |
|
3445 |
||
3446 |
! ! |
|
3447 |
||
222 | 3448 |
!UIPainter::TreeView methodsFor:'user interactions'! |
3449 |
||
3450 |
doStepIn |
|
3451 |
|item prnt canvas| |
|
3452 |
||
3453 |
( (item := self selectedNode) isNil |
|
3454 |
or:[(prnt := item parent) isNil |
|
3455 |
or:[(prnt := prnt childAt:((prnt indexOfChild:item) + 1)) isNil |
|
3456 |
or:[prnt contents spec class supportsSubComponents not]]] |
|
3457 |
) ifFalse:[ |
|
3458 |
canvas := self canvas. |
|
3459 |
canvas deleteSelection. |
|
3460 |
canvas setSelection:(prnt contents view) withRedraw:false. |
|
3461 |
canvas pasteWithLayout. |
|
3462 |
] |
|
3463 |
! |
|
3464 |
||
3465 |
doStepOut |
|
250 | 3466 |
|item next prnt canvas| |
222 | 3467 |
|
3468 |
( (item := self selectedNode) isNil |
|
3469 |
or:[(prnt := item parent) isNil |
|
3470 |
or:[(next := prnt parent) isNil]] |
|
3471 |
) ifTrue:[ |
|
3472 |
^ self |
|
3473 |
]. |
|
3474 |
model removeDependent:self. |
|
3475 |
||
3476 |
canvas := self canvas. |
|
3477 |
canvas deleteSelection. |
|
3478 |
canvas setSelection:(next contents view) withRedraw:false. |
|
3479 |
canvas pasteWithLayout. |
|
3480 |
||
3481 |
! |
|
3482 |
||
3483 |
doStepOver:anIndex |
|
3484 |
"move child 'anOffset' forward or backward in list of children |
|
3485 |
" |
|
282 | 3486 |
|item idx size prnt spVw view canvas| |
222 | 3487 |
|
3488 |
( (item := self selectedNode) isNil |
|
3489 |
or:[(prnt := item parent) isNil |
|
282 | 3490 |
or:[(size := prnt children size) < 2 |
3491 |
or:[(idx := prnt indexOfChild:item) == 0]]] |
|
3492 |
) ifTrue:[ |
|
3493 |
^ self |
|
3494 |
]. |
|
3495 |
model removeDependent:self. |
|
3496 |
model removeSelection. |
|
3497 |
selection := nil. |
|
3498 |
model addDependent:self. |
|
3499 |
idx := idx + anIndex. |
|
3500 |
||
3501 |
idx < 1 ifTrue:[idx := size] |
|
3502 |
ifFalse:[idx > size ifTrue:[idx := 1]]. |
|
3503 |
||
3504 |
model add:item beforeIndex:idx below:prnt. |
|
3505 |
idx := prnt indexOfChild:item. |
|
3506 |
view := item contents view. |
|
3507 |
spVw := prnt contents view. |
|
3508 |
canvas := self canvas. |
|
3509 |
||
3510 |
canvas hideSelection. |
|
3511 |
||
3512 |
"/ input view might by contained in sequence |
|
3513 |
((size := canvas findInputViewIn:spVw) ~~ 0 and:[idx >= size]) ifTrue:[ |
|
3514 |
idx := idx + 1 |
|
3515 |
]. |
|
3516 |
spVw changeSequenceOrderFor:view to:idx. |
|
3517 |
||
3518 |
spVw specClass isLayoutContainer ifFalse:[ |
|
3519 |
spVw subViews do:[:v| v raise ]. |
|
3520 |
canvas inputView raise |
|
3521 |
]. |
|
3522 |
canvas showSelection. |
|
3523 |
self selectNode:item. |
|
222 | 3524 |
! ! |
3525 |
||
60 | 3526 |
!UIPainter class methodsFor:'documentation'! |
3527 |
||
3528 |
version |
|
3529 |
^ '$Header$' |
|
3530 |
! ! |