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