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