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