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