author | ca |
Wed, 11 Jun 1997 16:00:53 +0200 | |
changeset 146 | ae84facd80be |
parent 143 | 9add9e2609d9 |
child 147 | 060fc1ac8d82 |
permissions | -rw-r--r-- |
93 | 1 |
" |
2 |
COPYRIGHT (c) 1997 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 |
||
112 | 14 |
ApplicationModel subclass:#UISelectionPanel |
15 |
instanceVariableNames:'selection selectors receiver' |
|
93 | 16 |
classVariableNames:'' |
17 |
poolDictionaries:'' |
|
18 |
category:'Interface-UIPainter' |
|
19 |
! |
|
20 |
||
112 | 21 |
View subclass:#Canvas |
22 |
instanceVariableNames:'inputView selection specification lastClickPoint labelHolder |
|
23 |
nameHolder' |
|
24 |
classVariableNames:'' |
|
25 |
poolDictionaries:'' |
|
26 |
privateIn:UISelectionPanel |
|
27 |
! |
|
28 |
||
93 | 29 |
DropObject subclass:#DropSpecification |
30 |
instanceVariableNames:'' |
|
31 |
classVariableNames:'' |
|
32 |
poolDictionaries:'' |
|
112 | 33 |
privateIn:UISelectionPanel::Canvas |
93 | 34 |
! |
35 |
||
36 |
!UISelectionPanel class methodsFor:'documentation'! |
|
37 |
||
38 |
copyright |
|
39 |
" |
|
40 |
COPYRIGHT (c) 1997 by eXept Software AG |
|
41 |
All Rights Reserved |
|
42 |
||
43 |
This software is furnished under a license and may be used |
|
44 |
only in accordance with the terms of that license and with the |
|
45 |
inclusion of the above copyright notice. This software may not |
|
46 |
be provided or otherwise made available to, or used by, any |
|
47 |
other person. No title to or ownership of the software is |
|
48 |
hereby transferred. |
|
49 |
" |
|
50 |
||
51 |
! |
|
52 |
||
53 |
documentation |
|
54 |
" |
|
55 |
implements a selection panel, keeping widgets which could be placed |
|
56 |
into the UIPainter by drag & drop. |
|
57 |
||
58 |
[author:] |
|
59 |
Claus Atzkern |
|
60 |
||
61 |
[see also:] |
|
62 |
TabView |
|
63 |
UIPainter |
|
104 | 64 |
|
65 |
[start with:] |
|
112 | 66 |
UISelectionPanel open |
104 | 67 |
|
93 | 68 |
" |
69 |
||
70 |
! ! |
|
71 |
||
72 |
!UISelectionPanel class methodsFor:'instance creation'! |
|
73 |
||
135 | 74 |
newDefault |
112 | 75 |
|appl| |
93 | 76 |
|
112 | 77 |
appl := self new. |
93 | 78 |
|
112 | 79 |
appl labels:#( 'Button & Toggle' |
93 | 80 |
'Panel' |
81 |
'Text' |
|
82 |
'View' |
|
83 |
'Menu & Combo' |
|
104 | 84 |
'Slider' |
93 | 85 |
) |
112 | 86 |
|
93 | 87 |
selectors:#( #buttonToggleSpec |
88 |
#panelSpec |
|
89 |
#textSpec |
|
90 |
#viewsSpec |
|
91 |
#menuComboSpec |
|
104 | 92 |
#sliderSpec |
93 | 93 |
) |
94 |
receiver:self. |
|
95 |
||
135 | 96 |
^ appl. |
97 |
! |
|
98 |
||
99 |
open |
|
100 |
|appl| |
|
101 |
||
102 |
appl := self newDefault. |
|
112 | 103 |
appl open. |
135 | 104 |
^ appl. |
93 | 105 |
! ! |
106 |
||
142 | 107 |
!UISelectionPanel class methodsFor:'interface specs'! |
93 | 108 |
|
109 |
buttonToggleSpec |
|
110 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
111 |
||
112 |
"do not manually edit this - the painter/builder may not be able to |
|
113 |
handle the specification if its corrupted." |
|
114 |
||
115 |
" |
|
116 |
UIPainter new openOnClass:UISelectionPanel andSelector:#buttonToggleSpec |
|
117 |
UISelectionPanel new openInterface:#buttonToggleSpec |
|
118 |
" |
|
119 |
||
120 |
<resource: #canvas> |
|
121 |
||
122 |
^ |
|
112 | 123 |
|
93 | 124 |
#(#FullSpec |
125 |
#'window:' |
|
126 |
#(#WindowSpec |
|
127 |
#'name:' 'uIPainterView' |
|
128 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
129 |
#'label:' 'unnamed' |
|
105 | 130 |
#'bounds:' #(#Rectangle 0 0 439 193) |
93 | 131 |
) |
132 |
#'component:' |
|
133 |
#(#SpecCollection |
|
134 |
#'collection:' |
|
135 |
#( |
|
136 |
#(#ArrowButtonSpec |
|
137 |
#'name:' 'ArrowButton up' |
|
105 | 138 |
#'layout:' #(#LayoutFrame 237 0 20 0 259 0 42 0) |
93 | 139 |
#'isTriggerOnDown:' true |
140 |
#'direction:' #up |
|
141 |
) |
|
142 |
#(#ActionButtonSpec |
|
143 |
#'name:' 'Button' |
|
105 | 144 |
#'layout:' #(#LayoutFrame 20 0 20 0 119 0 42 0) |
93 | 145 |
#'label:' 'Button' |
146 |
#'isTriggerOnDown:' false |
|
147 |
) |
|
148 |
#(#RadioButtonSpec |
|
149 |
#'name:' 'RadioButton' |
|
105 | 150 |
#'layout:' #(#LayoutFrame 127 0.0 20 0 226 0 42 0) |
93 | 151 |
#'label:' 'RadioButton' |
152 |
#'isTriggerOnDown:' true |
|
153 |
#'showLamp:' true |
|
154 |
#'lampColor:' #(#Color 100.0 100.0 0.0) |
|
155 |
) |
|
156 |
#(#ArrowButtonSpec |
|
157 |
#'name:' 'ArrowButton down' |
|
105 | 158 |
#'layout:' #(#LayoutFrame 238 0 51 0 260 0 73 0) |
93 | 159 |
#'hasCharacterOrientedLabel:' false |
160 |
#'isTriggerOnDown:' true |
|
161 |
#'direction:' #down |
|
162 |
) |
|
163 |
#(#ArrowButtonSpec |
|
164 |
#'name:' 'ArrowButton left' |
|
105 | 165 |
#'layout:' #(#LayoutFrame 238 0 82 0 260 0 104 0) |
93 | 166 |
#'hasCharacterOrientedLabel:' false |
167 |
#'isTriggerOnDown:' true |
|
168 |
#'direction:' #left |
|
169 |
) |
|
170 |
#(#ArrowButtonSpec |
|
171 |
#'name:' 'ArrowButton right' |
|
105 | 172 |
#'layout:' #(#LayoutFrame 238 0 113 0 260 0 135 0) |
93 | 173 |
#'hasCharacterOrientedLabel:' false |
174 |
#'isTriggerOnDown:' true |
|
175 |
#'direction:' #right |
|
176 |
) |
|
177 |
#(#CheckToggleSpec |
|
178 |
#'name:' 'CheckToggle' |
|
105 | 179 |
#'layout:' #(#LayoutFrame 297 0 82 0 317 0 102 0) |
93 | 180 |
#'isTriggerOnDown:' true |
181 |
#'showLamp:' false |
|
182 |
#'lampColor:' #(#Color 100.0 100.0 0.0) |
|
183 |
) |
|
184 |
#(#ToggleSpec |
|
185 |
#'name:' 'Toggle' |
|
105 | 186 |
#'layout:' #(#LayoutFrame 297 0 20 0 396 0 42 0) |
93 | 187 |
#'label:' 'Toggle' |
188 |
#'isTriggerOnDown:' true |
|
189 |
#'showLamp:' true |
|
190 |
#'lampColor:' #(#Color 100.0 100.0 0.0) |
|
191 |
) |
|
192 |
#(#CheckBoxSpec |
|
193 |
#'name:' 'CheckBox' |
|
105 | 194 |
#'layout:' #(#LayoutFrame 295 0 51 0 396 0 73 0) |
93 | 195 |
#'tabable:' false |
196 |
#'label:' 'CheckBox' |
|
197 |
#'translateLabel:' false |
|
198 |
) |
|
105 | 199 |
#(#ActionButtonSpec |
200 |
#'name:' 'ok' |
|
201 |
#'layout:' #(#LayoutFrame 20 0 51 0 119 0 73 0) |
|
202 |
#'label:' 'ok' |
|
203 |
#'model:' #accept |
|
204 |
#'isTriggerOnDown:' false |
|
205 |
) |
|
206 |
#(#ActionButtonSpec |
|
207 |
#'name:' 'cancel' |
|
208 |
#'layout:' #(#LayoutFrame 20 0 82 0 119 0 104 0) |
|
209 |
#'label:' 'cancel' |
|
210 |
#'model:' #cancel |
|
211 |
#'isTriggerOnDown:' false |
|
212 |
) |
|
213 |
#(#ActionButtonSpec |
|
214 |
#'name:' 'help' |
|
215 |
#'layout:' #(#LayoutFrame 20 0 113 0 119 0 135 0) |
|
216 |
#'label:' 'help' |
|
217 |
#'model:' #help |
|
218 |
#'isTriggerOnDown:' false |
|
219 |
) |
|
93 | 220 |
) |
221 |
) |
|
222 |
) |
|
223 |
||
112 | 224 |
|
93 | 225 |
! |
226 |
||
142 | 227 |
menuComboSpec |
228 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
229 |
||
230 |
"do not manually edit this - the painter/builder may not be able to |
|
231 |
handle the specification if its corrupted." |
|
232 |
||
233 |
" |
|
234 |
UIPainter new openOnClass:UISelectionPanel andSelector:#menuComboSpec |
|
235 |
UISelectionPanel new openInterface:#menuComboSpec |
|
236 |
" |
|
237 |
||
238 |
<resource: #canvas> |
|
239 |
||
240 |
^ |
|
241 |
||
242 |
#(#FullSpec |
|
243 |
#'window:' |
|
244 |
#(#WindowSpec |
|
245 |
#'name:' 'uIPainterView' |
|
246 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
247 |
#'label:' 'unnamed' |
|
248 |
#'bounds:' #(#Rectangle 0 0 464 253) |
|
249 |
) |
|
250 |
#'component:' |
|
251 |
#(#SpecCollection |
|
252 |
#'collection:' |
|
253 |
#( |
|
254 |
#(#ComboBoxSpec |
|
255 |
#'name:' 'ComboBox' |
|
256 |
#'layout:' #(#LayoutFrame 20 0 20 0 123 0 40 0) |
|
257 |
#'immediateAccept:' true |
|
258 |
) |
|
259 |
#(#ComboListSpec |
|
260 |
#'name:' 'ComboList' |
|
261 |
#'layout:' #(#LayoutFrame 20 0 51 0 123 0 71 0) |
|
262 |
#'tabable:' false |
|
263 |
) |
|
264 |
#(#PopUpListSpec |
|
265 |
#'name:' 'PopUpList' |
|
266 |
#'layout:' #(#LayoutFrame 147 0 20 0 250 0 42 0) |
|
267 |
#'label:' 'PopUpList' |
|
268 |
) |
|
269 |
#(#MenuPanelSpec |
|
270 |
#'name:' 'MenuPanel' |
|
271 |
#'layout:' #(#LayoutFrame 147 0 67 0 250 0 89 0) |
|
272 |
) |
|
273 |
#(#TabViewSpec |
|
274 |
#'name:' 'TabView' |
|
275 |
#'layout:' #(#LayoutFrame 269 0 20 0 409 0 56 0) |
|
276 |
#'tabWidget:' #Window |
|
277 |
#'direction:' #top |
|
278 |
) |
|
279 |
#(#NoteBookViewSpec |
|
280 |
#'name:' 'noteBookView' |
|
281 |
#'layout:' #(#LayoutFrame 269 0 66 0 409 0 182 0) |
|
282 |
#'level:' 2 |
|
283 |
) |
|
284 |
#(#LabelSpec |
|
285 |
#'name:' 'label1' |
|
286 |
#'layout:' #(#LayoutFrame 147 0 51 0 250 0 67 0) |
|
287 |
#'label:' 'MenuPanel' |
|
288 |
#'canUIDrag:' false |
|
289 |
) |
|
290 |
) |
|
291 |
) |
|
292 |
) |
|
293 |
! |
|
294 |
||
93 | 295 |
panelSpec |
296 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
297 |
||
298 |
"do not manually edit this - the painter/builder may not be able to |
|
299 |
handle the specification if its corrupted." |
|
300 |
||
301 |
" |
|
302 |
UIPainter new openOnClass:UISelectionPanel andSelector:#panelSpec |
|
303 |
UISelectionPanel new openInterface:#panelSpec |
|
304 |
" |
|
305 |
||
306 |
<resource: #canvas> |
|
307 |
||
308 |
^ |
|
112 | 309 |
|
93 | 310 |
#(#FullSpec |
311 |
#'window:' |
|
312 |
#(#WindowSpec |
|
313 |
#'name:' 'uIPainterView' |
|
314 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
315 |
#'label:' 'unnamed' |
|
105 | 316 |
#'bounds:' #(#Rectangle 0 0 475 136) |
93 | 317 |
) |
318 |
#'component:' |
|
319 |
#(#SpecCollection |
|
320 |
#'collection:' |
|
321 |
#( |
|
322 |
#(#HorizontalPanelViewSpec |
|
323 |
#'name:' 'HorizontalPanelView' |
|
105 | 324 |
#'layout:' #(#LayoutFrame 20 0 20 0 104 0 105 0) |
93 | 325 |
#'component:' |
326 |
#(#SpecCollection |
|
327 |
#'collection:' |
|
328 |
#( |
|
112 | 329 |
#(#LabelSpec |
330 |
#'name:' 'label1' |
|
93 | 331 |
#'label:' 'A' |
112 | 332 |
#'level:' 2 |
333 |
#'extent:' #(#Point 23 23) |
|
93 | 334 |
#'canUIDrag:' false |
335 |
) |
|
112 | 336 |
#(#LabelSpec |
337 |
#'name:' 'label2' |
|
93 | 338 |
#'label:' 'B' |
112 | 339 |
#'level:' 2 |
340 |
#'extent:' #(#Point 23 23) |
|
104 | 341 |
#'canUIDrag:' false |
342 |
) |
|
112 | 343 |
#(#LabelSpec |
344 |
#'name:' 'label3' |
|
104 | 345 |
#'label:' 'C' |
112 | 346 |
#'level:' 2 |
347 |
#'extent:' #(#Point 23 23) |
|
93 | 348 |
#'canUIDrag:' false |
349 |
) |
|
350 |
) |
|
351 |
) |
|
352 |
#'horizontalLayout:' #center |
|
353 |
#'verticalLayout:' #center |
|
354 |
#'horizontalSpace:' 3 |
|
355 |
#'verticalSpace:' 3 |
|
356 |
) |
|
357 |
#(#VariableHorizontalPanelSpec |
|
358 |
#'name:' 'VariableHorizontalPanel' |
|
112 | 359 |
#'layout:' #(#LayoutFrame 249 0 20 0 337 0 105 0) |
93 | 360 |
#'component:' |
361 |
#(#SpecCollection |
|
362 |
#'collection:' |
|
363 |
#( |
|
112 | 364 |
#(#LabelSpec |
365 |
#'name:' 'label4' |
|
93 | 366 |
#'label:' 'A' |
112 | 367 |
#'level:' 2 |
93 | 368 |
#'canUIDrag:' false |
369 |
) |
|
112 | 370 |
#(#LabelSpec |
371 |
#'name:' 'label5' |
|
93 | 372 |
#'label:' 'B' |
112 | 373 |
#'level:' 2 |
93 | 374 |
#'canUIDrag:' false |
375 |
) |
|
376 |
) |
|
377 |
) |
|
378 |
) |
|
379 |
#(#VerticalPanelViewSpec |
|
380 |
#'name:' 'VerticalPanelView' |
|
112 | 381 |
#'layout:' #(#LayoutFrame 110 0 20 0 168 0 105 0) |
93 | 382 |
#'component:' |
383 |
#(#SpecCollection |
|
384 |
#'collection:' |
|
385 |
#( |
|
112 | 386 |
#(#LabelSpec |
387 |
#'name:' 'label6' |
|
93 | 388 |
#'label:' 'A' |
112 | 389 |
#'level:' 2 |
390 |
#'extent:' #(#Point 23 23) |
|
93 | 391 |
#'canUIDrag:' false |
392 |
) |
|
112 | 393 |
#(#LabelSpec |
394 |
#'name:' 'label7' |
|
93 | 395 |
#'label:' 'B' |
112 | 396 |
#'level:' 2 |
397 |
#'extent:' #(#Point 23 23) |
|
104 | 398 |
#'canUIDrag:' false |
399 |
) |
|
112 | 400 |
#(#LabelSpec |
401 |
#'name:' 'label8' |
|
104 | 402 |
#'label:' 'C' |
112 | 403 |
#'level:' 2 |
404 |
#'extent:' #(#Point 23 23) |
|
93 | 405 |
#'canUIDrag:' false |
406 |
) |
|
407 |
) |
|
408 |
) |
|
409 |
#'horizontalLayout:' #center |
|
410 |
#'verticalLayout:' #center |
|
411 |
#'horizontalSpace:' 3 |
|
412 |
#'verticalSpace:' 3 |
|
413 |
) |
|
414 |
#(#VariableVerticalPanelSpec |
|
415 |
#'name:' 'VariableVerticalPanel' |
|
112 | 416 |
#'layout:' #(#LayoutFrame 342 0 20 0 426 0 105 0) |
93 | 417 |
#'component:' |
418 |
#(#SpecCollection |
|
419 |
#'collection:' |
|
420 |
#( |
|
112 | 421 |
#(#LabelSpec |
422 |
#'name:' 'label9' |
|
93 | 423 |
#'label:' 'A' |
112 | 424 |
#'level:' 2 |
93 | 425 |
#'canUIDrag:' false |
426 |
) |
|
112 | 427 |
#(#LabelSpec |
428 |
#'name:' 'label10' |
|
93 | 429 |
#'label:' 'B' |
112 | 430 |
#'level:' 2 |
93 | 431 |
#'canUIDrag:' false |
432 |
) |
|
433 |
) |
|
434 |
) |
|
435 |
) |
|
104 | 436 |
#(#PanelViewSpec |
437 |
#'name:' 'PanelView' |
|
112 | 438 |
#'layout:' #(#LayoutFrame 174 0 20 0 232 0 105 0) |
104 | 439 |
#'component:' |
440 |
#(#SpecCollection |
|
441 |
#'collection:' |
|
442 |
#( |
|
112 | 443 |
#(#LabelSpec |
444 |
#'name:' 'label11' |
|
104 | 445 |
#'label:' 'A' |
112 | 446 |
#'level:' 2 |
447 |
#'extent:' #(#Point 23 23) |
|
104 | 448 |
#'canUIDrag:' false |
449 |
) |
|
112 | 450 |
#(#LabelSpec |
451 |
#'name:' 'label12' |
|
104 | 452 |
#'label:' 'B' |
112 | 453 |
#'level:' 2 |
454 |
#'extent:' #(#Point 23 23) |
|
104 | 455 |
#'canUIDrag:' false |
456 |
) |
|
112 | 457 |
#(#LabelSpec |
458 |
#'name:' 'label13' |
|
104 | 459 |
#'label:' 'C' |
112 | 460 |
#'level:' 2 |
461 |
#'extent:' #(#Point 23 23) |
|
104 | 462 |
#'canUIDrag:' false |
463 |
) |
|
112 | 464 |
#(#LabelSpec |
465 |
#'name:' 'label14' |
|
104 | 466 |
#'label:' 'D' |
112 | 467 |
#'level:' 2 |
468 |
#'extent:' #(#Point 23 23) |
|
104 | 469 |
#'canUIDrag:' false |
470 |
) |
|
112 | 471 |
#(#LabelSpec |
472 |
#'name:' 'label15' |
|
104 | 473 |
#'label:' 'E' |
112 | 474 |
#'level:' 2 |
475 |
#'extent:' #(#Point 23 23) |
|
104 | 476 |
#'canUIDrag:' false |
477 |
) |
|
478 |
) |
|
479 |
) |
|
480 |
#'horizontalLayout:' #fitSpace |
|
481 |
#'verticalLayout:' #fitSpace |
|
482 |
#'horizontalSpace:' 3 |
|
483 |
#'verticalSpace:' 3 |
|
484 |
) |
|
93 | 485 |
) |
486 |
) |
|
487 |
) |
|
112 | 488 |
|
93 | 489 |
! |
490 |
||
104 | 491 |
sliderSpec |
93 | 492 |
"this window spec was automatically generated by the ST/X UIPainter" |
493 |
||
494 |
"do not manually edit this - the painter/builder may not be able to |
|
495 |
handle the specification if its corrupted." |
|
496 |
||
497 |
" |
|
104 | 498 |
UIPainter new openOnClass:UISelectionPanel andSelector:#sliderSpec |
499 |
UISelectionPanel new openInterface:#sliderSpec |
|
93 | 500 |
" |
501 |
||
502 |
<resource: #canvas> |
|
503 |
||
504 |
^ |
|
112 | 505 |
|
93 | 506 |
#(#FullSpec |
507 |
#'window:' |
|
508 |
#(#WindowSpec |
|
509 |
#'name:' 'uIPainterView' |
|
510 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
511 |
#'label:' 'unnamed' |
|
105 | 512 |
#'bounds:' #(#Rectangle 0 0 445 162) |
93 | 513 |
) |
514 |
#'component:' |
|
515 |
#(#SpecCollection |
|
516 |
#'collection:' |
|
517 |
#( |
|
104 | 518 |
#(#SliderSpec |
519 |
#'name:' 'Vertical Slider' |
|
105 | 520 |
#'layout:' #(#LayoutFrame 20 0 20 0 38 0 108 0) |
104 | 521 |
#'orientation:' #vertical |
93 | 522 |
) |
104 | 523 |
#(#ThumbWheelSpec |
524 |
#'name:' 'Vertical ThumbWheel' |
|
105 | 525 |
#'layout:' #(#LayoutFrame 48 0 20 0 63 0 108 0) |
104 | 526 |
#'orientation:' #vertical |
527 |
#'start:' 0 |
|
528 |
#'stop:' 360 |
|
93 | 529 |
) |
104 | 530 |
#(#ThumbWheelSpec |
531 |
#'name:' 'Horizontal ThumbWheel' |
|
105 | 532 |
#'layout:' #(#LayoutFrame 102 0 20 0 191 0 35 0) |
104 | 533 |
#'orientation:' #horizontal |
534 |
#'start:' 0 |
|
535 |
#'stop:' 360 |
|
93 | 536 |
) |
537 |
#(#SliderSpec |
|
104 | 538 |
#'name:' 'Horizontal Slider' |
105 | 539 |
#'layout:' #(#LayoutFrame 102 0 47 0 191 0 65 0) |
104 | 540 |
#'orientation:' #horizontal |
541 |
#'start:' 0 |
|
542 |
#'stop:' 100 |
|
93 | 543 |
) |
544 |
) |
|
545 |
) |
|
546 |
) |
|
112 | 547 |
|
93 | 548 |
! |
549 |
||
97 | 550 |
textSpec |
551 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
552 |
||
553 |
"do not manually edit this - the painter/builder may not be able to |
|
554 |
handle the specification if its corrupted." |
|
555 |
||
556 |
" |
|
557 |
UIPainter new openOnClass:UISelectionPanel andSelector:#textSpec |
|
558 |
UISelectionPanel new openInterface:#textSpec |
|
559 |
" |
|
560 |
||
561 |
<resource: #canvas> |
|
562 |
||
563 |
^ |
|
139 | 564 |
|
97 | 565 |
#(#FullSpec |
566 |
#'window:' |
|
567 |
#(#WindowSpec |
|
568 |
#'name:' 'uIPainterView' |
|
569 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
570 |
#'label:' 'unnamed' |
|
139 | 571 |
#'bounds:' #(#Rectangle 0 0 467 207) |
97 | 572 |
) |
573 |
#'component:' |
|
574 |
#(#SpecCollection |
|
575 |
#'collection:' |
|
576 |
#( |
|
577 |
#(#InputFieldSpec |
|
578 |
#'name:' 'EditField' |
|
139 | 579 |
#'layout:' #(#LayoutFrame 222 0 109 0 401 0 131 0) |
97 | 580 |
) |
581 |
#(#LabelSpec |
|
582 |
#'name:' 'Text Label' |
|
139 | 583 |
#'layout:' #(#LayoutFrame 222 0 138 0 401 0 160 0) |
97 | 584 |
#'label:' 'Text Label' |
585 |
) |
|
586 |
#(#TextEditorSpec |
|
587 |
#'name:' 'EditTextView' |
|
143
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
588 |
#'layout:' #(#LayoutFrame 20 0 13 0 199 0 101 0) |
139 | 589 |
#'hasHorizontalScrollBar:' true |
590 |
#'hasVerticalScrollBar:' true |
|
591 |
) |
|
592 |
#(#SequenceViewSpec |
|
593 |
#'name:' 'SelectionInListView' |
|
143
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
594 |
#'layout:' #(#LayoutFrame 222 0 13 0 401 0 101 0) |
139 | 595 |
#'hasHorizontalScrollBar:' true |
596 |
#'hasVerticalScrollBar:' true |
|
597 |
) |
|
598 |
#(#HTMLViewSpec |
|
599 |
#'name:' 'HTMLView' |
|
143
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
600 |
#'layout:' #(#LayoutFrame 20 0 109 0 199 0 197 0) |
97 | 601 |
#'hasHorizontalScrollBar:' true |
602 |
#'hasVerticalScrollBar:' true |
|
603 |
) |
|
139 | 604 |
#(#LabelSpec |
605 |
#'name:' 'HTMLViewLabel' |
|
143
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
606 |
#'layout:' #(#LayoutFrame 99 0 178 0 164 0 192 0) |
139 | 607 |
#'label:' 'HTMLView' |
608 |
#'canUIDrag:' false |
|
97 | 609 |
) |
139 | 610 |
#(#LabelSpec |
611 |
#'name:' 'label1' |
|
143
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
612 |
#'layout:' #(#LayoutFrame 91 0 83 0 153 0 97 0) |
139 | 613 |
#'label:' 'EditText' |
614 |
#'canUIDrag:' false |
|
97 | 615 |
) |
139 | 616 |
#(#LabelSpec |
617 |
#'name:' 'label2' |
|
143
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
618 |
#'layout:' #(#LayoutFrame 297 0 83 0 384 0 97 0) |
139 | 619 |
#'label:' 'SelectionInList' |
620 |
#'canUIDrag:' false |
|
98 | 621 |
) |
97 | 622 |
) |
623 |
) |
|
624 |
) |
|
625 |
! |
|
626 |
||
93 | 627 |
viewsSpec |
628 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
629 |
||
630 |
"do not manually edit this - the painter/builder may not be able to |
|
631 |
handle the specification if its corrupted." |
|
632 |
||
633 |
" |
|
634 |
UIPainter new openOnClass:UISelectionPanel andSelector:#viewsSpec |
|
635 |
UISelectionPanel new openInterface:#viewsSpec |
|
636 |
" |
|
637 |
||
638 |
<resource: #canvas> |
|
639 |
||
640 |
^ |
|
135 | 641 |
|
93 | 642 |
#(#FullSpec |
643 |
#'window:' |
|
644 |
#(#WindowSpec |
|
645 |
#'name:' 'uIPainterView' |
|
646 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
647 |
#'label:' 'unnamed' |
|
112 | 648 |
#'bounds:' #(#Rectangle 0 0 485 245) |
93 | 649 |
) |
650 |
#'component:' |
|
651 |
#(#SpecCollection |
|
652 |
#'collection:' |
|
653 |
#( |
|
654 |
#(#FramedBoxSpec |
|
655 |
#'name:' 'FramedBox' |
|
143
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
656 |
#'layout:' #(#LayoutFrame 16 0 14 0 177 0 104 0) |
104 | 657 |
#'label:' 'FramedBox' |
93 | 658 |
#'labelPosition:' #topCenter |
659 |
) |
|
660 |
#(#ViewSpec |
|
98 | 661 |
#'name:' 'View' |
143
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
662 |
#'layout:' #(#LayoutFrame 14 0 116 0 175 0 188 0) |
93 | 663 |
) |
664 |
#(#SubCanvasSpec |
|
98 | 665 |
#'name:' 'SubCanvas' |
143
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
666 |
#'layout:' #(#LayoutFrame 199 0 14 0 360 0 104 0) |
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
667 |
#'hasHorizontalScrollBar:' true |
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
668 |
#'hasVerticalScrollBar:' true |
93 | 669 |
) |
670 |
#(#LabelSpec |
|
112 | 671 |
#'name:' 'subCanvasLabel' |
143
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
672 |
#'layout:' #(#LayoutFrame 272 0 85 0 343 0 102 0) |
93 | 673 |
#'label:' 'SubCanvas' |
674 |
#'canUIDrag:' false |
|
675 |
) |
|
676 |
#(#DividerSpec |
|
677 |
#'name:' 'Horizontal Seperator' |
|
143
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
678 |
#'layout:' #(#LayoutFrame 199 0 116 0 360 0 120 0) |
93 | 679 |
#'orientation:' #horizontal |
680 |
) |
|
681 |
#(#DividerSpec |
|
682 |
#'name:' 'Vertical Seperator' |
|
143
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
683 |
#'layout:' #(#LayoutFrame 356 0 116 0 360 0 188 0) |
93 | 684 |
#'orientation:' #vertical |
685 |
) |
|
104 | 686 |
#(#LabelSpec |
112 | 687 |
#'name:' 'viewLabel' |
143
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
688 |
#'layout:' #(#LayoutFrame 14 0 116 0 65 0 133 0) |
112 | 689 |
#'label:' 'View' |
104 | 690 |
#'canUIDrag:' false |
691 |
) |
|
143
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
692 |
#(#LabelSpec |
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
693 |
#'name:' 'Seperators' |
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
694 |
#'layout:' #(#LayoutFrame 199 0 133 0 270 0 151 0) |
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
695 |
#'label:' 'Seperators' |
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
696 |
#'canUIDrag:' false |
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
697 |
) |
93 | 698 |
) |
699 |
) |
|
700 |
) |
|
139 | 701 |
! |
112 | 702 |
|
703 |
windowSpec |
|
704 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
705 |
||
706 |
"do not manually edit this - the painter/builder may not be able to |
|
707 |
handle the specification if its corrupted." |
|
708 |
||
709 |
" |
|
710 |
UIPainter new openOnClass:UISelectionPanel andSelector:#windowSpec |
|
711 |
UISelectionPanel new openInterface:#windowSpec |
|
712 |
" |
|
713 |
"UISelectionPanel open" |
|
714 |
||
715 |
<resource: #canvas> |
|
716 |
||
717 |
^ |
|
718 |
||
719 |
#(#FullSpec |
|
720 |
#'window:' |
|
721 |
#(#WindowSpec |
|
722 |
#'name:' 'uIPainterView' |
|
723 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
125 | 724 |
#'label:' 'Component Gallery' |
112 | 725 |
#'bounds:' #(#Rectangle 0 0 480 260) |
726 |
) |
|
727 |
#'component:' |
|
728 |
#(#SpecCollection |
|
729 |
#'collection:' |
|
730 |
#( |
|
731 |
#(#LabelSpec |
|
732 |
#'name:' 'label1' |
|
733 |
#'layout:' #(#LayoutFrame 0 0.0 -20 1.0 0 1.0 0 1.0) |
|
734 |
#'label:' 'selection' |
|
142 | 735 |
#'labelChannel:' #nameOfObject |
112 | 736 |
#'level:' 2 |
737 |
#'hasCharacterOrientedLabel:' false |
|
738 |
) |
|
739 |
#(#NoteBookViewSpec |
|
740 |
#'name:' 'noteBookView1' |
|
741 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -21 1.0) |
|
142 | 742 |
#'menu:' #tabList |
112 | 743 |
#'model:' #tabModel |
744 |
#'tabWidget:' #Window |
|
745 |
#'useIndex:' true |
|
746 |
#'level:' 2 |
|
747 |
#'canvas:' #canvas |
|
748 |
) |
|
749 |
) |
|
750 |
) |
|
751 |
) |
|
93 | 752 |
! ! |
753 |
||
754 |
!UISelectionPanel methodsFor:'accessing'! |
|
755 |
||
112 | 756 |
labels:loLabels selectors:loSelectors receiver:aReceiver |
757 |
selectors := loSelectors. |
|
758 |
receiver := aReceiver. |
|
759 |
(self tabList) value:loLabels. |
|
760 |
||
761 |
! ! |
|
762 |
||
763 |
!UISelectionPanel methodsFor:'aspects'! |
|
764 |
||
765 |
canvas |
|
766 |
|holder| |
|
767 |
||
768 |
(holder := builder bindingAt:#canvas) isNil ifTrue:[ |
|
769 |
builder aspectAt:#canvas put:(holder := Canvas new) |
|
770 |
]. |
|
771 |
^ holder |
|
772 |
! |
|
773 |
||
774 |
nameOfObject |
|
775 |
|holder canvas| |
|
776 |
||
777 |
(holder := builder bindingAt:#nameOfObject) isNil ifTrue:[ |
|
778 |
builder aspectAt:#nameOfObject put:(holder := ValueHolder new). |
|
779 |
canvas := self canvas. |
|
780 |
canvas nameHolder:holder. |
|
781 |
]. |
|
782 |
^ holder |
|
783 |
! |
|
784 |
||
785 |
tabList |
|
786 |
"returns list of tab-labels |
|
93 | 787 |
" |
112 | 788 |
|holder| |
789 |
||
790 |
(holder := builder bindingAt:#tabList) isNil ifTrue:[ |
|
791 |
builder aspectAt:#tabList put:(holder := ValueHolder new). |
|
93 | 792 |
]. |
112 | 793 |
^ holder |
93 | 794 |
! |
795 |
||
112 | 796 |
tabModel |
797 |
"returns my model; catching select notifications |
|
798 |
" |
|
799 |
|holder| |
|
800 |
||
801 |
(holder := builder bindingAt:#tabModel) isNil ifTrue:[ |
|
802 |
holder := AspectAdaptor new subject:self; forAspect:#selection. |
|
803 |
builder aspectAt:#tabModel put:holder. |
|
804 |
]. |
|
805 |
^ holder |
|
806 |
||
807 |
! ! |
|
808 |
||
809 |
!UISelectionPanel methodsFor:'selection'! |
|
810 |
||
811 |
selection |
|
812 |
^ selection |
|
813 |
! |
|
814 |
||
815 |
selection:aValue |
|
816 |
|spec| |
|
817 |
||
139 | 818 |
(aValue isNil or:[aValue == 0]) ifTrue:[ |
819 |
^ self |
|
820 |
]. |
|
112 | 821 |
selection ~~ aValue ifTrue:[ |
822 |
(selection := aValue) notNil ifTrue:[ |
|
823 |
selectors size >= aValue ifTrue:[ |
|
824 |
spec := receiver perform:(selectors at:selection) |
|
825 |
] |
|
826 |
]. |
|
827 |
(builder aspectAt:#canvas) specification:spec |
|
828 |
]. |
|
829 |
! ! |
|
830 |
||
831 |
!UISelectionPanel::Canvas methodsFor:'accessing'! |
|
832 |
||
833 |
nameHolder:aValueHolder |
|
834 |
"set value holder which keeps the name of the object |
|
835 |
under the cursor or selected |
|
836 |
" |
|
837 |
nameHolder := aValueHolder |
|
838 |
! |
|
839 |
||
840 |
specification:aSpecOrSpecArray |
|
841 |
"load a new specification |
|
93 | 842 |
" |
843 |
|builder| |
|
844 |
||
845 |
self selection:nil. |
|
846 |
||
112 | 847 |
self subViews copy do:[:aSubView| |
93 | 848 |
aSubView ~~ inputView ifTrue:[ |
849 |
aSubView destroy |
|
850 |
] |
|
851 |
]. |
|
852 |
||
112 | 853 |
aSpecOrSpecArray notNil ifTrue:[ |
854 |
specification := UISpecification from:aSpecOrSpecArray. |
|
93 | 855 |
builder := UIBuilder new. |
112 | 856 |
specification buildViewFor:builder in:self. |
857 |
self realizeAllSubViews. |
|
93 | 858 |
inputView raise. |
859 |
] ifFalse:[ |
|
112 | 860 |
specification := nil |
93 | 861 |
] |
862 |
||
863 |
! ! |
|
864 |
||
112 | 865 |
!UISelectionPanel::Canvas methodsFor:'drag & drop'! |
93 | 866 |
|
867 |
buildSpecFrom:aSpec |
|
868 |
"build spec out of spec |
|
869 |
" |
|
870 |
|spec comp coll| |
|
871 |
||
872 |
(aSpec notNil and:[aSpec canUIDrag]) ifFalse:[ |
|
873 |
^ nil |
|
874 |
]. |
|
875 |
||
112 | 876 |
spec := aSpec copy. |
877 |
||
93 | 878 |
(aSpec class supportsSubComponents and:[aSpec component notNil]) ifFalse:[ |
112 | 879 |
^ spec |
93 | 880 |
]. |
881 |
comp := aSpec component. |
|
882 |
spec component:nil. |
|
883 |
||
884 |
comp canUIDrag ifFalse:[ |
|
885 |
^ spec |
|
886 |
]. |
|
887 |
coll := OrderedCollection new. |
|
888 |
||
889 |
comp do:[:anEntry||spc| |
|
890 |
(spc := self buildSpecFrom:anEntry) notNil ifTrue:[ |
|
891 |
coll add:spc |
|
892 |
] |
|
893 |
]. |
|
894 |
coll isEmpty ifTrue:[ |
|
895 |
^ spec |
|
896 |
]. |
|
897 |
comp := comp copy. |
|
898 |
comp collection:coll. |
|
899 |
spec component:comp. |
|
900 |
^ spec |
|
112 | 901 |
|
902 |
||
93 | 903 |
! |
904 |
||
112 | 905 |
startDrag |
906 |
"start drag of selection |
|
907 |
" |
|
908 |
|dragObj spec name| |
|
909 |
||
910 |
spec := self findSpecFor:selection. |
|
911 |
||
912 |
spec notNil ifTrue:[ |
|
913 |
spec := self buildSpecFrom:spec. |
|
914 |
name := spec className asString. |
|
915 |
name := name copyFrom:1 to:(name size - ('Spec' size) + 1). |
|
916 |
name at:1 put:(name at:1) asLowercase. |
|
917 |
name at:(name size) put:$1. |
|
918 |
spec name:name. |
|
919 |
||
920 |
self showUnselected. |
|
921 |
dragObj := DropSpecification for:selection specification:spec. |
|
922 |
self showSelected. |
|
923 |
DragAndDropManager startDrag:dragObj from:inputView. |
|
924 |
] |
|
925 |
||
926 |
||
927 |
! ! |
|
928 |
||
929 |
!UISelectionPanel::Canvas methodsFor:'event handling'! |
|
930 |
||
931 |
buttonMotion:state x:x y:y |
|
932 |
"start a drag on selection |
|
933 |
" |
|
934 |
|obj sensor| |
|
935 |
||
936 |
(state ~~ 0 and:[selection notNil]) ifTrue:[ |
|
937 |
sensor := self sensor. |
|
938 |
sensor anyButtonPressed ifTrue:[ |
|
939 |
(lastClickPoint dist:(x@y)) > 10.0 ifTrue:[ |
|
940 |
self startDrag |
|
941 |
] |
|
942 |
] |
|
943 |
] ifFalse:[ |
|
944 |
(nameHolder notNil and:[(obj := self findObjectAtX:x y:y) notNil]) ifTrue:[ |
|
945 |
nameHolder value:(obj name) |
|
946 |
] |
|
947 |
] |
|
948 |
||
949 |
! |
|
950 |
||
951 |
buttonPress:button x:x y:y |
|
952 |
"change selection |
|
953 |
" |
|
954 |
lastClickPoint := Point x:x y:y. |
|
955 |
self selection:(self findObjectAtX:x y:y). |
|
956 |
||
957 |
||
958 |
! |
|
959 |
||
960 |
exposeX:x y:y width:w height:h |
|
961 |
"handle an expose event from device; redraw selection |
|
962 |
" |
|
963 |
super exposeX:x y:y width:w height:h. |
|
964 |
self showSelected. |
|
965 |
||
966 |
||
967 |
! ! |
|
968 |
||
969 |
!UISelectionPanel::Canvas methodsFor:'initialization'! |
|
970 |
||
971 |
initialize |
|
972 |
super initialize. |
|
973 |
||
974 |
inputView := InputView origin:0.0@0.0 extent:1.0@1.0 in:self. |
|
975 |
||
976 |
inputView eventReceiver:self. |
|
977 |
inputView enableButtonEvents. |
|
978 |
inputView enableButtonMotionEvents. |
|
979 |
inputView enableMotionEvents. |
|
980 |
||
981 |
! ! |
|
982 |
||
983 |
!UISelectionPanel::Canvas methodsFor:'searching'! |
|
984 |
||
93 | 985 |
findObjectAtX:x y:y |
986 |
"find the origin/corner of the currentWidget |
|
987 |
" |
|
988 |
|view viewId point| |
|
989 |
||
990 |
point := Point x:x y:y. |
|
991 |
point := device translatePoint:point from:(inputView id) |
|
992 |
to:(inputView device rootView id). |
|
993 |
inputView lower. |
|
112 | 994 |
viewId := device viewIdFromPoint:point in:(self id). |
93 | 995 |
view := device viewFromId:viewId. |
996 |
inputView raise. |
|
997 |
||
112 | 998 |
(view ~~ self and:[view ~~ inputView]) ifTrue:[ |
93 | 999 |
(self findSpecFor:view) notNil ifTrue:[ |
1000 |
^ view |
|
1001 |
] |
|
1002 |
]. |
|
1003 |
^ nil |
|
1004 |
||
1005 |
||
112 | 1006 |
|
1007 |
||
93 | 1008 |
! |
1009 |
||
1010 |
findSpecFor:anObject |
|
1011 |
"returns subspec assigned to instance or nil |
|
1012 |
" |
|
1013 |
|name components spec| |
|
1014 |
||
1015 |
anObject notNil ifTrue:[ |
|
1016 |
name := anObject name. |
|
1017 |
||
1018 |
specification do:[:aSpec| |
|
1019 |
aSpec name = name ifTrue:[ |
|
1020 |
aSpec canUIDrag ifTrue:[^ aSpec] |
|
1021 |
ifFalse:[^ nil] |
|
1022 |
] |
|
1023 |
] |
|
1024 |
]. |
|
1025 |
^ nil |
|
1026 |
||
1027 |
! ! |
|
1028 |
||
112 | 1029 |
!UISelectionPanel::Canvas methodsFor:'selection'! |
93 | 1030 |
|
1031 |
handlesOf:aComponent do:aOneArgBlock |
|
1032 |
"evaluate the block on each handle; the argument to the block |
|
1033 |
is a rectangle |
|
1034 |
" |
|
1035 |
aComponent notNil ifTrue:[ |
|
1036 |
aOneArgBlock value:(aComponent origin - (4@4) extent:7@7). |
|
1037 |
aOneArgBlock value:(aComponent corner - (4@4) extent:7@7). |
|
1038 |
aOneArgBlock value:(aComponent topRight - (4@4) extent:7@7). |
|
1039 |
aOneArgBlock value:(aComponent bottomLeft - (4@4) extent:7@7). |
|
1040 |
aOneArgBlock value:(aComponent leftCenter - (4@4) extent:7@7). |
|
1041 |
aOneArgBlock value:(aComponent rightCenter - (4@4) extent:7@7). |
|
1042 |
aOneArgBlock value:(aComponent topCenter - (4@4) extent:7@7). |
|
1043 |
aOneArgBlock value:(aComponent bottomCenter - (4@4) extent:7@7). |
|
1044 |
] |
|
1045 |
||
1046 |
! |
|
1047 |
||
1048 |
selection:anObject |
|
1049 |
"selection changed |
|
1050 |
" |
|
112 | 1051 |
|name| |
93 | 1052 |
|
1053 |
selection ~~ anObject ifTrue:[ |
|
1054 |
self showUnselected. |
|
112 | 1055 |
(self findSpecFor:anObject) notNil ifTrue:[ |
93 | 1056 |
selection := anObject. |
112 | 1057 |
name := anObject name. |
93 | 1058 |
self showSelected |
1059 |
] ifFalse:[ |
|
1060 |
selection := nil |
|
1061 |
]. |
|
112 | 1062 |
nameHolder notNil ifTrue:[nameHolder value:name] |
93 | 1063 |
] |
1064 |
||
1065 |
! |
|
1066 |
||
1067 |
showSelected |
|
1068 |
"show selected |
|
1069 |
" |
|
1070 |
selection notNil ifTrue:[ |
|
112 | 1071 |
self clippedByChildren:false. |
93 | 1072 |
|
1073 |
self handlesOf:selection do:[:aRectangle| |
|
112 | 1074 |
self fillRectangle:aRectangle |
93 | 1075 |
]. |
112 | 1076 |
self clippedByChildren:true. |
93 | 1077 |
]. |
112 | 1078 |
|
1079 |
||
93 | 1080 |
! |
1081 |
||
1082 |
showUnselected |
|
1083 |
"show unselected |
|
1084 |
" |
|
1085 |
|r| |
|
1086 |
||
1087 |
selection isNil ifTrue:[ |
|
1088 |
^ self |
|
1089 |
]. |
|
1090 |
||
112 | 1091 |
self clippedByChildren:false. |
93 | 1092 |
|
1093 |
self handlesOf:selection do:[:aRectangle| |
|
112 | 1094 |
self clearRectangle:aRectangle |
93 | 1095 |
]. |
112 | 1096 |
self clippedByChildren:true. |
93 | 1097 |
|
1098 |
"must redraw all components which are affected b the handles |
|
1099 |
" |
|
112 | 1100 |
r := (selection originRelativeTo:self) - (4@4) extent:(selection extent + (4@4)). |
93 | 1101 |
|
112 | 1102 |
self subViews do:[:aComponent | |
93 | 1103 |
|absOrg absFrame| |
1104 |
||
1105 |
aComponent ~~ inputView ifTrue:[ |
|
112 | 1106 |
absOrg := aComponent originRelativeTo:self. |
93 | 1107 |
absFrame := absOrg extent:(aComponent extent). |
1108 |
||
1109 |
(absFrame intersects:r) ifTrue:[ |
|
1110 |
aComponent withAllSubViewsDo:[:aView| |
|
1111 |
aView clear. |
|
1112 |
aView exposeX:0 y:0 width:9999 height:9999. |
|
1113 |
] |
|
1114 |
] |
|
1115 |
] |
|
1116 |
] |
|
1117 |
||
112 | 1118 |
|
93 | 1119 |
! ! |
1120 |
||
112 | 1121 |
!UISelectionPanel::Canvas::DropSpecification class methodsFor:'instance creation'! |
93 | 1122 |
|
1123 |
for:aView specification:aSpec |
|
1124 |
"create drop object for a view derived from a specification |
|
1125 |
" |
|
1126 |
aView topView raise. |
|
1127 |
aView device sync. |
|
1128 |
aView invalidate. |
|
1129 |
aView windowGroup processExposeEvents. |
|
1130 |
DisplayObject := Image fromView:aView grab:false. |
|
1131 |
||
1132 |
DisplayObject extent ~= aView extent ifTrue:[ |
|
1133 |
DisplayObject := Form extent:(aView extent) depth:1. |
|
1134 |
DisplayObject colorMap:(Array with:Color white with:Color black). |
|
1135 |
DisplayObject fill:(Color colorId:0). |
|
1136 |
DisplayObject paint:(Color colorId:1). |
|
1137 |
DisplayObject displayRectangleX:0 y:0 width:aView extent x height:aView extent y. |
|
1138 |
]. |
|
1139 |
||
1140 |
^ self new theObject:aSpec |
|
112 | 1141 |
|
1142 |
||
93 | 1143 |
! ! |
1144 |
||
1145 |
!UISelectionPanel class methodsFor:'documentation'! |
|
1146 |
||
1147 |
version |
|
1148 |
^ '$Header$' |
|
1149 |
! ! |