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