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