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