author | ca |
Sat, 28 Jun 1997 15:13:13 +0200 | |
changeset 192 | 43da8d509ae6 |
parent 188 | 8091a35bccf1 |
child 194 | 2b05bd327785 |
permissions | -rw-r--r-- |
60 | 1 |
" |
156 | 2 |
COPYRIGHT (c) 1995 by Claus Gittinger / eXept Software AG |
3 |
All Rights Reserved |
|
60 | 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 |
UIObjectView subclass:#UIPainterView |
|
111 | 14 |
instanceVariableNames:'listHolder superclassName className methodName categoryName' |
60 | 15 |
classVariableNames:'HandCursor' |
16 |
poolDictionaries:'' |
|
17 |
category:'Interface-UIPainter' |
|
18 |
! |
|
19 |
||
180 | 20 |
MultiSelectionInList subclass:#ListHolder |
21 |
instanceVariableNames:'painter propertyList masterElement disabledChanged' |
|
22 |
classVariableNames:'' |
|
119 | 23 |
poolDictionaries:'' |
24 |
privateIn:UIPainterView |
|
25 |
! |
|
26 |
||
180 | 27 |
Object subclass:#ViewProperty |
28 |
instanceVariableNames:'view spec identifier' |
|
29 |
classVariableNames:'Identifier' |
|
60 | 30 |
poolDictionaries:'' |
31 |
privateIn:UIPainterView |
|
32 |
! |
|
33 |
||
34 |
!UIPainterView class methodsFor:'documentation'! |
|
35 |
||
36 |
copyright |
|
37 |
" |
|
156 | 38 |
COPYRIGHT (c) 1995 by Claus Gittinger / eXept Software AG |
39 |
All Rights Reserved |
|
60 | 40 |
|
41 |
This software is furnished under a license and may be used |
|
42 |
only in accordance with the terms of that license and with the |
|
43 |
inclusion of the above copyright notice. This software may not |
|
44 |
be provided or otherwise made available to, or used by, any |
|
45 |
other person. No title to or ownership of the software is |
|
46 |
hereby transferred. |
|
47 |
" |
|
48 |
! |
|
49 |
||
50 |
documentation |
|
51 |
" |
|
128 | 52 |
buildIn view used by the UIPainter; from this view, the layout of the |
53 |
new application derives from. |
|
54 |
||
55 |
[see also:] |
|
56 |
UIBuilder |
|
57 |
UIObjectView |
|
156 | 58 |
|
59 |
[author:] |
|
60 |
Claus Gittinger |
|
61 |
Claus Atzkern |
|
60 | 62 |
" |
63 |
! ! |
|
64 |
||
65 |
!UIPainterView class methodsFor:'defaults'! |
|
66 |
||
67 |
defaultMenuMessage |
|
68 |
"This message is the default yo be sent to the menuHolder to get a menu |
|
69 |
" |
|
121 | 70 |
^ #showMiddleButtonMenu |
60 | 71 |
|
72 |
||
73 |
! ! |
|
74 |
||
111 | 75 |
!UIPainterView class methodsFor:'menu specs'! |
76 |
||
77 |
menu |
|
78 |
||
79 |
^ #(#Menu #( |
|
80 |
#(#MenuItem |
|
81 |
#'label:' 'copy' |
|
115 | 82 |
#'value:' #copySelection |
111 | 83 |
#'shortcutKeyCharacter:' #Copy |
84 |
) |
|
85 |
#(#MenuItem |
|
86 |
#'label:' 'cut' |
|
115 | 87 |
#'value:' #deleteSelection |
111 | 88 |
#'shortcutKeyCharacter:' #Cut |
89 |
) |
|
90 |
#(#MenuItem |
|
115 | 91 |
#'label:' 'paste' |
111 | 92 |
#'nameKey:' #paste |
115 | 93 |
#'value:' #paste |
111 | 94 |
#'submenu:' |
95 |
#(#Menu #( |
|
96 |
#(#MenuItem |
|
97 |
#'label:' 'paste' |
|
115 | 98 |
#'value:' #pasteBuffer |
111 | 99 |
#'shortcutKeyCharacter:' #Paste |
100 |
) |
|
101 |
#(#MenuItem |
|
102 |
#'label:' 'keep layout' |
|
115 | 103 |
#'value:' #pasteWithLayout |
111 | 104 |
) |
105 |
) |
|
106 |
nil |
|
107 |
nil |
|
108 |
) |
|
109 |
) |
|
110 |
#(#MenuItem |
|
115 | 111 |
#'label:' 'undo' |
112 |
#'nameKey:' #undo |
|
113 |
#'value:' #undoLast) |
|
111 | 114 |
#(#MenuItem |
115 |
#'label:' 'arrange' |
|
115 | 116 |
#'value:' #arrange |
111 | 117 |
#'submenu:' |
118 |
#(#Menu #( |
|
119 |
#(#MenuItem |
|
120 |
#'label:' 'to front' |
|
115 | 121 |
#'value:' #raiseSelection |
111 | 122 |
) |
123 |
#(#MenuItem |
|
124 |
#'label:' 'to back' |
|
115 | 125 |
#'value:' #lowerSelection |
111 | 126 |
) |
127 |
) |
|
128 |
nil |
|
129 |
nil |
|
130 |
) |
|
131 |
) |
|
132 |
#(#MenuItem |
|
133 |
#'label:' 'dimension' |
|
115 | 134 |
#'value:' #dimension |
111 | 135 |
#'submenu:' |
136 |
#(#Menu #( |
|
137 |
#(#MenuItem |
|
138 |
#'label:' 'default extent' |
|
115 | 139 |
#'value:' #setToDefaultExtent |
111 | 140 |
) |
141 |
#(#MenuItem |
|
142 |
#'label:' 'default width' |
|
115 | 143 |
#'value:' #setToDefaultWidth |
111 | 144 |
) |
145 |
#(#MenuItem |
|
146 |
#'label:' 'default height' |
|
115 | 147 |
#'value:' #setToDefaultHeight |
111 | 148 |
) |
149 |
#(#MenuItem |
|
150 |
#'label:' 'copy extent' |
|
115 | 151 |
#'value:' #copyExtent |
111 | 152 |
) |
153 |
#(#MenuItem |
|
154 |
#'label:' 'paste extent' |
|
115 | 155 |
#'value:' #pasteExtent |
111 | 156 |
) |
157 |
#(#MenuItem |
|
158 |
#'label:' 'paste width' |
|
115 | 159 |
#'value:' #pasteWidth |
111 | 160 |
) |
161 |
#(#MenuItem |
|
162 |
#'label:' 'paste height' |
|
115 | 163 |
#'value:' #pasteHeight |
111 | 164 |
) |
165 |
#(#MenuItem |
|
166 |
#'label:' 'copy layout' |
|
115 | 167 |
#'value:' #copyLayout |
111 | 168 |
) |
169 |
#(#MenuItem |
|
170 |
#'label:' 'paste layout' |
|
115 | 171 |
#'value:' #pasteLayout |
111 | 172 |
) |
173 |
) |
|
174 |
#(3 1 3) |
|
175 |
nil |
|
176 |
) |
|
177 |
) |
|
178 |
#(#MenuItem |
|
179 |
#'label:' 'align' |
|
115 | 180 |
#'value:' #align |
111 | 181 |
#'submenu:' |
182 |
#(#Menu #( |
|
183 |
#(#MenuItem |
|
115 | 184 |
#'value:' #alignSelectionLeft |
119 | 185 |
#'labelImage:' #( ResourceRetriever UIPainter iconAlignL 'align left' ) |
192 | 186 |
#'activeHelpKey:' #alignSelectionLeft |
111 | 187 |
) |
188 |
#(#MenuItem |
|
115 | 189 |
#'value:' #alignSelectionRight |
119 | 190 |
#'labelImage:' #( ResourceRetriever UIPainter iconAlignR 'align right' ) |
192 | 191 |
#'activeHelpKey:' #alignSelectionRight |
111 | 192 |
) |
193 |
#(#MenuItem |
|
115 | 194 |
#'value:' #alignSelectionLeftAndRight |
119 | 195 |
#'labelImage:' #( ResourceRetriever UIPainter iconAlignLR 'align left & right' ) |
192 | 196 |
#'activeHelpKey:' #alignSelectionLeftAndRight |
111 | 197 |
) |
198 |
#(#MenuItem |
|
115 | 199 |
#'value:' #alignSelectionTop |
119 | 200 |
#'labelImage:' #( ResourceRetriever UIPainter iconAlignT 'align top' ) |
192 | 201 |
#'activeHelpKey:' #alignSelectionTop |
119 | 202 |
) |
203 |
#(#MenuItem |
|
204 |
#'value:' #alignSelectionBottom |
|
205 |
#'labelImage:' #( ResourceRetriever UIPainter iconAlignB 'align bottom' ) |
|
192 | 206 |
#'activeHelpKey:' #alignSelectionBottom |
111 | 207 |
) |
208 |
#(#MenuItem |
|
119 | 209 |
#'value:' #alignSelectionTopAndBottom |
210 |
#'labelImage:' #( ResourceRetriever UIPainter iconAlignTB 'align top & bottom' ) |
|
192 | 211 |
#'activeHelpKey:' #alignSelectionTopAndBottom |
111 | 212 |
) |
213 |
#(#MenuItem |
|
115 | 214 |
#'value:' #alignSelectionCenterHor |
119 | 215 |
#'labelImage:' #( ResourceRetriever UIPainter iconAlignCenterH 'align centered horizontal' ) |
192 | 216 |
#'activeHelpKey:' #alignSelectionCenterHor |
111 | 217 |
) |
218 |
#(#MenuItem |
|
115 | 219 |
#'value:' #alignSelectionCenterVer |
119 | 220 |
#'labelImage:' #( ResourceRetriever UIPainter iconAlignCenterV 'align centered vertical' ) |
192 | 221 |
#'activeHelpKey:' #alignSelectionCenterVer |
111 | 222 |
) |
223 |
#(#MenuItem |
|
224 |
#'label:' 'spread horizontal' |
|
115 | 225 |
#'value:' #spreadSelectionHor |
111 | 226 |
) |
227 |
#(#MenuItem |
|
228 |
#'label:' 'spread vertical' |
|
115 | 229 |
#'value:' #spreadSelectionVer |
111 | 230 |
) |
231 |
#(#MenuItem |
|
232 |
#'label:' 'center horizontal in frame' |
|
115 | 233 |
#'value:' #centerSelectionHor |
111 | 234 |
) |
235 |
#(#MenuItem |
|
236 |
#'label:' 'center vertical in frame' |
|
115 | 237 |
#'value:' #centerSelectionVer |
111 | 238 |
) |
239 |
) |
|
119 | 240 |
#(8 2) |
111 | 241 |
nil |
242 |
) |
|
243 |
) |
|
244 |
) |
|
245 |
#(4) |
|
246 |
nil |
|
247 |
) |
|
248 |
! ! |
|
249 |
||
60 | 250 |
!UIPainterView methodsFor:'accessing'! |
251 |
||
252 |
application |
|
253 |
^ nil |
|
254 |
||
255 |
"Modified: 6.9.1995 / 00:46:44 / claus" |
|
256 |
! |
|
257 |
||
78 | 258 |
applicationName |
259 |
^ self className |
|
260 |
! |
|
261 |
||
262 |
applicationName:aName |
|
263 |
self className:aName |
|
264 |
! |
|
265 |
||
60 | 266 |
className |
267 |
^ className |
|
268 |
! |
|
269 |
||
78 | 270 |
className:aName |
271 |
className := aName |
|
60 | 272 |
! |
273 |
||
274 |
className:aClassName superclassName:aSuperclassName selector:aSelector |
|
78 | 275 |
className := aClassName. |
60 | 276 |
superclassName := aSuperclassName. |
78 | 277 |
methodName := aSelector. |
60 | 278 |
|
279 |
! |
|
280 |
||
111 | 281 |
listHolder |
282 |
^ listHolder |
|
283 |
! |
|
284 |
||
60 | 285 |
methodName |
286 |
^ methodName |
|
287 |
! |
|
288 |
||
78 | 289 |
methodName:aName |
290 |
methodName := aName |
|
60 | 291 |
! |
292 |
||
293 |
selectNames:aStringOrCollection |
|
294 |
|prop coll s| |
|
295 |
||
296 |
(aStringOrCollection isNil or:[aStringOrCollection isEmpty]) ifTrue:[ |
|
131 | 297 |
^ self select:nil |
60 | 298 |
]. |
299 |
||
300 |
(s := aStringOrCollection) isString ifFalse:[ |
|
301 |
s size == 1 ifTrue:[ |
|
302 |
s := s first |
|
303 |
] ifFalse:[ |
|
304 |
coll := OrderedCollection new. |
|
305 |
||
306 |
s do:[:aName| |
|
307 |
(prop := self propertyOfName:aName) notNil ifTrue:[ |
|
308 |
coll add:(prop view) |
|
309 |
] |
|
310 |
]. |
|
311 |
coll size == 1 ifTrue:[ ^ self select:(coll at:1) ]. |
|
131 | 312 |
coll size == 0 ifTrue:[ ^ self select:nil ]. |
60 | 313 |
|
314 |
^ self select:coll. |
|
315 |
] |
|
316 |
]. |
|
317 |
||
318 |
prop := self propertyOfName:s. |
|
131 | 319 |
prop isNil ifTrue:[^ self select:nil] |
60 | 320 |
ifFalse:[^ self select:(prop view)] |
321 |
||
322 |
! ! |
|
323 |
||
111 | 324 |
!UIPainterView methodsFor:'change & update'! |
325 |
||
326 |
changed:aParameter |
|
327 |
aParameter == #layout ifTrue:[ |
|
328 |
listHolder removeDependent:self. |
|
329 |
listHolder changed:aParameter. |
|
330 |
listHolder addDependent:self. |
|
331 |
] ifFalse:[ |
|
332 |
super changed:aParameter |
|
333 |
] |
|
334 |
! |
|
335 |
||
336 |
selectionChanged |
|
337 |
"selection has changed |
|
338 |
" |
|
339 |
|newSel| |
|
340 |
||
128 | 341 |
self selectionDo:[:aView||p| |
342 |
(p := self propertyOfView:aView) notNil ifTrue:[ |
|
343 |
newSel isNil ifTrue:[ |
|
344 |
newSel := OrderedCollection new |
|
345 |
]. |
|
346 |
newSel add:(listHolder indexOfName:(p name)) |
|
111 | 347 |
] |
348 |
]. |
|
349 |
listHolder removeDependent:self. |
|
350 |
listHolder selectionIndex:newSel. |
|
351 |
listHolder addDependent:self. |
|
352 |
! |
|
353 |
||
354 |
update:what with:aParm from:aSender |
|
355 |
|loIdx newSel| |
|
356 |
||
357 |
(what == #selectionIndex and:[aSender == listHolder]) ifFalse:[ |
|
358 |
^ self |
|
359 |
]. |
|
360 |
loIdx := listHolder selectionIndex. |
|
361 |
||
362 |
loIdx size ~~ 0 ifTrue:[ |
|
363 |
newSel := loIdx collect:[:i|(listHolder propertyAt:i) view] |
|
364 |
]. |
|
128 | 365 |
self updateSelectionFrom:newSel. |
366 |
! |
|
367 |
||
368 |
updateSelectionFrom:aSel |
|
369 |
"update selection from a new selection |
|
370 |
" |
|
371 |
|csel| |
|
372 |
||
373 |
selectionHiddenLevel == 0 ifTrue:[ |
|
374 |
aSel isCollection ifTrue:[ |
|
375 |
self selectionDo:[:el| |
|
376 |
(aSel includes:el) ifFalse:[self showUnselected:el] |
|
377 |
] |
|
378 |
] ifFalse:[ |
|
379 |
self selectionDo:[:el| |
|
380 |
aSel == el ifFalse:[self showUnselected:el] |
|
381 |
] |
|
382 |
] |
|
111 | 383 |
]. |
128 | 384 |
self setSelection:aSel withRedraw:false. |
385 |
self showSelection |
|
111 | 386 |
! ! |
387 |
||
60 | 388 |
!UIPainterView methodsFor:'copy & cut & paste'! |
389 |
||
390 |
copySelection |
|
391 |
"copy the selection into the cut&paste-buffer |
|
392 |
" |
|
71 | 393 |
|specs coll| |
394 |
||
128 | 395 |
coll := self minSetOfSuperViews:(self selection). |
60 | 396 |
|
71 | 397 |
coll notNil ifTrue:[ |
131 | 398 |
self select:nil. |
78 | 399 |
specs := coll collect:[:aView| self fullSpecFor:aView ]. |
60 | 400 |
self setSelection:specs |
401 |
]. |
|
78 | 402 |
|
403 |
||
60 | 404 |
! |
405 |
||
406 |
deleteSelection |
|
62 | 407 |
"delete the selection; copy the selection into the cut&paste-buffer |
408 |
and open a transaction |
|
60 | 409 |
" |
134 | 410 |
|specs coll| |
71 | 411 |
|
128 | 412 |
coll := self minSetOfSuperViews:(self selection). |
60 | 413 |
|
78 | 414 |
coll notNil ifTrue:[ |
111 | 415 |
listHolder disableNotificationsWhileEvaluating:[ |
131 | 416 |
self select:nil. |
111 | 417 |
specs := coll collect:[:aView| self fullSpecFor:aView ]. |
60 | 418 |
|
134 | 419 |
self withinTransaction:#cut objects:coll do:[ |
420 |
coll reverseDo:[:aView| |
|
421 |
self createUndoRemove:aView. |
|
422 |
self remove:aView |
|
111 | 423 |
] |
424 |
]. |
|
425 |
self setSelection:specs. |
|
426 |
] |
|
60 | 427 |
] |
428 |
! |
|
429 |
||
430 |
pasteBuffer |
|
62 | 431 |
"add the objects in the paste-buffer to the object view |
60 | 432 |
" |
89 | 433 |
self pasteSpecifications:(self getSelection) keepLayout:false |
434 |
||
435 |
! |
|
436 |
||
437 |
pasteSpecifications:aSpecificationOrList keepLayout:keepLayout |
|
438 |
"add the specs to the object view |
|
439 |
" |
|
111 | 440 |
|paste frame pasteOrigin pasteOffset builder newSel| |
60 | 441 |
|
89 | 442 |
(self canPaste:aSpecificationOrList) ifFalse:[ |
443 |
^ self |
|
444 |
]. |
|
165 | 445 |
listHolder disableNotificationsWhileEvaluating:[ |
446 |
aSpecificationOrList isCollection ifTrue:[ |
|
447 |
paste := aSpecificationOrList |
|
448 |
] ifFalse:[ |
|
449 |
paste := Array with:aSpecificationOrList |
|
450 |
]. |
|
451 |
frame := self singleSelection. |
|
60 | 452 |
|
165 | 453 |
(self canPasteInto:frame) ifFalse:[ |
454 |
frame := self |
|
455 |
]. |
|
456 |
self setSelection:nil withRedraw:true. |
|
60 | 457 |
|
165 | 458 |
newSel := OrderedCollection new. |
459 |
builder := UIBuilder new. |
|
89 | 460 |
|
165 | 461 |
keepLayout ifFalse:[ |
462 |
pasteOffset := 0@0. |
|
463 |
pasteOrigin := self sensor mousePoint. |
|
464 |
pasteOrigin := device translatePoint:pasteOrigin from:device rootView id to:frame id. |
|
465 |
]. |
|
60 | 466 |
|
165 | 467 |
listHolder disableNotificationsWhileEvaluating:[ |
468 |
paste do:[:aSpec| |
|
469 |
|view| |
|
60 | 470 |
|
165 | 471 |
view := self addSpec:aSpec builder:builder in:frame. |
60 | 472 |
|
165 | 473 |
keepLayout ifFalse:[ |
474 |
(frame bounds containsPoint:pasteOrigin) ifFalse:[ |
|
475 |
self moveObject:view to:pasteOffset. |
|
476 |
] ifTrue:[ |
|
477 |
self moveObject:view to:pasteOrigin + pasteOffset. |
|
478 |
]. |
|
479 |
pasteOffset := pasteOffset + 4 |
|
111 | 480 |
]. |
165 | 481 |
view realize. |
482 |
newSel add:view. |
|
89 | 483 |
]. |
60 | 484 |
]. |
485 |
||
165 | 486 |
self withinTransaction:#paste objects:newSel do:[ |
487 |
undoHistory addUndoSelector:#undoCreate: |
|
488 |
withArgs:(newSel collect:[:v|(self propertyOfView:v) identifier]) |
|
489 |
]. |
|
134 | 490 |
|
165 | 491 |
newSel size == 1 ifTrue:[ |
492 |
newSel := newSel at:1 |
|
493 |
]. |
|
494 |
self realizeAllSubViews. |
|
495 |
inputView raise. |
|
496 |
self select:newSel. |
|
497 |
self elementChangedSize:frame. |
|
498 |
] |
|
89 | 499 |
! |
500 |
||
501 |
pasteWithLayout |
|
502 |
"add the objects in the paste-buffer to the object view; don't change the |
|
503 |
layout |
|
504 |
" |
|
505 |
self pasteSpecifications:(self getSelection) keepLayout:true |
|
506 |
||
60 | 507 |
! ! |
508 |
||
509 |
!UIPainterView methodsFor:'drag & drop'! |
|
510 |
||
511 |
canDrop:anObjectOrCollection |
|
89 | 512 |
|spec| |
60 | 513 |
|
119 | 514 |
self enabled ifTrue:[ |
89 | 515 |
anObjectOrCollection size == 1 ifTrue:[ |
516 |
spec := (anObjectOrCollection at:1) theObject. |
|
96
73725336b4fe
dont paste into scrollable selectionInListViews ...
Claus Gittinger <cg@exept.de>
parents:
89
diff
changeset
|
517 |
^ (spec isKindOf:UISpecification) |
89 | 518 |
] |
519 |
]. |
|
520 |
^ false |
|
96
73725336b4fe
dont paste into scrollable selectionInListViews ...
Claus Gittinger <cg@exept.de>
parents:
89
diff
changeset
|
521 |
|
73725336b4fe
dont paste into scrollable selectionInListViews ...
Claus Gittinger <cg@exept.de>
parents:
89
diff
changeset
|
522 |
"Modified: 8.4.1997 / 01:01:50 / cg" |
60 | 523 |
! |
524 |
||
525 |
drop:anObjectOrCollection at:aPoint |
|
89 | 526 |
|spec| |
527 |
||
528 |
spec := (anObjectOrCollection at:1) theObject. |
|
529 |
self pasteSpecifications:spec keepLayout:false. |
|
60 | 530 |
|
531 |
||
532 |
! ! |
|
533 |
||
78 | 534 |
!UIPainterView methodsFor:'generating output'! |
535 |
||
60 | 536 |
generateActionMethodFor:aspect spec:protoSpec inClass:targetClass |
149 | 537 |
|args showIt| |
141 | 538 |
|
149 | 539 |
(aspect asSymbol numArgs) == 1 ifFalse:[ |
540 |
args := '\'. |
|
541 |
showIt := ' ...''.\'. |
|
542 |
] ifTrue:[ |
|
543 |
args := 'anArgument\'. |
|
544 |
showIt := ''' , anArgument printString , '' ...''.\'. |
|
545 |
]. |
|
141 | 546 |
|
60 | 547 |
^ ('!!' , targetClass name , ' methodsFor:''actions''!!\\' , |
141 | 548 |
aspect , args , |
60 | 549 |
' "automatically generated by UIPainter ..."\' , |
550 |
'\' , |
|
551 |
' "action to be added ..."\' , |
|
149 | 552 |
' Transcript showCR:self class name , '': action for ' , aspect , showIt , |
60 | 553 |
'!! !!\\') withCRs |
554 |
! |
|
555 |
||
556 |
generateAspectMethodFor:aspect spec:protoSpec inClass:targetClass |
|
134 | 557 |
|modelClass| |
558 |
||
149 | 559 |
modelClass := protoSpec defaultModelClassFor:aspect. |
134 | 560 |
|
60 | 561 |
^ ('!!' , targetClass name , ' methodsFor:''aspects''!!\\' , |
562 |
aspect , '\' , |
|
563 |
' "automatically generated by UIPainter ..."\' , |
|
564 |
'\' , |
|
565 |
' |holder|\' , |
|
566 |
'\' , |
|
567 |
' (holder := builder bindingAt:#' , aspect , ') isNil ifTrue:[\' , |
|
134 | 568 |
' builder aspectAt:#' , aspect , ' put:(holder := ' , ' ' , modelClass name , ' new' , ').\' , |
60 | 569 |
' ].\' , |
570 |
' ^ holder\' , |
|
571 |
'!! !!\\') withCRs |
|
572 |
! |
|
573 |
||
574 |
generateAspectMethods |
|
158
6e7f892308ae
do not generate accept/cancel and help action methods,
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
575 |
|cls code skip| |
60 | 576 |
|
78 | 577 |
code := ''. |
578 |
||
60 | 579 |
className isNil ifTrue:[ |
69 | 580 |
self warn:'set the class first'. |
78 | 581 |
^ code |
60 | 582 |
]. |
89 | 583 |
cls := Smalltalk classNamed:className. |
60 | 584 |
|
111 | 585 |
listHolder propertiesDo:[:aProp | |
62 | 586 |
|modelSelector menuSelector protoSpec thisCode| |
60 | 587 |
|
134 | 588 |
protoSpec := aProp spec. |
175 | 589 |
|
78 | 590 |
(modelSelector := aProp model) notNil ifTrue:[ |
60 | 591 |
(cls implements:modelSelector asSymbol) ifFalse:[ |
158
6e7f892308ae
do not generate accept/cancel and help action methods,
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
592 |
skip := false. |
6e7f892308ae
do not generate accept/cancel and help action methods,
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
593 |
(cls isSubclassOf:SimpleDialog) ifTrue:[ |
6e7f892308ae
do not generate accept/cancel and help action methods,
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
594 |
skip := SimpleDialog implements:modelSelector asSymbol |
60 | 595 |
]. |
158
6e7f892308ae
do not generate accept/cancel and help action methods,
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
596 |
skip ifFalse:[ |
6e7f892308ae
do not generate accept/cancel and help action methods,
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
597 |
"/ kludge .. |
6e7f892308ae
do not generate accept/cancel and help action methods,
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
598 |
(protoSpec isMemberOf:ActionButtonSpec) ifTrue:[ |
6e7f892308ae
do not generate accept/cancel and help action methods,
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
599 |
thisCode := (self generateActionMethodFor:modelSelector spec:protoSpec inClass:cls). |
6e7f892308ae
do not generate accept/cancel and help action methods,
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
600 |
] ifFalse:[ |
6e7f892308ae
do not generate accept/cancel and help action methods,
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
601 |
thisCode := (self generateAspectMethodFor:modelSelector spec:protoSpec inClass:cls). |
6e7f892308ae
do not generate accept/cancel and help action methods,
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
602 |
]. |
6e7f892308ae
do not generate accept/cancel and help action methods,
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
603 |
code := code , thisCode |
6e7f892308ae
do not generate accept/cancel and help action methods,
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
604 |
]. |
62 | 605 |
]. |
606 |
]. |
|
607 |
||
78 | 608 |
(menuSelector := aProp menu) notNil ifTrue:[ |
62 | 609 |
(cls implements:menuSelector asSymbol) ifFalse:[ |
610 |
thisCode := (self generateAspectMethodFor:menuSelector spec:protoSpec inClass:cls). |
|
611 |
code := code , thisCode |
|
60 | 612 |
] |
111 | 613 |
]. |
614 |
||
615 |
aProp spec aspectSelectors do:[:aSel| |
|
616 |
(cls implements:aSel asSymbol) ifFalse:[ |
|
617 |
thisCode := (self generateAspectMethodFor:aSel spec:protoSpec inClass:cls). |
|
618 |
code := code , thisCode |
|
619 |
] |
|
620 |
]. |
|
137 | 621 |
aProp spec actionSelectors do:[:aSel| |
622 |
(cls implements:aSel asSymbol) ifFalse:[ |
|
623 |
thisCode := (self generateActionMethodFor:aSel spec:protoSpec inClass:cls). |
|
624 |
code := code , thisCode |
|
625 |
] |
|
626 |
]. |
|
188
8091a35bccf1
generateValueMethodFor:aspect spec:protoSpec inClass:targetClass
ca
parents:
180
diff
changeset
|
627 |
aProp spec valueSelectors do:[:aSel| |
8091a35bccf1
generateValueMethodFor:aspect spec:protoSpec inClass:targetClass
ca
parents:
180
diff
changeset
|
628 |
(cls implements:aSel asSymbol) ifFalse:[ |
8091a35bccf1
generateValueMethodFor:aspect spec:protoSpec inClass:targetClass
ca
parents:
180
diff
changeset
|
629 |
thisCode := (self generateValueMethodFor:aSel spec:protoSpec inClass:cls). |
8091a35bccf1
generateValueMethodFor:aspect spec:protoSpec inClass:targetClass
ca
parents:
180
diff
changeset
|
630 |
code := code , thisCode |
8091a35bccf1
generateValueMethodFor:aspect spec:protoSpec inClass:targetClass
ca
parents:
180
diff
changeset
|
631 |
] |
8091a35bccf1
generateValueMethodFor:aspect spec:protoSpec inClass:targetClass
ca
parents:
180
diff
changeset
|
632 |
]. |
111 | 633 |
|
60 | 634 |
]. |
635 |
^ code |
|
636 |
! |
|
637 |
||
188
8091a35bccf1
generateValueMethodFor:aspect spec:protoSpec inClass:targetClass
ca
parents:
180
diff
changeset
|
638 |
generateValueMethodFor:aspect spec:protoSpec inClass:targetClass |
8091a35bccf1
generateValueMethodFor:aspect spec:protoSpec inClass:targetClass
ca
parents:
180
diff
changeset
|
639 |
^ ('!!' , targetClass name , ' methodsFor:''values''!!\\' , |
8091a35bccf1
generateValueMethodFor:aspect spec:protoSpec inClass:targetClass
ca
parents:
180
diff
changeset
|
640 |
aspect , '\' , |
8091a35bccf1
generateValueMethodFor:aspect spec:protoSpec inClass:targetClass
ca
parents:
180
diff
changeset
|
641 |
' "automatically generated by UIPainter ..."\' , |
8091a35bccf1
generateValueMethodFor:aspect spec:protoSpec inClass:targetClass
ca
parents:
180
diff
changeset
|
642 |
'\' , |
8091a35bccf1
generateValueMethodFor:aspect spec:protoSpec inClass:targetClass
ca
parents:
180
diff
changeset
|
643 |
' "value to be added below ..."\' , |
8091a35bccf1
generateValueMethodFor:aspect spec:protoSpec inClass:targetClass
ca
parents:
180
diff
changeset
|
644 |
' Transcript showCR:self class name , '': no value yet for ' , aspect , ' ...''.\' , |
8091a35bccf1
generateValueMethodFor:aspect spec:protoSpec inClass:targetClass
ca
parents:
180
diff
changeset
|
645 |
'\' , |
8091a35bccf1
generateValueMethodFor:aspect spec:protoSpec inClass:targetClass
ca
parents:
180
diff
changeset
|
646 |
'^ nil.' , |
8091a35bccf1
generateValueMethodFor:aspect spec:protoSpec inClass:targetClass
ca
parents:
180
diff
changeset
|
647 |
'!! !!\\') withCRs |
8091a35bccf1
generateValueMethodFor:aspect spec:protoSpec inClass:targetClass
ca
parents:
180
diff
changeset
|
648 |
|
8091a35bccf1
generateValueMethodFor:aspect spec:protoSpec inClass:targetClass
ca
parents:
180
diff
changeset
|
649 |
|
8091a35bccf1
generateValueMethodFor:aspect spec:protoSpec inClass:targetClass
ca
parents:
180
diff
changeset
|
650 |
|
8091a35bccf1
generateValueMethodFor:aspect spec:protoSpec inClass:targetClass
ca
parents:
180
diff
changeset
|
651 |
|
8091a35bccf1
generateValueMethodFor:aspect spec:protoSpec inClass:targetClass
ca
parents:
180
diff
changeset
|
652 |
! |
8091a35bccf1
generateValueMethodFor:aspect spec:protoSpec inClass:targetClass
ca
parents:
180
diff
changeset
|
653 |
|
78 | 654 |
generateWindowSpecMethodSource |
178
fb8451053c96
keep windowSpec methods category if it already exists
Claus Gittinger <cg@exept.de>
parents:
175
diff
changeset
|
655 |
|t s spec specArray str code category cls mthd| |
60 | 656 |
|
78 | 657 |
specArray := OrderedCollection new. |
60 | 658 |
|
78 | 659 |
self subViews do:[:aView| |
660 |
aView ~~ inputView ifTrue:[ |
|
661 |
specArray add:(self fullSpecFor:aView) |
|
60 | 662 |
] |
663 |
]. |
|
78 | 664 |
spec := FullSpec new. |
665 |
spec fromBuilder:self components:(SpecCollection new collection:specArray). |
|
60 | 666 |
specArray := spec literalArrayEncoding. |
667 |
||
668 |
str := WriteStream on:String new. |
|
86 | 669 |
UISpecification prettyPrintSpecArray:specArray on:str indent:5. |
60 | 670 |
|
178
fb8451053c96
keep windowSpec methods category if it already exists
Claus Gittinger <cg@exept.de>
parents:
175
diff
changeset
|
671 |
"/ if that method already exists, do not overwrite the category |
fb8451053c96
keep windowSpec methods category if it already exists
Claus Gittinger <cg@exept.de>
parents:
175
diff
changeset
|
672 |
|
fb8451053c96
keep windowSpec methods category if it already exists
Claus Gittinger <cg@exept.de>
parents:
175
diff
changeset
|
673 |
category := 'interface specs'. |
fb8451053c96
keep windowSpec methods category if it already exists
Claus Gittinger <cg@exept.de>
parents:
175
diff
changeset
|
674 |
(cls := Smalltalk classNamed:className) notNil ifTrue:[ |
fb8451053c96
keep windowSpec methods category if it already exists
Claus Gittinger <cg@exept.de>
parents:
175
diff
changeset
|
675 |
(mthd := cls class compiledMethodAt:methodName asSymbol) notNil ifTrue:[ |
fb8451053c96
keep windowSpec methods category if it already exists
Claus Gittinger <cg@exept.de>
parents:
175
diff
changeset
|
676 |
category := mthd category. |
fb8451053c96
keep windowSpec methods category if it already exists
Claus Gittinger <cg@exept.de>
parents:
175
diff
changeset
|
677 |
] |
fb8451053c96
keep windowSpec methods category if it already exists
Claus Gittinger <cg@exept.de>
parents:
175
diff
changeset
|
678 |
]. |
fb8451053c96
keep windowSpec methods category if it already exists
Claus Gittinger <cg@exept.de>
parents:
175
diff
changeset
|
679 |
|
60 | 680 |
code := Character excla asString |
178
fb8451053c96
keep windowSpec methods category if it already exists
Claus Gittinger <cg@exept.de>
parents:
175
diff
changeset
|
681 |
, className , ' class methodsFor:' , category storeString |
60 | 682 |
, Character excla asString , '\\' |
683 |
||
684 |
, methodName , '\' |
|
685 |
, ' "this window spec was automatically generated by the ST/X UIPainter"\\' |
|
686 |
, ' "do not manually edit this - the painter/builder may not be able to\' |
|
687 |
, ' handle the specification if its corrupted."\\' |
|
688 |
, ' "\' |
|
689 |
, ' UIPainter new openOnClass:' , className , ' andSelector:#' , methodName , '\' |
|
690 |
, ' ' , className , ' new openInterface:#' , methodName , '\' |
|
691 |
, ' "\'. |
|
692 |
||
693 |
methodName = 'windowSpec' ifTrue:[ |
|
694 |
code := code , ' "' , className , ' open"\' |
|
695 |
]. |
|
696 |
code := code |
|
697 |
, '\' |
|
698 |
, ' <resource: #canvas>\\' |
|
699 |
, ' ^\' |
|
700 |
, ' ', str contents |
|
701 |
, '\' |
|
702 |
, Character excla asString |
|
703 |
, ' ' |
|
704 |
, Character excla asString |
|
705 |
, '\\'. |
|
706 |
||
707 |
^ code withCRs |
|
708 |
||
709 |
"Modified: 5.9.1995 / 21:01:35 / claus" |
|
178
fb8451053c96
keep windowSpec methods category if it already exists
Claus Gittinger <cg@exept.de>
parents:
175
diff
changeset
|
710 |
"Modified: 24.6.1997 / 19:12:44 / cg" |
60 | 711 |
! ! |
712 |
||
713 |
!UIPainterView methodsFor:'initialization'! |
|
714 |
||
137 | 715 |
destroy |
716 |
"remove dependencies |
|
717 |
" |
|
718 |
listHolder notNil ifTrue:[ |
|
719 |
listHolder removeDependent:self. |
|
720 |
]. |
|
721 |
super destroy. |
|
722 |
! |
|
723 |
||
60 | 724 |
initialize |
62 | 725 |
"setup attributes |
726 |
" |
|
60 | 727 |
super initialize. |
728 |
||
729 |
superclassName := 'ApplicationModel'. |
|
730 |
className := 'NewApplication'. |
|
731 |
methodName := 'windowSpec'. |
|
732 |
categoryName := 'Applications'. |
|
111 | 733 |
listHolder := ListHolder for:self. |
60 | 734 |
HandCursor := Cursor leftHand. |
735 |
||
736 |
! |
|
737 |
||
738 |
setupFromSpec:specOrSpecArray |
|
78 | 739 |
|spec builder| |
60 | 740 |
|
111 | 741 |
listHolder disableNotificationsWhileEvaluating:[ |
742 |
self removeAll. |
|
743 |
spec := UISpecification from:specOrSpecArray. |
|
744 |
builder := UIBuilder new. |
|
745 |
spec window setupView:self topView for:builder. |
|
746 |
self addSpec:(spec component) builder:builder in:self. |
|
747 |
self realizeAllSubViews. |
|
748 |
inputView raise. |
|
749 |
] |
|
60 | 750 |
! ! |
751 |
||
752 |
!UIPainterView methodsFor:'menus'! |
|
753 |
||
121 | 754 |
showMiddleButtonMenu |
755 |
"show the middle button menu; this returns nil |
|
62 | 756 |
" |
111 | 757 |
|menu canPaste| |
60 | 758 |
|
121 | 759 |
self enabled ifFalse:[ |
760 |
^ nil |
|
761 |
]. |
|
111 | 762 |
menu := MenuPanel fromSpec:(self class menu) receiver:self. |
60 | 763 |
|
764 |
canPaste := self canPaste:(self getSelection). |
|
765 |
||
128 | 766 |
self hasSelection ifTrue:[ |
767 |
canPaste := (canPaste and:[self canPasteInto:(self selection)]) |
|
768 |
] ifFalse:[ |
|
111 | 769 |
menu disableAll |
770 |
]. |
|
128 | 771 |
menu enabledAt:#paste put:canPaste. |
134 | 772 |
menu enabledAt:#undo put:(undoHistory isEmpty not). |
121 | 773 |
menu startUp. |
774 |
^ nil |
|
60 | 775 |
|
62 | 776 |
|
777 |
||
60 | 778 |
! ! |
779 |
||
780 |
!UIPainterView methodsFor:'removing components'! |
|
781 |
||
78 | 782 |
remove:anObject |
783 |
"remove anObject from the contents do redraw |
|
60 | 784 |
" |
134 | 785 |
anObject notNil ifTrue:[ |
786 |
listHolder remove:anObject |
|
787 |
] |
|
60 | 788 |
! |
789 |
||
790 |
removeAll |
|
62 | 791 |
"remove all objects and properties |
792 |
" |
|
111 | 793 |
listHolder disableNotificationsWhileEvaluating:[ |
131 | 794 |
self select:nil. |
134 | 795 |
listHolder removeAll. |
796 |
self removeUndoHistory. |
|
111 | 797 |
] |
60 | 798 |
! ! |
799 |
||
800 |
!UIPainterView methodsFor:'searching'! |
|
801 |
||
89 | 802 |
findContainerViewAt:aPoint |
803 |
"find container view responds to aPoint. |
|
804 |
" |
|
805 |
|view| |
|
806 |
||
807 |
(view := self findObjectAt:aPoint) isNil ifTrue:[ |
|
808 |
^ self |
|
809 |
]. |
|
810 |
||
811 |
[(view specClass supportsSubComponents or:[(view := view superView) == self]) |
|
812 |
] whileFalse:[ |
|
813 |
[(self propertyOfView:view) isNil] whileTrue:[ |
|
814 |
(view := view superView) == self ifTrue:[^ self] |
|
815 |
]. |
|
816 |
]. |
|
817 |
^ view |
|
818 |
! |
|
819 |
||
60 | 820 |
findObjectAt:aPoint |
821 |
"find the origin/corner of the currentWidget |
|
822 |
" |
|
823 |
|view| |
|
824 |
||
825 |
view := super findObjectAt:aPoint. |
|
826 |
||
827 |
view notNil ifTrue:[ |
|
828 |
"can be a view within a view not visible |
|
829 |
" |
|
830 |
[ (self propertyOfView:view) isNil ] whileTrue:[ |
|
831 |
(view := view superView) == self ifTrue:[^ nil] |
|
832 |
] |
|
833 |
]. |
|
834 |
^ view |
|
835 |
! |
|
836 |
||
837 |
findViewWithId:aViewId |
|
62 | 838 |
"finds view assigned to identifier and returns the view or nil |
60 | 839 |
" |
840 |
|prop| |
|
841 |
||
842 |
prop := self propertyOfIdentifier:aViewId. |
|
843 |
||
844 |
prop notNil ifTrue:[^ prop view] |
|
845 |
ifFalse:[^ nil] |
|
78 | 846 |
! |
847 |
||
848 |
propertyOfIdentifier:anId |
|
849 |
"returns property assigned to unique identifier |
|
850 |
" |
|
851 |
anId notNil ifTrue:[ |
|
111 | 852 |
^ listHolder detectProperty:[:p| p identifier == anId ] |
78 | 853 |
]. |
854 |
^ nil |
|
855 |
! |
|
856 |
||
857 |
propertyOfName:aString |
|
858 |
"returns property assigned to name |
|
859 |
" |
|
111 | 860 |
|name| |
861 |
||
862 |
aString isNil ifFalse:[ |
|
863 |
name := aString string withoutSeparators. |
|
864 |
||
865 |
name = 'self' ifFalse:[ |
|
866 |
^ listHolder detectProperty:[:p| p name = name ]. |
|
867 |
] |
|
78 | 868 |
]. |
869 |
^ nil |
|
870 |
! |
|
871 |
||
872 |
propertyOfView:aView |
|
873 |
"returns property assigned to view |
|
874 |
" |
|
875 |
(aView isNil or:[aView == self]) ifFalse:[ |
|
111 | 876 |
^ listHolder detectProperty:[:p| p view == aView ] |
78 | 877 |
]. |
878 |
^ nil |
|
879 |
! |
|
880 |
||
111 | 881 |
uniqueNameFor:aSpecOrString |
78 | 882 |
"generate and return an unique name for a class |
883 |
" |
|
884 |
|next name size| |
|
885 |
||
111 | 886 |
aSpecOrString isString ifFalse:[name := aSpecOrString className asString] |
887 |
ifTrue:[name := aSpecOrString]. |
|
78 | 888 |
|
111 | 889 |
(name endsWith:'Spec') ifTrue:[ |
890 |
name := name copyFrom:1 to:(name size - 4). |
|
891 |
] ifFalse:[ |
|
892 |
name := name copy |
|
893 |
]. |
|
78 | 894 |
name at:1 put:(name at:1) asLowercase. |
111 | 895 |
size := name size + 1. |
896 |
next := 0. |
|
78 | 897 |
|
111 | 898 |
listHolder propertiesDo:[:p| |
899 |
|n| |
|
78 | 900 |
n := p name. |
901 |
||
902 |
(n size >= size and:[n startsWith:name]) ifTrue:[ |
|
903 |
next := next max:(p extractNumberStartingAt:size) |
|
904 |
] |
|
905 |
]. |
|
906 |
next := next + 1. |
|
907 |
name := name, next printString. |
|
908 |
^ name |
|
909 |
||
910 |
||
911 |
||
912 |
! |
|
913 |
||
914 |
uniqueNameOf:aView |
|
111 | 915 |
|prop| |
78 | 916 |
|
111 | 917 |
(prop := self propertyOfView:aView) notNil ifTrue:[ |
918 |
prop name isNil ifTrue:[ |
|
919 |
prop name:(self uniqueNameFor:(prop spec)). |
|
920 |
]. |
|
921 |
^ prop name |
|
78 | 922 |
]. |
111 | 923 |
^ 'self' |
78 | 924 |
|
60 | 925 |
! ! |
926 |
||
78 | 927 |
!UIPainterView methodsFor:'specification'! |
928 |
||
929 |
addSpec:aSpecification builder:aBuilder in:aFrame |
|
930 |
"build view and subviews from aSpecification into a frame. The top view |
|
931 |
is returned. The contained components of a spec are set to nil |
|
932 |
" |
|
933 |
aBuilder applicationClass:(Smalltalk classNamed:className). |
|
934 |
||
111 | 935 |
aBuilder componentCreationHook:[:aView :aSpec :aBdr||sv p s n| |
78 | 936 |
p := ViewProperty new. |
937 |
s := aSpec copy. |
|
938 |
p spec:s. |
|
939 |
p view:aView. |
|
940 |
||
941 |
s class supportsSubComponents ifTrue:[ |
|
942 |
s component:nil |
|
943 |
]. |
|
944 |
||
111 | 945 |
n := s name. |
946 |
||
947 |
(n isNil or:[(self propertyOfName:n) notNil]) ifTrue:[ |
|
948 |
s name:(self uniqueNameFor:s) |
|
78 | 949 |
]. |
111 | 950 |
listHolder add:p |
78 | 951 |
]. |
952 |
||
953 |
^ aSpecification buildViewWithLayoutFor:aBuilder in:aFrame. |
|
60 | 954 |
|
78 | 955 |
! |
956 |
||
957 |
fullSpecFor:anObject |
|
958 |
"generate a full spec for an object |
|
62 | 959 |
" |
78 | 960 |
|mySpec subSpecs| |
961 |
||
962 |
mySpec := self specFor:anObject. |
|
963 |
||
964 |
(mySpec notNil and:[mySpec class supportsSubComponents]) ifTrue:[ |
|
965 |
(anObject subViews notNil) ifTrue:[ |
|
966 |
anObject subViews do:[:aSubView||spec| |
|
967 |
spec := self fullSpecFor:aSubView. |
|
968 |
spec notNil ifTrue:[ |
|
969 |
subSpecs isNil ifTrue:[ |
|
970 |
subSpecs := OrderedCollection new |
|
971 |
]. |
|
972 |
subSpecs add:spec. |
|
973 |
]. |
|
974 |
]. |
|
975 |
subSpecs notNil ifTrue:[ |
|
976 |
mySpec component:(SpecCollection new collection:subSpecs) |
|
977 |
] |
|
978 |
] |
|
979 |
]. |
|
980 |
^ mySpec |
|
981 |
||
60 | 982 |
|
983 |
||
984 |
||
985 |
||
986 |
||
987 |
! |
|
988 |
||
78 | 989 |
specFor:anObject |
990 |
"returns spec assigned to an object |
|
62 | 991 |
" |
78 | 992 |
|prop spec| |
60 | 993 |
|
78 | 994 |
(prop := self propertyOfView:anObject) notNil ifTrue:[ |
995 |
spec := prop spec copy. |
|
996 |
spec layoutFromView:anObject |
|
60 | 997 |
]. |
78 | 998 |
^ spec |
999 |
||
1000 |
||
1001 |
||
60 | 1002 |
! |
1003 |
||
146 | 1004 |
specForSelection |
1005 |
"returns spec assigned to current single selection or nil |
|
1006 |
" |
|
1007 |
^ self specFor:(self singleSelection) |
|
1008 |
||
1009 |
||
1010 |
! |
|
1011 |
||
78 | 1012 |
updateFromSpec:aSpec |
1013 |
"update current selected view from specification |
|
62 | 1014 |
" |
78 | 1015 |
|props name builder v| |
1016 |
||
1017 |
self singleSelection notNil ifTrue:[ |
|
1018 |
self withSelectionHiddenDo:[ |
|
1019 |
self transaction:#specification selectionDo:[:aView| |
|
1020 |
builder := UIBuilder new. |
|
1021 |
props := self propertyOfView:aView. |
|
82 | 1022 |
name := (aSpec name) withoutSeparators. |
78 | 1023 |
|
82 | 1024 |
name = props name ifFalse:[ |
1025 |
(self propertyOfName:name) notNil ifTrue:[ |
|
1026 |
name := props name |
|
78 | 1027 |
] |
1028 |
]. |
|
82 | 1029 |
aSpec name:name. |
134 | 1030 |
self createUndoSpecModify:props. |
78 | 1031 |
|
1032 |
aSpec needsRebuildForAttributes ifTrue:[ |
|
1033 |
v := aSpec buildViewWithLayoutFor:builder in:aView superView. |
|
1034 |
v realize. |
|
1035 |
aView destroy. |
|
1036 |
device sync. device flush. |
|
1037 |
aView becomeSameAs:v. |
|
1038 |
inputView raise. |
|
1039 |
] ifFalse:[ |
|
1040 |
aSpec setAttributesIn:aView with:builder. |
|
1041 |
self elementChangedSize:aView. |
|
1042 |
]. |
|
1043 |
props spec:(aSpec copy). |
|
111 | 1044 |
listHolder propertyChanged:props. |
78 | 1045 |
] |
111 | 1046 |
] |
82 | 1047 |
] |
60 | 1048 |
! ! |
1049 |
||
1050 |
!UIPainterView methodsFor:'transaction'! |
|
1051 |
||
1052 |
transaction:aType objects:something do:aOneArgBlock |
|
1053 |
"opens a transaction and evaluates a block within the transaction; the |
|
1054 |
argument to the block is a view from derived from something |
|
1055 |
" |
|
134 | 1056 |
self withinTransaction:aType objects:something do:[ |
1057 |
self forEach:something do:aOneArgBlock |
|
60 | 1058 |
] |
1059 |
! |
|
1060 |
||
134 | 1061 |
withinTransaction:aType objects:objects do:aNoneArgBlock |
1062 |
"evaluate a block with no arguments within a transaction |
|
60 | 1063 |
" |
134 | 1064 |
|text size prop| |
1065 |
||
1066 |
objects isNil ifTrue:[ ^ self ]. |
|
1067 |
||
1068 |
size := objects size. |
|
60 | 1069 |
|
134 | 1070 |
objects isCollection ifTrue:[ |
1071 |
size == 0 ifTrue:[ ^ self ]. |
|
1072 |
size == 1 ifTrue:[ prop := self propertyOfView:(objects first) ] |
|
1073 |
] ifFalse:[ |
|
1074 |
prop := self propertyOfView:objects |
|
1075 |
]. |
|
60 | 1076 |
|
134 | 1077 |
prop notNil ifTrue:[ |
1078 |
text := prop name |
|
1079 |
] ifFalse:[ |
|
1080 |
text := size printString, ' elements' |
|
60 | 1081 |
]. |
134 | 1082 |
|
1083 |
undoHistory withinTransaction:aType text:text do:[ |
|
1084 |
aNoneArgBlock value |
|
1085 |
] |
|
60 | 1086 |
! ! |
1087 |
||
1088 |
!UIPainterView methodsFor:'undo actions'! |
|
1089 |
||
134 | 1090 |
createUndoLayout:aView |
1091 |
"create undo action before changing a views layout |
|
60 | 1092 |
" |
134 | 1093 |
|lyt args prop| |
60 | 1094 |
|
1095 |
undoHistory isTransactionOpen ifTrue:[ |
|
1096 |
prop := self propertyOfView:aView. |
|
134 | 1097 |
|
60 | 1098 |
prop notNil ifTrue:[ |
134 | 1099 |
args := Array new:3. |
1100 |
args at:1 put:(prop identifier). |
|
1101 |
||
1102 |
(lyt := aView geometryLayout) notNil ifTrue:[ |
|
1103 |
args at:2 put:#geometryLayout: |
|
1104 |
] ifFalse:[ |
|
146 | 1105 |
lyt := aView extent. |
134 | 1106 |
args at:2 put:#extent: |
1107 |
]. |
|
1108 |
args at:3 put:(lyt copy). |
|
1109 |
undoHistory addUndoSelector:#undoLayout: withArgs:args. |
|
60 | 1110 |
] |
1111 |
] |
|
1112 |
! |
|
1113 |
||
134 | 1114 |
createUndoRemove:aView |
1115 |
"create undo method before deleting views |
|
60 | 1116 |
" |
134 | 1117 |
|frame prop pId spec| |
1118 |
||
1119 |
(prop := self propertyOfView:aView) notNil ifTrue:[ |
|
1120 |
spec := self fullSpecFor:aView. |
|
1121 |
frame := aView superView. |
|
60 | 1122 |
|
134 | 1123 |
(self canPasteInto:frame) ifTrue:[ |
1124 |
(frame := self propertyOfView:frame) notNil ifTrue:[ |
|
1125 |
pId := frame identifier |
|
1126 |
] |
|
1127 |
]. |
|
1128 |
undoHistory addUndoSelector:#undoRemove: |
|
1129 |
withArgs:(Array with:spec with:(prop identifier) with:pId) |
|
1130 |
] |
|
1131 |
! |
|
60 | 1132 |
|
134 | 1133 |
createUndoSpecModify:aProp |
1134 |
"undo method when changing the specification for an object |
|
1135 |
" |
|
1136 |
aProp notNil ifTrue:[ |
|
1137 |
undoHistory addUndoSelector:#undoSpecModify: |
|
1138 |
withArgs:(Array with:(aProp spec) with:(aProp identifier)) |
|
1139 |
] |
|
1140 |
! |
|
60 | 1141 |
|
134 | 1142 |
undoCreate:something |
1143 |
"undo method for creating or pasting an object |
|
1144 |
" |
|
1145 |
self forEach:something do:[:anId|self remove:(self findViewWithId:anId)]. |
|
1146 |
! |
|
60 | 1147 |
|
134 | 1148 |
undoLayout:args |
1149 |
"undo method to set the old layout; see 'createUndoLayout:' |
|
1150 |
" |
|
1151 |
|view| |
|
1152 |
||
1153 |
(view := self findViewWithId:(args at:1)) notNil ifTrue:[ |
|
146 | 1154 |
view perform:(args at:2) with:(args at:3). |
1155 |
self changed:#layout. |
|
60 | 1156 |
] |
1157 |
! |
|
1158 |
||
134 | 1159 |
undoRemove:args |
1160 |
"undo method when removing an object; see 'createUndoRemove:' |
|
1161 |
" |
|
1162 |
|frame prop view| |
|
1163 |
||
1164 |
(args at:3) notNil ifTrue:[ |
|
1165 |
frame := self findViewWithId:(args at:3). |
|
1166 |
]. |
|
1167 |
frame isNil ifTrue:[ |
|
1168 |
frame := self |
|
1169 |
]. |
|
1170 |
view := self addSpec:(args at:1) builder:(UIBuilder new) in:frame. |
|
1171 |
view realize. |
|
1172 |
inputView raise. |
|
1173 |
||
1174 |
prop := self propertyOfView:view. |
|
1175 |
prop identifier:(args at:2). |
|
1176 |
||
1177 |
! |
|
1178 |
||
1179 |
undoSpecModify:args |
|
1180 |
"undo method when changing a spec; see 'createUndoSpecModify:' |
|
60 | 1181 |
" |
80
3316c52ef2b7
write back specification to properties after undo modification
ca
parents:
78
diff
changeset
|
1182 |
|builder view spec v props| |
60 | 1183 |
|
134 | 1184 |
props := self propertyOfIdentifier:(args at:2). |
60 | 1185 |
|
134 | 1186 |
props notNil ifTrue:[ |
1187 |
view := props view. |
|
1188 |
spec := args at:1. |
|
1189 |
builder := UIBuilder new. |
|
1190 |
props spec:spec. |
|
80
3316c52ef2b7
write back specification to properties after undo modification
ca
parents:
78
diff
changeset
|
1191 |
|
134 | 1192 |
spec needsRebuildForAttributes ifTrue:[ |
1193 |
v := spec buildViewWithLayoutFor:builder in:view superView. |
|
1194 |
v realize. |
|
1195 |
view destroy. |
|
1196 |
view become:v |
|
1197 |
] ifFalse:[ |
|
1198 |
spec setAttributesIn:view with:builder. |
|
1199 |
self elementChangedSize:view. |
|
1200 |
]. |
|
1201 |
listHolder propertyChanged:props. |
|
1202 |
] |
|
60 | 1203 |
|
1204 |
! ! |
|
1205 |
||
111 | 1206 |
!UIPainterView::ListHolder class methodsFor:'instance creation'! |
1207 |
||
1208 |
for:aPainter |
|
1209 |
^ self new for:aPainter |
|
1210 |
! ! |
|
1211 |
||
1212 |
!UIPainterView::ListHolder methodsFor:'accessing'! |
|
1213 |
||
1214 |
painter |
|
1215 |
"returns painter |
|
1216 |
" |
|
1217 |
^ painter |
|
1218 |
! |
|
1219 |
||
1220 |
propertyAt:anIndex |
|
1221 |
"returns property at an index |
|
1222 |
" |
|
1223 |
^ propertyList at:anIndex |
|
1224 |
! ! |
|
1225 |
||
1226 |
!UIPainterView::ListHolder methodsFor:'adding & removing'! |
|
1227 |
||
1228 |
add:aProperty |
|
1229 |
"add property and update list |
|
1230 |
" |
|
1231 |
|idx list name last| |
|
1232 |
||
1233 |
list := self list. |
|
1234 |
idx := self findParentProperty:aProperty. |
|
1235 |
name := aProperty name. |
|
1236 |
||
1237 |
idx == 0 ifTrue:[ |
|
1238 |
last := list size |
|
1239 |
] ifFalse:[ |
|
1240 |
last := self lastInGroupStartingAt:idx. |
|
1241 |
name := (String new:(4+((list at:idx) leftIndent))), name. |
|
1242 |
]. |
|
1243 |
propertyList add:aProperty afterIndex:last. |
|
1244 |
list add:name afterIndex:last. |
|
1245 |
self changed:#size |
|
1246 |
||
1247 |
||
1248 |
! |
|
1249 |
||
1250 |
remove:aView |
|
1251 |
"remove all view relevant resources |
|
1252 |
" |
|
1253 |
|start| |
|
1254 |
||
1255 |
aView notNil ifTrue:[ |
|
1256 |
start := self findProperty:[:p| p view == aView ]. |
|
1257 |
||
1258 |
start ~~ 0 ifTrue:[ |
|
1259 |
self basicRemove:start. |
|
1260 |
self changed:#size. |
|
1261 |
] |
|
1262 |
] |
|
1263 |
! |
|
1264 |
||
1265 |
removeAll |
|
1266 |
masterElement := nil. |
|
1267 |
self selection:#(). |
|
1268 |
||
1269 |
[propertyList notEmpty] whileTrue:[ |
|
1270 |
self basicRemove:1 |
|
1271 |
]. |
|
1272 |
self changed:#size. |
|
1273 |
||
1274 |
! ! |
|
1275 |
||
1276 |
!UIPainterView::ListHolder methodsFor:'change & update'! |
|
1277 |
||
1278 |
changed:aParameter |
|
1279 |
"notify all dependents that the receiver has changed somehow. |
|
1280 |
Each dependent gets a '#update:'-message with aParameter |
|
1281 |
as argument. In case of disabled no notifications are raised |
|
1282 |
" |
|
1283 |
disabledChanged ifFalse:[ |
|
1284 |
super changed:aParameter |
|
1285 |
] |
|
1286 |
! |
|
1287 |
||
1288 |
disableNotificationsWhileEvaluating:aBlock |
|
1289 |
"perform block without notification; after evaluation of block, |
|
1290 |
a #size changed notification is raised |
|
1291 |
" |
|
1292 |
|oldState| |
|
1293 |
||
1294 |
oldState := disabledChanged. |
|
1295 |
disabledChanged := true. |
|
1296 |
aBlock value. |
|
1297 |
disabledChanged := oldState. |
|
1298 |
self changed:#size. |
|
1299 |
! |
|
1300 |
||
1301 |
propertyChanged:aProperty |
|
1302 |
"property list changed; update list names |
|
1303 |
" |
|
1304 |
|list idx oldName newName wspName view indent mid| |
|
1305 |
||
1306 |
view := aProperty view. |
|
1307 |
idx := self findProperty:[:p| p view == view ]. |
|
1308 |
||
1309 |
idx == 0 ifTrue:[ |
|
1310 |
^ self error |
|
1311 |
]. |
|
1312 |
||
1313 |
list := self list. |
|
1314 |
oldName := list at:idx. |
|
1315 |
wspName := oldName string withoutSeparators. |
|
1316 |
newName := aProperty name. |
|
1317 |
||
1318 |
wspName = newName ifFalse:[ |
|
1319 |
mid := self masterElement. |
|
1320 |
list at:idx put:((String new:(oldName leftIndent)), newName). |
|
1321 |
||
1322 |
idx == mid ifTrue:[ |
|
1323 |
masterElement := nil. |
|
1324 |
self masterElement:idx |
|
1325 |
]. |
|
1326 |
]. |
|
1327 |
self changed:#property |
|
1328 |
||
1329 |
! ! |
|
1330 |
||
1331 |
!UIPainterView::ListHolder methodsFor:'enumerating'! |
|
1332 |
||
1333 |
propertiesDo:aBlock |
|
1334 |
"evaluate a block for each property |
|
1335 |
" |
|
1336 |
propertyList do:aBlock |
|
1337 |
! ! |
|
1338 |
||
1339 |
!UIPainterView::ListHolder methodsFor:'initialization'! |
|
1340 |
||
1341 |
for:aPainter |
|
1342 |
"initialize for a painter |
|
1343 |
" |
|
119 | 1344 |
painter := aPainter. |
121 | 1345 |
disabledChanged := false. |
111 | 1346 |
self list:(OrderedCollection new). |
1347 |
propertyList := OrderedCollection new. |
|
1348 |
self selection:#(). |
|
1349 |
self addDependent:painter. |
|
1350 |
||
1351 |
! ! |
|
1352 |
||
1353 |
!UIPainterView::ListHolder methodsFor:'private'! |
|
1354 |
||
1355 |
basicRemove:start |
|
1356 |
"remove all resources assigned to a group starting at start; |
|
1357 |
no notifications are raised |
|
1358 |
" |
|
1359 |
|end view superView| |
|
1360 |
||
1361 |
end := self lastInGroupStartingAt:start. |
|
1362 |
view := (propertyList at:start) view. |
|
1363 |
||
1364 |
view notNil ifTrue:[ |
|
1365 |
superView := view superView. |
|
1366 |
view destroy. |
|
1367 |
superView sizeChanged:nil. |
|
1368 |
]. |
|
1369 |
||
1370 |
propertyList removeFromIndex:start toIndex:end. |
|
1371 |
self list removeFromIndex:start toIndex:end. |
|
1372 |
! |
|
1373 |
||
1374 |
masterElement |
|
1375 |
"returns index of master |
|
1376 |
" |
|
1377 |
^ self indexOfName:masterElement. |
|
1378 |
! |
|
1379 |
||
1380 |
masterElement:newIndex |
|
1381 |
"change master of selection |
|
1382 |
" |
|
1383 |
|name list oldIdx| |
|
1384 |
||
1385 |
(oldIdx := self masterElement) ~~ newIndex ifTrue:[ |
|
1386 |
list := self list. |
|
1387 |
||
1388 |
oldIdx ~~ 0 ifTrue:[ |
|
1389 |
list at:oldIdx put:masterElement |
|
1390 |
]. |
|
1391 |
newIndex ~~ 0 ifTrue:[ |
|
1392 |
masterElement := list at:newIndex. |
|
1393 |
name := Text string:masterElement. |
|
1394 |
name emphasizeFrom:(1+(name leftIndent)) with:#(#bold #underline). |
|
1395 |
list at:newIndex put:name. |
|
1396 |
] ifFalse:[ |
|
1397 |
masterElement := nil |
|
1398 |
]. |
|
1399 |
self changed:#list. |
|
1400 |
] |
|
1401 |
! ! |
|
1402 |
||
1403 |
!UIPainterView::ListHolder methodsFor:'searching'! |
|
1404 |
||
1405 |
detectProperty:aBlock |
|
1406 |
"find the property, for which evaluation of the argument, aBlock |
|
1407 |
returns true; return the property or nil if none detected |
|
1408 |
" |
|
1409 |
|idx| |
|
1410 |
||
1411 |
idx := self findProperty:aBlock. |
|
1412 |
idx ~~ 0 ifTrue:[ ^ propertyList at:idx ]. |
|
1413 |
^ nil |
|
1414 |
! |
|
1415 |
||
1416 |
findParentProperty:aChildProp |
|
1417 |
"returns index of parent or 0 |
|
1418 |
" |
|
1419 |
|view index| |
|
1420 |
||
1421 |
view := aChildProp view. |
|
1422 |
||
1423 |
view notNil ifTrue:[ |
|
1424 |
[ (view := view superView) notNil ] whileTrue:[ |
|
1425 |
index := self findProperty:[:aProp| aProp view == view ]. |
|
1426 |
index ~~ 0 ifTrue:[ |
|
1427 |
^ index |
|
1428 |
] |
|
1429 |
] |
|
1430 |
]. |
|
1431 |
^ 0 |
|
1432 |
||
1433 |
||
1434 |
! |
|
1435 |
||
1436 |
findProperty:aBlock |
|
1437 |
"find the first property, for which evaluation of the argument, aBlock |
|
1438 |
returns true; return its index or 0 if none detected |
|
1439 |
" |
|
1440 |
^ propertyList findFirst:aBlock |
|
1441 |
! |
|
1442 |
||
1443 |
indexOfName:aString |
|
1444 |
"returns index assigned to a string or 0 |
|
1445 |
" |
|
1446 |
|name list size| |
|
1447 |
||
1448 |
aString notNil ifTrue:[ |
|
1449 |
name := aString string withoutSeparators. |
|
1450 |
size := name size. |
|
1451 |
list := self list. |
|
1452 |
||
1453 |
list keysAndValuesDo:[:anIndex :aName| |
|
1454 |
|el| |
|
1455 |
||
1456 |
el := aName string. |
|
1457 |
(el endsWith:name) ifTrue:[ |
|
1458 |
(el size - el leftIndent) == name size ifTrue:[ |
|
1459 |
^ anIndex |
|
1460 |
] |
|
1461 |
] |
|
1462 |
] |
|
1463 |
]. |
|
1464 |
^ 0 |
|
1465 |
||
1466 |
! |
|
1467 |
||
1468 |
lastInGroupStartingAt:start |
|
1469 |
"returns last index of a group |
|
1470 |
" |
|
1471 |
|end list idt| |
|
1472 |
||
1473 |
list := self list. |
|
1474 |
||
1475 |
start < list size ifTrue:[ |
|
1476 |
idt := (list at:start) leftIndent. |
|
1477 |
end := list findFirst:[:el|(el leftIndent) <= idt] startingAt:(start+1). |
|
1478 |
end ~~ 0 ifTrue:[ |
|
1479 |
^ end - 1 |
|
1480 |
] |
|
1481 |
]. |
|
1482 |
^ list size |
|
1483 |
! ! |
|
1484 |
||
1485 |
!UIPainterView::ListHolder methodsFor:'selection'! |
|
1486 |
||
1487 |
selectGroup |
|
1488 |
"select all elements assigned to master |
|
1489 |
" |
|
1490 |
|start end sel size| |
|
1491 |
||
119 | 1492 |
painter enabled ifTrue:[ |
111 | 1493 |
(start := self masterElement) ~~ 0 ifTrue:[ |
1494 |
end := self lastInGroupStartingAt:start. |
|
1495 |
size := end - start + 1. |
|
1496 |
sel := Array new:size. |
|
1497 |
||
1498 |
1 to:size do:[:i| |
|
1499 |
sel at:i put:start. |
|
1500 |
start := start + 1 |
|
1501 |
]. |
|
1502 |
self selectionIndex:sel. |
|
1503 |
] ifFalse:[ |
|
1504 |
(self selectionIndex) size == 0 ifFalse:[ |
|
1505 |
self selectionIndex:#() |
|
1506 |
]. |
|
1507 |
] |
|
1508 |
] |
|
1509 |
! |
|
1510 |
||
1511 |
selectedProperty |
|
1512 |
"returns current selected instance; in case of multiple selection |
|
1513 |
or no selection nil is returned |
|
1514 |
" |
|
1515 |
|selection| |
|
1516 |
selection := self selectionIndex. |
|
1517 |
||
1518 |
selection size == 1 ifTrue:[ |
|
137 | 1519 |
propertyList size ~~ 0 ifTrue:[ |
1520 |
^ propertyList at:(selection first) |
|
1521 |
] |
|
111 | 1522 |
]. |
1523 |
^ nil |
|
1524 |
! |
|
1525 |
||
1526 |
selectionIndex:aList |
|
1527 |
|masterIndex aSel| |
|
1528 |
||
119 | 1529 |
painter enabled ifTrue:[aSel := aList] |
1530 |
ifFalse:[aSel := nil]. |
|
111 | 1531 |
|
1532 |
aSel size ~~ 0 ifTrue:[masterIndex := aSel at:1] |
|
1533 |
ifFalse:[masterIndex := 0]. |
|
1534 |
||
1535 |
self masterElement:masterIndex. |
|
1536 |
super selectionIndex:aSel |
|
1537 |
! ! |
|
1538 |
||
180 | 1539 |
!UIPainterView::ViewProperty class methodsFor:'documentation'! |
1540 |
||
1541 |
version |
|
1542 |
^ '$Header$' |
|
1543 |
! ! |
|
1544 |
||
1545 |
!UIPainterView::ViewProperty class methodsFor:'instance creation'! |
|
1546 |
||
1547 |
new |
|
1548 |
Identifier notNil ifTrue:[Identifier := Identifier + 1] |
|
1549 |
ifFalse:[Identifier := 1]. |
|
1550 |
||
1551 |
^ self basicNew initialize |
|
1552 |
! ! |
|
1553 |
||
1554 |
!UIPainterView::ViewProperty methodsFor:'accessing'! |
|
1555 |
||
1556 |
identifier |
|
1557 |
"return the unique identifier assigned to property |
|
1558 |
" |
|
1559 |
^ identifier |
|
1560 |
! |
|
1561 |
||
1562 |
identifier:anIdentifier |
|
1563 |
"set the unique identifier assigned to property; called after an restore of |
|
1564 |
a deleted instance |
|
1565 |
" |
|
1566 |
identifier := anIdentifier |
|
1567 |
! |
|
1568 |
||
1569 |
spec |
|
1570 |
"return the value of the instance variable 'spec' (automatically generated)" |
|
1571 |
||
1572 |
^ spec! |
|
1573 |
||
1574 |
spec:something |
|
1575 |
"set the value of the instance variable 'spec' (automatically generated)" |
|
1576 |
||
1577 |
spec := something.! |
|
1578 |
||
1579 |
view |
|
1580 |
"return the value of the instance variable 'view' (automatically generated)" |
|
1581 |
||
1582 |
^ view! |
|
1583 |
||
1584 |
view:something |
|
1585 |
"set the value of the instance variable 'view' (automatically generated)" |
|
1586 |
||
1587 |
view := something.! ! |
|
1588 |
||
1589 |
!UIPainterView::ViewProperty methodsFor:'initialization'! |
|
1590 |
||
1591 |
initialize |
|
1592 |
super initialize. |
|
1593 |
identifier := Identifier |
|
1594 |
! ! |
|
1595 |
||
1596 |
!UIPainterView::ViewProperty methodsFor:'misc'! |
|
1597 |
||
1598 |
extractNumberStartingAt:anIndex |
|
1599 |
"return the number from the name starting at anIndex or 0. |
|
1600 |
" |
|
1601 |
|val| |
|
1602 |
||
1603 |
val := 0. |
|
1604 |
||
1605 |
self name from:anIndex do:[:c| |
|
1606 |
c isDigit ifTrue:[val := val * 10 + c digitValue] |
|
1607 |
ifFalse:[^ 0] |
|
1608 |
]. |
|
1609 |
^ val |
|
1610 |
||
1611 |
! ! |
|
1612 |
||
1613 |
!UIPainterView::ViewProperty methodsFor:'spec messages'! |
|
1614 |
||
1615 |
doesNotUnderstand:aMessage |
|
1616 |
spec notNil ifTrue:[ |
|
1617 |
(spec respondsTo:(aMessage selector)) ifTrue:[^ aMessage sendTo:spec] |
|
1618 |
]. |
|
1619 |
^ nil |
|
1620 |
! |
|
1621 |
||
1622 |
layout |
|
1623 |
spec layout |
|
1624 |
! |
|
1625 |
||
1626 |
layout:aLayout |
|
1627 |
spec layout:aLayout |
|
1628 |
! |
|
1629 |
||
1630 |
name |
|
1631 |
^ spec name |
|
1632 |
! |
|
1633 |
||
1634 |
name:aName |
|
1635 |
spec name:aName |
|
1636 |
! ! |
|
1637 |
||
60 | 1638 |
!UIPainterView class methodsFor:'documentation'! |
1639 |
||
1640 |
version |
|
1641 |
^ '$Header$' |
|
1642 |
! ! |