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