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