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