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