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