author | ca |
Mon, 23 Jun 1997 12:53:14 +0200 | |
changeset 174 | 0e87610c2768 |
parent 173 | a8468f4e83f0 |
child 176 | a9e5b1615761 |
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 |
) |
|
173 | 605 |
#(#ToggleSpec |
606 |
#'name:' 'galleryLabel' |
|
607 |
#'layout:' #(#LayoutFrame -162 1.0 1 0 -82 1.0 23 0) |
|
171 | 608 |
#'flags:' 0 |
609 |
#'label:' 'Gallery' |
|
173 | 610 |
#'model:' #galleryShown |
611 |
#'isTriggerOnDown:' true |
|
612 |
#'showLamp:' true |
|
613 |
#'lampColor:' #(#Color 100.0 100.0 0.0) |
|
171 | 614 |
) |
173 | 615 |
#(#ToggleSpec |
616 |
#'name:' 'painterLabel' |
|
617 |
#'layout:' #(#LayoutFrame -81 1.0 1 0 -1 1.0 23 0) |
|
171 | 618 |
#'flags:' 0 |
619 |
#'label:' 'Painter' |
|
173 | 620 |
#'model:' #painterShown |
621 |
#'isTriggerOnDown:' true |
|
622 |
#'showLamp:' true |
|
623 |
#'lampColor:' #(#Color 100.0 100.0 0.0) |
|
171 | 624 |
) |
109 | 625 |
) |
626 |
) |
|
627 |
) |
|
60 | 628 |
! ! |
629 |
||
109 | 630 |
!UIPainter methodsFor:'actions'! |
60 | 631 |
|
109 | 632 |
accept |
633 |
|layout| |
|
60 | 634 |
|
166 | 635 |
objectList removeDependent:self. |
636 |
||
637 |
self isLayoutToolSelected ifTrue:[ |
|
144 | 638 |
(layout := layoutTool layout) notNil ifTrue:[ |
639 |
layoutTool layoutType == #Extent ifTrue:[ |
|
640 |
self painter setExtent:layout |
|
641 |
] ifFalse:[ |
|
149 | 642 |
self painter setLayout:layout |
109 | 643 |
] |
144 | 644 |
] |
645 |
] ifFalse:[ |
|
166 | 646 |
self isHelpToolSelected ifTrue:[ |
149 | 647 |
activeHelpTool accept |
648 |
]. |
|
171 | 649 |
self painter updateFromSpec:(specTool specification). |
144 | 650 |
]. |
166 | 651 |
self modifiedChannel value:false. |
652 |
objectList addDependent:self. |
|
109 | 653 |
|
654 |
! |
|
655 |
||
656 |
cancel |
|
657 |
"cancel all changes and read back attributes from current view |
|
658 |
" |
|
166 | 659 |
self modifiedChannel value ifTrue:[ |
171 | 660 |
specTool specification:(self painter specForSelection). |
166 | 661 |
layoutTool layoutView:(layoutTool layoutView). |
662 |
self modifiedChannel value:false. |
|
663 |
] |
|
137 | 664 |
! |
665 |
||
666 |
doubleClick |
|
667 |
objectList selectGroup |
|
60 | 668 |
! ! |
669 |
||
149 | 670 |
!UIPainter methodsFor:'active help'! |
671 |
||
171 | 672 |
activeHelpApplicationClass |
673 |
"gets application class keeping the associated help component |
|
674 |
" |
|
675 |
|cls| |
|
676 |
||
677 |
specClass notNil ifTrue:[ |
|
678 |
specClass isBehavior ifFalse:[cls := Smalltalk at:specClass asSymbol] |
|
679 |
ifTrue:[cls := specClass]. |
|
680 |
||
681 |
(cls isSubclassOf:UISpecification) ifTrue:[ |
|
682 |
cls := UISpecificationTool |
|
683 |
] |
|
684 |
]. |
|
685 |
^ cls |
|
686 |
! |
|
687 |
||
149 | 688 |
activeHelpTool |
152 | 689 |
|cls| |
690 |
||
149 | 691 |
activeHelpTool isNil ifTrue:[ |
152 | 692 |
activeHelpTool := UIHelpTool new. |
693 |
||
171 | 694 |
(cls := self activeHelpApplicationClass) notNil ifTrue:[ |
166 | 695 |
activeHelpTool dictionary:(cls helpSpec). |
171 | 696 |
] |
149 | 697 |
]. |
698 |
^ activeHelpTool |
|
699 |
! |
|
700 |
||
701 |
showHelp:aHelpText for:view |
|
702 |
"hook to allow an application to display active help |
|
703 |
texts in its own info area. |
|
704 |
This method may be redefined in a concrete application. |
|
705 |
If it returns false, the ActiveHelp manager will popup a |
|
706 |
bubble with the help text." |
|
707 |
||
708 |
|l| |
|
709 |
||
710 |
(l := self builder componentAt:#helpInfo) notNil ifTrue:[ |
|
152 | 711 |
aHelpText replaceAll:(Character cr) by:(Character space). |
149 | 712 |
l label:aHelpText. |
152 | 713 |
^ true. |
149 | 714 |
]. |
715 |
^ false |
|
716 |
||
717 |
||
718 |
! ! |
|
719 |
||
60 | 720 |
!UIPainter methodsFor:'aspects'! |
721 |
||
118 | 722 |
enableChannel |
723 |
"true if modifications are allowed otherwise running test |
|
724 |
" |
|
725 |
^ self painter enableChannel |
|
109 | 726 |
! |
727 |
||
173 | 728 |
galleryShown |
729 |
|holder| |
|
730 |
||
731 |
(holder := builder bindingAt:#galleryShown) isNil ifTrue:[ |
|
732 |
builder aspectAt:#galleryShown put:(holder := true asValue). |
|
733 |
holder addDependent:self |
|
734 |
]. |
|
735 |
^ holder |
|
736 |
||
737 |
! |
|
738 |
||
118 | 739 |
menuAlignment |
740 |
|menu channel| |
|
741 |
||
742 |
channel := self enableChannel. |
|
743 |
||
744 |
menu := Menu new. |
|
745 |
menu fromLiteralArrayEncoding:(self class menuAlignment). |
|
746 |
menu receiver:self. |
|
747 |
menu menuItems do:[:anItem| anItem enabled:channel]. |
|
748 |
^ menu |
|
749 |
! |
|
750 |
||
751 |
menuPullDown |
|
752 |
|menu channel| |
|
753 |
||
754 |
channel := self enableChannel. |
|
755 |
||
756 |
menu := Menu new. |
|
757 |
menu fromLiteralArrayEncoding:(self class menuPullDown). |
|
758 |
menu receiver:self. |
|
759 |
||
760 |
menu menuItems do:[:anItem| |
|
761 |
anItem nameKey ~~ #test ifTrue:[anItem enabled:channel] |
|
133 | 762 |
ifFalse:[anItem value:channel]. |
118 | 763 |
]. |
764 |
^ menu |
|
109 | 765 |
! |
766 |
||
767 |
modifiedChannel |
|
768 |
||
769 |
|holder| |
|
770 |
||
771 |
(holder := builder bindingAt:#modifiedChannel) isNil ifTrue:[ |
|
772 |
builder aspectAt:#modifiedChannel put:(holder := false asValue). |
|
773 |
]. |
|
774 |
^ holder |
|
775 |
! |
|
776 |
||
777 |
noteBookView |
|
778 |
"automatically generated by UIPainter ..." |
|
779 |
||
166 | 780 |
|noteBook channel n1 n2| |
109 | 781 |
|
782 |
(noteBook := builder bindingAt:#noteBookView) isNil ifTrue:[ |
|
166 | 783 |
noteBook := View new. |
784 |
layoutTool := UILayoutTool new. |
|
785 |
specTool := UISpecificationTool new. |
|
144 | 786 |
channel := self modifiedChannel. |
166 | 787 |
|
152 | 788 |
layoutTool masterApplication:self. |
166 | 789 |
specTool masterApplication:self. |
790 |
||
791 |
n1 := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook. |
|
792 |
n2 := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook. |
|
793 |
||
794 |
n1 client:layoutTool. |
|
795 |
specTool builder:(n2 client:specTool). |
|
796 |
||
797 |
layoutTool masterApplication:self. |
|
798 |
specTool masterApplication:self. |
|
109 | 799 |
layoutTool modifiedHolder:channel. |
166 | 800 |
specTool modifiedHolder:channel. |
109 | 801 |
builder aspectAt:#noteBookView put:noteBook. |
802 |
]. |
|
803 |
^ noteBook |
|
804 |
! |
|
805 |
||
806 |
objectList |
|
807 |
^ objectList |
|
808 |
! |
|
809 |
||
810 |
objectListMenu |
|
811 |
"returns a block which returns the menu |
|
114 | 812 |
!!hack!! |
109 | 813 |
" |
121 | 814 |
^ [ self painter showMiddleButtonMenu ]. |
109 | 815 |
|
816 |
||
817 |
||
818 |
! |
|
819 |
||
173 | 820 |
painterShown |
821 |
|holder| |
|
822 |
||
823 |
(holder := builder bindingAt:#painterShown) isNil ifTrue:[ |
|
824 |
builder aspectAt:#painterShown put:(holder := true asValue). |
|
825 |
holder addDependent:self |
|
826 |
]. |
|
827 |
^ holder |
|
828 |
||
829 |
! |
|
830 |
||
109 | 831 |
tabList |
832 |
"automatically generated by UIPainter ..." |
|
833 |
||
834 |
|holder| |
|
835 |
||
836 |
(holder := builder bindingAt:#tabList) isNil ifTrue:[ |
|
837 |
builder aspectAt:#tabList put:(holder := ValueHolder new). |
|
144 | 838 |
holder value:#( 'Properties' ). |
109 | 839 |
]. |
840 |
^ holder |
|
841 |
! |
|
842 |
||
843 |
tabModel |
|
844 |
"automatically generated by UIPainter ..." |
|
845 |
||
846 |
|holder| |
|
847 |
||
848 |
(holder := builder bindingAt:#tabModel) isNil ifTrue:[ |
|
849 |
holder := AspectAdaptor new subject:self; forAspect:#tabSelection. |
|
850 |
builder aspectAt:#tabModel put:holder. |
|
851 |
]. |
|
852 |
^ holder |
|
60 | 853 |
! ! |
854 |
||
109 | 855 |
!UIPainter methodsFor:'binding access'! |
856 |
||
857 |
aspectFor:aKey |
|
858 |
"check wether aspect is assigned to a label icon |
|
859 |
" |
|
860 |
(aKey startsWith:'LABEL') ifFalse:[ |
|
861 |
^ aspects at:aKey ifAbsent:[ super aspectFor:aKey ] |
|
862 |
]. |
|
863 |
^ Image fromFile:(aKey copyFrom:(('LABEL' size) + 1)) |
|
864 |
! ! |
|
865 |
||
866 |
!UIPainter methodsFor:'change & update'! |
|
867 |
||
868 |
update:something with:aParameter from:someObject |
|
869 |
||
870 |
(someObject == objectList and:[something ~~ #list]) ifTrue:[ |
|
871 |
something ~~ #layout ifTrue:[ |
|
872 |
self objectListChanged |
|
873 |
] ifFalse:[ |
|
166 | 874 |
self modifiedChannel value ifTrue:[ |
875 |
^ self |
|
876 |
]. |
|
877 |
layoutTool update |
|
878 |
]. |
|
173 | 879 |
^ self modifiedChannel value:false |
880 |
]. |
|
881 |
||
882 |
self galleryShown == someObject ifTrue:[ |
|
883 |
(self galleryShown value) ifTrue:[ |
|
884 |
self raiseUIView:(selectionPanel window) |
|
885 |
] ifFalse:[ |
|
886 |
self hideUIView:(selectionPanel window) |
|
887 |
]. |
|
888 |
^ self |
|
889 |
]. |
|
890 |
||
891 |
self painterShown == someObject ifTrue:[ |
|
892 |
(self painterShown value) ifTrue:[ |
|
893 |
self raiseUIView:(self painter topView) |
|
894 |
] ifFalse:[ |
|
895 |
self hideUIView:(self painter topView) |
|
896 |
]. |
|
897 |
^ self |
|
898 |
]. |
|
899 |
||
109 | 900 |
! ! |
901 |
||
902 |
!UIPainter methodsFor:'event handling'! |
|
903 |
||
904 |
doesNotUnderstand:aMessage |
|
905 |
|painter| |
|
906 |
||
907 |
painter := self painter. |
|
908 |
||
909 |
(painter respondsTo:(aMessage selector)) ifTrue:[ |
|
910 |
^ aMessage sendTo:painter |
|
911 |
]. |
|
149 | 912 |
super doesNotUnderstand:aMessage |
109 | 913 |
|
914 |
! |
|
915 |
||
916 |
objectListChanged |
|
917 |
"something changed in the painter view |
|
918 |
" |
|
171 | 919 |
|oldSelection view slices list spec props size nameOfSpec| |
109 | 920 |
|
921 |
props := objectList selectedProperty. |
|
166 | 922 |
oldSelection := tabSelection. |
109 | 923 |
tabSelection := nil. |
924 |
||
925 |
props isNil ifFalse:[ |
|
144 | 926 |
view := props view. |
927 |
spec := props spec copy. |
|
142 | 928 |
|
166 | 929 |
layoutTool layoutView == view ifFalse:[ |
144 | 930 |
slices := spec class slices. |
931 |
size := slices size + 1. |
|
932 |
list := Array new:size. |
|
933 |
slices keysAndValuesDo:[:i :s|list at:i put:(s first asString)]. |
|
166 | 934 |
list at:size put:(layoutTool class label). |
144 | 935 |
(self tabList) value:list. |
936 |
] ifTrue:[ |
|
937 |
list := self tabList value |
|
142 | 938 |
]. |
166 | 939 |
(list findFirst:[:n| n = oldSelection ]) ~~ 0 ifTrue:[ |
940 |
tabSelection := oldSelection |
|
941 |
] ifFalse:[ |
|
942 |
tabSelection := list first |
|
171 | 943 |
]. |
944 |
nameOfSpec := spec class name. |
|
945 |
] ifTrue:[ |
|
946 |
nameOfSpec := '' |
|
109 | 947 |
]. |
171 | 948 |
|
949 |
self showHelp:nameOfSpec for:nil. |
|
950 |
||
166 | 951 |
layoutTool layoutView:view. |
171 | 952 |
specTool specification:spec. |
60 | 953 |
|
166 | 954 |
tabSelection notNil ifTrue:[ |
955 |
self isLayoutToolSelected ifTrue:[ |
|
956 |
(self noteBookView subViews at:1) raise |
|
957 |
] ifFalse:[ |
|
958 |
specTool selection:tabSelection. |
|
959 |
(self noteBookView subViews at:2) raise |
|
960 |
] |
|
60 | 961 |
]. |
962 |
||
168 | 963 |
(builder componentAt:#noteBook) setSelection:tabSelection. |
166 | 964 |
self modifiedChannel value:false. |
60 | 965 |
! ! |
966 |
||
109 | 967 |
!UIPainter methodsFor:'private'! |
968 |
||
173 | 969 |
hideUIView:aView |
970 |
aView beIndependent. |
|
971 |
aView unmap. |
|
972 |
! |
|
973 |
||
109 | 974 |
painter |
975 |
^ objectList painter |
|
173 | 976 |
! |
977 |
||
978 |
raiseUIView:aView |
|
979 |
aView map. |
|
980 |
aView bePartner. |
|
109 | 981 |
! ! |
982 |
||
166 | 983 |
!UIPainter methodsFor:'queries'! |
984 |
||
985 |
isHelpToolSelected |
|
986 |
^ tabSelection = 'Help' |
|
987 |
! |
|
988 |
||
989 |
isLayoutToolSelected |
|
990 |
^ tabSelection = layoutTool class label |
|
991 |
! ! |
|
992 |
||
109 | 993 |
!UIPainter methodsFor:'selection'! |
994 |
||
995 |
tabSelection |
|
996 |
^ tabSelection |
|
997 |
! |
|
998 |
||
999 |
tabSelection:something |
|
166 | 1000 |
|raiseViewIdx| |
121 | 1001 |
|
166 | 1002 |
something notNil ifTrue:[ |
1003 |
raiseViewIdx := 1. |
|
1004 |
tabSelection := something. |
|
109 | 1005 |
|
166 | 1006 |
self isLayoutToolSelected ifFalse:[ |
1007 |
specTool selection:tabSelection. |
|
1008 |
raiseViewIdx := 2 |
|
121 | 1009 |
]. |
166 | 1010 |
(self noteBookView subViews at:raiseViewIdx) raise. |
1011 |
self cancel. |
|
109 | 1012 |
] |
60 | 1013 |
! ! |
1014 |
||
109 | 1015 |
!UIPainter methodsFor:'startup / release'! |
1016 |
||
1017 |
closeRequest |
|
1018 |
"close all windows open by builder |
|
1019 |
" |
|
133 | 1020 |
|anyUnsavedChanges| |
1021 |
||
1022 |
objectList painter isModified ifTrue:[ |
|
1023 |
(self confirm:'quit without saving ?') ifFalse:[ |
|
1024 |
^ self |
|
1025 |
] |
|
1026 |
]. |
|
1027 |
||
109 | 1028 |
objectList removeDependent:self. |
1029 |
objectList painter release. |
|
60 | 1030 |
|
109 | 1031 |
selectionPanel notNil ifTrue:[ |
1032 |
selectionPanel closeRequest |
|
1033 |
]. |
|
149 | 1034 |
selectionPanel := nil. |
1035 |
layoutTool := nil. |
|
1036 |
objectList := nil. |
|
1037 |
activeHelpTool := nil. |
|
1038 |
||
109 | 1039 |
super closeRequest. |
1040 |
||
1041 |
! |
|
1042 |
||
1043 |
closeRequestFor:aTopView |
|
1044 |
"handle a close request for a specific view |
|
1045 |
" |
|
173 | 1046 |
|topView| |
60 | 1047 |
|
109 | 1048 |
topView := self window. |
60 | 1049 |
|
109 | 1050 |
topView == aTopView ifTrue:[ |
1051 |
super closeRequestFor:aTopView |
|
1052 |
] ifFalse:[ |
|
173 | 1053 |
aTopView = selectionPanel window ifTrue:[ |
1054 |
self galleryShown value:false |
|
1055 |
] ifFalse:[ |
|
1056 |
self painterShown value:false |
|
1057 |
]. |
|
133 | 1058 |
topView raise. |
109 | 1059 |
]. |
60 | 1060 |
! |
1061 |
||
109 | 1062 |
openInterface |
1063 |
"open interfaces |
|
1064 |
" |
|
136 | 1065 |
|painterView painter cls topView| |
60 | 1066 |
|
1067 |
aspects := IdentityDictionary new. |
|
1068 |
||
1069 |
aspects at:#classNameChannel put:( |
|
1070 |
(specClass notNil ifTrue:[specClass] |
|
1071 |
ifFalse:['NewApplication']) asValue |
|
1072 |
). |
|
1073 |
specSuperclass isNil ifTrue:[ |
|
1074 |
specClass notNil ifTrue:[ |
|
1075 |
(cls := Smalltalk at:specClass asSymbol) notNil ifTrue:[ |
|
1076 |
specSuperclass := cls superclass name. |
|
1077 |
] |
|
1078 |
] |
|
1079 |
]. |
|
1080 |
aspects at:#superclassNameChannel put:( |
|
1081 |
(specSuperclass notNil ifTrue:[specSuperclass] |
|
1082 |
ifFalse:['ApplicationModel']) asValue |
|
1083 |
). |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1084 |
aspects at:#superclassNameDefaults put:#('ApplicationModel' 'SimpleDialog') asValue. |
60 | 1085 |
aspects at:#methodNameChannel put:( |
161 | 1086 |
(specSelector notNil ifTrue:[specSelector asValue] |
60 | 1087 |
ifFalse:[#windowSpec]) asValue |
1088 |
). |
|
136 | 1089 |
|
1090 |
painterView := StandardSystemView new. |
|
1091 |
painterView label:'unnamed canvas'. |
|
1092 |
painterView extent:300@300. |
|
1093 |
||
1094 |
painter := UIPainterView in:painterView. |
|
109 | 1095 |
painter layout:(0.0 @ 0.0 corner:1.0 @ 1.0) asLayout. |
136 | 1096 |
|
109 | 1097 |
objectList := painter listHolder. |
1098 |
objectList addDependent:self. |
|
136 | 1099 |
|
109 | 1100 |
super openInterface. |
60 | 1101 |
|
136 | 1102 |
topView := self window. |
1103 |
topView bePartner. |
|
1104 |
topView label:'Interface Builder'. |
|
1105 |
topView icon:(Image fromFile:'bitmaps/Builder.xbm' resolution:100). |
|
1106 |
||
1107 |
painterView openInGroup:(topView windowGroup). |
|
1108 |
painterView bePartner. |
|
1109 |
painterView application:self. |
|
1110 |
painterView open. |
|
1111 |
||
1112 |
painterView application:self. |
|
1113 |
selectionPanel := UISelectionPanel newDefault. |
|
1114 |
selectionPanel allButOpenInterface:#windowSpec. |
|
1115 |
selectionPanel window openInGroup:(topView windowGroup). |
|
1116 |
selectionPanel window bePartner. |
|
1117 |
selectionPanel openWindow. |
|
1118 |
selectionPanel window application:self. |
|
1119 |
||
161 | 1120 |
"Modified: 17.6.1997 / 14:41:15 / cg" |
60 | 1121 |
! |
1122 |
||
1123 |
openNewWindowCanvas |
|
109 | 1124 |
"open new |
1125 |
" |
|
60 | 1126 |
self open. |
1127 |
||
1128 |
||
1129 |
! |
|
1130 |
||
109 | 1131 |
openOnClass:aClass |
1132 |
"open up an interface builder |
|
1133 |
" |
|
1134 |
self openOnClass:aClass andSelector:#windowSpec |
|
1135 |
! |
|
1136 |
||
60 | 1137 |
openOnClass:aClass andSelector:aSelector |
1138 |
"open up an interface builder, fetching a spec from someClass |
|
109 | 1139 |
via some selector |
1140 |
" |
|
1141 |
|painter| |
|
60 | 1142 |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1143 |
aClass isNil ifTrue:[ |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1144 |
self warn:'nil class given (class was probably renamed ?)'. |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1145 |
]. |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1146 |
|
109 | 1147 |
self openInterface. |
60 | 1148 |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1149 |
aClass notNil ifTrue:[ |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1150 |
painter := self painter. |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1151 |
specClass := aClass name. |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1152 |
specSuperclass := aClass superclass name. |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1153 |
specSelector := aSelector. |
60 | 1154 |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1155 |
(aspects at:#classNameChannel) value:specClass. |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1156 |
(aspects at:#superclassNameChannel) value:specSuperclass. |
161 | 1157 |
(aspects at:#methodNameChannel) value:specSelector asSymbol. |
60 | 1158 |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1159 |
painter className:aClass name. |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1160 |
painter methodName:aSelector. |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1161 |
painter setupFromSpec:(aClass perform:aSelector). |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1162 |
] |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
1163 |
|
161 | 1164 |
"Modified: 17.6.1997 / 14:41:25 / cg" |
60 | 1165 |
! ! |
1166 |
||
109 | 1167 |
!UIPainter methodsFor:'user interaction - dialog'! |
60 | 1168 |
|
1169 |
checkClassAndSelector |
|
1170 |
"check for class & superclass" |
|
1171 |
||
1172 |
|superclass cls| |
|
1173 |
||
1174 |
specClass isNil ifTrue:[^ false]. |
|
1175 |
||
1176 |
specClass isBehavior ifFalse:[ |
|
1177 |
cls := Smalltalk at:specClass asSymbol |
|
1178 |
] ifTrue:[ |
|
1179 |
cls := specClass |
|
1180 |
]. |
|
1181 |
cls isNil ifTrue:[ |
|
1182 |
(superclass := Smalltalk at:specSuperclass asSymbol) isNil ifTrue:[ |
|
1183 |
self warn:'no class named ' , specSuperclass , ' exists.'. |
|
1184 |
^ false. |
|
1185 |
]. |
|
1186 |
(self confirm:'create ' , specClass , ' ?') ifTrue:[ |
|
1187 |
superclass subclass:(specClass asSymbol) |
|
1188 |
instanceVariableNames:'' |
|
1189 |
classVariableNames:'' |
|
1190 |
poolDictionaries:'' |
|
1191 |
category:'New-Applications'. |
|
1192 |
^ true. |
|
1193 |
]. |
|
1194 |
^ false. |
|
1195 |
]. |
|
1196 |
cls isBehavior ifFalse:[ |
|
1197 |
self warn:'a global named ' , specClass , ' exists, but is no class.'. |
|
1198 |
^ false. |
|
1199 |
]. |
|
1200 |
||
1201 |
specSuperclass isBehavior ifFalse:[ |
|
1202 |
superclass := Smalltalk at:specSuperclass asSymbol |
|
1203 |
] ifTrue:[ |
|
1204 |
superclass := specSuperclass |
|
1205 |
]. |
|
1206 |
specSuperclass notNil ifTrue:[ |
|
1207 |
superclass isNil ifTrue:[ |
|
1208 |
self warn:'no class named ' , specSuperclass , ' exists.'. |
|
1209 |
^ false. |
|
1210 |
]. |
|
1211 |
||
1212 |
(cls isSubclassOf:superclass) ifFalse:[ |
|
1213 |
self warn:'a global named ' , specClass , ' exists, but is not a subclass of ' , superclass name , '.'. |
|
1214 |
^ false. |
|
1215 |
] |
|
1216 |
]. |
|
1217 |
^ true |
|
109 | 1218 |
|
1219 |
||
60 | 1220 |
! |
1221 |
||
1222 |
defineClassAndSelector |
|
1223 |
"launch a dialog to define class, superclass and method" |
|
1224 |
||
1225 |
|again| |
|
1226 |
||
1227 |
[ |
|
1228 |
again := false. |
|
160 | 1229 |
|
1230 |
aspects at:#classNameChannel put:specClass asValue. |
|
1231 |
aspects at:#methodNameChannel put:specSelector asValue. |
|
1232 |
aspects at:#superclassNameChannel put:specSuperclass asValue. |
|
1233 |
||
60 | 1234 |
(self openDialogInterface:#nameAndSelectorSpec) ifTrue:[ |
1235 |
||
1236 |
specClass := (self aspectFor:#classNameChannel) value. |
|
1237 |
specSelector := (self aspectFor:#methodNameChannel) value. |
|
161 | 1238 |
specSelector notNil ifTrue:[specSelector := specSelector asSymbol]. |
60 | 1239 |
specSuperclass := (self aspectFor:#superclassNameChannel) value. |
1240 |
||
109 | 1241 |
(again := self checkClassAndSelector not) ifFalse:[ |
1242 |
self painter className:specClass |
|
1243 |
superclassName:specSuperclass |
|
1244 |
selector:specSelector. |
|
1245 |
] |
|
60 | 1246 |
] |
109 | 1247 |
|
60 | 1248 |
] doWhile:[again] |
1249 |
||
161 | 1250 |
"Modified: 17.6.1997 / 14:42:02 / cg" |
60 | 1251 |
! ! |
1252 |
||
109 | 1253 |
!UIPainter methodsFor:'user interaction - pullDown'! |
60 | 1254 |
|
149 | 1255 |
doBrowseAppClass |
1256 |
"open a browser on the class" |
|
1257 |
||
1258 |
|cls| |
|
1259 |
||
1260 |
specClass isNil ifTrue:[ |
|
1261 |
^ self information:'no class yet'. |
|
1262 |
]. |
|
1263 |
||
1264 |
specClass isBehavior ifFalse:[ |
|
1265 |
cls := Smalltalk at:specClass asSymbol |
|
1266 |
] ifTrue:[ |
|
1267 |
cls := specClass |
|
1268 |
]. |
|
1269 |
||
1270 |
cls isNil ifTrue:[ |
|
1271 |
^ self information:'no class yet'. |
|
1272 |
]. |
|
1273 |
||
1274 |
SystemBrowser openInClass:cls |
|
1275 |
||
1276 |
||
1277 |
! |
|
1278 |
||
60 | 1279 |
doFromClass |
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1280 |
|className methodName cls sel accepted failed spec s painter| |
109 | 1281 |
|
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1282 |
objectList painter isModified ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1283 |
(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
|
1284 |
^ self |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1285 |
] |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1286 |
]. |
60 | 1287 |
|
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1288 |
className := '' asValue. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1289 |
methodName := '' asValue. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1290 |
painter := self painter. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1291 |
|
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1292 |
(s := painter className) notNil ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1293 |
className value:s |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1294 |
]. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1295 |
(s := painter methodName) notNil ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1296 |
methodName value:s |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1297 |
]. |
60 | 1298 |
|
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1299 |
failed := false. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1300 |
[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1301 |
accepted := |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1302 |
(DialogBox new |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1303 |
addTextLabel:'Classes name:'; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1304 |
addInputFieldOn:className; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1305 |
addVerticalSpace; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1306 |
addTextLabel:'methods name:'; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1307 |
addInputFieldOn:methodName; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1308 |
addAbortButton; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1309 |
addOkButton; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1310 |
open |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1311 |
) accepted. |
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 |
accepted ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1314 |
cls := Smalltalk classNamed:className value. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1315 |
cls isNil ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1316 |
failed := true. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1317 |
self warn:'no such class'. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1318 |
] ifFalse:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1319 |
sel := methodName value asSymbol. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1320 |
(cls respondsTo:sel ) ifFalse:[ |
60 | 1321 |
failed := true. |
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1322 |
self warn:'no such method' |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1323 |
] ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1324 |
spec := cls perform:sel. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1325 |
spec isArray ifFalse:[ |
60 | 1326 |
failed := true. |
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1327 |
self warn:'not a windowSpec method' |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1328 |
]. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1329 |
"/ ok, got it |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1330 |
painter className:className value. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1331 |
painter methodName:methodName value. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1332 |
painter setupFromSpec:spec. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1333 |
^ self |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1334 |
] |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1335 |
] |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1336 |
] |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1337 |
] doWhile:[accepted and:[failed]]. |
60 | 1338 |
|
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1339 |
"Modified: 17.6.1997 / 12:33:36 / cg" |
60 | 1340 |
! |
1341 |
||
1342 |
doInstallAspects |
|
1343 |
|code| |
|
1344 |
||
1345 |
(specClass isNil or:[specSelector isNil]) ifTrue:[ |
|
1346 |
self defineClassAndSelector |
|
1347 |
]. |
|
1348 |
||
1349 |
self checkClassAndSelector ifFalse:[ |
|
1350 |
^ self |
|
1351 |
]. |
|
1352 |
||
109 | 1353 |
self painter className:specClass |
1354 |
superclassName:specSuperclass |
|
1355 |
selector:specSelector. |
|
60 | 1356 |
|
109 | 1357 |
code := self painter generateAspectMethods. |
60 | 1358 |
(ReadStream on:code) fileIn. |
1359 |
||
1360 |
! |
|
1361 |
||
152 | 1362 |
doInstallHelp |
1363 |
|dict cls src| |
|
1364 |
||
171 | 1365 |
cls := self activeHelpApplicationClass. |
152 | 1366 |
|
1367 |
cls isNil ifTrue:[ |
|
171 | 1368 |
^ self information:'no application class defined' |
152 | 1369 |
]. |
1370 |
||
1371 |
activeHelpTool isNil ifTrue:[ |
|
1372 |
^ self information:'no help text defined' |
|
1373 |
]. |
|
1374 |
dict := activeHelpTool dictionary. |
|
171 | 1375 |
src := '' writeStream. |
1376 |
||
1377 |
src nextPutAll: |
|
152 | 1378 |
|
171 | 1379 |
'helpSpec |
152 | 1380 |
"return a dictionary filled with helpKey -> helptext associations. |
171 | 1381 |
These are used by the activeHelp tool. |
1382 |
" |
|
1383 |
^ super helpSpec addPairsFrom:#( |
|
152 | 1384 |
|
1385 |
'. |
|
1386 |
||
171 | 1387 |
dict keysAndValuesDo:[:key :txt| |
152 | 1388 |
|t| |
171 | 1389 |
src nextPutLine:key storeString. |
1390 |
||
152 | 1391 |
t := txt asString. |
171 | 1392 |
(t endsWith:Character cr) ifTrue:[ |
1393 |
t := t copyWithoutLast:1 |
|
1394 |
]. |
|
1395 |
src nextPutLine:t storeString; cr. |
|
152 | 1396 |
]. |
171 | 1397 |
src nextPutLine:')'. |
152 | 1398 |
src := src contents. |
1399 |
Compiler compile:src forClass:cls class inCategory:'help specs' |
|
1400 |
! |
|
1401 |
||
60 | 1402 |
doInstallSpec |
1403 |
|code| |
|
1404 |
||
1405 |
(specClass isNil or:[specSelector isNil]) ifTrue:[ |
|
1406 |
self defineClassAndSelector |
|
1407 |
]. |
|
1408 |
||
1409 |
self checkClassAndSelector ifFalse:[ |
|
1410 |
^ self |
|
1411 |
]. |
|
1412 |
||
109 | 1413 |
self painter className:specClass |
1414 |
superclassName:specSuperclass |
|
1415 |
selector:specSelector. |
|
60 | 1416 |
|
109 | 1417 |
code := self painter generateCode. |
60 | 1418 |
(ReadStream on:code) fileIn. |
1419 |
||
1420 |
! |
|
1421 |
||
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1422 |
doNew |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1423 |
objectList painter isModified ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1424 |
(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
|
1425 |
^ self |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1426 |
] |
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 |
|
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1429 |
self removeAll |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1430 |
|
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1431 |
"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
|
1432 |
! |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1433 |
|
60 | 1434 |
doPickAView |
109 | 1435 |
|painter view className methodName cls sel accepted spec s| |
60 | 1436 |
|
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1437 |
objectList painter isModified ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1438 |
(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
|
1439 |
^ self |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1440 |
] |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1441 |
]. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
1442 |
|
171 | 1443 |
(view := Screen current viewFromUser) notNil ifTrue:[ |
174 | 1444 |
view == Screen current rootView ifFalse:[ |
1445 |
painter := self painter. |
|
1446 |
spec := UISpecification fromView:view topView. |
|
60 | 1447 |
|
174 | 1448 |
"/ ok, got it |
1449 |
painter setupFromSpec:spec. |
|
1450 |
painter className:view class name. |
|
1451 |
painter methodName:#newSpec. |
|
1452 |
] |
|
109 | 1453 |
] |
60 | 1454 |
! |
1455 |
||
1456 |
doRaise |
|
171 | 1457 |
|top x| |
109 | 1458 |
|
171 | 1459 |
top := self painter topView. |
1460 |
top realized ifFalse:[ |
|
173 | 1461 |
self painterShown value:true |
171 | 1462 |
]. |
1463 |
top raise. |
|
109 | 1464 |
|
171 | 1465 |
top := selectionPanel window. |
1466 |
top realized ifFalse:[ |
|
173 | 1467 |
self galleryShown value:true |
171 | 1468 |
]. |
1469 |
top raise. |
|
60 | 1470 |
! |
1471 |
||
149 | 1472 |
doStartApplication |
1473 |
|cls| |
|
1474 |
||
1475 |
(specClass isNil or:[specSelector isNil]) ifTrue:[ |
|
1476 |
^ self information:'no class or selector defined'. |
|
1477 |
]. |
|
1478 |
||
1479 |
specClass isBehavior ifFalse:[ |
|
1480 |
cls := Smalltalk at:specClass asSymbol |
|
1481 |
] ifTrue:[ |
|
1482 |
cls := specClass |
|
1483 |
]. |
|
1484 |
||
1485 |
cls isNil ifTrue:[ |
|
1486 |
^ self information:'class not existant'. |
|
1487 |
]. |
|
1488 |
||
1489 |
(cls respondsTo:specSelector) ifFalse:[ |
|
161 | 1490 |
self halt. |
1491 |
^ self information:('no method for: #' |
|
1492 |
, specSelector , ' in ' , cls name , |
|
1493 |
'\\(did you install the spec ?)') withCRs. |
|
149 | 1494 |
]. |
1495 |
cls new openInterface:specSelector |
|
161 | 1496 |
|
1497 |
"Modified: 17.6.1997 / 14:40:21 / cg" |
|
149 | 1498 |
! |
1499 |
||
60 | 1500 |
doWindowSpec |
68 | 1501 |
|code code2 v| |
60 | 1502 |
|
109 | 1503 |
code := self painter generateWindowSpecMethodSource. |
68 | 1504 |
|
60 | 1505 |
v := CodeView open. |
1506 |
v contents:code. |
|
1507 |
v label:'windowSpec'. |
|
1508 |
||
81 | 1509 |
! ! |
1510 |
||
60 | 1511 |
!UIPainter class methodsFor:'documentation'! |
1512 |
||
1513 |
version |
|
1514 |
^ '$Header$' |
|
1515 |
! ! |