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