author | Claus Gittinger <cg@exept.de> |
Tue, 17 Jun 1997 14:08:32 +0200 | |
changeset 158 | 6e7f892308ae |
parent 157 | ce974dce3dd4 |
child 160 | 622b88baeff6 |
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 |
||
13 |
||
60 | 14 |
ApplicationModel subclass:#UIPainter |
149 | 15 |
instanceVariableNames:'activeHelpTool layoutTool objectList selectionPanel tabSelection |
16 |
lastSlice specView fileName specClass specSelector specSuperclass |
|
17 |
aspects' |
|
60 | 18 |
classVariableNames:'' |
19 |
poolDictionaries:'' |
|
20 |
category:'Interface-UIPainter' |
|
21 |
! |
|
22 |
||
23 |
!UIPainter class methodsFor:'documentation'! |
|
24 |
||
156 | 25 |
copyright |
26 |
" |
|
27 |
COPYRIGHT (c) 1995 by eXept Software AG |
|
28 |
All Rights Reserved |
|
29 |
||
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
||
38 |
! |
|
39 |
||
60 | 40 |
documentation |
41 |
" |
|
127 | 42 |
GUI-Builder: |
43 |
this class allows the user to build its own applications providing a graphical |
|
44 |
user interface to buildin components and to define the behavior of the components |
|
45 |
during runtime. The resulting specifications can be installed as methods on |
|
46 |
classes, typically subclasses of an ApplicationModel. These specifications |
|
47 |
are used by the UIBuilder to generate the application window and its component |
|
48 |
structues when open the application. |
|
60 | 49 |
|
50 |
[start with:] |
|
51 |
UIPainter open |
|
127 | 52 |
|
156 | 53 |
[author:] |
54 |
Claus Atzkern |
|
55 |
||
127 | 56 |
[see also:] |
57 |
UIBuilder |
|
58 |
ApplicationModel |
|
59 |
UISpecification |
|
60 | 60 |
" |
109 | 61 |
|
62 |
! ! |
|
63 |
||
64 |
!UIPainter class methodsFor:'instance creation'! |
|
65 |
||
66 |
listHolder:aListHolder |
|
67 |
|application| |
|
68 |
||
69 |
application := self new. |
|
70 |
application objectList:aListHolder. |
|
71 |
^ application open |
|
72 |
! |
|
73 |
||
74 |
painter:aBuilderView |
|
75 |
|application| |
|
76 |
||
77 |
application := self new. |
|
78 |
application painter:aBuilderView. |
|
79 |
^ application open |
|
60 | 80 |
! ! |
81 |
||
87 | 82 |
!UIPainter class methodsFor:'ST-80 queries'! |
83 |
||
84 |
preferenceFor:aSymbol |
|
85 |
^ false |
|
109 | 86 |
|
87 |
||
88 |
! ! |
|
89 |
||
118 | 90 |
!UIPainter class methodsFor:'icons'! |
91 |
||
92 |
iconAlignB |
|
93 |
^ Image fromFile:'b_alignB.xbm' |
|
94 |
||
95 |
! |
|
96 |
||
97 |
iconAlignCenterH |
|
98 |
^ Image fromFile:'b_alignCH.xbm' |
|
99 |
||
100 |
! |
|
101 |
||
102 |
iconAlignCenterV |
|
103 |
^ Image fromFile:'b_alignCV.xbm' |
|
104 |
||
105 |
! |
|
106 |
||
107 |
iconAlignL |
|
108 |
^ Image fromFile:'b_alignL.xbm' |
|
109 |
! |
|
110 |
||
111 |
iconAlignLR |
|
112 |
^ Image fromFile:'b_alignLR.xbm' |
|
113 |
||
114 |
! |
|
115 |
||
116 |
iconAlignR |
|
117 |
^ Image fromFile:'b_alignR.xbm' |
|
118 |
||
119 |
! |
|
120 |
||
121 |
iconAlignT |
|
122 |
^ Image fromFile:'b_alignT.xbm' |
|
123 |
||
124 |
! |
|
125 |
||
126 |
iconAlignTB |
|
127 |
^ Image fromFile:'b_alignTB.xbm' |
|
128 |
||
129 |
! ! |
|
130 |
||
60 | 131 |
!UIPainter class methodsFor:'interface specs'! |
132 |
||
118 | 133 |
menuAlignment |
134 |
^ #(#Menu #( |
|
135 |
#(#MenuItem |
|
136 |
#'label:' 'align left' |
|
137 |
#'value:' #alignSelectionLeft |
|
130 | 138 |
#'labelImage:' #( ResourceRetriever nil iconAlignL ) |
118 | 139 |
) |
140 |
#(#MenuItem |
|
141 |
#'label:' 'align right' |
|
142 |
#'value:' #alignSelectionRight |
|
130 | 143 |
#'labelImage:' #( ResourceRetriever nil iconAlignR ) |
118 | 144 |
) |
145 |
#(#MenuItem |
|
146 |
#'label:' 'align left & right' |
|
147 |
#'value:' #alignSelectionLeftAndRight |
|
130 | 148 |
#'labelImage:' #( ResourceRetriever nil iconAlignLR ) |
118 | 149 |
) |
150 |
#(#MenuItem |
|
151 |
#'label:' 'align top' |
|
152 |
#'value:' #alignSelectionTop |
|
130 | 153 |
#'labelImage:' #( ResourceRetriever nil iconAlignT ) |
118 | 154 |
) |
155 |
#(#MenuItem |
|
156 |
#'label:' 'align bottom' |
|
157 |
#'value:' #alignSelectionBottom |
|
130 | 158 |
#'labelImage:' #( ResourceRetriever nil iconAlignB ) |
118 | 159 |
) |
160 |
#(#MenuItem |
|
161 |
#'label:' 'align top & bottom' |
|
162 |
#'value:' #alignSelectionTopAndBottom |
|
130 | 163 |
#'labelImage:' #( ResourceRetriever nil iconAlignTB ) |
118 | 164 |
) |
165 |
#(#MenuItem |
|
166 |
#'label:' 'align centered horizontal' |
|
167 |
#'value:' #alignSelectionCenterHor |
|
130 | 168 |
#'labelImage:' #( ResourceRetriever nil iconAlignCenterH ) |
118 | 169 |
) |
170 |
#(#MenuItem |
|
171 |
#'label:' 'align centered vertical' |
|
172 |
#'value:' #alignSelectionCenterVer |
|
130 | 173 |
#'labelImage:' #( ResourceRetriever nil iconAlignCenterV ) |
118 | 174 |
) |
175 |
) |
|
176 |
#( 4 2 ) |
|
177 |
nil |
|
178 |
) |
|
179 |
||
180 |
! |
|
181 |
||
182 |
menuPullDown |
|
109 | 183 |
^ #(#Menu #( |
184 |
#(#MenuItem |
|
185 |
#'label:' 'file' |
|
114 | 186 |
#'value:' #file |
109 | 187 |
#'submenu:' |
188 |
#(#Menu #( |
|
189 |
#(#MenuItem |
|
190 |
#'label:' 'new' |
|
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
191 |
#'value:' #doNew |
109 | 192 |
) |
193 |
#(#MenuItem |
|
194 |
#'label:' 'from class ...' |
|
114 | 195 |
#'value:' #doFromClass |
109 | 196 |
) |
197 |
#(#MenuItem |
|
198 |
#'label:' 'pick a view ' |
|
114 | 199 |
#'value:' #doPickAView |
109 | 200 |
) |
201 |
#(#MenuItem |
|
202 |
#'label:' 'raise' |
|
114 | 203 |
#'value:' #doRaise |
109 | 204 |
) |
205 |
#(#MenuItem |
|
206 |
#'label:' 'quit' |
|
114 | 207 |
#'value:' #closeRequest |
109 | 208 |
) |
209 |
) |
|
133 | 210 |
#(3 1) |
109 | 211 |
nil |
212 |
) |
|
213 |
) |
|
214 |
#(#MenuItem |
|
215 |
#'label:' 'misc' |
|
114 | 216 |
#'value:' #misc |
109 | 217 |
#'submenu:' |
218 |
#(#Menu #( |
|
219 |
#(#MenuItem |
|
220 |
#'label:' 'grid' |
|
114 | 221 |
#'value:' #grid |
109 | 222 |
#'submenu:' |
223 |
#(#Menu #( |
|
224 |
#(#MenuItem |
|
137 | 225 |
#'label:' 'show' |
226 |
#'indication:' #gridShown: |
|
109 | 227 |
) |
228 |
#(#MenuItem |
|
137 | 229 |
#'label:' 'align' |
230 |
#'indication:' #gridAlign: |
|
109 | 231 |
) |
232 |
) |
|
233 |
nil |
|
234 |
nil |
|
235 |
) |
|
236 |
) |
|
237 |
#(#MenuItem |
|
238 |
#'label:' 'undo' |
|
114 | 239 |
#'value:' #undo |
109 | 240 |
#'submenu:' |
241 |
#(#Menu #( |
|
242 |
#(#MenuItem |
|
243 |
#'label:' 'last' |
|
114 | 244 |
#'value:' #undoLast |
109 | 245 |
) |
246 |
#(#MenuItem |
|
247 |
#'label:' 'menu' |
|
114 | 248 |
#'value:' #openUndoMenu |
109 | 249 |
) |
250 |
#(#MenuItem |
|
251 |
#'label:' 'delete' |
|
114 | 252 |
#'value:' #removeUndoHistory |
109 | 253 |
) |
254 |
) |
|
255 |
#(2) |
|
256 |
nil |
|
257 |
) |
|
258 |
) |
|
259 |
) |
|
260 |
nil |
|
261 |
nil |
|
262 |
) |
|
263 |
) |
|
264 |
#(#MenuItem |
|
265 |
#'label:' 'code' |
|
114 | 266 |
#'value:' #code |
109 | 267 |
#'submenu:' |
268 |
#(#Menu #( |
|
269 |
#(#MenuItem |
|
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
270 |
#'label:' 'class && method ...' |
114 | 271 |
#'value:' #defineClassAndSelector |
109 | 272 |
) |
273 |
#(#MenuItem |
|
274 |
#'label:' 'install spec' |
|
114 | 275 |
#'value:' #doInstallSpec |
109 | 276 |
) |
277 |
#(#MenuItem |
|
152 | 278 |
#'label:' 'install help spec' |
279 |
#'value:' #doInstallHelp |
|
280 |
) |
|
281 |
#(#MenuItem |
|
109 | 282 |
#'label:' 'install aspects' |
114 | 283 |
#'value:' #doInstallAspects |
109 | 284 |
) |
285 |
#(#MenuItem |
|
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
286 |
#'label:' 'show windowSpec' |
114 | 287 |
#'value:' #doWindowSpec |
109 | 288 |
) |
133 | 289 |
#(#MenuItem |
149 | 290 |
#'label:' 'browse application' |
291 |
#'value:' #doBrowseAppClass |
|
292 |
) |
|
293 |
#(#MenuItem |
|
294 |
#'label:' 'start application' |
|
295 |
#'value:' #doStartApplication |
|
133 | 296 |
) |
109 | 297 |
) |
152 | 298 |
#( 1 3 1) |
109 | 299 |
nil |
300 |
) |
|
301 |
) |
|
302 |
#(#MenuItem |
|
303 |
#'label:' 'test' |
|
118 | 304 |
#'nameKey:' #test |
114 | 305 |
#'value:' #test |
109 | 306 |
#'submenu:' |
307 |
#(#Menu #( |
|
308 |
#(#MenuItem |
|
137 | 309 |
#'label:' 'test mode' |
310 |
#'indication:' #testMode: |
|
109 | 311 |
) |
312 |
) |
|
313 |
nil |
|
314 |
nil |
|
315 |
) |
|
316 |
) |
|
317 |
) |
|
318 |
nil |
|
319 |
nil |
|
320 |
) |
|
321 |
||
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
322 |
"Modified: 17.6.1997 / 12:30:17 / cg" |
109 | 323 |
! |
324 |
||
60 | 325 |
nameAndSelectorSpec |
326 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
327 |
||
328 |
"do not manually edit this - the painter/builder may not be able to |
|
329 |
handle the specification if its corrupted." |
|
330 |
||
331 |
" |
|
332 |
UIPainter new openOnClass:UIPainter andSelector:#nameAndSelectorSpec |
|
333 |
UIPainter new openInterface:#nameAndSelectorSpec |
|
334 |
" |
|
335 |
||
336 |
<resource: #canvas> |
|
337 |
||
338 |
^ |
|
142 | 339 |
|
60 | 340 |
#(#FullSpec |
341 |
#'window:' |
|
342 |
#(#WindowSpec |
|
343 |
#'name:' 'uIPainterView' |
|
344 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
127 | 345 |
#'label:' 'unnamed canvas' |
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
346 |
#'bounds:' #(#Rectangle 0 0 392 223) |
60 | 347 |
) |
348 |
#'component:' |
|
349 |
#(#SpecCollection |
|
350 |
#'collection:' |
|
351 |
#( |
|
352 |
#(#LabelSpec |
|
353 |
#'name:' 'label1' |
|
354 |
#'layout:' #(#LayoutFrame 10 0 50 0 110 0 70 0) |
|
355 |
#'label:' 'class:' |
|
356 |
#'adjust:' #right |
|
357 |
) |
|
358 |
#(#LabelSpec |
|
359 |
#'name:' 'label2' |
|
360 |
#'layout:' #(#LayoutFrame 10 0 90 0 110 0 110 0) |
|
361 |
#'label:' 'superclass:' |
|
362 |
#'adjust:' #right |
|
363 |
) |
|
364 |
#(#LabelSpec |
|
365 |
#'name:' 'label3' |
|
366 |
#'layout:' #(#LayoutFrame 10 0 130 0 110 0 150 0) |
|
367 |
#'label:' 'selector:' |
|
368 |
#'adjust:' #right |
|
369 |
) |
|
370 |
#(#InputFieldSpec |
|
371 |
#'name:' 'classNameField' |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
372 |
#'layout:' #(#LayoutFrame 120 0 50 0 -2 1.0 72 0) |
60 | 373 |
#'tabable:' true |
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
374 |
#'model:' #classNameChannel |
60 | 375 |
) |
376 |
#(#InputFieldSpec |
|
377 |
#'name:' 'methodNameField' |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
378 |
#'layout:' #(#LayoutFrame 120 0 130 0 -2 1.0 152 0) |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
379 |
#'tabable:' true |
60 | 380 |
#'model:' #methodNameChannel |
381 |
) |
|
382 |
#(#ActionButtonSpec |
|
383 |
#'name:' 'button1' |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
384 |
#'layout:' #(#AlignmentOrigin -2 0.5 195 0 1 0.5) |
60 | 385 |
#'label:' 'cancel' |
386 |
#'tabable:' true |
|
387 |
#'model:' #cancel |
|
388 |
) |
|
389 |
#(#ActionButtonSpec |
|
390 |
#'name:' 'button2' |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
391 |
#'layout:' #(#AlignmentOrigin 2 0.5 195 0 0 0.5) |
60 | 392 |
#'label:' 'ok' |
393 |
#'tabable:' true |
|
394 |
#'isDefault:' true |
|
395 |
#'model:' #accept |
|
396 |
) |
|
397 |
#(#LabelSpec |
|
398 |
#'name:' 'boxLabel' |
|
92 | 399 |
#'layout:' #(#LayoutFrame 0 0.0 11 0 0 1.0 32 0) |
400 |
#'label:' 'class & selector for code:' |
|
401 |
#'adjust:' #left |
|
60 | 402 |
) |
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
403 |
#(#ComboBoxSpec |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
404 |
#'name:' 'comboBox1' |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
405 |
#'layout:' #(#LayoutFrame 120 0 90 0 -2 1.0 112 0) |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
406 |
#'tabable:' true |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
407 |
#'model:' #superclassNameChannel |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
408 |
#'immediateAccept:' false |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
409 |
#'acceptOnLeave:' true |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
410 |
#'acceptOnLostFocus:' true |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
411 |
#'comboList:' #superclassNameDefaults |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
412 |
) |
60 | 413 |
) |
414 |
) |
|
415 |
) |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
416 |
|
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
417 |
"Modified: 17.6.1997 / 13:02:12 / cg" |
109 | 418 |
! |
419 |
||
420 |
windowSpec |
|
421 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
422 |
||
423 |
"do not manually edit this - the painter/builder may not be able to |
|
424 |
handle the specification if its corrupted." |
|
425 |
||
426 |
" |
|
427 |
UIPainter new openOnClass:UIPainter andSelector:#windowSpec |
|
428 |
UIPainter new openInterface:#windowSpec |
|
429 |
" |
|
430 |
"UIPainter open" |
|
431 |
||
432 |
<resource: #canvas> |
|
433 |
||
434 |
^ |
|
435 |
||
436 |
#(#FullSpec |
|
437 |
#'window:' |
|
438 |
#(#WindowSpec |
|
439 |
#'name:' 'uIPainterView' |
|
440 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
441 |
#'label:' 'Tree-View' |
|
137 | 442 |
#'bounds:' #(#Rectangle 0 0 478 429) |
109 | 443 |
) |
444 |
#'component:' |
|
445 |
#(#SpecCollection |
|
446 |
#'collection:' |
|
447 |
#( |
|
448 |
#(#MenuPanelSpec |
|
137 | 449 |
#'name:' 'menuPullDown' |
114 | 450 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 24 0) |
144 | 451 |
#'tabable:' true |
118 | 452 |
#'menu:' #menuPullDown |
109 | 453 |
) |
137 | 454 |
#(#MenuPanelSpec |
455 |
#'name:' 'menuAlignment' |
|
456 |
#'layout:' #(#LayoutFrame 0 0.0 29 0 233 0 54 0) |
|
144 | 457 |
#'tabable:' true |
137 | 458 |
#'menu:' #menuAlignment |
459 |
#'showSeparatingLines:' true |
|
460 |
) |
|
461 |
#(#PanelViewSpec |
|
462 |
#'name:' 'panelViewButtons' |
|
149 | 463 |
#'layout:' #(#LayoutFrame -125 1.0 25 0.0 0 1.0 57 0.0) |
137 | 464 |
#'component:' |
465 |
#(#SpecCollection |
|
466 |
#'collection:' |
|
467 |
#( |
|
468 |
#(#ActionButtonSpec |
|
469 |
#'name:' 'moveLeft' |
|
470 |
#'label:' '' |
|
471 |
#'translateLabel:' true |
|
472 |
#'labelChannel:' #'LABELb_moveLeft.xbm' |
|
144 | 473 |
#'tabable:' true |
137 | 474 |
#'defaultable:' true |
475 |
#'model:' #moveSelectionLeft |
|
476 |
#'isTriggerOnDown:' true |
|
477 |
#'enableChannel:' #enableChannel |
|
478 |
#'extent:' #(#Point 26 24) |
|
479 |
) |
|
480 |
#(#ActionButtonSpec |
|
481 |
#'name:' 'moveRight' |
|
482 |
#'label:' '' |
|
483 |
#'translateLabel:' true |
|
484 |
#'labelChannel:' #'LABELb_moveRight.xbm' |
|
144 | 485 |
#'tabable:' true |
137 | 486 |
#'defaultable:' true |
487 |
#'model:' #moveSelectionRight |
|
488 |
#'isTriggerOnDown:' true |
|
489 |
#'enableChannel:' #enableChannel |
|
490 |
#'extent:' #(#Point 26 24) |
|
491 |
) |
|
492 |
#(#ActionButtonSpec |
|
493 |
#'name:' 'moveUp' |
|
494 |
#'label:' '' |
|
495 |
#'translateLabel:' true |
|
496 |
#'labelChannel:' #'LABELb_moveUp.xbm' |
|
144 | 497 |
#'tabable:' true |
137 | 498 |
#'defaultable:' true |
499 |
#'model:' #moveSelectionUp |
|
500 |
#'isTriggerOnDown:' true |
|
501 |
#'enableChannel:' #enableChannel |
|
502 |
#'extent:' #(#Point 26 24) |
|
503 |
) |
|
504 |
#(#ActionButtonSpec |
|
505 |
#'name:' 'moveDown' |
|
506 |
#'label:' '' |
|
507 |
#'translateLabel:' true |
|
508 |
#'labelChannel:' #'LABELb_moveDown.xbm' |
|
144 | 509 |
#'tabable:' true |
137 | 510 |
#'defaultable:' true |
511 |
#'model:' #moveSelectionDown |
|
512 |
#'isTriggerOnDown:' true |
|
513 |
#'enableChannel:' #enableChannel |
|
514 |
#'extent:' #(#Point 26 24) |
|
515 |
) |
|
516 |
) |
|
517 |
) |
|
518 |
#'level:' 1 |
|
519 |
#'horizontalLayout:' #fitSpace |
|
520 |
#'verticalLayout:' #fitSpace |
|
521 |
#'horizontalSpace:' 4 |
|
522 |
#'verticalSpace:' 4 |
|
523 |
) |
|
524 |
#(#SequenceViewSpec |
|
525 |
#'name:' 'objectTree' |
|
149 | 526 |
#'layout:' #(#LayoutFrame 0 0.0 59 0.0 0 0.35 -25 1.0) |
137 | 527 |
#'enableChannel:' #enableChannel |
144 | 528 |
#'tabable:' true |
137 | 529 |
#'menu:' #objectListMenu |
530 |
#'model:' #objectList |
|
531 |
#'hasHorizontalScrollBar:' true |
|
532 |
#'hasVerticalScrollBar:' true |
|
533 |
#'miniScrollerHorizontal:' true |
|
534 |
#'isMultiSelect:' true |
|
535 |
#'doubleClickSelector:' #doubleClick |
|
536 |
#'useIndex:' true |
|
537 |
) |
|
538 |
#(#NoteBookViewSpec |
|
539 |
#'name:' 'noteBook' |
|
149 | 540 |
#'layout:' #(#LayoutFrame 0 0.35 59 0.0 0 1.0 -55 1.0) |
137 | 541 |
#'enableChannel:' #enableChannel |
144 | 542 |
#'tabable:' true |
137 | 543 |
#'menu:' #tabList |
544 |
#'style:' |
|
545 |
#(#FontDescription |
|
144 | 546 |
#helvetica #medium |
137 | 547 |
#roman #'10' |
548 |
) |
|
549 |
#'model:' #tabModel |
|
550 |
#'tabWidget:' #Window |
|
551 |
#'canvas:' #noteBookView |
|
552 |
) |
|
553 |
#(#HorizontalPanelViewSpec |
|
554 |
#'name:' 'modifyPanel' |
|
149 | 555 |
#'layout:' #(#LayoutFrame 0 0.35 -55 1.0 0 1.0 -25 1.0) |
137 | 556 |
#'component:' |
557 |
#(#SpecCollection |
|
558 |
#'collection:' |
|
559 |
#( |
|
560 |
#(#ActionButtonSpec |
|
561 |
#'name:' 'cancelButton' |
|
562 |
#'label:' 'cancel' |
|
144 | 563 |
#'tabable:' true |
137 | 564 |
#'model:' #cancel |
565 |
#'enableChannel:' #modifiedChannel |
|
566 |
#'extent:' #(#Point 151 24) |
|
567 |
) |
|
568 |
#(#ActionButtonSpec |
|
569 |
#'name:' 'acceptButton' |
|
570 |
#'label:' 'ok' |
|
144 | 571 |
#'tabable:' true |
137 | 572 |
#'model:' #accept |
573 |
#'enableChannel:' #modifiedChannel |
|
574 |
#'extent:' #(#Point 151 24) |
|
575 |
) |
|
576 |
) |
|
577 |
) |
|
578 |
#'level:' 0 |
|
579 |
#'horizontalLayout:' #fitSpace |
|
580 |
#'verticalLayout:' #fitSpace |
|
581 |
#'horizontalSpace:' 3 |
|
582 |
#'verticalSpace:' 3 |
|
583 |
) |
|
149 | 584 |
#(#LabelSpec |
585 |
#'name:' 'helpInfo' |
|
586 |
#'layout:' #(#LayoutFrame 2 0.0 -25 1.0 -2 1.0 -2 1.0) |
|
587 |
#'label:' '' |
|
588 |
#'level:' -1 |
|
589 |
#'adjust:' #left |
|
590 |
) |
|
109 | 591 |
) |
592 |
) |
|
593 |
) |
|
60 | 594 |
! ! |
595 |
||
109 | 596 |
!UIPainter methodsFor:'actions'! |
60 | 597 |
|
109 | 598 |
accept |
599 |
|layout| |
|
60 | 600 |
|
149 | 601 |
tabSelection = layoutTool label ifTrue:[ |
144 | 602 |
(layout := layoutTool layout) notNil ifTrue:[ |
603 |
layoutTool layoutType == #Extent ifTrue:[ |
|
604 |
self painter setExtent:layout |
|
605 |
] ifFalse:[ |
|
149 | 606 |
self painter setLayout:layout |
109 | 607 |
] |
144 | 608 |
] |
609 |
] ifFalse:[ |
|
149 | 610 |
tabSelection = 'Help' ifTrue:[ |
611 |
activeHelpTool accept |
|
612 |
]. |
|
613 |
self painter updateFromSpec:(specView specEdited) |
|
144 | 614 |
]. |
615 |
self cancel |
|
109 | 616 |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
617 |
"Modified: 17.6.1997 / 12:50:59 / cg" |
109 | 618 |
! |
619 |
||
620 |
cancel |
|
621 |
"cancel all changes and read back attributes from current view |
|
622 |
" |
|
144 | 623 |
specView specEdited:(self painter specForSelection). |
624 |
layoutTool update. |
|
109 | 625 |
self modifiedChannel value:false. |
137 | 626 |
! |
627 |
||
628 |
doubleClick |
|
629 |
objectList selectGroup |
|
60 | 630 |
! ! |
631 |
||
149 | 632 |
!UIPainter methodsFor:'active help'! |
633 |
||
634 |
activeHelpTool |
|
152 | 635 |
|cls| |
636 |
||
149 | 637 |
activeHelpTool isNil ifTrue:[ |
152 | 638 |
activeHelpTool := UIHelpTool new. |
639 |
||
640 |
specClass notNil ifTrue:[ |
|
641 |
specClass isBehavior ifFalse:[ |
|
642 |
cls := Smalltalk at:specClass asSymbol |
|
643 |
] ifTrue:[ |
|
644 |
cls := specClass |
|
645 |
]. |
|
646 |
||
647 |
(cls respondsTo:#helpSpec) ifTrue:[ |
|
648 |
activeHelpTool dictionary:(cls helpSpec). |
|
649 |
] |
|
650 |
]. |
|
149 | 651 |
]. |
652 |
^ activeHelpTool |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
653 |
|
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
654 |
"Modified: 17.6.1997 / 12:51:15 / cg" |
149 | 655 |
! |
656 |
||
657 |
showHelp:aHelpText for:view |
|
658 |
"hook to allow an application to display active help |
|
659 |
texts in its own info area. |
|
660 |
This method may be redefined in a concrete application. |
|
661 |
If it returns false, the ActiveHelp manager will popup a |
|
662 |
bubble with the help text." |
|
663 |
||
664 |
|l| |
|
665 |
||
666 |
(l := self builder componentAt:#helpInfo) notNil ifTrue:[ |
|
152 | 667 |
aHelpText replaceAll:(Character cr) by:(Character space). |
149 | 668 |
l label:aHelpText. |
152 | 669 |
^ true. |
149 | 670 |
]. |
671 |
^ false |
|
672 |
||
673 |
||
674 |
! ! |
|
675 |
||
60 | 676 |
!UIPainter methodsFor:'aspects'! |
677 |
||
118 | 678 |
enableChannel |
679 |
"true if modifications are allowed otherwise running test |
|
680 |
" |
|
681 |
^ self painter enableChannel |
|
109 | 682 |
! |
683 |
||
118 | 684 |
menuAlignment |
685 |
|menu channel| |
|
686 |
||
687 |
channel := self enableChannel. |
|
688 |
||
689 |
menu := Menu new. |
|
690 |
menu fromLiteralArrayEncoding:(self class menuAlignment). |
|
691 |
menu receiver:self. |
|
692 |
menu menuItems do:[:anItem| anItem enabled:channel]. |
|
693 |
^ menu |
|
694 |
! |
|
695 |
||
696 |
menuPullDown |
|
697 |
|menu channel| |
|
698 |
||
699 |
channel := self enableChannel. |
|
700 |
||
701 |
menu := Menu new. |
|
702 |
menu fromLiteralArrayEncoding:(self class menuPullDown). |
|
703 |
menu receiver:self. |
|
704 |
||
705 |
menu menuItems do:[:anItem| |
|
706 |
anItem nameKey ~~ #test ifTrue:[anItem enabled:channel] |
|
133 | 707 |
ifFalse:[anItem value:channel]. |
118 | 708 |
]. |
709 |
^ menu |
|
109 | 710 |
! |
711 |
||
712 |
modifiedChannel |
|
713 |
||
714 |
|holder| |
|
715 |
||
716 |
(holder := builder bindingAt:#modifiedChannel) isNil ifTrue:[ |
|
717 |
builder aspectAt:#modifiedChannel put:(holder := false asValue). |
|
718 |
]. |
|
719 |
^ holder |
|
720 |
! |
|
721 |
||
722 |
noteBookView |
|
723 |
"automatically generated by UIPainter ..." |
|
724 |
||
725 |
|noteBook channel| |
|
726 |
||
727 |
(noteBook := builder bindingAt:#noteBookView) isNil ifTrue:[ |
|
728 |
noteBook := View origin:0.0 @0.0 corner:1.0@1.0. |
|
729 |
layoutTool := UIPropertyView for:#Dimension in:noteBook. |
|
730 |
specView := UIPropertyView for:#Specification in:noteBook. |
|
144 | 731 |
channel := self modifiedChannel. |
152 | 732 |
layoutTool masterApplication:self. |
733 |
specView masterApplication:self. |
|
109 | 734 |
layoutTool modifiedHolder:channel. |
735 |
specView modifiedHolder:channel. |
|
736 |
builder aspectAt:#noteBookView put:noteBook. |
|
737 |
]. |
|
738 |
^ noteBook |
|
739 |
! |
|
740 |
||
741 |
objectList |
|
742 |
^ objectList |
|
743 |
! |
|
744 |
||
745 |
objectListMenu |
|
746 |
"returns a block which returns the menu |
|
114 | 747 |
!!hack!! |
109 | 748 |
" |
121 | 749 |
^ [ self painter showMiddleButtonMenu ]. |
109 | 750 |
|
751 |
||
752 |
||
753 |
! |
|
754 |
||
755 |
tabList |
|
756 |
"automatically generated by UIPainter ..." |
|
757 |
||
758 |
|holder| |
|
759 |
||
760 |
(holder := builder bindingAt:#tabList) isNil ifTrue:[ |
|
761 |
builder aspectAt:#tabList put:(holder := ValueHolder new). |
|
144 | 762 |
holder value:#( 'Properties' ). |
109 | 763 |
]. |
764 |
^ holder |
|
765 |
! |
|
766 |
||
767 |
tabModel |
|
768 |
"automatically generated by UIPainter ..." |
|
769 |
||
770 |
|holder| |
|
771 |
||
772 |
(holder := builder bindingAt:#tabModel) isNil ifTrue:[ |
|
773 |
lastSlice := 'Basics'. |
|
774 |
holder := AspectAdaptor new subject:self; forAspect:#tabSelection. |
|
775 |
builder aspectAt:#tabModel put:holder. |
|
776 |
]. |
|
777 |
^ holder |
|
60 | 778 |
! ! |
779 |
||
109 | 780 |
!UIPainter methodsFor:'binding access'! |
781 |
||
782 |
aspectFor:aKey |
|
783 |
"check wether aspect is assigned to a label icon |
|
784 |
" |
|
785 |
(aKey startsWith:'LABEL') ifFalse:[ |
|
786 |
^ aspects at:aKey ifAbsent:[ super aspectFor:aKey ] |
|
787 |
]. |
|
788 |
^ Image fromFile:(aKey copyFrom:(('LABEL' size) + 1)) |
|
789 |
! ! |
|
790 |
||
791 |
!UIPainter methodsFor:'change & update'! |
|
792 |
||
793 |
update:something with:aParameter from:someObject |
|
794 |
||
795 |
(someObject == objectList and:[something ~~ #list]) ifTrue:[ |
|
796 |
something ~~ #layout ifTrue:[ |
|
797 |
self objectListChanged |
|
798 |
] ifFalse:[ |
|
799 |
(self modifiedChannel value) ifFalse:[ |
|
144 | 800 |
layoutTool update |
109 | 801 |
] |
802 |
] |
|
803 |
] |
|
804 |
! ! |
|
805 |
||
806 |
!UIPainter methodsFor:'event handling'! |
|
807 |
||
808 |
doesNotUnderstand:aMessage |
|
809 |
|painter| |
|
810 |
||
811 |
painter := self painter. |
|
812 |
||
813 |
(painter respondsTo:(aMessage selector)) ifTrue:[ |
|
814 |
^ aMessage sendTo:painter |
|
815 |
]. |
|
149 | 816 |
super doesNotUnderstand:aMessage |
109 | 817 |
|
818 |
! |
|
819 |
||
820 |
objectListChanged |
|
821 |
"something changed in the painter view |
|
822 |
" |
|
144 | 823 |
|setSel view slices list spec props size same| |
109 | 824 |
|
825 |
props := objectList selectedProperty. |
|
826 |
tabSelection := nil. |
|
827 |
||
828 |
props isNil ifFalse:[ |
|
144 | 829 |
view := props view. |
830 |
spec := props spec copy. |
|
142 | 831 |
|
144 | 832 |
layoutTool forView == view ifFalse:[ |
833 |
slices := spec class slices. |
|
834 |
size := slices size + 1. |
|
835 |
list := Array new:size. |
|
836 |
slices keysAndValuesDo:[:i :s|list at:i put:(s first asString)]. |
|
149 | 837 |
list at:size put:(layoutTool label). |
144 | 838 |
(self tabList) value:list. |
839 |
] ifTrue:[ |
|
840 |
list := self tabList value |
|
142 | 841 |
]. |
109 | 842 |
(list findFirst:[:aName| aName = lastSlice]) ~~ 0 ifTrue:[ |
843 |
setSel := lastSlice |
|
844 |
] |
|
845 |
]. |
|
144 | 846 |
layoutTool forView:view. |
109 | 847 |
specView specEdited:spec. |
848 |
self tabModel value:setSel. |
|
849 |
! ! |
|
850 |
||
851 |
!UIPainter methodsFor:'file access'! |
|
60 | 852 |
|
853 |
openFile:aFileName |
|
854 |
|aStream | |
|
855 |
||
856 |
aStream := FileStream readonlyFileNamed:aFileName. |
|
857 |
||
858 |
aStream notNil ifTrue:[ |
|
109 | 859 |
self painter fileInContentsFrom:aStream. |
60 | 860 |
aStream close. |
861 |
fileName := aFileName |
|
862 |
] |
|
863 |
||
109 | 864 |
|
60 | 865 |
! |
866 |
||
867 |
saveAs:aFileName |
|
868 |
|aStream| |
|
869 |
||
870 |
aStream := FileStream newFileNamed:aFileName. |
|
871 |
||
872 |
aStream notNil ifTrue:[ |
|
109 | 873 |
self painter storeContentsOn:aStream. |
60 | 874 |
aStream close. |
875 |
fileName := aFileName |
|
876 |
]. |
|
877 |
||
878 |
! ! |
|
879 |
||
109 | 880 |
!UIPainter methodsFor:'private'! |
881 |
||
882 |
painter |
|
883 |
^ objectList painter |
|
884 |
! ! |
|
885 |
||
886 |
!UIPainter methodsFor:'selection'! |
|
887 |
||
888 |
tabSelection |
|
889 |
^ tabSelection |
|
890 |
! |
|
891 |
||
892 |
tabSelection:something |
|
893 |
|specEdited slices spec idx| |
|
60 | 894 |
|
121 | 895 |
something isNil ifTrue:[^ self]. |
896 |
||
897 |
tabSelection := something. |
|
898 |
||
899 |
(specEdited := specView specEdited) notNil ifTrue:[ |
|
900 |
slices := specEdited class slices. |
|
901 |
lastSlice := tabSelection. |
|
109 | 902 |
|
121 | 903 |
idx:= slices findFirst:[:aSlice| aSlice first = tabSelection ]. |
904 |
idx == 0 ifTrue:[ |
|
144 | 905 |
layoutTool update. |
121 | 906 |
^ layoutTool raise. |
907 |
]. |
|
908 |
spec := specEdited class perform:((slices at:idx) last). |
|
60 | 909 |
]. |
121 | 910 |
specView raise. |
911 |
||
109 | 912 |
specEdited isNil ifTrue:[ |
121 | 913 |
specView buildFromSpec:nil |
109 | 914 |
] ifFalse:[ |
915 |
specView buildFromSpec:spec |
|
916 |
] |
|
60 | 917 |
! ! |
918 |
||
109 | 919 |
!UIPainter methodsFor:'startup / release'! |
920 |
||
921 |
closeRequest |
|
922 |
"close all windows open by builder |
|
923 |
" |
|
133 | 924 |
|anyUnsavedChanges| |
925 |
||
926 |
objectList painter isModified ifTrue:[ |
|
927 |
(self confirm:'quit without saving ?') ifFalse:[ |
|
928 |
^ self |
|
929 |
] |
|
930 |
]. |
|
931 |
||
109 | 932 |
objectList removeDependent:self. |
933 |
objectList painter release. |
|
60 | 934 |
|
109 | 935 |
selectionPanel notNil ifTrue:[ |
936 |
selectionPanel closeRequest |
|
937 |
]. |
|
149 | 938 |
selectionPanel := nil. |
939 |
layoutTool := nil. |
|
940 |
objectList := nil. |
|
941 |
activeHelpTool := nil. |
|
942 |
||
109 | 943 |
super closeRequest. |
944 |
||
945 |
! |
|
946 |
||
947 |
closeRequestFor:aTopView |
|
948 |
"handle a close request for a specific view |
|
949 |
" |
|
60 | 950 |
|topView| |
951 |
||
109 | 952 |
topView := self window. |
60 | 953 |
|
109 | 954 |
topView == aTopView ifTrue:[ |
955 |
super closeRequestFor:aTopView |
|
956 |
] ifFalse:[ |
|
133 | 957 |
topView raise. |
958 |
topView device beep |
|
109 | 959 |
]. |
60 | 960 |
! |
961 |
||
109 | 962 |
openInterface |
963 |
"open interfaces |
|
964 |
" |
|
136 | 965 |
|painterView painter cls topView| |
60 | 966 |
|
967 |
aspects := IdentityDictionary new. |
|
968 |
||
969 |
aspects at:#classNameChannel put:( |
|
970 |
(specClass notNil ifTrue:[specClass] |
|
971 |
ifFalse:['NewApplication']) asValue |
|
972 |
). |
|
973 |
specSuperclass isNil ifTrue:[ |
|
974 |
specClass notNil ifTrue:[ |
|
975 |
(cls := Smalltalk at:specClass asSymbol) notNil ifTrue:[ |
|
976 |
specSuperclass := cls superclass name. |
|
977 |
] |
|
978 |
] |
|
979 |
]. |
|
980 |
aspects at:#superclassNameChannel put:( |
|
981 |
(specSuperclass notNil ifTrue:[specSuperclass] |
|
982 |
ifFalse:['ApplicationModel']) asValue |
|
983 |
). |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
984 |
aspects at:#superclassNameDefaults put:#('ApplicationModel' 'SimpleDialog') asValue. |
60 | 985 |
aspects at:#methodNameChannel put:( |
986 |
(specSelector notNil ifTrue:[specSelector] |
|
987 |
ifFalse:[#windowSpec]) asValue |
|
988 |
). |
|
136 | 989 |
|
990 |
painterView := StandardSystemView new. |
|
991 |
painterView label:'unnamed canvas'. |
|
992 |
painterView extent:300@300. |
|
993 |
||
994 |
painter := UIPainterView in:painterView. |
|
109 | 995 |
painter layout:(0.0 @ 0.0 corner:1.0 @ 1.0) asLayout. |
136 | 996 |
|
109 | 997 |
objectList := painter listHolder. |
998 |
objectList addDependent:self. |
|
136 | 999 |
|
109 | 1000 |
super openInterface. |
60 | 1001 |
|
136 | 1002 |
topView := self window. |
1003 |
topView bePartner. |
|
1004 |
topView label:'Interface Builder'. |
|
1005 |
topView icon:(Image fromFile:'bitmaps/Builder.xbm' resolution:100). |
|
1006 |
||
1007 |
painterView openInGroup:(topView windowGroup). |
|
1008 |
painterView bePartner. |
|
1009 |
painterView application:self. |
|
1010 |
painterView open. |
|
1011 |
||
1012 |
painterView application:self. |
|
1013 |
selectionPanel := UISelectionPanel newDefault. |
|
1014 |
selectionPanel allButOpenInterface:#windowSpec. |
|
1015 |
selectionPanel window openInGroup:(topView windowGroup). |
|
1016 |
selectionPanel window bePartner. |
|
1017 |
selectionPanel openWindow. |
|
1018 |
selectionPanel window application:self. |
|
1019 |
||
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1020 |
"Modified: 17.6.1997 / 13:06:25 / cg" |
60 | 1021 |
! |
1022 |
||
1023 |
openNewWindowCanvas |
|
109 | 1024 |
"open new |
1025 |
" |
|
60 | 1026 |
self open. |
1027 |
||
1028 |
||
1029 |
! |
|
1030 |
||
109 | 1031 |
openOnClass:aClass |
1032 |
"open up an interface builder |
|
1033 |
" |
|
1034 |
self openOnClass:aClass andSelector:#windowSpec |
|
1035 |
! |
|
1036 |
||
60 | 1037 |
openOnClass:aClass andSelector:aSelector |
1038 |
"open up an interface builder, fetching a spec from someClass |
|
109 | 1039 |
via some selector |
1040 |
" |
|
1041 |
|painter| |
|
60 | 1042 |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1043 |
aClass isNil ifTrue:[ |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1044 |
self warn:'nil class given (class was probably renamed ?)'. |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1045 |
]. |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1046 |
|
109 | 1047 |
self openInterface. |
60 | 1048 |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1049 |
aClass notNil ifTrue:[ |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1050 |
painter := self painter. |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1051 |
specClass := aClass name. |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1052 |
specSuperclass := aClass superclass name. |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1053 |
specSelector := aSelector. |
60 | 1054 |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1055 |
(aspects at:#classNameChannel) value:specClass. |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1056 |
(aspects at:#superclassNameChannel) value:specSuperclass. |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1057 |
(aspects at:#methodNameChannel) value:specSelector. |
60 | 1058 |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1059 |
painter className:aClass name. |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1060 |
painter methodName:aSelector. |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1061 |
painter setupFromSpec:(aClass perform:aSelector). |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1062 |
] |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1063 |
|
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1064 |
"Modified: 17.6.1997 / 13:04:48 / cg" |
60 | 1065 |
! ! |
1066 |
||
109 | 1067 |
!UIPainter methodsFor:'user interaction - dialog'! |
60 | 1068 |
|
1069 |
checkClassAndSelector |
|
1070 |
"check for class & superclass" |
|
1071 |
||
1072 |
|superclass cls| |
|
1073 |
||
1074 |
specClass isNil ifTrue:[^ false]. |
|
1075 |
||
1076 |
specClass isBehavior ifFalse:[ |
|
1077 |
cls := Smalltalk at:specClass asSymbol |
|
1078 |
] ifTrue:[ |
|
1079 |
cls := specClass |
|
1080 |
]. |
|
1081 |
cls isNil ifTrue:[ |
|
1082 |
(superclass := Smalltalk at:specSuperclass asSymbol) isNil ifTrue:[ |
|
1083 |
self warn:'no class named ' , specSuperclass , ' exists.'. |
|
1084 |
^ false. |
|
1085 |
]. |
|
1086 |
(self confirm:'create ' , specClass , ' ?') ifTrue:[ |
|
1087 |
superclass subclass:(specClass asSymbol) |
|
1088 |
instanceVariableNames:'' |
|
1089 |
classVariableNames:'' |
|
1090 |
poolDictionaries:'' |
|
1091 |
category:'New-Applications'. |
|
1092 |
^ true. |
|
1093 |
]. |
|
1094 |
^ false. |
|
1095 |
]. |
|
1096 |
cls isBehavior ifFalse:[ |
|
1097 |
self warn:'a global named ' , specClass , ' exists, but is no class.'. |
|
1098 |
^ false. |
|
1099 |
]. |
|
1100 |
||
1101 |
specSuperclass isBehavior ifFalse:[ |
|
1102 |
superclass := Smalltalk at:specSuperclass asSymbol |
|
1103 |
] ifTrue:[ |
|
1104 |
superclass := specSuperclass |
|
1105 |
]. |
|
1106 |
specSuperclass notNil ifTrue:[ |
|
1107 |
superclass isNil ifTrue:[ |
|
1108 |
self warn:'no class named ' , specSuperclass , ' exists.'. |
|
1109 |
^ false. |
|
1110 |
]. |
|
1111 |
||
1112 |
(cls isSubclassOf:superclass) ifFalse:[ |
|
1113 |
self warn:'a global named ' , specClass , ' exists, but is not a subclass of ' , superclass name , '.'. |
|
1114 |
^ false. |
|
1115 |
] |
|
1116 |
]. |
|
1117 |
^ true |
|
109 | 1118 |
|
1119 |
||
60 | 1120 |
! |
1121 |
||
1122 |
defineClassAndSelector |
|
1123 |
"launch a dialog to define class, superclass and method" |
|
1124 |
||
1125 |
|again| |
|
1126 |
||
1127 |
[ |
|
1128 |
again := false. |
|
1129 |
(self openDialogInterface:#nameAndSelectorSpec) ifTrue:[ |
|
1130 |
||
1131 |
specClass := (self aspectFor:#classNameChannel) value. |
|
1132 |
specSelector := (self aspectFor:#methodNameChannel) value. |
|
1133 |
specSuperclass := (self aspectFor:#superclassNameChannel) value. |
|
1134 |
||
109 | 1135 |
(again := self checkClassAndSelector not) ifFalse:[ |
1136 |
self painter className:specClass |
|
1137 |
superclassName:specSuperclass |
|
1138 |
selector:specSelector. |
|
1139 |
] |
|
60 | 1140 |
] |
109 | 1141 |
|
60 | 1142 |
] doWhile:[again] |
1143 |
||
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1144 |
"Modified: 17.6.1997 / 13:04:26 / cg" |
60 | 1145 |
! ! |
1146 |
||
109 | 1147 |
!UIPainter methodsFor:'user interaction - pullDown'! |
60 | 1148 |
|
149 | 1149 |
doBrowseAppClass |
1150 |
"open a browser on the class" |
|
1151 |
||
1152 |
|cls| |
|
1153 |
||
1154 |
specClass isNil ifTrue:[ |
|
1155 |
^ self information:'no class yet'. |
|
1156 |
]. |
|
1157 |
||
1158 |
specClass isBehavior ifFalse:[ |
|
1159 |
cls := Smalltalk at:specClass asSymbol |
|
1160 |
] ifTrue:[ |
|
1161 |
cls := specClass |
|
1162 |
]. |
|
1163 |
||
1164 |
cls isNil ifTrue:[ |
|
1165 |
^ self information:'no class yet'. |
|
1166 |
]. |
|
1167 |
||
1168 |
SystemBrowser openInClass:cls |
|
1169 |
||
1170 |
||
1171 |
! |
|
1172 |
||
60 | 1173 |
doFromClass |
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1174 |
|className methodName cls sel accepted failed spec s painter| |
109 | 1175 |
|
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1176 |
objectList painter isModified ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1177 |
(self confirm:'edit another interface without saving your modifications ?') ifFalse:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1178 |
^ self |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1179 |
] |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1180 |
]. |
60 | 1181 |
|
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1182 |
className := '' asValue. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1183 |
methodName := '' asValue. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1184 |
painter := self painter. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1185 |
|
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1186 |
(s := painter className) notNil ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1187 |
className value:s |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1188 |
]. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1189 |
(s := painter methodName) notNil ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1190 |
methodName value:s |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1191 |
]. |
60 | 1192 |
|
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1193 |
failed := false. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1194 |
[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1195 |
accepted := |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1196 |
(DialogBox new |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1197 |
addTextLabel:'Classes name:'; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1198 |
addInputFieldOn:className; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1199 |
addVerticalSpace; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1200 |
addTextLabel:'methods name:'; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1201 |
addInputFieldOn:methodName; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1202 |
addAbortButton; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1203 |
addOkButton; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1204 |
open |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1205 |
) accepted. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1206 |
|
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1207 |
accepted ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1208 |
cls := Smalltalk classNamed:className value. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1209 |
cls isNil ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1210 |
failed := true. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1211 |
self warn:'no such class'. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1212 |
] ifFalse:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1213 |
sel := methodName value asSymbol. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1214 |
(cls respondsTo:sel ) ifFalse:[ |
60 | 1215 |
failed := true. |
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1216 |
self warn:'no such method' |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1217 |
] ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1218 |
spec := cls perform:sel. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1219 |
spec isArray ifFalse:[ |
60 | 1220 |
failed := true. |
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1221 |
self warn:'not a windowSpec method' |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1222 |
]. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1223 |
"/ ok, got it |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1224 |
painter className:className value. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1225 |
painter methodName:methodName value. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1226 |
painter setupFromSpec:spec. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1227 |
^ self |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1228 |
] |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1229 |
] |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1230 |
] |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1231 |
] doWhile:[accepted and:[failed]]. |
60 | 1232 |
|
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1233 |
"Modified: 17.6.1997 / 12:33:36 / cg" |
60 | 1234 |
! |
1235 |
||
1236 |
doInstallAspects |
|
1237 |
|code| |
|
1238 |
||
1239 |
(specClass isNil or:[specSelector isNil]) ifTrue:[ |
|
1240 |
self defineClassAndSelector |
|
1241 |
]. |
|
1242 |
||
1243 |
self checkClassAndSelector ifFalse:[ |
|
1244 |
^ self |
|
1245 |
]. |
|
1246 |
||
109 | 1247 |
self painter className:specClass |
1248 |
superclassName:specSuperclass |
|
1249 |
selector:specSelector. |
|
60 | 1250 |
|
109 | 1251 |
code := self painter generateAspectMethods. |
60 | 1252 |
(ReadStream on:code) fileIn. |
1253 |
||
1254 |
! |
|
1255 |
||
152 | 1256 |
doInstallHelp |
1257 |
|dict cls src| |
|
1258 |
||
1259 |
specClass isNil ifTrue:[ |
|
1260 |
^ self information:'no class defined' |
|
1261 |
]. |
|
1262 |
specClass isBehavior ifFalse:[ |
|
1263 |
cls := Smalltalk at:specClass asSymbol |
|
1264 |
] ifTrue:[ |
|
1265 |
cls := specClass |
|
1266 |
]. |
|
1267 |
||
1268 |
cls isNil ifTrue:[ |
|
1269 |
^ self information:'no class yet'. |
|
1270 |
]. |
|
1271 |
||
1272 |
activeHelpTool isNil ifTrue:[ |
|
1273 |
^ self information:'no help text defined' |
|
1274 |
]. |
|
1275 |
dict := activeHelpTool dictionary. |
|
1276 |
||
1277 |
src := '' writeStream. |
|
1278 |
src nextPutAll:'helpSpec |
|
1279 |
"return a dictionary filled with helpKey -> helptext associations. |
|
1280 |
These are used by the activeHelp tool." |
|
1281 |
||
1282 |
|dict| |
|
1283 |
||
1284 |
dict := super helpSpec. |
|
1285 |
'. |
|
1286 |
||
1287 |
dict keysAndValuesDo:[:key :txt | |
|
1288 |
|t| |
|
1289 |
||
1290 |
t := txt asString. |
|
1291 |
(t endsWith:Character cr) ifTrue:[t := t copyWithoutLast:1]. |
|
1292 |
src nextPutLine:' dict at:' , key storeString , ' put:' , t storeString , '.'. |
|
1293 |
]. |
|
1294 |
src nextPutLine:' ^ dict'. |
|
1295 |
src := src contents. |
|
1296 |
Compiler compile:src forClass:cls class inCategory:'help specs' |
|
1297 |
! |
|
1298 |
||
60 | 1299 |
doInstallSpec |
1300 |
|code| |
|
1301 |
||
1302 |
(specClass isNil or:[specSelector isNil]) ifTrue:[ |
|
1303 |
self defineClassAndSelector |
|
1304 |
]. |
|
1305 |
||
1306 |
self checkClassAndSelector ifFalse:[ |
|
1307 |
^ self |
|
1308 |
]. |
|
1309 |
||
109 | 1310 |
self painter className:specClass |
1311 |
superclassName:specSuperclass |
|
1312 |
selector:specSelector. |
|
60 | 1313 |
|
109 | 1314 |
code := self painter generateCode. |
60 | 1315 |
(ReadStream on:code) fileIn. |
1316 |
||
1317 |
! |
|
1318 |
||
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1319 |
doNew |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1320 |
objectList painter isModified ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1321 |
(self confirm:'new interface without saving your modifications ?') ifFalse:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1322 |
^ self |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1323 |
] |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1324 |
]. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1325 |
|
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1326 |
self removeAll |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1327 |
|
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1328 |
"Modified: 17.6.1997 / 12:33:31 / cg" |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1329 |
! |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1330 |
|
60 | 1331 |
doOpen |
1332 |
|box| |
|
1333 |
||
1334 |
box := FileSelectionBox new. |
|
1335 |
box title:(resources string:'Which file ?'). |
|
1336 |
box selectingDirectory:false. |
|
1337 |
box pattern:'*.*'. |
|
1338 |
box action:[:aFile| self openFile:aFile ]. |
|
1339 |
box open |
|
109 | 1340 |
|
60 | 1341 |
! |
1342 |
||
1343 |
doPickAView |
|
109 | 1344 |
|painter view className methodName cls sel accepted spec s| |
60 | 1345 |
|
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1346 |
objectList painter isModified ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1347 |
(self confirm:'pick another interface without saving your modifications ?') ifFalse:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1348 |
^ self |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1349 |
] |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1350 |
]. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1351 |
|
109 | 1352 |
(view := Display viewFromUser) notNil ifTrue:[ |
1353 |
painter := self painter. |
|
60 | 1354 |
|
109 | 1355 |
spec := UISpecification fromView:view topView. |
60 | 1356 |
|
109 | 1357 |
"/ ok, got it |
1358 |
painter setupFromSpec:spec. |
|
1359 |
painter className:view class name. |
|
1360 |
painter methodName:#newSpec. |
|
1361 |
] |
|
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1362 |
|
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1363 |
"Modified: 17.6.1997 / 12:33:23 / cg" |
60 | 1364 |
! |
1365 |
||
1366 |
doRaise |
|
109 | 1367 |
self painter topView raise. |
1368 |
||
1369 |
selectionPanel notNil ifTrue:[ |
|
1370 |
selectionPanel window raise |
|
1371 |
] |
|
1372 |
||
60 | 1373 |
! |
1374 |
||
1375 |
doSave |
|
1376 |
fileName notNil ifTrue:[ |
|
1377 |
self saveAs:fileName |
|
1378 |
] ifFalse:[ |
|
1379 |
self doSaveAs |
|
1380 |
] |
|
109 | 1381 |
|
60 | 1382 |
! |
1383 |
||
1384 |
doSaveAs |
|
1385 |
|box| |
|
1386 |
||
1387 |
box := FileSelectionBox new. |
|
1388 |
box title:(resources string:'Which file ?'). |
|
1389 |
box selectingDirectory:false. |
|
1390 |
box pattern:'*.*'. |
|
1391 |
box action:[:aFile| self saveAs:aFile ]. |
|
1392 |
box open |
|
1393 |
||
1394 |
! |
|
1395 |
||
149 | 1396 |
doStartApplication |
1397 |
|cls| |
|
1398 |
||
1399 |
(specClass isNil or:[specSelector isNil]) ifTrue:[ |
|
1400 |
^ self information:'no class or selector defined'. |
|
1401 |
]. |
|
1402 |
||
1403 |
specClass isBehavior ifFalse:[ |
|
1404 |
cls := Smalltalk at:specClass asSymbol |
|
1405 |
] ifTrue:[ |
|
1406 |
cls := specClass |
|
1407 |
]. |
|
1408 |
||
1409 |
cls isNil ifTrue:[ |
|
1410 |
^ self information:'class not existant'. |
|
1411 |
]. |
|
1412 |
||
1413 |
(cls respondsTo:specSelector) ifFalse:[ |
|
1414 |
^ self information:'selector not defined'. |
|
1415 |
]. |
|
1416 |
cls new openInterface:specSelector |
|
1417 |
! |
|
1418 |
||
60 | 1419 |
doWindowSpec |
68 | 1420 |
|code code2 v| |
60 | 1421 |
|
109 | 1422 |
code := self painter generateWindowSpecMethodSource. |
68 | 1423 |
|
60 | 1424 |
v := CodeView open. |
1425 |
v contents:code. |
|
1426 |
v label:'windowSpec'. |
|
1427 |
||
81 | 1428 |
! ! |
1429 |
||
60 | 1430 |
!UIPainter class methodsFor:'documentation'! |
1431 |
||
1432 |
version |
|
1433 |
^ '$Header$' |
|
1434 |
! ! |