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