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