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