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