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