author | ca |
Mon, 16 Jun 1997 18:56:52 +0200 | |
changeset 152 | 2261aa2fa21d |
parent 150 | 9f88bc99e0af |
child 167 | 01cbd385f878 |
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 |
^ |
|
150 | 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' |
150 | 546 |
#'layout:' #(#LayoutFrame 102 0 53 0 191 0 71 0) |
104 | 547 |
#'orientation:' #horizontal |
548 |
#'start:' 0 |
|
549 |
#'stop:' 100 |
|
93 | 550 |
) |
150 | 551 |
#(#ProgressIndicatorSpec |
552 |
#'name:' 'Progress Indicator' |
|
553 |
#'layout:' #(#LayoutFrame 102 0 90 0 191 0 108 0) |
|
554 |
#'showPercentage:' true |
|
555 |
) |
|
93 | 556 |
) |
557 |
) |
|
558 |
) |
|
559 |
! |
|
560 |
||
97 | 561 |
textSpec |
562 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
563 |
||
564 |
"do not manually edit this - the painter/builder may not be able to |
|
565 |
handle the specification if its corrupted." |
|
566 |
||
567 |
" |
|
568 |
UIPainter new openOnClass:UISelectionPanel andSelector:#textSpec |
|
569 |
UISelectionPanel new openInterface:#textSpec |
|
570 |
" |
|
571 |
||
572 |
<resource: #canvas> |
|
573 |
||
574 |
^ |
|
139 | 575 |
|
97 | 576 |
#(#FullSpec |
577 |
#'window:' |
|
578 |
#(#WindowSpec |
|
579 |
#'name:' 'uIPainterView' |
|
580 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
581 |
#'label:' 'unnamed' |
|
139 | 582 |
#'bounds:' #(#Rectangle 0 0 467 207) |
97 | 583 |
) |
584 |
#'component:' |
|
585 |
#(#SpecCollection |
|
586 |
#'collection:' |
|
587 |
#( |
|
588 |
#(#InputFieldSpec |
|
589 |
#'name:' 'EditField' |
|
139 | 590 |
#'layout:' #(#LayoutFrame 222 0 109 0 401 0 131 0) |
97 | 591 |
) |
592 |
#(#LabelSpec |
|
593 |
#'name:' 'Text Label' |
|
139 | 594 |
#'layout:' #(#LayoutFrame 222 0 138 0 401 0 160 0) |
147 | 595 |
#'label:' '' |
97 | 596 |
) |
597 |
#(#TextEditorSpec |
|
598 |
#'name:' 'EditTextView' |
|
143
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
599 |
#'layout:' #(#LayoutFrame 20 0 13 0 199 0 101 0) |
139 | 600 |
#'hasHorizontalScrollBar:' true |
601 |
#'hasVerticalScrollBar:' true |
|
602 |
) |
|
603 |
#(#SequenceViewSpec |
|
604 |
#'name:' 'SelectionInListView' |
|
143
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
605 |
#'layout:' #(#LayoutFrame 222 0 13 0 401 0 101 0) |
139 | 606 |
#'hasHorizontalScrollBar:' true |
607 |
#'hasVerticalScrollBar:' true |
|
608 |
) |
|
609 |
#(#HTMLViewSpec |
|
610 |
#'name:' 'HTMLView' |
|
143
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
611 |
#'layout:' #(#LayoutFrame 20 0 109 0 199 0 197 0) |
97 | 612 |
#'hasHorizontalScrollBar:' true |
613 |
#'hasVerticalScrollBar:' true |
|
614 |
) |
|
139 | 615 |
#(#LabelSpec |
616 |
#'name:' 'HTMLViewLabel' |
|
147 | 617 |
#'layout:' #(#LayoutFrame 93 0 179 0 158 0 193 0) |
139 | 618 |
#'label:' 'HTMLView' |
147 | 619 |
#'adjust:' #left |
139 | 620 |
#'canUIDrag:' false |
97 | 621 |
) |
139 | 622 |
#(#LabelSpec |
623 |
#'name:' 'label1' |
|
147 | 624 |
#'layout:' #(#LayoutFrame 93 0 83 0 155 0 97 0) |
139 | 625 |
#'label:' 'EditText' |
147 | 626 |
#'adjust:' #left |
139 | 627 |
#'canUIDrag:' false |
97 | 628 |
) |
139 | 629 |
#(#LabelSpec |
630 |
#'name:' 'label2' |
|
147 | 631 |
#'layout:' #(#LayoutFrame 295 0 83 0 382 0 97 0) |
139 | 632 |
#'label:' 'SelectionInList' |
147 | 633 |
#'adjust:' #left |
634 |
#'canUIDrag:' false |
|
635 |
) |
|
636 |
#(#LabelSpec |
|
637 |
#'name:' 'labelInLabel' |
|
638 |
#'layout:' #(#LayoutFrame 226 0 142 0 260 0 156 0) |
|
639 |
#'label:' 'Label' |
|
640 |
#'adjust:' #left |
|
139 | 641 |
#'canUIDrag:' false |
98 | 642 |
) |
97 | 643 |
) |
644 |
) |
|
645 |
) |
|
646 |
! |
|
647 |
||
93 | 648 |
viewsSpec |
649 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
650 |
||
651 |
"do not manually edit this - the painter/builder may not be able to |
|
652 |
handle the specification if its corrupted." |
|
653 |
||
654 |
" |
|
655 |
UIPainter new openOnClass:UISelectionPanel andSelector:#viewsSpec |
|
656 |
UISelectionPanel new openInterface:#viewsSpec |
|
657 |
" |
|
658 |
||
659 |
<resource: #canvas> |
|
660 |
||
661 |
^ |
|
135 | 662 |
|
93 | 663 |
#(#FullSpec |
664 |
#'window:' |
|
665 |
#(#WindowSpec |
|
666 |
#'name:' 'uIPainterView' |
|
667 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
668 |
#'label:' 'unnamed' |
|
112 | 669 |
#'bounds:' #(#Rectangle 0 0 485 245) |
93 | 670 |
) |
671 |
#'component:' |
|
672 |
#(#SpecCollection |
|
673 |
#'collection:' |
|
674 |
#( |
|
675 |
#(#FramedBoxSpec |
|
676 |
#'name:' 'FramedBox' |
|
143
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
677 |
#'layout:' #(#LayoutFrame 16 0 14 0 177 0 104 0) |
104 | 678 |
#'label:' 'FramedBox' |
93 | 679 |
#'labelPosition:' #topCenter |
680 |
) |
|
681 |
#(#ViewSpec |
|
98 | 682 |
#'name:' 'View' |
143
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
683 |
#'layout:' #(#LayoutFrame 14 0 116 0 175 0 188 0) |
93 | 684 |
) |
685 |
#(#SubCanvasSpec |
|
98 | 686 |
#'name:' 'SubCanvas' |
143
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
687 |
#'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
|
688 |
#'hasHorizontalScrollBar:' true |
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
689 |
#'hasVerticalScrollBar:' true |
93 | 690 |
) |
691 |
#(#LabelSpec |
|
112 | 692 |
#'name:' 'subCanvasLabel' |
147 | 693 |
#'layout:' #(#LayoutFrame 272 0 86 0 343 0 100 0) |
93 | 694 |
#'label:' 'SubCanvas' |
147 | 695 |
#'adjust:' #left |
93 | 696 |
#'canUIDrag:' false |
697 |
) |
|
698 |
#(#DividerSpec |
|
699 |
#'name:' 'Horizontal Seperator' |
|
143
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
700 |
#'layout:' #(#LayoutFrame 199 0 116 0 360 0 120 0) |
93 | 701 |
#'orientation:' #horizontal |
702 |
) |
|
703 |
#(#DividerSpec |
|
704 |
#'name:' 'Vertical Seperator' |
|
143
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
705 |
#'layout:' #(#LayoutFrame 356 0 116 0 360 0 188 0) |
93 | 706 |
#'orientation:' #vertical |
707 |
) |
|
104 | 708 |
#(#LabelSpec |
112 | 709 |
#'name:' 'viewLabel' |
147 | 710 |
#'layout:' #(#LayoutFrame 19 0 118 0 70 0 135 0) |
112 | 711 |
#'label:' 'View' |
147 | 712 |
#'adjust:' #left |
104 | 713 |
#'canUIDrag:' false |
714 |
) |
|
143
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
715 |
#(#LabelSpec |
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
716 |
#'name:' 'Seperators' |
147 | 717 |
#'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
|
718 |
#'label:' 'Seperators' |
147 | 719 |
#'adjust:' #left |
143
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
720 |
#'canUIDrag:' false |
9add9e2609d9
change SubCanvasSpec; have to update caused by new attributes
ca
parents:
142
diff
changeset
|
721 |
) |
150 | 722 |
#(#RegionSpec |
723 |
#'name:' 'Region' |
|
724 |
#'layout:' #(#LayoutFrame 377 0 14 0 467 0 104 0) |
|
725 |
#'lineWidth:' 2 |
|
726 |
#'regionType:' #ellipse |
|
727 |
) |
|
728 |
#(#LabelSpec |
|
729 |
#'name:' 'RegionLabel' |
|
730 |
#'layout:' #(#LayoutFrame 388 0 50 0 459 0 68 0) |
|
731 |
#'label:' 'Region' |
|
732 |
#'canUIDrag:' false |
|
733 |
) |
|
93 | 734 |
) |
735 |
) |
|
736 |
) |
|
139 | 737 |
! |
112 | 738 |
|
739 |
windowSpec |
|
740 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
741 |
||
742 |
"do not manually edit this - the painter/builder may not be able to |
|
743 |
handle the specification if its corrupted." |
|
744 |
||
745 |
" |
|
746 |
UIPainter new openOnClass:UISelectionPanel andSelector:#windowSpec |
|
747 |
UISelectionPanel new openInterface:#windowSpec |
|
748 |
" |
|
749 |
"UISelectionPanel open" |
|
750 |
||
751 |
<resource: #canvas> |
|
752 |
||
753 |
^ |
|
754 |
||
755 |
#(#FullSpec |
|
756 |
#'window:' |
|
757 |
#(#WindowSpec |
|
758 |
#'name:' 'uIPainterView' |
|
759 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
125 | 760 |
#'label:' 'Component Gallery' |
112 | 761 |
#'bounds:' #(#Rectangle 0 0 480 260) |
762 |
) |
|
763 |
#'component:' |
|
764 |
#(#SpecCollection |
|
765 |
#'collection:' |
|
766 |
#( |
|
767 |
#(#LabelSpec |
|
768 |
#'name:' 'label1' |
|
769 |
#'layout:' #(#LayoutFrame 0 0.0 -20 1.0 0 1.0 0 1.0) |
|
770 |
#'label:' 'selection' |
|
142 | 771 |
#'labelChannel:' #nameOfObject |
112 | 772 |
#'level:' 2 |
773 |
#'hasCharacterOrientedLabel:' false |
|
774 |
) |
|
775 |
#(#NoteBookViewSpec |
|
776 |
#'name:' 'noteBookView1' |
|
777 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -21 1.0) |
|
142 | 778 |
#'menu:' #tabList |
112 | 779 |
#'model:' #tabModel |
780 |
#'tabWidget:' #Window |
|
781 |
#'useIndex:' true |
|
782 |
#'level:' 2 |
|
783 |
#'canvas:' #canvas |
|
784 |
) |
|
785 |
) |
|
786 |
) |
|
787 |
) |
|
93 | 788 |
! ! |
789 |
||
790 |
!UISelectionPanel methodsFor:'accessing'! |
|
791 |
||
112 | 792 |
labels:loLabels selectors:loSelectors receiver:aReceiver |
793 |
selectors := loSelectors. |
|
794 |
receiver := aReceiver. |
|
795 |
(self tabList) value:loLabels. |
|
796 |
||
797 |
! ! |
|
798 |
||
799 |
!UISelectionPanel methodsFor:'aspects'! |
|
800 |
||
801 |
canvas |
|
802 |
|holder| |
|
803 |
||
804 |
(holder := builder bindingAt:#canvas) isNil ifTrue:[ |
|
805 |
builder aspectAt:#canvas put:(holder := Canvas new) |
|
806 |
]. |
|
807 |
^ holder |
|
808 |
! |
|
809 |
||
810 |
nameOfObject |
|
811 |
|holder canvas| |
|
812 |
||
813 |
(holder := builder bindingAt:#nameOfObject) isNil ifTrue:[ |
|
814 |
builder aspectAt:#nameOfObject put:(holder := ValueHolder new). |
|
815 |
canvas := self canvas. |
|
816 |
canvas nameHolder:holder. |
|
817 |
]. |
|
818 |
^ holder |
|
819 |
! |
|
820 |
||
821 |
tabList |
|
822 |
"returns list of tab-labels |
|
93 | 823 |
" |
112 | 824 |
|holder| |
825 |
||
826 |
(holder := builder bindingAt:#tabList) isNil ifTrue:[ |
|
827 |
builder aspectAt:#tabList put:(holder := ValueHolder new). |
|
93 | 828 |
]. |
112 | 829 |
^ holder |
93 | 830 |
! |
831 |
||
112 | 832 |
tabModel |
833 |
"returns my model; catching select notifications |
|
834 |
" |
|
835 |
|holder| |
|
836 |
||
837 |
(holder := builder bindingAt:#tabModel) isNil ifTrue:[ |
|
838 |
holder := AspectAdaptor new subject:self; forAspect:#selection. |
|
839 |
builder aspectAt:#tabModel put:holder. |
|
840 |
]. |
|
841 |
^ holder |
|
842 |
||
843 |
! ! |
|
844 |
||
845 |
!UISelectionPanel methodsFor:'selection'! |
|
846 |
||
847 |
selection |
|
848 |
^ selection |
|
849 |
! |
|
850 |
||
851 |
selection:aValue |
|
147 | 852 |
|spec canvas| |
112 | 853 |
|
139 | 854 |
(aValue isNil or:[aValue == 0]) ifTrue:[ |
855 |
^ self |
|
856 |
]. |
|
112 | 857 |
selection ~~ aValue ifTrue:[ |
858 |
(selection := aValue) notNil ifTrue:[ |
|
859 |
selectors size >= aValue ifTrue:[ |
|
860 |
spec := receiver perform:(selectors at:selection) |
|
861 |
] |
|
862 |
]. |
|
147 | 863 |
canvas := builder aspectAt:#canvas. |
864 |
canvas specification:spec. |
|
112 | 865 |
]. |
866 |
! ! |
|
867 |
||
868 |
!UISelectionPanel::Canvas methodsFor:'accessing'! |
|
869 |
||
870 |
nameHolder:aValueHolder |
|
871 |
"set value holder which keeps the name of the object |
|
872 |
under the cursor or selected |
|
873 |
" |
|
874 |
nameHolder := aValueHolder |
|
875 |
! |
|
876 |
||
877 |
specification:aSpecOrSpecArray |
|
878 |
"load a new specification |
|
93 | 879 |
" |
880 |
|builder| |
|
881 |
||
882 |
self selection:nil. |
|
883 |
||
112 | 884 |
self subViews copy do:[:aSubView| |
93 | 885 |
aSubView ~~ inputView ifTrue:[ |
886 |
aSubView destroy |
|
887 |
] |
|
888 |
]. |
|
889 |
||
112 | 890 |
aSpecOrSpecArray notNil ifTrue:[ |
891 |
specification := UISpecification from:aSpecOrSpecArray. |
|
93 | 892 |
builder := UIBuilder new. |
112 | 893 |
specification buildViewFor:builder in:self. |
147 | 894 |
|
895 |
subViews do:[:v| |
|
896 |
(v ~~ inputView and:[(self findSpecFor:v) notNil]) ifTrue:[ |
|
897 |
v borderWidth:1. |
|
898 |
] |
|
899 |
]. |
|
900 |
||
112 | 901 |
self realizeAllSubViews. |
93 | 902 |
inputView raise. |
903 |
] ifFalse:[ |
|
112 | 904 |
specification := nil |
93 | 905 |
] |
906 |
||
907 |
! ! |
|
908 |
||
112 | 909 |
!UISelectionPanel::Canvas methodsFor:'drag & drop'! |
93 | 910 |
|
911 |
buildSpecFrom:aSpec |
|
912 |
"build spec out of spec |
|
913 |
" |
|
914 |
|spec comp coll| |
|
915 |
||
916 |
(aSpec notNil and:[aSpec canUIDrag]) ifFalse:[ |
|
917 |
^ nil |
|
918 |
]. |
|
919 |
||
112 | 920 |
spec := aSpec copy. |
921 |
||
93 | 922 |
(aSpec class supportsSubComponents and:[aSpec component notNil]) ifFalse:[ |
112 | 923 |
^ spec |
93 | 924 |
]. |
925 |
comp := aSpec component. |
|
926 |
spec component:nil. |
|
927 |
||
928 |
comp canUIDrag ifFalse:[ |
|
929 |
^ spec |
|
930 |
]. |
|
931 |
coll := OrderedCollection new. |
|
932 |
||
933 |
comp do:[:anEntry||spc| |
|
934 |
(spc := self buildSpecFrom:anEntry) notNil ifTrue:[ |
|
935 |
coll add:spc |
|
936 |
] |
|
937 |
]. |
|
938 |
coll isEmpty ifTrue:[ |
|
939 |
^ spec |
|
940 |
]. |
|
941 |
comp := comp copy. |
|
942 |
comp collection:coll. |
|
943 |
spec component:comp. |
|
944 |
^ spec |
|
112 | 945 |
|
946 |
||
93 | 947 |
! |
948 |
||
112 | 949 |
startDrag |
950 |
"start drag of selection |
|
951 |
" |
|
952 |
|dragObj spec name| |
|
953 |
||
954 |
spec := self findSpecFor:selection. |
|
955 |
||
956 |
spec notNil ifTrue:[ |
|
957 |
spec := self buildSpecFrom:spec. |
|
958 |
name := spec className asString. |
|
959 |
name := name copyFrom:1 to:(name size - ('Spec' size) + 1). |
|
960 |
name at:1 put:(name at:1) asLowercase. |
|
961 |
name at:(name size) put:$1. |
|
962 |
spec name:name. |
|
963 |
||
964 |
self showUnselected. |
|
965 |
dragObj := DropSpecification for:selection specification:spec. |
|
966 |
self showSelected. |
|
967 |
DragAndDropManager startDrag:dragObj from:inputView. |
|
968 |
] |
|
969 |
||
970 |
||
971 |
! ! |
|
972 |
||
973 |
!UISelectionPanel::Canvas methodsFor:'event handling'! |
|
974 |
||
975 |
buttonMotion:state x:x y:y |
|
976 |
"start a drag on selection |
|
977 |
" |
|
978 |
|obj sensor| |
|
979 |
||
980 |
(state ~~ 0 and:[selection notNil]) ifTrue:[ |
|
981 |
sensor := self sensor. |
|
982 |
sensor anyButtonPressed ifTrue:[ |
|
983 |
(lastClickPoint dist:(x@y)) > 10.0 ifTrue:[ |
|
984 |
self startDrag |
|
985 |
] |
|
986 |
] |
|
987 |
] ifFalse:[ |
|
988 |
(nameHolder notNil and:[(obj := self findObjectAtX:x y:y) notNil]) ifTrue:[ |
|
989 |
nameHolder value:(obj name) |
|
990 |
] |
|
991 |
] |
|
992 |
||
993 |
! |
|
994 |
||
995 |
buttonPress:button x:x y:y |
|
996 |
"change selection |
|
997 |
" |
|
998 |
lastClickPoint := Point x:x y:y. |
|
999 |
self selection:(self findObjectAtX:x y:y). |
|
1000 |
||
1001 |
||
1002 |
! |
|
1003 |
||
1004 |
exposeX:x y:y width:w height:h |
|
1005 |
"handle an expose event from device; redraw selection |
|
1006 |
" |
|
1007 |
super exposeX:x y:y width:w height:h. |
|
1008 |
self showSelected. |
|
1009 |
||
1010 |
||
1011 |
! ! |
|
1012 |
||
1013 |
!UISelectionPanel::Canvas methodsFor:'initialization'! |
|
1014 |
||
1015 |
initialize |
|
1016 |
super initialize. |
|
1017 |
||
1018 |
inputView := InputView origin:0.0@0.0 extent:1.0@1.0 in:self. |
|
1019 |
||
1020 |
inputView eventReceiver:self. |
|
1021 |
inputView enableButtonEvents. |
|
1022 |
inputView enableButtonMotionEvents. |
|
1023 |
inputView enableMotionEvents. |
|
1024 |
||
1025 |
! ! |
|
1026 |
||
1027 |
!UISelectionPanel::Canvas methodsFor:'searching'! |
|
1028 |
||
93 | 1029 |
findObjectAtX:x y:y |
1030 |
"find the origin/corner of the currentWidget |
|
1031 |
" |
|
147 | 1032 |
|point id p e| |
1033 |
||
1034 |
point := Point x:x y:y. |
|
1035 |
id := inputView id. |
|
93 | 1036 |
|
147 | 1037 |
subViews do:[:v| |
1038 |
v ~~ inputView ifTrue:[ |
|
1039 |
p := device translatePoint:point from:id to:(v id). |
|
1040 |
( p x >= 0 and:[p x <= v width |
|
1041 |
and:[p y >= 0 and:[p y <= v height |
|
1042 |
and:[(self findSpecFor:v) notNil]]]] |
|
1043 |
) ifTrue:[ |
|
1044 |
^ v |
|
1045 |
] |
|
93 | 1046 |
] |
1047 |
]. |
|
147 | 1048 |
^ nil |
1049 |
||
93 | 1050 |
|
1051 |
||
112 | 1052 |
|
1053 |
||
93 | 1054 |
! |
1055 |
||
1056 |
findSpecFor:anObject |
|
1057 |
"returns subspec assigned to instance or nil |
|
1058 |
" |
|
1059 |
|name components spec| |
|
1060 |
||
1061 |
anObject notNil ifTrue:[ |
|
1062 |
name := anObject name. |
|
1063 |
||
1064 |
specification do:[:aSpec| |
|
1065 |
aSpec name = name ifTrue:[ |
|
1066 |
aSpec canUIDrag ifTrue:[^ aSpec] |
|
1067 |
ifFalse:[^ nil] |
|
1068 |
] |
|
1069 |
] |
|
1070 |
]. |
|
1071 |
^ nil |
|
1072 |
||
1073 |
! ! |
|
1074 |
||
112 | 1075 |
!UISelectionPanel::Canvas methodsFor:'selection'! |
93 | 1076 |
|
1077 |
handlesOf:aComponent do:aOneArgBlock |
|
1078 |
"evaluate the block on each handle; the argument to the block |
|
1079 |
is a rectangle |
|
1080 |
" |
|
1081 |
aComponent notNil ifTrue:[ |
|
1082 |
aOneArgBlock value:(aComponent origin - (4@4) extent:7@7). |
|
1083 |
aOneArgBlock value:(aComponent corner - (4@4) extent:7@7). |
|
1084 |
aOneArgBlock value:(aComponent topRight - (4@4) extent:7@7). |
|
1085 |
aOneArgBlock value:(aComponent bottomLeft - (4@4) extent:7@7). |
|
1086 |
aOneArgBlock value:(aComponent leftCenter - (4@4) extent:7@7). |
|
1087 |
aOneArgBlock value:(aComponent rightCenter - (4@4) extent:7@7). |
|
1088 |
aOneArgBlock value:(aComponent topCenter - (4@4) extent:7@7). |
|
1089 |
aOneArgBlock value:(aComponent bottomCenter - (4@4) extent:7@7). |
|
1090 |
] |
|
1091 |
||
1092 |
! |
|
1093 |
||
1094 |
selection:anObject |
|
1095 |
"selection changed |
|
1096 |
" |
|
112 | 1097 |
|name| |
93 | 1098 |
|
1099 |
selection ~~ anObject ifTrue:[ |
|
1100 |
self showUnselected. |
|
112 | 1101 |
(self findSpecFor:anObject) notNil ifTrue:[ |
93 | 1102 |
selection := anObject. |
112 | 1103 |
name := anObject name. |
93 | 1104 |
self showSelected |
1105 |
] ifFalse:[ |
|
1106 |
selection := nil |
|
1107 |
]. |
|
112 | 1108 |
nameHolder notNil ifTrue:[nameHolder value:name] |
93 | 1109 |
] |
1110 |
||
1111 |
! |
|
1112 |
||
1113 |
showSelected |
|
1114 |
"show selected |
|
1115 |
" |
|
1116 |
selection notNil ifTrue:[ |
|
112 | 1117 |
self clippedByChildren:false. |
93 | 1118 |
|
1119 |
self handlesOf:selection do:[:aRectangle| |
|
112 | 1120 |
self fillRectangle:aRectangle |
93 | 1121 |
]. |
112 | 1122 |
self clippedByChildren:true. |
93 | 1123 |
]. |
112 | 1124 |
|
1125 |
||
93 | 1126 |
! |
1127 |
||
1128 |
showUnselected |
|
1129 |
"show unselected |
|
1130 |
" |
|
1131 |
|r| |
|
1132 |
||
1133 |
selection isNil ifTrue:[ |
|
1134 |
^ self |
|
1135 |
]. |
|
1136 |
||
112 | 1137 |
self clippedByChildren:false. |
93 | 1138 |
|
1139 |
self handlesOf:selection do:[:aRectangle| |
|
112 | 1140 |
self clearRectangle:aRectangle |
93 | 1141 |
]. |
112 | 1142 |
self clippedByChildren:true. |
93 | 1143 |
|
1144 |
"must redraw all components which are affected b the handles |
|
1145 |
" |
|
112 | 1146 |
r := (selection originRelativeTo:self) - (4@4) extent:(selection extent + (4@4)). |
93 | 1147 |
|
112 | 1148 |
self subViews do:[:aComponent | |
93 | 1149 |
|absOrg absFrame| |
1150 |
||
1151 |
aComponent ~~ inputView ifTrue:[ |
|
112 | 1152 |
absOrg := aComponent originRelativeTo:self. |
93 | 1153 |
absFrame := absOrg extent:(aComponent extent). |
1154 |
||
1155 |
(absFrame intersects:r) ifTrue:[ |
|
1156 |
aComponent withAllSubViewsDo:[:aView| |
|
1157 |
aView clear. |
|
1158 |
aView exposeX:0 y:0 width:9999 height:9999. |
|
1159 |
] |
|
1160 |
] |
|
1161 |
] |
|
1162 |
] |
|
1163 |
||
112 | 1164 |
|
93 | 1165 |
! ! |
1166 |
||
112 | 1167 |
!UISelectionPanel::Canvas::DropSpecification class methodsFor:'instance creation'! |
93 | 1168 |
|
1169 |
for:aView specification:aSpec |
|
1170 |
"create drop object for a view derived from a specification |
|
1171 |
" |
|
147 | 1172 |
|point extent root device| |
1173 |
||
1174 |
device := aView device. |
|
1175 |
root := device rootView. |
|
1176 |
extent := aView extent. |
|
1177 |
point := device translatePoint:0@0 from:(aView id) to:(root id). |
|
1178 |
||
1179 |
DisplayObject := nil. |
|
93 | 1180 |
|
147 | 1181 |
(point x > 0 and:[point y > 0]) ifTrue:[ |
1182 |
point := point + extent. |
|
1183 |
(point x < root width and:[point y < root height]) ifTrue:[ |
|
1184 |
aView topView raise. |
|
1185 |
device sync. |
|
1186 |
aView invalidate. |
|
1187 |
aView windowGroup processExposeEvents. |
|
1188 |
DisplayObject := Image fromView:aView grab:false. |
|
1189 |
] |
|
1190 |
]. |
|
1191 |
DisplayObject isNil ifTrue:[ |
|
1192 |
DisplayObject := Form extent:extent depth:1. |
|
93 | 1193 |
DisplayObject colorMap:(Array with:Color white with:Color black). |
1194 |
DisplayObject fill:(Color colorId:0). |
|
1195 |
DisplayObject paint:(Color colorId:1). |
|
1196 |
DisplayObject displayRectangleX:0 y:0 width:aView extent x height:aView extent y. |
|
1197 |
]. |
|
147 | 1198 |
^ self new theObject:aSpec |
112 | 1199 |
|
1200 |
||
93 | 1201 |
! ! |
1202 |
||
1203 |
!UISelectionPanel class methodsFor:'documentation'! |
|
1204 |
||
1205 |
version |
|
1206 |
^ '$Header$' |
|
1207 |
! ! |