author | tz |
Fri, 03 Apr 1998 16:54:44 +0200 | |
changeset 1477 | 2d4b6115e2c5 |
parent 1416 | b915d4f7709c |
child 1529 | 509edab0a08b |
permissions | -rw-r--r-- |
295 | 1 |
" |
2 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
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 |
SimpleView subclass:#VariablePanel |
|
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
14 |
instanceVariableNames:'barHeight barWidth separatingLine shadowForm lightForm showHandle |
295 | 15 |
handlePosition handleColor handleStyle handleLevel noColor |
871 | 16 |
trackLine redrawLocked orientation handleLabels knobHeight' |
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
17 |
classVariableNames:'DefaultShowHandle DefaultHandleStyle DefaultHandlePosition |
295 | 18 |
DefaultTrackingLine DefaultSeparatingLine DefaultHandleColor |
19 |
DefaultHandleLevel DefaultVCursor DefaultHCursor' |
|
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
20 |
poolDictionaries:'' |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
21 |
category:'Views-Layout' |
295 | 22 |
! |
23 |
||
871 | 24 |
!VariablePanel class methodsFor:'documentation'! |
295 | 25 |
|
26 |
copyright |
|
27 |
" |
|
28 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
29 |
All Rights Reserved |
|
30 |
||
31 |
This software is furnished under a license and may be used |
|
32 |
only in accordance with the terms of that license and with the |
|
33 |
inclusion of the above copyright notice. This software may not |
|
34 |
be provided or otherwise made available to, or used by, any |
|
35 |
other person. No title to or ownership of the software is |
|
36 |
hereby transferred. |
|
37 |
" |
|
38 |
! |
|
39 |
||
40 |
documentation |
|
41 |
" |
|
42 |
a View to separate its subviews vertically by a movable bar; |
|
43 |
the size-ratios of the subviews can be changed by moving this bar. |
|
44 |
||
45 |
In order to correctly setup this kind of view, the subviews must |
|
46 |
be created with a relative origin & relative corner. |
|
47 |
The panel does not verify the relative subview bounds; |
|
48 |
therefore, it is your responsibility to set those relative sizes to fit |
|
49 |
according the orientation (see bad example below). |
|
50 |
||
51 |
The bar-handle is either an exposed knob (style == #motif) |
|
52 |
or the form defined in Scroller (style ~~ #motif) |
|
53 |
or nothing. |
|
54 |
||
55 |
Typically creation is done as: |
|
56 |
||
496 | 57 |
p := VariablePanel in:superView. |
58 |
p orientation:#vertical. |
|
295 | 59 |
|
496 | 60 |
v1 := <someViewClass> origin:0.0 @ 0.0 |
61 |
corner:1.0 @ 0.5 |
|
62 |
in:p. |
|
63 |
v2 := <someViewClass> origin:0.0 @ 0.5 |
|
64 |
corner:1.0 @ 0.8 |
|
65 |
in:p. |
|
66 |
v3 := <someViewClass> origin:0.0 @ 0.8 |
|
67 |
corner:1.0 @ 1.0 |
|
68 |
in:p. |
|
69 |
||
70 |
The two subclasses VariableHorizontalPanel and VariableVerticalPanel |
|
71 |
preset the orientation. They are a kept for backward compatibility |
|
72 |
(in previous versions, there used to be no common VariablePanel (super-) class). |
|
295 | 73 |
|
74 |
Notice: if it is required to insert a fixed-size view in the panel, |
|
75 |
use an extra view & insets, and place the subview into that extra view. |
|
1381 | 76 |
See examples. |
496 | 77 |
|
585 | 78 |
[instance Variables:] |
496 | 79 |
|
80 |
barHeight <Integer> the height of the bar (for verticalPanels) |
|
81 |
barWidth <Integer> the width of the bar (for horizontalPanels) |
|
82 |
||
83 |
separatingLine <Boolean> show a separating line (as in motif style) |
|
84 |
||
85 |
shadowForm <Image/Form> form (shadow part) drawn as handle - if nonNil |
|
86 |
||
87 |
lightForm <Image/Form> form (light part) drawn as handle - if nonNil |
|
88 |
||
89 |
showHandle <Boolean> if false, no handle is drawn |
|
90 |
||
91 |
handlePosition <Symbol> where is the handle - one of #left, #center, #right |
|
92 |
||
93 |
handleColor <Color> inside color of handle - defaults to viewBackground |
|
94 |
||
95 |
handleStyle <Symbol> type of handle; one of #next, #motif or nil |
|
96 |
||
97 |
handleLevel <Integer> 3D level of handle (only valid if no form is given) |
|
98 |
||
99 |
trackLine <Boolean> if true, an inverted line is drawn for tracking; |
|
100 |
otherwise, the whole bar is inverted. |
|
101 |
||
102 |
redrawLocked internal - locks redraws while tracking |
|
103 |
||
104 |
orientation <Symbol> one of #horizontal / #vertical |
|
105 |
||
106 |
||
585 | 107 |
[styleSheet values:] |
1381 | 108 |
variablePanel.showHandle true/false - should a handle be shown (default:true) |
496 | 109 |
|
1381 | 110 |
variablePanel.handleStyle #next / #motif / #iris / #full / nil (special handles) |
496 | 111 |
|
1381 | 112 |
variablePanel.handlePosition #left / #center / #right (default:#right) |
496 | 113 |
|
1381 | 114 |
variablePanel.handleLevel 3D level of heandle (default:2) |
496 | 115 |
|
1381 | 116 |
variablePanel.trackingLine when moved, track an inverted line (as in motif) |
496 | 117 |
as opposed to tracking the whole bar (default:false) |
1381 | 118 |
(obsoleted by trackingStyle) |
496 | 119 |
|
1381 | 120 |
variablePanel.trackingStyle #solidRectangle / #solidLine / #dashedLine |
121 |
detailed control over how to draw tracking |
|
122 |
(obsoletes trackingLine above) |
|
496 | 123 |
|
1381 | 124 |
variablePanel.separatingLine draw a separating line in the bar as in motif (default:false) |
496 | 125 |
|
1381 | 126 |
variablePanel.handleColor color of the handle. (default:Black) |
127 |
||
128 |
variablePanel.handleEnteredColor |
|
129 |
color of the handle when the pointer is in the bar (default:nil) |
|
585 | 130 |
|
131 |
[see also:] |
|
132 |
PanelView |
|
133 |
||
134 |
[author:] |
|
135 |
Claus Gittinger |
|
295 | 136 |
" |
137 |
! |
|
138 |
||
139 |
examples |
|
140 |
" |
|
874 | 141 |
example (notice that the subviews MUST have relative bounds): |
593 | 142 |
[exBegin] |
143 |
|top p v1 v2 v3| |
|
295 | 144 |
|
593 | 145 |
top := StandardSystemView new. |
146 |
top extent:300@300. |
|
295 | 147 |
|
593 | 148 |
p := VariablePanel |
149 |
origin:0.0 @ 0.0 |
|
150 |
corner:1.0 @ 1.0 |
|
151 |
in:top. |
|
152 |
p orientation:#vertical. |
|
295 | 153 |
|
593 | 154 |
v1 := View origin:0.0@0.0 corner:1.0@(1/2) in:p. |
155 |
v2 := View origin:0.0@(1/2) corner:1.0@(2/3) in:p. |
|
156 |
v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p. |
|
295 | 157 |
|
593 | 158 |
v1 viewBackground:(Color red). |
159 |
v2 viewBackground:(Color green). |
|
160 |
v3 viewBackground:(Color yellow). |
|
295 | 161 |
|
593 | 162 |
top open |
163 |
[exEnd] |
|
295 | 164 |
|
165 |
||
166 |
||
876 | 167 |
change the handles level: |
593 | 168 |
[exBegin] |
169 |
|top p v1 v2 v3| |
|
295 | 170 |
|
593 | 171 |
top := StandardSystemView new. |
172 |
top extent:300@300. |
|
295 | 173 |
|
593 | 174 |
p := VariablePanel |
175 |
origin:0.0 @ 0.0 |
|
176 |
corner:1.0 @ 1.0 |
|
177 |
in:top. |
|
178 |
p orientation:#vertical. |
|
179 |
p handleLevel:-1. |
|
295 | 180 |
|
593 | 181 |
v1 := View origin:0.0@0.0 corner:1.0@(1/3) in:p. |
182 |
v2 := View origin:0.0@(1/3) corner:1.0@(2/3) in:p. |
|
183 |
v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p. |
|
295 | 184 |
|
593 | 185 |
v1 viewBackground:(Color red). |
186 |
v2 viewBackground:(Color green). |
|
187 |
v3 viewBackground:(Color yellow). |
|
295 | 188 |
|
593 | 189 |
top open |
190 |
[exEnd] |
|
295 | 191 |
|
192 |
||
193 |
||
876 | 194 |
change the handles style to nil makes it invisible: |
593 | 195 |
[exBegin] |
196 |
|top p v1 v2 v3| |
|
397 | 197 |
|
593 | 198 |
top := StandardSystemView new. |
199 |
top extent:300@300. |
|
397 | 200 |
|
593 | 201 |
p := VariablePanel |
202 |
origin:0.0 @ 0.0 |
|
203 |
corner:1.0 @ 1.0 |
|
204 |
in:top. |
|
205 |
p orientation:#vertical. |
|
206 |
p handleStyle:nil. |
|
397 | 207 |
|
593 | 208 |
v1 := View origin:0.0@0.0 corner:1.0@(1/3) in:p. |
209 |
v2 := View origin:0.0@(1/3) corner:1.0@(2/3) in:p. |
|
210 |
v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p. |
|
397 | 211 |
|
593 | 212 |
v1 viewBackground:(Color red). |
213 |
v2 viewBackground:(Color green). |
|
214 |
v3 viewBackground:(Color yellow). |
|
397 | 215 |
|
593 | 216 |
top open |
217 |
[exEnd] |
|
397 | 218 |
|
219 |
||
220 |
||
876 | 221 |
define your own handle (-bitmap): |
222 |
[exBegin] |
|
223 |
|top p v1 v2 v3| |
|
224 |
||
225 |
top := StandardSystemView new. |
|
226 |
top extent:300@300. |
|
227 |
||
228 |
p := VariablePanel |
|
229 |
origin:0.0 @ 0.0 |
|
230 |
corner:1.0 @ 1.0 |
|
231 |
in:top. |
|
232 |
p orientation:#vertical. |
|
233 |
p handleImage:(Image fromFile:'bitmaps/ScrollLt.8.xbm'). |
|
234 |
||
235 |
v1 := View origin:0.0@0.0 corner:1.0@(1/3) in:p. |
|
236 |
v2 := View origin:0.0@(1/3) corner:1.0@(2/3) in:p. |
|
237 |
v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p. |
|
238 |
||
239 |
v1 viewBackground:(Color red). |
|
240 |
v2 viewBackground:(Color green). |
|
241 |
v3 viewBackground:(Color yellow). |
|
242 |
||
243 |
top open |
|
244 |
[exEnd] |
|
245 |
||
246 |
||
247 |
||
248 |
another handle-bitmap: |
|
249 |
[exBegin] |
|
250 |
|top p v1 v2 v3| |
|
251 |
||
252 |
top := StandardSystemView new. |
|
253 |
top extent:300@300. |
|
254 |
||
255 |
p := VariablePanel |
|
256 |
origin:0.0 @ 0.0 |
|
257 |
corner:1.0 @ 1.0 |
|
258 |
in:top. |
|
259 |
p orientation:#vertical. |
|
260 |
p handleImage:(Form width:9 |
|
261 |
height:11 |
|
262 |
fromArray:#( |
|
263 |
2r00000000 2r00000000 |
|
264 |
2r00001000 2r00000000 |
|
265 |
2r00011100 2r00000000 |
|
266 |
2r00111110 2r00000000 |
|
267 |
2r01111111 2r00000000 |
|
268 |
2r00000000 2r00000000 |
|
269 |
2r01111111 2r00000000 |
|
270 |
2r00111110 2r00000000 |
|
271 |
2r00011100 2r00000000 |
|
272 |
2r00001000 2r00000000 |
|
273 |
2r00000000 2r00000000 |
|
274 |
) |
|
275 |
). |
|
276 |
||
277 |
v1 := View origin:0.0@0.0 corner:1.0@(1/3) in:p. |
|
278 |
v2 := View origin:0.0@(1/3) corner:1.0@(2/3) in:p. |
|
279 |
v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p. |
|
280 |
||
281 |
v1 viewBackground:(Color red). |
|
282 |
v2 viewBackground:(Color green). |
|
283 |
v3 viewBackground:(Color yellow). |
|
284 |
||
285 |
top open |
|
286 |
[exEnd] |
|
287 |
||
288 |
placing scrolled and unscrolled views into a variablePanel: |
|
593 | 289 |
[exBegin] |
290 |
|top p v1 v2 v3| |
|
295 | 291 |
|
593 | 292 |
top := StandardSystemView new. |
293 |
top extent:300@300. |
|
295 | 294 |
|
593 | 295 |
p := VariablePanel |
296 |
origin:0.0 @ 0.0 |
|
297 |
corner:1.0 @ 1.0 |
|
298 |
in:top. |
|
299 |
p orientation:#vertical. |
|
295 | 300 |
|
593 | 301 |
v1 := ScrollableView for:SelectionInListView in:p. |
302 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5. |
|
303 |
v1 list:(FileDirectory directoryNamed:'/etc') contents. |
|
304 |
v1 action:[:selNr | |
|
305 |
|fullName stream text| |
|
306 |
fullName := '/etc/' , v1 selectionValue. |
|
307 |
stream := fullName asFilename readStream. |
|
308 |
stream notNil ifTrue:[ |
|
309 |
text := stream contents. |
|
310 |
v2 contents:text. |
|
311 |
v3 contents:text |
|
312 |
] |
|
313 |
]. |
|
295 | 314 |
|
593 | 315 |
v2 := TextView origin:0.0 @ 0.5 corner:1.0 @ 0.8 in:p. |
295 | 316 |
|
593 | 317 |
v3 := ScrollableView for:TextView in:p. |
318 |
v3 origin:0.0 @ 0.8 corner:1.0 @ 1.0. |
|
319 |
top open |
|
320 |
[exEnd] |
|
295 | 321 |
|
322 |
||
876 | 323 |
dynamically adding/removing views: |
593 | 324 |
[exBegin] |
325 |
|top p v1 v2 b| |
|
295 | 326 |
|
593 | 327 |
top := StandardSystemView new. |
328 |
top extent:300@300. |
|
295 | 329 |
|
593 | 330 |
b := Toggle label:'show' in:top. |
331 |
b showLamp:false. |
|
332 |
b origin:0.0 @ 0.0 corner:(1.0 @ 40). |
|
333 |
b action:[:state | |
|
334 |
state ifTrue:[ |
|
335 |
b label:'hide'. |
|
336 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5. |
|
337 |
v2 := ScrollableView for:EditTextView. |
|
338 |
v2 origin:0.0 @ 0.5 corner:1.0 @ 1.0. |
|
339 |
v2 contents:'another text'. |
|
340 |
p addSubView:v2. |
|
341 |
v2 realize. |
|
342 |
] ifFalse:[ |
|
343 |
b label:'show'. |
|
344 |
v2 destroy. |
|
345 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 1.0 |
|
346 |
] |
|
347 |
]. |
|
295 | 348 |
|
593 | 349 |
p := VariablePanel |
350 |
origin:0.0 @ 0.0 |
|
351 |
corner:1.0 @ 1.0 |
|
352 |
in:top. |
|
353 |
p orientation:#vertical. |
|
354 |
p topInset:50. |
|
295 | 355 |
|
593 | 356 |
v1 := ScrollableView for:EditTextView in:p. |
357 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 1.0. |
|
358 |
v1 contents:'some text'. |
|
295 | 359 |
|
593 | 360 |
top open |
361 |
[exEnd] |
|
295 | 362 |
|
363 |
||
876 | 364 |
dynamically flipping orientation: |
295 | 365 |
Notice: you have to change the relative bounds of the subviews first. |
593 | 366 |
[exBegin] |
367 |
|top p v1 v2 b| |
|
295 | 368 |
|
593 | 369 |
top := StandardSystemView new. |
370 |
top extent:300@300. |
|
295 | 371 |
|
593 | 372 |
b := Toggle label:'flip' in:top. |
373 |
b showLamp:false. |
|
374 |
b origin:0.0 @ 0.0 corner:(1.0 @ 40). |
|
375 |
b action:[:state | |
|
376 |
state ifTrue:[ |
|
377 |
v1 origin:0.0 @ 0.0 corner:0.5 @ 1.0. |
|
378 |
v2 origin:0.5 @ 0.0 corner:1.0 @ 1.0. |
|
379 |
p orientation:#horizontal. |
|
380 |
] ifFalse:[ |
|
381 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5. |
|
382 |
v2 origin:0.0 @ 0.5 corner:1.0 @ 1.0. |
|
383 |
p orientation:#vertical. |
|
384 |
]. |
|
385 |
]. |
|
295 | 386 |
|
593 | 387 |
p := VariablePanel |
388 |
origin:0.0 @ 0.0 |
|
389 |
corner:1.0 @ 1.0 |
|
390 |
in:top. |
|
391 |
p orientation:#vertical. |
|
392 |
p topInset:50. |
|
295 | 393 |
|
593 | 394 |
v1 := ScrollableView for:EditTextView in:p. |
395 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5. |
|
396 |
v1 contents:'some text'. |
|
295 | 397 |
|
593 | 398 |
v2 := ScrollableView for:EditTextView in:p. |
399 |
v2 origin:0.0 @ 0.5 corner:1.0 @ 1.0. |
|
400 |
v2 contents:'another text'. |
|
295 | 401 |
|
593 | 402 |
top open |
403 |
[exEnd] |
|
295 | 404 |
|
405 |
||
876 | 406 |
combining fix-size with variable size: |
295 | 407 |
(need 3 extra frame-views to place the extra labels into) |
593 | 408 |
[exBegin] |
409 |
|top p v1 l1 v2 l2 v3 l3 f1 f2 f3| |
|
295 | 410 |
|
593 | 411 |
top := StandardSystemView new. |
412 |
top extent:300@300. |
|
295 | 413 |
|
593 | 414 |
p := VariablePanel |
415 |
origin:0.0 @ 0.0 |
|
416 |
corner:1.0 @ 1.0 |
|
417 |
in:top. |
|
295 | 418 |
|
874 | 419 |
p orientation:#vertical. |
420 |
||
421 |
f1 := View origin:0.0@0.0 corner:1.0@0.3 in:p. |
|
422 |
f2 := View origin:0.0@0.3 corner:1.0@0.6 in:p. |
|
423 |
f3 := View origin:0.0@0.6 corner:1.0@1.0 in:p. |
|
295 | 424 |
|
593 | 425 |
v1 := View origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:f1. |
426 |
v2 := View origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:f2. |
|
427 |
v3 := View origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:f3. |
|
295 | 428 |
|
593 | 429 |
l1 := Label label:'sub1' in:f1. |
430 |
l2 := Label label:'sub2' in:f2. |
|
431 |
l3 := Label label:'sub3' in:f3. |
|
295 | 432 |
|
593 | 433 |
l1 origin:0.0 @ 0.0 corner:1.0 @ 0.0 ; |
434 |
bottomInset:(l1 preferredExtent y negated). |
|
435 |
l2 origin:0.0 @ 0.0 corner:1.0 @ 0.0 ; |
|
436 |
bottomInset:(l2 preferredExtent y negated). |
|
437 |
l3 origin:0.0 @ 0.0 corner:1.0 @ 0.0 ; |
|
438 |
bottomInset:(l3 preferredExtent y negated). |
|
295 | 439 |
|
593 | 440 |
v1 topInset:(l1 preferredExtent y); level:-1. |
441 |
v2 topInset:(l2 preferredExtent y); level:-1. |
|
442 |
v3 topInset:(l3 preferredExtent y); level:-1. |
|
295 | 443 |
|
593 | 444 |
v1 viewBackground:(Color red). |
445 |
v2 viewBackground:(Color green). |
|
446 |
v3 viewBackground:(Color yellow). |
|
295 | 447 |
|
874 | 448 |
top open |
449 |
[exEnd] |
|
450 |
||
451 |
VerticalPansels allow a label to be associated with the |
|
452 |
handles; this looks much like the above, but is slightly |
|
453 |
more compact. Notice, no label can be placed above the first |
|
454 |
view - it has no handle. |
|
455 |
[exBegin] |
|
456 |
|top p v1 v2 v3| |
|
457 |
||
458 |
top := StandardSystemView new. |
|
459 |
top extent:300@300. |
|
460 |
||
461 |
p := VariablePanel |
|
462 |
origin:0.0 @ 0.0 |
|
463 |
corner:1.0 @ 1.0 |
|
464 |
in:top. |
|
465 |
||
593 | 466 |
p orientation:#vertical. |
874 | 467 |
p handleLabels:#('ignored' 'sub2' 'sub3'). |
468 |
||
469 |
v1 := View origin:0.0@0.0 corner:1.0@0.3 in:p. |
|
470 |
v2 := View origin:0.0@0.3 corner:1.0@0.6 in:p. |
|
471 |
v3 := View origin:0.0@0.6 corner:1.0@1.0 in:p. |
|
472 |
||
473 |
v1 viewBackground:(Color red). |
|
474 |
v2 viewBackground:(Color green). |
|
475 |
v3 viewBackground:(Color yellow). |
|
476 |
||
593 | 477 |
top open |
478 |
[exEnd] |
|
295 | 479 |
|
874 | 480 |
handle labels can be more than strings .... |
481 |
(however, they should have about the same height, since |
|
482 |
the largest defines heights of all bars; |
|
483 |
retry the example below with a larger bitmap image ...) |
|
484 |
[exBegin] |
|
485 |
|top e p v1 v2 v3| |
|
486 |
||
487 |
top := StandardSystemView new. |
|
488 |
top extent:300@300. |
|
489 |
||
490 |
p := VariablePanel |
|
491 |
origin:0.0 @ 0.0 |
|
492 |
corner:1.0 @ 1.0 |
|
493 |
in:top. |
|
494 |
||
495 |
p orientation:#vertical. |
|
496 |
e := Array with:#bold |
|
497 |
with:#color->Color red. |
|
498 |
||
499 |
p handleLabels:(Array with:nil |
|
500 |
with:('bold and red' asText emphasizeAllWith:e) |
|
501 |
with:(Image fromFile:'ScrollRt.xbm')). |
|
502 |
||
503 |
v1 := View origin:0.0@0.0 corner:1.0@0.3 in:p. |
|
504 |
v2 := View origin:0.0@0.3 corner:1.0@0.6 in:p. |
|
505 |
v3 := View origin:0.0@0.6 corner:1.0@1.0 in:p. |
|
506 |
||
507 |
v1 viewBackground:(Color red). |
|
508 |
v2 viewBackground:(Color green). |
|
509 |
v3 viewBackground:(Color yellow). |
|
510 |
||
511 |
top open |
|
512 |
[exEnd] |
|
513 |
||
514 |
||
295 | 515 |
|
516 |
BAD EXAMPLE (wrong relative sizes - repaired on handle move): |
|
593 | 517 |
[exBegin] |
518 |
|top p v1 v2 v3| |
|
295 | 519 |
|
593 | 520 |
top := StandardSystemView new. |
521 |
top extent:300@300. |
|
295 | 522 |
|
593 | 523 |
p := VariablePanel |
524 |
origin:0.0 @ 0.0 |
|
525 |
corner:1.0 @ 1.0 |
|
526 |
in:top. |
|
527 |
p orientation:#vertical. |
|
295 | 528 |
|
593 | 529 |
v1 := View origin:0.0 @ 0.0 corner:1.0 @ (1/4) in:p. |
530 |
v2 := View origin:0.0 @ (1/2) corner:1.0 @ (3/4) in:p. |
|
531 |
v3 := View origin:0.0 @ (3/4) corner:1.0 @ 1.0 in:p. |
|
295 | 532 |
|
593 | 533 |
v1 viewBackground:(Color red). |
534 |
v2 viewBackground:(Color green). |
|
535 |
v3 viewBackground:(Color yellow). |
|
295 | 536 |
|
593 | 537 |
top open |
538 |
[exEnd] |
|
295 | 539 |
" |
540 |
! ! |
|
541 |
||
871 | 542 |
!VariablePanel class methodsFor:'defaults'! |
295 | 543 |
|
1158
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
544 |
cursorForOrientation:orientation |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
545 |
"return an appropriate cursor" |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
546 |
|
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
547 |
|cursor| |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
548 |
|
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
549 |
orientation == #vertical ifTrue:[ |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
550 |
DefaultVCursor notNil ifTrue:[ |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
551 |
cursor := DefaultVCursor |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
552 |
] ifFalse:[ |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
553 |
cursor := Cursor |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
554 |
sourceForm:(Image fromFile:'bitmaps/VVPanel.xbm') |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
555 |
maskForm:(Image fromFile:'bitmaps/VVPanel_m.xbm') |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
556 |
hotX:8 |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
557 |
hotY:8. |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
558 |
" |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
559 |
if bitmaps are not available, use a standard cursor |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
560 |
" |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
561 |
cursor isNil ifTrue:[ |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
562 |
"which one looks better ?" |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
563 |
cursor := Cursor upDownArrow |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
564 |
"cursor := Cursor upLimitArrow" |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
565 |
]. |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
566 |
DefaultVCursor := cursor |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
567 |
] |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
568 |
] ifFalse:[ |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
569 |
DefaultHCursor notNil ifTrue:[ |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
570 |
cursor := DefaultHCursor |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
571 |
] ifFalse:[ |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
572 |
cursor := Cursor |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
573 |
sourceForm:(Image fromFile:'bitmaps/VHPanel.xbm') |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
574 |
maskForm:(Image fromFile:'bitmaps/VHPanel_m.xbm') |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
575 |
hotX:8 |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
576 |
hotY:8. |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
577 |
" |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
578 |
if bitmaps are not available, use a standard cursor |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
579 |
" |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
580 |
cursor isNil ifTrue:[ |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
581 |
"which one looks better ?" |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
582 |
cursor := Cursor leftRightArrow |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
583 |
"cursor := Cursor leftLimitArrow" |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
584 |
]. |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
585 |
DefaultHCursor := cursor |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
586 |
] |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
587 |
]. |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
588 |
|
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
589 |
^ cursor |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
590 |
|
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
591 |
"Created: 28.3.1997 / 13:40:01 / cg" |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
592 |
"Modified: 28.3.1997 / 14:45:29 / cg" |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
593 |
! |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
594 |
|
295 | 595 |
lightFormOn:aDisplay |
596 |
"use same handle as Scroller" |
|
597 |
||
598 |
^ Scroller handleLightFormOn:aDisplay |
|
599 |
! |
|
600 |
||
601 |
shadowFormOn:aDisplay |
|
602 |
"use same handle as Scroller" |
|
603 |
||
604 |
^ Scroller handleShadowFormOn:aDisplay |
|
605 |
! |
|
606 |
||
607 |
updateStyleCache |
|
441
e170bca66a78
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
397
diff
changeset
|
608 |
"extract values from the styleSheet and cache them in class variables" |
e170bca66a78
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
397
diff
changeset
|
609 |
|
1388 | 610 |
<resource: #style (#'variablePanel.showHandle' |
1350
a25b2a5f3c7c
new viewStyle resource names
Claus Gittinger <cg@exept.de>
parents:
1220
diff
changeset
|
611 |
#'variablePanel.handlePosition' #'variablePanel.handleLevel' |
a25b2a5f3c7c
new viewStyle resource names
Claus Gittinger <cg@exept.de>
parents:
1220
diff
changeset
|
612 |
#'variablePanel.trackingLine' #'variablePanel.trackingStyle' |
a25b2a5f3c7c
new viewStyle resource names
Claus Gittinger <cg@exept.de>
parents:
1220
diff
changeset
|
613 |
#'variablePanel.separatingLine' #'variablePanel.handleColor')> |
441
e170bca66a78
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
397
diff
changeset
|
614 |
|
1129
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
615 |
|lineModeBoolean| |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
616 |
|
1350
a25b2a5f3c7c
new viewStyle resource names
Claus Gittinger <cg@exept.de>
parents:
1220
diff
changeset
|
617 |
DefaultShowHandle := StyleSheet at:'variablePanel.showHandle' default:true. |
a25b2a5f3c7c
new viewStyle resource names
Claus Gittinger <cg@exept.de>
parents:
1220
diff
changeset
|
618 |
DefaultHandleStyle := StyleSheet at:'variablePanel.handleStyle'. |
1381 | 619 |
DefaultHandlePosition := StyleSheet at:'variablePanel.handlePosition' default:nil "#right". |
620 |
DefaultHandlePosition isNil ifTrue:[ |
|
621 |
DefaultHandlePosition := ScrollableView defaultScrollBarPosition. |
|
622 |
]. |
|
1350
a25b2a5f3c7c
new viewStyle resource names
Claus Gittinger <cg@exept.de>
parents:
1220
diff
changeset
|
623 |
DefaultHandleLevel := StyleSheet at:'variablePanel.handleLevel' default:2. |
a25b2a5f3c7c
new viewStyle resource names
Claus Gittinger <cg@exept.de>
parents:
1220
diff
changeset
|
624 |
DefaultTrackingLine := StyleSheet at:'variablePanel.trackingStyle' default:nil. |
1129
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
625 |
DefaultTrackingLine isNil ifTrue:[ |
1350
a25b2a5f3c7c
new viewStyle resource names
Claus Gittinger <cg@exept.de>
parents:
1220
diff
changeset
|
626 |
lineModeBoolean := StyleSheet at:'variablePanel.trackingLine' default:false. |
1129
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
627 |
lineModeBoolean ifTrue:[ |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
628 |
DefaultTrackingLine := #solidLine |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
629 |
] ifFalse:[ |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
630 |
DefaultTrackingLine := #solidRectangle |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
631 |
] |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
632 |
]. |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
633 |
|
1350
a25b2a5f3c7c
new viewStyle resource names
Claus Gittinger <cg@exept.de>
parents:
1220
diff
changeset
|
634 |
DefaultSeparatingLine := StyleSheet at:'variablePanel.separatingLine' default:false. |
a25b2a5f3c7c
new viewStyle resource names
Claus Gittinger <cg@exept.de>
parents:
1220
diff
changeset
|
635 |
DefaultHandleColor := StyleSheet colorAt:'variablePanel.handleColor' default:Black. |
441
e170bca66a78
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
397
diff
changeset
|
636 |
|
1129
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
637 |
" |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
638 |
VariablePanel updateStyleCache |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
639 |
" |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
640 |
|
1388 | 641 |
"Modified: / 3.11.1997 / 02:19:56 / cg" |
295 | 642 |
! ! |
643 |
||
644 |
!VariablePanel methodsFor:'accessing'! |
|
645 |
||
646 |
addSubView:aView |
|
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
647 |
"a view is added; adjust other subviews sizes" |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
648 |
|
295 | 649 |
super addSubView:aView. |
1043 | 650 |
|
651 |
"/ (aView relativeOrigin isNil |
|
652 |
"/ or:[aView relativeExtent isNil and:[aView relativeCorner isNil]]) ifTrue:[ |
|
653 |
"/ aView geometryLayout:nil. |
|
654 |
"/ aView origin:0.0@0.0. |
|
655 |
"/ aView extent:1.0@0.5. |
|
656 |
"/ self setupSubviews |
|
657 |
"/ ]. |
|
658 |
||
295 | 659 |
realized ifTrue:[ |
1043 | 660 |
self resizeSubviews. |
295 | 661 |
] |
662 |
||
663 |
"Created: 17.1.1996 / 22:41:00 / cg" |
|
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
664 |
"Modified: 24.2.1996 / 19:05:05 / cg" |
295 | 665 |
! |
666 |
||
667 |
orientation |
|
485 | 668 |
"return my orientation; either #horizontal or #vertical" |
669 |
||
295 | 670 |
^ orientation |
485 | 671 |
|
672 |
"Modified: 6.3.1996 / 18:08:45 / cg" |
|
295 | 673 |
! |
674 |
||
675 |
orientation:aSymbol |
|
485 | 676 |
"change my orientation; aSymbol must be one of #horizontal or #vertical. |
677 |
Changing implies a resize of my subViews." |
|
678 |
||
679 |
aSymbol ~~ orientation ifTrue:[ |
|
680 |
orientation := aSymbol. |
|
681 |
self initCursor. |
|
682 |
self anyNonRelativeSubviews ifTrue:[ |
|
683 |
self setupSubviews |
|
684 |
]. |
|
685 |
shown ifTrue:[ |
|
686 |
self cursor:cursor. |
|
687 |
self sizeChanged:nil. |
|
722
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
688 |
self invalidate. |
485 | 689 |
] |
295 | 690 |
] |
485 | 691 |
|
722
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
692 |
"Modified: 29.5.1996 / 16:22:35 / cg" |
295 | 693 |
! |
694 |
||
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
695 |
removeSubView:aView |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
696 |
"a view is removed; adjust other subviews sizes" |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
697 |
|
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
698 |
super removeSubView:aView. |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
699 |
shown ifTrue:[ |
1043 | 700 |
(superView isNil or:[superView shown]) ifTrue:[ |
701 |
self setupSubviews. |
|
702 |
self resizeSubviews. |
|
703 |
] |
|
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
704 |
] |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
705 |
! ! |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
706 |
|
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
707 |
!VariablePanel methodsFor:'accessing-look'! |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
708 |
|
295 | 709 |
barHeight |
710 |
"return the height of the separating bar" |
|
711 |
||
712 |
^ barHeight |
|
713 |
! |
|
714 |
||
715 |
barHeight:nPixel |
|
716 |
"set the height of the separating bar" |
|
717 |
||
718 |
barHeight := nPixel. |
|
719 |
||
1207 | 720 |
"make certain bar is visible and catchable" |
295 | 721 |
(barHeight < 4) ifTrue:[ |
876 | 722 |
barHeight := 4 |
295 | 723 |
]. |
724 |
||
876 | 725 |
"make it even, so spacing is equally spreadable among subviews" |
295 | 726 |
barHeight odd ifTrue:[ |
876 | 727 |
barHeight := barHeight + 1 |
295 | 728 |
] |
876 | 729 |
|
730 |
"Modified: 7.11.1996 / 20:07:11 / cg" |
|
1207 | 731 |
"Modified: 28.4.1997 / 14:30:33 / dq" |
876 | 732 |
! |
733 |
||
734 |
handleImage:aBitmapOrImage |
|
735 |
"define the handles image" |
|
736 |
||
737 |
shadowForm := aBitmapOrImage. |
|
738 |
lightForm := nil. |
|
739 |
self computeBarHeight. |
|
740 |
||
741 |
"Created: 7.11.1996 / 20:21:10 / cg" |
|
742 |
"Modified: 7.11.1996 / 20:27:22 / cg" |
|
295 | 743 |
! |
744 |
||
871 | 745 |
handleLabels:aCollectionOfLabels |
746 |
orientation == #horizontal ifTrue:[ |
|
747 |
self error:'not allowed for horizontal panels' |
|
748 |
]. |
|
749 |
||
750 |
handleLabels := aCollectionOfLabels. |
|
751 |
self computeBarHeight. |
|
752 |
self resizeSubviews. |
|
753 |
||
754 |
! |
|
755 |
||
295 | 756 |
handleLevel:aNumber |
757 |
"define the 3D level of the handle (only with some styles). |
|
758 |
Normally, this is defined via styleSheet files, but this entry allows |
|
759 |
individual views to be manipulated." |
|
760 |
||
761 |
handleLevel := aNumber |
|
762 |
! |
|
763 |
||
764 |
handlePosition |
|
765 |
"return the position of the handle" |
|
766 |
||
767 |
^ handlePosition |
|
768 |
! |
|
769 |
||
770 |
handlePosition:aSymbol |
|
771 |
"define the position of the handle; the argument aSymbol |
|
772 |
may be one of #left, #right or #center" |
|
773 |
||
774 |
handlePosition := aSymbol |
|
775 |
! |
|
776 |
||
876 | 777 |
handleShadowImage:shadowImage lightImage:lightImage |
778 |
"define the handles image; both shadow and light parts" |
|
779 |
||
780 |
shadowForm := shadowImage. |
|
781 |
lightForm := lightImage. |
|
782 |
self computeBarHeight. |
|
783 |
||
784 |
"Created: 7.11.1996 / 20:21:51 / cg" |
|
785 |
"Modified: 7.11.1996 / 20:27:26 / cg" |
|
786 |
! |
|
787 |
||
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
788 |
handleStyle:styleSymbol |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
789 |
"define the style of the handle; |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
790 |
styleSymbol may be #motif to draw a little knob or |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
791 |
anything else to draw scrollBars handleForm. |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
792 |
Normally, this is defined via styleSheet files, but this entry allows |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
793 |
individual views to be manipulated." |
295 | 794 |
|
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
795 |
(styleSymbol ~~ handleStyle) ifTrue:[ |
722
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
796 |
handleStyle := styleSymbol. |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
797 |
handleStyle == #next ifTrue:[ |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
798 |
shadowForm := self class shadowFormOn:device. |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
799 |
lightForm := self class lightFormOn:device. |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
800 |
] ifFalse:[ |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
801 |
shadowForm := lightForm := nil |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
802 |
]. |
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
803 |
|
722
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
804 |
shadowForm notNil ifTrue:[ |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
805 |
(self is3D and:[handleStyle ~~ #motif]) ifTrue:[ |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
806 |
self barHeight:(shadowForm height + 2). |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
807 |
barWidth := shadowForm width |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
808 |
] |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
809 |
]. |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
810 |
shown ifTrue:[ |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
811 |
self resizeSubviews. |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
812 |
self invalidate |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
813 |
] |
295 | 814 |
] |
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
815 |
|
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
816 |
"Created: 24.2.1996 / 19:04:07 / cg" |
722
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
817 |
"Modified: 29.5.1996 / 16:22:24 / cg" |
295 | 818 |
! |
819 |
||
820 |
style:styleSymbol |
|
821 |
"define the style of the handle; |
|
822 |
styleSymbol may be #motif to draw a little knob or |
|
823 |
anything else to draw scrollBars handleForm. |
|
824 |
Normally, this is defined via styleSheet files, but this entry allows |
|
825 |
individual views to be manipulated." |
|
826 |
||
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
827 |
self handleStyle:styleSymbol |
295 | 828 |
|
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
829 |
"Modified: 24.2.1996 / 19:04:19 / cg" |
295 | 830 |
! ! |
831 |
||
832 |
!VariablePanel methodsFor:'drawing'! |
|
833 |
||
871 | 834 |
drawHandle:hIndex atX:hx y:hy |
295 | 835 |
"draw a single handle at hx/hy" |
836 |
||
1096 | 837 |
|h w x y m lbl maxKnob |
838 |
mar "{ Class: SmallInteger }" |
|
839 |
barWidthInt "{ Class: SmallInteger }" |
|
840 |
barHeightInt "{ Class: SmallInteger }" | |
|
295 | 841 |
|
1131 | 842 |
(handleStyle isNil |
843 |
or:[handleStyle == #none]) ifTrue:[^ self]. |
|
396
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
844 |
|
1096 | 845 |
mar := margin. |
846 |
barHeightInt := barHeight. |
|
847 |
barWidthInt := barWidth. |
|
871 | 848 |
|
295 | 849 |
shadowForm notNil ifTrue:[ |
871 | 850 |
h := shadowForm height. |
851 |
w := shadowForm width . |
|
1096 | 852 |
maxKnob := h min:barHeightInt. |
295 | 853 |
] ifFalse:[ |
1096 | 854 |
maxKnob := knobHeight min: barHeightInt. |
876 | 855 |
maxKnob := maxKnob max:4. |
856 |
w := h := maxKnob - 4. |
|
295 | 857 |
]. |
858 |
||
859 |
self paint:viewBackground. |
|
1131 | 860 |
self lineStyle:#solid. |
861 |
||
295 | 862 |
orientation == #vertical ifTrue:[ |
1096 | 863 |
self fillRectangleX:mar y:hy |
864 |
width:(width - mar - mar) |
|
865 |
height:barHeightInt. |
|
871 | 866 |
|
867 |
(handleStyle ~~ #normal and:[handleStyle ~~ #mswindows]) ifTrue:[ |
|
876 | 868 |
m := (maxKnob - h) // 2. |
871 | 869 |
|
870 |
shadowForm isNil ifTrue:[ |
|
876 | 871 |
|
1096 | 872 |
y := hy + (barHeightInt // 2). "/ center of the bar |
295 | 873 |
|
871 | 874 |
separatingLine ifTrue:[ |
875 |
self paint:shadowColor. |
|
1096 | 876 |
self displayLineFromX:mar y:y toX:(width - mar) y:y. |
871 | 877 |
y := y + 1. |
878 |
self paint:lightColor. |
|
1096 | 879 |
self displayLineFromX:mar y:y toX:(width - mar) y:y. |
871 | 880 |
]. |
881 |
self paint:viewBackground. |
|
1096 | 882 |
|
883 |
self fillRectangleX:(hx - barWidthInt) y:hy |
|
884 |
width:(barWidthInt + barWidthInt) |
|
871 | 885 |
height:h. |
295 | 886 |
|
871 | 887 |
handleStyle == #line ifTrue:[ |
888 |
self paint:handleColor. |
|
1096 | 889 |
self displayLineFromX:hx - barWidthInt y:y toX:hx + barWidthInt y:y |
871 | 890 |
] ifFalse:[ |
891 |
y := hy. |
|
892 |
handleStyle == #st80 ifTrue:[ |
|
893 |
y := y - 1 |
|
894 |
]. |
|
876 | 895 |
|
1096 | 896 |
handleStyle == #full ifTrue:[ |
897 |
self drawEdgesForX:0-handleLevel |
|
898 |
y:(y + m) |
|
899 |
width:width+handleLevel+handleLevel |
|
900 |
height:h |
|
901 |
level:handleLevel. |
|
902 |
] ifFalse:[ |
|
903 |
self drawEdgesForX:(hx - barWidthInt) |
|
904 |
y:(y + m) |
|
905 |
width:(barWidthInt + barWidthInt) |
|
906 |
height:h |
|
907 |
level:handleLevel. |
|
295 | 908 |
|
1096 | 909 |
handleStyle == #iris ifTrue:[ |
910 |
self paint:handleColor. |
|
911 |
self fillDeviceRectangleX:(hx - barWidthInt + 2) |
|
912 |
y:(y + m + 2) |
|
913 |
width:(barWidthInt + barWidthInt - 4) |
|
914 |
height:h - 4 |
|
915 |
] |
|
871 | 916 |
] |
917 |
]. |
|
918 |
] ifFalse:[ |
|
919 |
y := hy. |
|
920 |
self drawHandleFormAtX:hx y:(y + m) |
|
921 |
]. |
|
876 | 922 |
|
871 | 923 |
handleStyle == #st80 ifTrue:[ |
924 |
y := hy - 1. |
|
925 |
self paint:lightColor. |
|
1096 | 926 |
self displayLineFromX:mar y:y toX:(width - mar - mar - 1) y:y. |
871 | 927 |
self displayLineFromX:0 y:hy toX:0 y:(hy + knobHeight - 1). |
928 |
y := hy + knobHeight - 2. |
|
929 |
self paint:shadowColor. |
|
1096 | 930 |
self displayLineFromX:mar y:y toX:(width - mar) y:y. |
871 | 931 |
"uncomment the -1 if you dont like the notch at the right end" |
932 |
" VVV" |
|
1119 | 933 |
self displayLineFromX:width-1 y:hy" "-1" " toX:width-1 y:(hy + knobHeight - 1 - 1). |
871 | 934 |
]. |
935 |
] ifFalse:[ |
|
1096 | 936 |
y := hy + barHeightInt - 1. |
871 | 937 |
self paint:handleColor. |
938 |
separatingLine ifTrue:[ |
|
939 |
self displayLineFromX:0 y:hy+1 toX:width y:hy+1. |
|
940 |
self displayLineFromX:0 y:y toX:width y:y. |
|
941 |
]. |
|
1096 | 942 |
self fillRectangleX:hx y:hy width:barWidthInt height:barHeightInt |
871 | 943 |
]. |
295 | 944 |
|
871 | 945 |
lbl := self handleLabelAt:hIndex. |
946 |
lbl notNil ifTrue:[ |
|
947 |
hIndex ~~ 1 ifTrue:[ |
|
948 |
self paint:Color black. |
|
874 | 949 |
lbl isImageOrForm ifTrue:[ |
1096 | 950 |
lbl displayOn:self x:mar y:hy |
874 | 951 |
] ifFalse:[ |
1096 | 952 |
lbl displayOn:self x:mar y:hy + font ascent + 1 |
874 | 953 |
] |
871 | 954 |
] |
955 |
]. |
|
956 |
||
295 | 957 |
] ifFalse:[ |
1096 | 958 |
self fillRectangleX:hx y:mar |
959 |
width:barHeightInt |
|
960 |
height:(height - mar - mar). |
|
876 | 961 |
|
871 | 962 |
(handleStyle ~~ #normal and:[handleStyle ~~ #mswindows]) ifTrue:[ |
1096 | 963 |
m := (barHeightInt - w) // 2. |
871 | 964 |
shadowForm isNil ifTrue:[ |
1096 | 965 |
x := hx + (barHeightInt // 2). |
871 | 966 |
separatingLine ifTrue:[ |
967 |
self paint:shadowColor. |
|
1096 | 968 |
self displayLineFromX:x y:mar toX:x y:(height - mar). |
871 | 969 |
x := x + 1. |
970 |
self paint:lightColor. |
|
1096 | 971 |
self displayLineFromX:x y:mar toX:x y:(height - mar). |
871 | 972 |
]. |
973 |
self paint:viewBackground. |
|
1096 | 974 |
self fillRectangleX:hx y:(hy - barWidthInt) |
871 | 975 |
width:w |
1096 | 976 |
height:(barWidthInt + barWidthInt). |
295 | 977 |
|
871 | 978 |
handleStyle == #line ifTrue:[ |
979 |
self paint:handleColor. |
|
1096 | 980 |
self displayLineFromX:x y:hy - barWidthInt toX:x y:hy + barWidthInt. |
871 | 981 |
] ifFalse:[ |
982 |
x := hx. |
|
983 |
handleStyle == #st80 ifTrue:[ |
|
984 |
x := x - 1. |
|
985 |
]. |
|
1096 | 986 |
handleStyle == #full ifTrue:[ |
987 |
self drawEdgesForX:(x + m) |
|
988 |
y:0-handleLevel |
|
989 |
width:w |
|
990 |
height:height+handleLevel+handleLevel |
|
991 |
level:handleLevel. |
|
992 |
] ifFalse:[ |
|
993 |
self drawEdgesForX:(x + m) |
|
994 |
y:(hy - barWidthInt) |
|
995 |
width:w |
|
996 |
height:(barWidthInt + barWidthInt) |
|
997 |
level:handleLevel. |
|
998 |
handleStyle == #iris ifTrue:[ |
|
999 |
self paint:handleColor. |
|
1000 |
self fillDeviceRectangleX:(x + m + 2) |
|
1001 |
y:(hy - barWidthInt + 2) |
|
1002 |
width:w - 4 |
|
1003 |
height:(barWidthInt + barWidthInt - 4) |
|
1004 |
]. |
|
871 | 1005 |
]. |
1006 |
] |
|
1007 |
] ifFalse:[ |
|
1008 |
x := hx. |
|
1009 |
self drawHandleFormAtX:(x + m) y:hy |
|
1010 |
]. |
|
1011 |
handleStyle == #st80 ifTrue:[ |
|
1012 |
x := hx - 1. |
|
1013 |
self paint:lightColor. |
|
1096 | 1014 |
self displayLineFromX:x y:mar toX:x y:(height - mar). |
1015 |
self displayLineFromX:hx y:0 toX:(hx + barHeightInt - 1) y:0. |
|
1016 |
x := hx + barHeightInt - 2. |
|
871 | 1017 |
self paint:shadowColor. |
1096 | 1018 |
self displayLineFromX:x y:mar toX:x y:(height - mar). |
871 | 1019 |
"uncomment the -1 if you dont like the notch at the bottom end" |
1020 |
" VVV" |
|
1096 | 1021 |
self displayLineFromX:hx" "-1" " y:height-1 toX:(hx + barHeightInt - 1) y:height-1. |
871 | 1022 |
]. |
1023 |
] ifFalse:[ |
|
1096 | 1024 |
x := hx + barHeightInt - 1. |
871 | 1025 |
self paint:handleColor. |
1026 |
separatingLine ifTrue:[ |
|
1027 |
self displayLineFromX:hx+1 y:0 toX:hx+1 y:height. |
|
1028 |
self displayLineFromX:x y:0 toX:x y:height. |
|
1029 |
]. |
|
1096 | 1030 |
self fillRectangleX:hx y:hy width:barHeightInt height:barWidthInt |
871 | 1031 |
] |
295 | 1032 |
]. |
1033 |
||
1381 | 1034 |
"Modified: / 1.11.1997 / 11:55:05 / cg" |
295 | 1035 |
! |
1036 |
||
1037 |
drawHandleFormAtX:hx y:hy |
|
1038 |
"draw a handles bitmap at hx/hy" |
|
1039 |
||
876 | 1040 |
shadowForm notNil ifTrue:[ |
1041 |
self paint:shadowColor. |
|
1042 |
self displayForm:shadowForm x:hx y:hy. |
|
1043 |
]. |
|
1044 |
lightForm notNil ifTrue:[ |
|
1045 |
self paint:lightColor. |
|
1046 |
self displayForm:lightForm x:hx y:hy. |
|
1047 |
]. |
|
295 | 1048 |
self paint:viewBackground |
876 | 1049 |
|
1050 |
"Modified: 7.11.1996 / 20:25:33 / cg" |
|
295 | 1051 |
! |
1052 |
||
1053 |
invertHandleBarAtX:hx y:hy |
|
1131 | 1054 |
trackLine == #dashedLine ifTrue:[ |
1055 |
self lineStyle:#dashed. |
|
1056 |
]. |
|
1057 |
||
1220 | 1058 |
self clippedByChildren:false. |
1131 | 1059 |
|
295 | 1060 |
self xoring:[ |
1129
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1061 |
|yL xL halfHeight| |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1062 |
|
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1063 |
halfHeight := barHeight // 2. |
1207 | 1064 |
yL := hy + halfHeight - 1. |
1065 |
xL := hx + halfHeight - 1. |
|
295 | 1066 |
|
1129
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1067 |
orientation == #vertical ifTrue:[ |
1130 | 1068 |
(trackLine == #solidLine |
1069 |
or:[trackLine == #dashedLine]) ifTrue:[ |
|
1129
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1070 |
self displayLineFromX:0 y:yL toX:width y:yL. |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1071 |
] ifFalse:[ |
1130 | 1072 |
self fillRectangleX:0 y:hy width:width height:barHeight |
1129
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1073 |
] |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1074 |
] ifFalse:[ |
1130 | 1075 |
(trackLine == #solidLine |
1076 |
or:[trackLine == #dashedLine]) ifTrue:[ |
|
1129
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1077 |
self displayLineFromX:xL y:0 toX:xL y:height. |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1078 |
] ifFalse:[ |
1130 | 1079 |
self fillRectangleX:hx y:0 width:barHeight height:height |
1129
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1080 |
] |
1130 | 1081 |
]. |
295 | 1082 |
]. |
1220 | 1083 |
self clippedByChildren:true. |
1131 | 1084 |
trackLine == #dashedLine ifTrue:[ |
1085 |
self lineStyle:#solid. |
|
1086 |
]. |
|
1129
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1087 |
|
1131 | 1088 |
"Modified: 19.3.1997 / 11:18:54 / cg" |
1207 | 1089 |
"Modified: 28.4.1997 / 14:56:26 / dq" |
295 | 1090 |
! |
1091 |
||
1092 |
lockRedraw |
|
1093 |
redrawLocked := true |
|
1094 |
! |
|
1095 |
||
1096 |
redraw |
|
1097 |
"redraw all of the handles" |
|
1098 |
||
1099 |
redrawLocked ~~ true ifTrue:[ |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1100 |
self redrawHandlesFrom:1 to:(self subViews size) |
295 | 1101 |
] |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1102 |
|
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1103 |
"Modified: 28.1.1997 / 17:54:15 / cg" |
295 | 1104 |
! |
1105 |
||
1106 |
redrawHandlesFrom:start to:stop |
|
1107 |
"redraw some handles" |
|
1108 |
||
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1109 |
(self subViews size > 0) ifTrue:[ |
871 | 1110 |
showHandle ifTrue:[ |
1111 |
self handleOriginsWithIndexFrom:start to:stop do:[:hPoint :hIndex | |
|
1112 |
self drawHandle:hIndex atX:(hPoint x) y:(hPoint y) |
|
1113 |
]. |
|
1114 |
] |
|
295 | 1115 |
] |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1116 |
|
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1117 |
"Modified: 28.1.1997 / 17:54:33 / cg" |
295 | 1118 |
! |
1119 |
||
1120 |
unlockRedraw |
|
1121 |
redrawLocked := false |
|
1122 |
! ! |
|
1123 |
||
1159 | 1124 |
!VariablePanel methodsFor:'enumerating subviews'! |
1125 |
||
1126 |
changeSequenceOrderFor:aSubView to:anIndex |
|
1416 | 1127 |
"change a subview's position in the subviews collection. |
1159 | 1128 |
" |
1129 |
|success| |
|
1130 |
||
1131 |
success := super changeSequenceOrderFor:aSubView to:anIndex. |
|
1132 |
success ifTrue:[ |
|
1133 |
self setupSubviews. |
|
1134 |
self resizeSubviews. |
|
1135 |
]. |
|
1136 |
^ success |
|
1137 |
! ! |
|
1138 |
||
295 | 1139 |
!VariablePanel methodsFor:'event handling'! |
1140 |
||
1141 |
sizeChanged:how |
|
1142 |
"my size has changed; resize my subviews" |
|
1143 |
||
1144 |
shown ifTrue:[ |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1145 |
(how == #smaller) ifTrue:[ |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1146 |
self resizeSubviews |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1147 |
] ifFalse:[ |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1148 |
"/ |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1149 |
"/ do it in reverse order, to avoid some redraws |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1150 |
"/ |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1151 |
self resizeSubviewsFrom:(self subViews size) to:1 |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1152 |
] |
295 | 1153 |
]. |
1154 |
self changed:#sizeOfView with:how. |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1155 |
|
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1156 |
"Modified: 28.1.1997 / 17:56:30 / cg" |
295 | 1157 |
! ! |
1158 |
||
1159 |
!VariablePanel methodsFor:'initializing'! |
|
1160 |
||
871 | 1161 |
computeBarHeight |
958 | 1162 |
"compute the height if the separating bar from either the |
1163 |
form or an explicit height given in the styleSheet" |
|
1164 |
||
1362 | 1165 |
<resource: #style (#'variablePanel.barHeight')> |
924
81f3ca4512bd
allow barHeight to be set in the styleSheet
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1166 |
|
871 | 1167 |
|bH h| |
1168 |
||
876 | 1169 |
shadowForm notNil ifTrue:[ |
871 | 1170 |
bH := shadowForm height + 2. |
1171 |
] ifFalse:[ |
|
1172 |
self is3D ifTrue:[ |
|
1381 | 1173 |
h := 2 |
871 | 1174 |
] ifFalse:[ |
1175 |
h := 2 |
|
1176 |
]. |
|
1362 | 1177 |
bH := styleSheet at:'variablePanel.barHeight'. |
924
81f3ca4512bd
allow barHeight to be set in the styleSheet
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1178 |
bH isNil ifTrue:[ |
1381 | 1179 |
h := styleSheet at:'variablePanel.barHeightMM' default:h. |
924
81f3ca4512bd
allow barHeight to be set in the styleSheet
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1180 |
bH := (h * device verticalPixelPerMillimeter) rounded. |
81f3ca4512bd
allow barHeight to be set in the styleSheet
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1181 |
]. |
871 | 1182 |
]. |
876 | 1183 |
self barHeight:bH. |
871 | 1184 |
knobHeight := bH. |
1185 |
||
1186 |
handleLabels notNil ifTrue:[ |
|
1187 |
font := font on:device. |
|
1188 |
bH := handleLabels inject:bH into:[:maxSoFar :thisLabel | |
|
874 | 1189 |
thisLabel isNil ifTrue:[ |
1190 |
maxSoFar |
|
1191 |
] ifFalse:[ |
|
1192 |
maxSoFar max:(thisLabel heightOn:self) |
|
1193 |
] |
|
1194 |
]. |
|
871 | 1195 |
bH := bH + font descent - 1 |
1196 |
]. |
|
1197 |
||
1198 |
self barHeight:bH. |
|
1199 |
||
1381 | 1200 |
"Modified: / 31.10.1997 / 22:23:44 / cg" |
871 | 1201 |
! |
1202 |
||
295 | 1203 |
defaultControllerClass |
1204 |
^ VariablePanelController |
|
1205 |
! |
|
1206 |
||
1207 |
fixSize |
|
1151
94aff1c7b0aa
Fix comments, eliminate common message sends.
Stefan Vogel <sv@exept.de>
parents:
1131
diff
changeset
|
1208 |
super fixSize. |
295 | 1209 |
extentChanged ifTrue:[ |
1151
94aff1c7b0aa
Fix comments, eliminate common message sends.
Stefan Vogel <sv@exept.de>
parents:
1131
diff
changeset
|
1210 |
self resizeSubviews |
94aff1c7b0aa
Fix comments, eliminate common message sends.
Stefan Vogel <sv@exept.de>
parents:
1131
diff
changeset
|
1211 |
]. |
94aff1c7b0aa
Fix comments, eliminate common message sends.
Stefan Vogel <sv@exept.de>
parents:
1131
diff
changeset
|
1212 |
|
94aff1c7b0aa
Fix comments, eliminate common message sends.
Stefan Vogel <sv@exept.de>
parents:
1131
diff
changeset
|
1213 |
"Modified: 22.3.1997 / 01:19:55 / stefan" |
295 | 1214 |
! |
1215 |
||
1216 |
initCursor |
|
1217 |
"set the cursor - a double arrow" |
|
1218 |
||
1158
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
1219 |
cursor := self class cursorForOrientation:orientation |
900 | 1220 |
|
1158
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
1221 |
"Modified: 28.3.1997 / 14:45:44 / cg" |
295 | 1222 |
! |
1223 |
||
1224 |
initStyle |
|
966 | 1225 |
"setup viewStyle specifics" |
1226 |
||
871 | 1227 |
|mm| |
295 | 1228 |
|
1229 |
super initStyle. |
|
1230 |
||
1231 |
handleColor := DefaultHandleColor on:device. |
|
1232 |
||
1233 |
DefaultHandleStyle isNil ifTrue:[ |
|
496 | 1234 |
handleStyle := styleSheet name |
295 | 1235 |
] ifFalse:[ |
496 | 1236 |
handleStyle := DefaultHandleStyle |
295 | 1237 |
]. |
1238 |
||
496 | 1239 |
handleLevel := DefaultHandleLevel. |
1240 |
showHandle := DefaultShowHandle. |
|
295 | 1241 |
handlePosition := DefaultHandlePosition. |
1242 |
trackLine := DefaultTrackingLine. |
|
1243 |
separatingLine := DefaultSeparatingLine. |
|
1244 |
||
496 | 1245 |
handleStyle == #next ifTrue:[ |
1246 |
shadowForm := self class shadowFormOn:device. |
|
1247 |
lightForm := self class lightFormOn:device. |
|
1248 |
||
1249 |
barWidth := shadowForm width. |
|
295 | 1250 |
] ifFalse:[ |
496 | 1251 |
shadowForm := lightForm := nil. |
1252 |
||
1253 |
mm := device verticalPixelPerMillimeter. |
|
1381 | 1254 |
barWidth := (1.5 * mm) rounded. "motif style width" |
295 | 1255 |
]. |
871 | 1256 |
self computeBarHeight. |
496 | 1257 |
|
295 | 1258 |
handleStyle == #mswindows ifTrue:[ |
496 | 1259 |
barWidth := (ArrowButton new direction:#up) width + 1 |
295 | 1260 |
]. |
496 | 1261 |
|
1381 | 1262 |
"Modified: / 31.10.1997 / 22:15:42 / cg" |
295 | 1263 |
! |
1264 |
||
1265 |
initialize |
|
496 | 1266 |
orientation isNil ifTrue:[orientation := #vertical]. |
295 | 1267 |
super initialize. |
496 | 1268 |
|
1269 |
"Modified: 7.3.1996 / 14:08:25 / cg" |
|
295 | 1270 |
! ! |
1271 |
||
1272 |
!VariablePanel methodsFor:'private'! |
|
1273 |
||
1274 |
anyNonRelativeSubviews |
|
1275 |
"return true, if any of my subviews has no relative origin/extent" |
|
1276 |
||
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1277 |
self subViews do:[:aComponent | |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1278 |
aComponent relativeCorner isNil ifTrue:[^ true]. |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1279 |
aComponent relativeOrigin isNil ifTrue:[^ true] |
295 | 1280 |
]. |
1281 |
^ false |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1282 |
|
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1283 |
"Modified: 28.1.1997 / 17:57:26 / cg" |
295 | 1284 |
! |
1285 |
||
871 | 1286 |
handleLabelAt:hIndex |
1287 |
handleLabels notNil ifTrue:[ |
|
1288 |
^ handleLabels at:hIndex ifAbsent:nil |
|
1289 |
]. |
|
1290 |
^ nil |
|
1291 |
! |
|
1292 |
||
1293 |
handleOriginsWithIndexDo:aBlock |
|
295 | 1294 |
"evaluate the argument block for every handle-origin" |
1295 |
||
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1296 |
self handleOriginsWithIndexFrom:1 to:(self subViews size) do:aBlock |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1297 |
|
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1298 |
"Modified: 28.1.1997 / 17:53:44 / cg" |
295 | 1299 |
! |
1300 |
||
871 | 1301 |
handleOriginsWithIndexFrom:start to:stop do:aBlock |
295 | 1302 |
"evaluate the argument block for some handle-origins" |
1303 |
||
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1304 |
|x y hw hh hDelta vDelta subViews |
295 | 1305 |
first "{ Class: SmallInteger }" |
1306 |
last "{ Class: SmallInteger }"| |
|
1307 |
||
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1308 |
(subViews := self subViews) notNil ifTrue:[ |
871 | 1309 |
shadowForm notNil ifTrue:[ |
1310 |
hw := shadowForm width. |
|
1311 |
hh := shadowForm height. |
|
1312 |
] ifFalse:[ |
|
1313 |
hw := hh := barWidth |
|
1314 |
]. |
|
295 | 1315 |
|
871 | 1316 |
(handleStyle ~~ #normal and:[handleStyle ~~ #mswindows]) ifTrue:[ |
1317 |
hDelta := barWidth // 2. |
|
1318 |
vDelta := barWidth // 2. |
|
1319 |
] ifFalse:[ |
|
1320 |
hDelta := vDelta := 0 |
|
1321 |
]. |
|
295 | 1322 |
|
871 | 1323 |
(handlePosition == #left) ifTrue:[ |
1324 |
x := hDelta. |
|
1381 | 1325 |
y := vDelta. |
1326 |
||
1327 |
orientation == #vertical ifTrue:[ |
|
1328 |
x := x + barWidth |
|
1329 |
] ifFalse:[ |
|
1330 |
y := y + barWidth |
|
1331 |
]. |
|
1332 |
margin ~~ 0 ifTrue:[ |
|
1333 |
x := x + 2 |
|
1334 |
]. |
|
871 | 1335 |
] ifFalse:[ |
1336 |
(handlePosition == #right) ifTrue:[ |
|
1337 |
x := width - hw - margin - hDelta. |
|
1338 |
y := height - hh - margin - vDelta. |
|
1339 |
] ifFalse:[ |
|
1340 |
x := width - barWidth // 2. |
|
1341 |
y := height - barWidth // 2 |
|
1342 |
] |
|
1343 |
]. |
|
1344 |
first := start + 1. |
|
1345 |
last := stop. |
|
1381 | 1346 |
|
871 | 1347 |
first to:last do:[:index | |
1348 |
|view| |
|
295 | 1349 |
|
871 | 1350 |
view := subViews at:index. |
1351 |
orientation == #vertical ifTrue:[ |
|
1352 |
y := view top "origin y" - barHeight + 1. |
|
1353 |
] ifFalse:[ |
|
1354 |
x := view left "origin x" - barHeight + 1. |
|
1355 |
]. |
|
1356 |
aBlock value:(x @ y) value:index |
|
1357 |
] |
|
295 | 1358 |
] |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1359 |
|
1381 | 1360 |
"Modified: / 1.11.1997 / 11:53:40 / cg" |
295 | 1361 |
! |
1362 |
||
1363 |
resizeSubviews |
|
1151
94aff1c7b0aa
Fix comments, eliminate common message sends.
Stefan Vogel <sv@exept.de>
parents:
1131
diff
changeset
|
1364 |
"readjust size of all subviews" |
295 | 1365 |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1366 |
self resizeSubviewsFrom:1 to:(self subViews size) |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1367 |
|
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1368 |
"Modified: 28.1.1997 / 17:54:42 / cg" |
1151
94aff1c7b0aa
Fix comments, eliminate common message sends.
Stefan Vogel <sv@exept.de>
parents:
1131
diff
changeset
|
1369 |
"Modified: 22.3.1997 / 01:01:31 / stefan" |
295 | 1370 |
! |
1371 |
||
1372 |
resizeSubviewsFrom:start to:stop |
|
1373 |
"readjust size of some subviews" |
|
1374 |
||
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1375 |
|step nSubviews subViews| |
295 | 1376 |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1377 |
(subViews := self subViews) size > 0 ifTrue:[ |
871 | 1378 |
(start <= stop) ifTrue:[ |
1379 |
step := 1 |
|
1380 |
] ifFalse:[ |
|
1381 |
step := -1 |
|
1382 |
]. |
|
1383 |
nSubviews := subViews size. |
|
1384 |
start to:stop by:step do:[:index | |
|
1385 |
|bw view o1 o2 relOrg relCorner newOrg newCorner newExt| |
|
295 | 1386 |
|
871 | 1387 |
view := subViews at:index. |
1388 |
bw := view borderWidth. |
|
295 | 1389 |
|
871 | 1390 |
index == 1 ifTrue:[ |
1391 |
o1 := 0. |
|
1392 |
] ifFalse:[ |
|
1393 |
o1 := barHeight // 2 - bw |
|
1394 |
]. |
|
1395 |
index == nSubviews ifTrue:[ |
|
1396 |
o2 := 0. |
|
1397 |
] ifFalse:[ |
|
1398 |
o2 := barHeight // 2 - bw |
|
1399 |
]. |
|
295 | 1400 |
|
871 | 1401 |
newOrg := view computeOrigin. |
1402 |
newOrg notNil ifTrue:[ |
|
1403 |
(index ~~ 1) ifTrue:[ |
|
1404 |
orientation == #vertical ifTrue:[ |
|
1405 |
newOrg y:(newOrg y + o1) |
|
1406 |
] ifFalse:[ |
|
1407 |
newOrg x:(newOrg x + o1) |
|
1408 |
] |
|
1409 |
]. |
|
1410 |
]. |
|
1411 |
newExt := view computeExtent. |
|
1412 |
newExt notNil ifTrue:[ |
|
1413 |
orientation == #vertical ifTrue:[ |
|
1414 |
newExt y:(newExt y - o2 - o1) |
|
1415 |
] ifFalse:[ |
|
1416 |
newExt x:(newExt x - o2 - o1) |
|
1417 |
] |
|
1418 |
]. |
|
1419 |
view pixelOrigin:newOrg extent:newExt. |
|
1420 |
] |
|
295 | 1421 |
] |
873 | 1422 |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1423 |
"Modified: 28.1.1997 / 17:55:03 / cg" |
1151
94aff1c7b0aa
Fix comments, eliminate common message sends.
Stefan Vogel <sv@exept.de>
parents:
1131
diff
changeset
|
1424 |
"Modified: 22.3.1997 / 01:02:21 / stefan" |
295 | 1425 |
! |
1426 |
||
1427 |
setupSubviews |
|
1428 |
"setup subviews sizes (in case of non-relative sizes)" |
|
1429 |
||
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1430 |
|pos delta subViews nSubViews "{ Class: SmallInteger }"| |
295 | 1431 |
|
300 | 1432 |
"/ setup all subviews to spread evenly ... |
295 | 1433 |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1434 |
subViews := self subViews. |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1435 |
nSubViews := subViews size. |
1043 | 1436 |
nSubViews == 0 ifTrue:[^ self]. |
295 | 1437 |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1438 |
pos := 0.0. |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1439 |
delta := 1.0 / nSubViews. |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1440 |
|
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1441 |
1 to:nSubViews do:[:index | |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1442 |
|view| |
295 | 1443 |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1444 |
view := subViews at:index. |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1445 |
orientation == #vertical ifTrue:[ |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1446 |
index == subViews size ifTrue:[ |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1447 |
view origin:(0.0 @ pos) corner:(1.0 @ 1.0) |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1448 |
] ifFalse:[ |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1449 |
view origin:(0.0 @ pos) corner:(1.0 @ (pos + delta)) |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1450 |
]. |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1451 |
] ifFalse:[ |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1452 |
index == subViews size ifTrue:[ |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1453 |
view origin:(pos @ 0.0) corner:(1.0 @ 1.0) |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1454 |
] ifFalse:[ |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1455 |
view origin:(pos @ 0.0) corner:((pos + delta) @ 1.0) |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1456 |
]. |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1457 |
]. |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1458 |
pos := pos + delta |
295 | 1459 |
] |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1460 |
|
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1461 |
"Modified: 28.1.1997 / 17:56:20 / cg" |
295 | 1462 |
! ! |
1463 |
||
299
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1464 |
!VariablePanel methodsFor:'private tableView protocol'! |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1465 |
|
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1466 |
setupSubviewOrigins |
826 | 1467 |
"setup subviews origins |
1468 |
if we only have relative extents |
|
1469 |
(Variable Panels need relative origins and corners!!) (SV 16.1.95)" |
|
299
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1470 |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1471 |
|x y e eX eY subViews n "{ Class: SmallInteger }"| |
299
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1472 |
|
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1473 |
x := y := 0.0. |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1474 |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1475 |
subViews := self subViews. |
299
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1476 |
n := subViews size. |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1477 |
1 to:n do:[:index | |
826 | 1478 |
|view| |
299
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1479 |
|
826 | 1480 |
view := subViews at:index. |
1481 |
e := view relativeExtent. |
|
1482 |
e notNil ifTrue:[ |
|
1483 |
view relativeExtent:nil. |
|
1484 |
eX := e x. |
|
1485 |
eY := e y. |
|
1486 |
index == n ifTrue:[ |
|
1487 |
view origin:(x @ y) corner:(1.0 @ 1.0) |
|
1488 |
] ifFalse:[ |
|
1489 |
orientation == #vertical ifTrue:[ |
|
1490 |
view origin:(x @ y) corner:(1.0 @ (y+eY)) |
|
1491 |
] ifFalse:[ |
|
1492 |
view origin:(x @ y) corner:((x+eX) @ 1.0) |
|
1493 |
]. |
|
1494 |
]. |
|
1495 |
orientation == #vertical ifTrue:[ |
|
1496 |
y := y + eY. |
|
1497 |
] ifFalse:[ |
|
1498 |
x := x + eX. |
|
1499 |
] |
|
1500 |
] ifFalse: [ |
|
1501 |
view origin:(x @ y). |
|
1502 |
orientation == #vertical ifTrue:[ |
|
1503 |
y := view relativeCorner y. |
|
1504 |
] ifFalse:[ |
|
1505 |
x := view relativeCorner x. |
|
1506 |
] |
|
1507 |
]. |
|
1508 |
] |
|
1509 |
||
1510 |
"Modified: 21.8.1996 / 10:01:29 / stefan" |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1511 |
"Modified: 28.1.1997 / 17:55:21 / cg" |
299
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1512 |
! ! |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1513 |
|
871 | 1514 |
!VariablePanel class methodsFor:'documentation'! |
295 | 1515 |
|
1516 |
version |
|
1416 | 1517 |
^ '$Header: /cvs/stx/stx/libwidg/Attic/VarPanel.st,v 1.38 1998-01-17 13:47:28 cg Exp $' |
295 | 1518 |
! ! |