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