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