author | Claus Gittinger <cg@exept.de> |
Wed, 02 Feb 2011 13:29:16 +0100 | |
changeset 4222 | 53a2a6433f59 |
parent 4206 | 570f1a1e587e |
child 4260 | 7acd85d3324f |
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 |
" |
|
2179 | 12 |
"{ Package: 'stx:libwidg' }" |
13 |
||
295 | 14 |
SimpleView subclass:#VariablePanel |
2623 | 15 |
instanceVariableNames:'barHeight barWidth barLevel separatingLine shadowForm lightForm |
4206
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
16 |
showHandle showHandleWhenEntered handlePosition handleColor |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
17 |
handleStyle handleLevel noColor trackLine redrawLocked |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
18 |
orientation handleLabels knobHeight realRelativeSizes |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
19 |
snapAdornment' |
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
20 |
classVariableNames:'DefaultShowHandle DefaultHandleStyle DefaultHandlePosition |
295 | 21 |
DefaultTrackingLine DefaultSeparatingLine DefaultHandleColor |
1529
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
22 |
DefaultHandleLevel DefaultVCursor DefaultHCursor |
4206
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
23 |
DefaultHandleImage DefaultSnapIcons DefaultSnapHandlePosition |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
24 |
DefaultShowHandleWhenEntered' |
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
25 |
poolDictionaries:'' |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
26 |
category:'Views-Layout' |
295 | 27 |
! |
28 |
||
4187 | 29 |
Object subclass:#SnapAdornment |
30 |
instanceVariableNames:'level mode selectedLevel enterLevel selectedBgColor enterBgColor |
|
31 |
iconLeftRight iconUpDown iconLeft iconRight iconUp iconDown width |
|
32 |
height' |
|
33 |
classVariableNames:'' |
|
34 |
poolDictionaries:'' |
|
35 |
privateIn:VariablePanel |
|
36 |
! |
|
37 |
||
871 | 38 |
!VariablePanel class methodsFor:'documentation'! |
295 | 39 |
|
40 |
copyright |
|
41 |
" |
|
42 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
43 |
All Rights Reserved |
|
44 |
||
45 |
This software is furnished under a license and may be used |
|
46 |
only in accordance with the terms of that license and with the |
|
47 |
inclusion of the above copyright notice. This software may not |
|
48 |
be provided or otherwise made available to, or used by, any |
|
49 |
other person. No title to or ownership of the software is |
|
50 |
hereby transferred. |
|
51 |
" |
|
52 |
! |
|
53 |
||
54 |
documentation |
|
55 |
" |
|
56 |
a View to separate its subviews vertically by a movable bar; |
|
57 |
the size-ratios of the subviews can be changed by moving this bar. |
|
58 |
||
59 |
In order to correctly setup this kind of view, the subviews must |
|
60 |
be created with a relative origin & relative corner. |
|
61 |
The panel does not verify the relative subview bounds; |
|
62 |
therefore, it is your responsibility to set those relative sizes to fit |
|
63 |
according the orientation (see bad example below). |
|
64 |
||
65 |
The bar-handle is either an exposed knob (style == #motif) |
|
66 |
or the form defined in Scroller (style ~~ #motif) |
|
67 |
or nothing. |
|
68 |
||
69 |
Typically creation is done as: |
|
70 |
||
496 | 71 |
p := VariablePanel in:superView. |
72 |
p orientation:#vertical. |
|
295 | 73 |
|
496 | 74 |
v1 := <someViewClass> origin:0.0 @ 0.0 |
75 |
corner:1.0 @ 0.5 |
|
76 |
in:p. |
|
77 |
v2 := <someViewClass> origin:0.0 @ 0.5 |
|
78 |
corner:1.0 @ 0.8 |
|
79 |
in:p. |
|
80 |
v3 := <someViewClass> origin:0.0 @ 0.8 |
|
81 |
corner:1.0 @ 1.0 |
|
82 |
in:p. |
|
83 |
||
84 |
The two subclasses VariableHorizontalPanel and VariableVerticalPanel |
|
85 |
preset the orientation. They are a kept for backward compatibility |
|
86 |
(in previous versions, there used to be no common VariablePanel (super-) class). |
|
295 | 87 |
|
88 |
Notice: if it is required to insert a fixed-size view in the panel, |
|
89 |
use an extra view & insets, and place the subview into that extra view. |
|
1381 | 90 |
See examples. |
496 | 91 |
|
585 | 92 |
[instance Variables:] |
496 | 93 |
|
94 |
barHeight <Integer> the height of the bar (for verticalPanels) |
|
95 |
barWidth <Integer> the width of the bar (for horizontalPanels) |
|
96 |
||
97 |
separatingLine <Boolean> show a separating line (as in motif style) |
|
98 |
||
99 |
shadowForm <Image/Form> form (shadow part) drawn as handle - if nonNil |
|
100 |
||
101 |
lightForm <Image/Form> form (light part) drawn as handle - if nonNil |
|
102 |
||
103 |
showHandle <Boolean> if false, no handle is drawn |
|
104 |
||
105 |
handlePosition <Symbol> where is the handle - one of #left, #center, #right |
|
106 |
||
107 |
handleColor <Color> inside color of handle - defaults to viewBackground |
|
108 |
||
109 |
handleStyle <Symbol> type of handle; one of #next, #motif or nil |
|
110 |
||
111 |
handleLevel <Integer> 3D level of handle (only valid if no form is given) |
|
112 |
||
113 |
trackLine <Boolean> if true, an inverted line is drawn for tracking; |
|
114 |
otherwise, the whole bar is inverted. |
|
115 |
||
116 |
redrawLocked internal - locks redraws while tracking |
|
117 |
||
118 |
orientation <Symbol> one of #horizontal / #vertical |
|
119 |
||
120 |
||
585 | 121 |
[styleSheet values:] |
1381 | 122 |
variablePanel.showHandle true/false - should a handle be shown (default:true) |
496 | 123 |
|
1381 | 124 |
variablePanel.handleStyle #next / #motif / #iris / #full / nil (special handles) |
496 | 125 |
|
1381 | 126 |
variablePanel.handlePosition #left / #center / #right (default:#right) |
496 | 127 |
|
1381 | 128 |
variablePanel.handleLevel 3D level of heandle (default:2) |
496 | 129 |
|
1381 | 130 |
variablePanel.trackingLine when moved, track an inverted line (as in motif) |
496 | 131 |
as opposed to tracking the whole bar (default:false) |
1381 | 132 |
(obsoleted by trackingStyle) |
496 | 133 |
|
1381 | 134 |
variablePanel.trackingStyle #solidRectangle / #solidLine / #dashedLine |
135 |
detailed control over how to draw tracking |
|
136 |
(obsoletes trackingLine above) |
|
496 | 137 |
|
1381 | 138 |
variablePanel.separatingLine draw a separating line in the bar as in motif (default:false) |
496 | 139 |
|
1381 | 140 |
variablePanel.handleColor color of the handle. (default:Black) |
141 |
||
142 |
variablePanel.handleEnteredColor |
|
143 |
color of the handle when the pointer is in the bar (default:nil) |
|
585 | 144 |
|
145 |
[see also:] |
|
146 |
PanelView |
|
147 |
||
148 |
[author:] |
|
149 |
Claus Gittinger |
|
295 | 150 |
" |
151 |
! |
|
152 |
||
153 |
examples |
|
154 |
" |
|
874 | 155 |
example (notice that the subviews MUST have relative bounds): |
593 | 156 |
[exBegin] |
157 |
|top p v1 v2 v3| |
|
295 | 158 |
|
593 | 159 |
top := StandardSystemView new. |
160 |
top extent:300@300. |
|
295 | 161 |
|
593 | 162 |
p := VariablePanel |
163 |
origin:0.0 @ 0.0 |
|
164 |
corner:1.0 @ 1.0 |
|
165 |
in:top. |
|
166 |
p orientation:#vertical. |
|
295 | 167 |
|
593 | 168 |
v1 := View origin:0.0@0.0 corner:1.0@(1/2) in:p. |
169 |
v2 := View origin:0.0@(1/2) corner:1.0@(2/3) in:p. |
|
170 |
v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p. |
|
295 | 171 |
|
593 | 172 |
v1 viewBackground:(Color red). |
173 |
v2 viewBackground:(Color green). |
|
174 |
v3 viewBackground:(Color yellow). |
|
295 | 175 |
|
593 | 176 |
top open |
177 |
[exEnd] |
|
295 | 178 |
|
179 |
||
180 |
||
876 | 181 |
change the handles level: |
593 | 182 |
[exBegin] |
183 |
|top p v1 v2 v3| |
|
295 | 184 |
|
593 | 185 |
top := StandardSystemView new. |
186 |
top extent:300@300. |
|
295 | 187 |
|
593 | 188 |
p := VariablePanel |
189 |
origin:0.0 @ 0.0 |
|
190 |
corner:1.0 @ 1.0 |
|
191 |
in:top. |
|
192 |
p orientation:#vertical. |
|
193 |
p handleLevel:-1. |
|
295 | 194 |
|
593 | 195 |
v1 := View origin:0.0@0.0 corner:1.0@(1/3) in:p. |
196 |
v2 := View origin:0.0@(1/3) corner:1.0@(2/3) in:p. |
|
197 |
v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p. |
|
295 | 198 |
|
593 | 199 |
v1 viewBackground:(Color red). |
200 |
v2 viewBackground:(Color green). |
|
201 |
v3 viewBackground:(Color yellow). |
|
295 | 202 |
|
593 | 203 |
top open |
204 |
[exEnd] |
|
295 | 205 |
|
206 |
||
207 |
||
876 | 208 |
change the handles style to nil makes it invisible: |
593 | 209 |
[exBegin] |
210 |
|top p v1 v2 v3| |
|
397 | 211 |
|
593 | 212 |
top := StandardSystemView new. |
213 |
top extent:300@300. |
|
397 | 214 |
|
593 | 215 |
p := VariablePanel |
216 |
origin:0.0 @ 0.0 |
|
217 |
corner:1.0 @ 1.0 |
|
218 |
in:top. |
|
219 |
p orientation:#vertical. |
|
220 |
p handleStyle:nil. |
|
397 | 221 |
|
593 | 222 |
v1 := View origin:0.0@0.0 corner:1.0@(1/3) in:p. |
223 |
v2 := View origin:0.0@(1/3) corner:1.0@(2/3) in:p. |
|
224 |
v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p. |
|
397 | 225 |
|
593 | 226 |
v1 viewBackground:(Color red). |
227 |
v2 viewBackground:(Color green). |
|
228 |
v3 viewBackground:(Color yellow). |
|
397 | 229 |
|
593 | 230 |
top open |
231 |
[exEnd] |
|
397 | 232 |
|
233 |
||
234 |
||
876 | 235 |
define your own handle (-bitmap): |
236 |
[exBegin] |
|
237 |
|top p v1 v2 v3| |
|
238 |
||
239 |
top := StandardSystemView new. |
|
240 |
top extent:300@300. |
|
241 |
||
242 |
p := VariablePanel |
|
243 |
origin:0.0 @ 0.0 |
|
244 |
corner:1.0 @ 1.0 |
|
245 |
in:top. |
|
246 |
p orientation:#vertical. |
|
247 |
p handleImage:(Image fromFile:'bitmaps/ScrollLt.8.xbm'). |
|
248 |
||
249 |
v1 := View origin:0.0@0.0 corner:1.0@(1/3) in:p. |
|
250 |
v2 := View origin:0.0@(1/3) corner:1.0@(2/3) in:p. |
|
251 |
v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p. |
|
252 |
||
253 |
v1 viewBackground:(Color red). |
|
254 |
v2 viewBackground:(Color green). |
|
255 |
v3 viewBackground:(Color yellow). |
|
256 |
||
257 |
top open |
|
258 |
[exEnd] |
|
259 |
||
260 |
||
261 |
||
262 |
another handle-bitmap: |
|
263 |
[exBegin] |
|
264 |
|top p v1 v2 v3| |
|
265 |
||
266 |
top := StandardSystemView new. |
|
267 |
top extent:300@300. |
|
268 |
||
269 |
p := VariablePanel |
|
270 |
origin:0.0 @ 0.0 |
|
271 |
corner:1.0 @ 1.0 |
|
272 |
in:top. |
|
273 |
p orientation:#vertical. |
|
274 |
p handleImage:(Form width:9 |
|
275 |
height:11 |
|
276 |
fromArray:#( |
|
277 |
2r00000000 2r00000000 |
|
278 |
2r00001000 2r00000000 |
|
279 |
2r00011100 2r00000000 |
|
280 |
2r00111110 2r00000000 |
|
281 |
2r01111111 2r00000000 |
|
282 |
2r00000000 2r00000000 |
|
283 |
2r01111111 2r00000000 |
|
284 |
2r00111110 2r00000000 |
|
285 |
2r00011100 2r00000000 |
|
286 |
2r00001000 2r00000000 |
|
287 |
2r00000000 2r00000000 |
|
288 |
) |
|
289 |
). |
|
290 |
||
291 |
v1 := View origin:0.0@0.0 corner:1.0@(1/3) in:p. |
|
292 |
v2 := View origin:0.0@(1/3) corner:1.0@(2/3) in:p. |
|
293 |
v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p. |
|
294 |
||
295 |
v1 viewBackground:(Color red). |
|
296 |
v2 viewBackground:(Color green). |
|
297 |
v3 viewBackground:(Color yellow). |
|
298 |
||
299 |
top open |
|
300 |
[exEnd] |
|
301 |
||
302 |
placing scrolled and unscrolled views into a variablePanel: |
|
593 | 303 |
[exBegin] |
304 |
|top p v1 v2 v3| |
|
295 | 305 |
|
593 | 306 |
top := StandardSystemView new. |
307 |
top extent:300@300. |
|
295 | 308 |
|
593 | 309 |
p := VariablePanel |
310 |
origin:0.0 @ 0.0 |
|
311 |
corner:1.0 @ 1.0 |
|
312 |
in:top. |
|
313 |
p orientation:#vertical. |
|
295 | 314 |
|
593 | 315 |
v1 := ScrollableView for:SelectionInListView in:p. |
316 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5. |
|
317 |
v1 list:(FileDirectory directoryNamed:'/etc') contents. |
|
318 |
v1 action:[:selNr | |
|
319 |
|fullName stream text| |
|
320 |
fullName := '/etc/' , v1 selectionValue. |
|
321 |
stream := fullName asFilename readStream. |
|
322 |
stream notNil ifTrue:[ |
|
323 |
text := stream contents. |
|
324 |
v2 contents:text. |
|
325 |
v3 contents:text |
|
326 |
] |
|
327 |
]. |
|
295 | 328 |
|
593 | 329 |
v2 := TextView origin:0.0 @ 0.5 corner:1.0 @ 0.8 in:p. |
295 | 330 |
|
593 | 331 |
v3 := ScrollableView for:TextView in:p. |
332 |
v3 origin:0.0 @ 0.8 corner:1.0 @ 1.0. |
|
333 |
top open |
|
334 |
[exEnd] |
|
295 | 335 |
|
336 |
||
876 | 337 |
dynamically adding/removing views: |
593 | 338 |
[exBegin] |
339 |
|top p v1 v2 b| |
|
295 | 340 |
|
593 | 341 |
top := StandardSystemView new. |
342 |
top extent:300@300. |
|
295 | 343 |
|
593 | 344 |
b := Toggle label:'show' in:top. |
345 |
b showLamp:false. |
|
346 |
b origin:0.0 @ 0.0 corner:(1.0 @ 40). |
|
347 |
b action:[:state | |
|
348 |
state ifTrue:[ |
|
349 |
b label:'hide'. |
|
350 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5. |
|
351 |
v2 := ScrollableView for:EditTextView. |
|
352 |
v2 origin:0.0 @ 0.5 corner:1.0 @ 1.0. |
|
353 |
v2 contents:'another text'. |
|
354 |
p addSubView:v2. |
|
355 |
v2 realize. |
|
356 |
] ifFalse:[ |
|
357 |
b label:'show'. |
|
358 |
v2 destroy. |
|
359 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 1.0 |
|
360 |
] |
|
361 |
]. |
|
295 | 362 |
|
593 | 363 |
p := VariablePanel |
364 |
origin:0.0 @ 0.0 |
|
365 |
corner:1.0 @ 1.0 |
|
366 |
in:top. |
|
367 |
p orientation:#vertical. |
|
368 |
p topInset:50. |
|
295 | 369 |
|
593 | 370 |
v1 := ScrollableView for:EditTextView in:p. |
371 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 1.0. |
|
372 |
v1 contents:'some text'. |
|
295 | 373 |
|
593 | 374 |
top open |
375 |
[exEnd] |
|
295 | 376 |
|
377 |
||
876 | 378 |
dynamically flipping orientation: |
295 | 379 |
Notice: you have to change the relative bounds of the subviews first. |
593 | 380 |
[exBegin] |
381 |
|top p v1 v2 b| |
|
295 | 382 |
|
593 | 383 |
top := StandardSystemView new. |
384 |
top extent:300@300. |
|
295 | 385 |
|
593 | 386 |
b := Toggle label:'flip' in:top. |
387 |
b showLamp:false. |
|
388 |
b origin:0.0 @ 0.0 corner:(1.0 @ 40). |
|
389 |
b action:[:state | |
|
390 |
state ifTrue:[ |
|
391 |
v1 origin:0.0 @ 0.0 corner:0.5 @ 1.0. |
|
392 |
v2 origin:0.5 @ 0.0 corner:1.0 @ 1.0. |
|
393 |
p orientation:#horizontal. |
|
394 |
] ifFalse:[ |
|
395 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5. |
|
396 |
v2 origin:0.0 @ 0.5 corner:1.0 @ 1.0. |
|
397 |
p orientation:#vertical. |
|
398 |
]. |
|
399 |
]. |
|
295 | 400 |
|
593 | 401 |
p := VariablePanel |
402 |
origin:0.0 @ 0.0 |
|
403 |
corner:1.0 @ 1.0 |
|
404 |
in:top. |
|
405 |
p orientation:#vertical. |
|
406 |
p topInset:50. |
|
295 | 407 |
|
593 | 408 |
v1 := ScrollableView for:EditTextView in:p. |
409 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5. |
|
410 |
v1 contents:'some text'. |
|
295 | 411 |
|
593 | 412 |
v2 := ScrollableView for:EditTextView in:p. |
413 |
v2 origin:0.0 @ 0.5 corner:1.0 @ 1.0. |
|
414 |
v2 contents:'another text'. |
|
295 | 415 |
|
593 | 416 |
top open |
417 |
[exEnd] |
|
295 | 418 |
|
419 |
||
876 | 420 |
combining fix-size with variable size: |
295 | 421 |
(need 3 extra frame-views to place the extra labels into) |
593 | 422 |
[exBegin] |
423 |
|top p v1 l1 v2 l2 v3 l3 f1 f2 f3| |
|
295 | 424 |
|
593 | 425 |
top := StandardSystemView new. |
426 |
top extent:300@300. |
|
295 | 427 |
|
593 | 428 |
p := VariablePanel |
429 |
origin:0.0 @ 0.0 |
|
430 |
corner:1.0 @ 1.0 |
|
431 |
in:top. |
|
295 | 432 |
|
874 | 433 |
p orientation:#vertical. |
434 |
||
435 |
f1 := View origin:0.0@0.0 corner:1.0@0.3 in:p. |
|
436 |
f2 := View origin:0.0@0.3 corner:1.0@0.6 in:p. |
|
437 |
f3 := View origin:0.0@0.6 corner:1.0@1.0 in:p. |
|
295 | 438 |
|
593 | 439 |
v1 := View origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:f1. |
440 |
v2 := View origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:f2. |
|
441 |
v3 := View origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:f3. |
|
295 | 442 |
|
593 | 443 |
l1 := Label label:'sub1' in:f1. |
444 |
l2 := Label label:'sub2' in:f2. |
|
445 |
l3 := Label label:'sub3' in:f3. |
|
295 | 446 |
|
593 | 447 |
l1 origin:0.0 @ 0.0 corner:1.0 @ 0.0 ; |
448 |
bottomInset:(l1 preferredExtent y negated). |
|
449 |
l2 origin:0.0 @ 0.0 corner:1.0 @ 0.0 ; |
|
450 |
bottomInset:(l2 preferredExtent y negated). |
|
451 |
l3 origin:0.0 @ 0.0 corner:1.0 @ 0.0 ; |
|
452 |
bottomInset:(l3 preferredExtent y negated). |
|
295 | 453 |
|
593 | 454 |
v1 topInset:(l1 preferredExtent y); level:-1. |
455 |
v2 topInset:(l2 preferredExtent y); level:-1. |
|
456 |
v3 topInset:(l3 preferredExtent y); level:-1. |
|
295 | 457 |
|
593 | 458 |
v1 viewBackground:(Color red). |
459 |
v2 viewBackground:(Color green). |
|
460 |
v3 viewBackground:(Color yellow). |
|
295 | 461 |
|
874 | 462 |
top open |
463 |
[exEnd] |
|
464 |
||
465 |
VerticalPansels allow a label to be associated with the |
|
466 |
handles; this looks much like the above, but is slightly |
|
467 |
more compact. Notice, no label can be placed above the first |
|
468 |
view - it has no handle. |
|
469 |
[exBegin] |
|
470 |
|top p v1 v2 v3| |
|
471 |
||
472 |
top := StandardSystemView new. |
|
473 |
top extent:300@300. |
|
474 |
||
475 |
p := VariablePanel |
|
476 |
origin:0.0 @ 0.0 |
|
477 |
corner:1.0 @ 1.0 |
|
478 |
in:top. |
|
479 |
||
593 | 480 |
p orientation:#vertical. |
874 | 481 |
p handleLabels:#('ignored' 'sub2' 'sub3'). |
482 |
||
483 |
v1 := View origin:0.0@0.0 corner:1.0@0.3 in:p. |
|
484 |
v2 := View origin:0.0@0.3 corner:1.0@0.6 in:p. |
|
485 |
v3 := View origin:0.0@0.6 corner:1.0@1.0 in:p. |
|
486 |
||
487 |
v1 viewBackground:(Color red). |
|
488 |
v2 viewBackground:(Color green). |
|
489 |
v3 viewBackground:(Color yellow). |
|
490 |
||
593 | 491 |
top open |
492 |
[exEnd] |
|
295 | 493 |
|
874 | 494 |
handle labels can be more than strings .... |
495 |
(however, they should have about the same height, since |
|
496 |
the largest defines heights of all bars; |
|
497 |
retry the example below with a larger bitmap image ...) |
|
498 |
[exBegin] |
|
499 |
|top e p v1 v2 v3| |
|
500 |
||
501 |
top := StandardSystemView new. |
|
502 |
top extent:300@300. |
|
503 |
||
504 |
p := VariablePanel |
|
505 |
origin:0.0 @ 0.0 |
|
506 |
corner:1.0 @ 1.0 |
|
507 |
in:top. |
|
508 |
||
509 |
p orientation:#vertical. |
|
510 |
e := Array with:#bold |
|
511 |
with:#color->Color red. |
|
512 |
||
513 |
p handleLabels:(Array with:nil |
|
514 |
with:('bold and red' asText emphasizeAllWith:e) |
|
515 |
with:(Image fromFile:'ScrollRt.xbm')). |
|
516 |
||
517 |
v1 := View origin:0.0@0.0 corner:1.0@0.3 in:p. |
|
518 |
v2 := View origin:0.0@0.3 corner:1.0@0.6 in:p. |
|
519 |
v3 := View origin:0.0@0.6 corner:1.0@1.0 in:p. |
|
520 |
||
521 |
v1 viewBackground:(Color red). |
|
522 |
v2 viewBackground:(Color green). |
|
523 |
v3 viewBackground:(Color yellow). |
|
524 |
||
525 |
top open |
|
526 |
[exEnd] |
|
527 |
||
528 |
||
295 | 529 |
|
530 |
BAD EXAMPLE (wrong relative sizes - repaired on handle move): |
|
593 | 531 |
[exBegin] |
532 |
|top p v1 v2 v3| |
|
295 | 533 |
|
593 | 534 |
top := StandardSystemView new. |
535 |
top extent:300@300. |
|
295 | 536 |
|
593 | 537 |
p := VariablePanel |
538 |
origin:0.0 @ 0.0 |
|
539 |
corner:1.0 @ 1.0 |
|
540 |
in:top. |
|
541 |
p orientation:#vertical. |
|
295 | 542 |
|
593 | 543 |
v1 := View origin:0.0 @ 0.0 corner:1.0 @ (1/4) in:p. |
544 |
v2 := View origin:0.0 @ (1/2) corner:1.0 @ (3/4) in:p. |
|
545 |
v3 := View origin:0.0 @ (3/4) corner:1.0 @ 1.0 in:p. |
|
295 | 546 |
|
593 | 547 |
v1 viewBackground:(Color red). |
548 |
v2 viewBackground:(Color green). |
|
549 |
v3 viewBackground:(Color yellow). |
|
295 | 550 |
|
593 | 551 |
top open |
552 |
[exEnd] |
|
2179 | 553 |
|
554 |
example with snapMode: |
|
555 |
[exBegin] |
|
556 |
|top p v1 v2 v3| |
|
557 |
||
558 |
top := StandardSystemView new. |
|
559 |
top extent:300@300. |
|
560 |
||
561 |
p := VariablePanel |
|
562 |
origin:0.0 @ 0.0 |
|
563 |
corner:1.0 @ 1.0 |
|
564 |
in:top. |
|
565 |
p orientation:#vertical. |
|
566 |
p snapMode:#min. |
|
567 |
||
568 |
v1 := View origin:0.0@0.0 corner:1.0@(1/2) in:p. |
|
569 |
v2 := View origin:0.0@(1/2) corner:1.0@(2/3) in:p. |
|
570 |
v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p. |
|
571 |
||
572 |
v1 viewBackground:(Color red). |
|
573 |
v2 viewBackground:(Color green). |
|
574 |
v3 viewBackground:(Color yellow). |
|
575 |
||
576 |
top open |
|
577 |
[exEnd] |
|
578 |
||
4043 | 579 |
example with redefined handle-image: |
580 |
[exBegin] |
|
581 |
|top p v1 v2 v3| |
|
582 |
||
583 |
top := StandardSystemView new. |
|
584 |
top extent:300@300. |
|
585 |
||
586 |
p := VariablePanel |
|
587 |
origin:0.0 @ 0.0 |
|
588 |
corner:1.0 @ 1.0 |
|
589 |
in:top. |
|
590 |
p orientation:#vertical. |
|
591 |
p handleImage:(ToolbarIconLibrary barResizeVerticalIcon). |
|
592 |
p showHandle:true. |
|
593 |
||
594 |
v1 := View origin:0.0@0.0 corner:1.0@(1/2) in:p. |
|
595 |
v2 := View origin:0.0@(1/2) corner:1.0@(2/3) in:p. |
|
596 |
v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p. |
|
597 |
||
598 |
v1 viewBackground:(Color red). |
|
599 |
v2 viewBackground:(Color green). |
|
600 |
v3 viewBackground:(Color yellow). |
|
601 |
||
602 |
top open |
|
603 |
[exEnd] |
|
604 |
||
605 |
||
295 | 606 |
" |
607 |
! ! |
|
608 |
||
871 | 609 |
!VariablePanel class methodsFor:'defaults'! |
295 | 610 |
|
1158
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
611 |
cursorForOrientation:orientation |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
612 |
"return an appropriate cursor" |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
613 |
|
1698
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
614 |
^ self cursorForOrientation:orientation onDevice:Display. |
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
615 |
|
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
616 |
"Modified: / 30.9.1998 / 18:21:10 / cg" |
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
617 |
! |
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
618 |
|
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
619 |
cursorForOrientation:orientation onDevice:device |
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
620 |
"return an appropriate cursor" |
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
621 |
|
1158
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
622 |
|cursor| |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
623 |
|
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
624 |
orientation == #vertical ifTrue:[ |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
625 |
DefaultVCursor notNil ifTrue:[ |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
626 |
cursor := DefaultVCursor |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
627 |
] ifFalse:[ |
1698
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
628 |
device platformName = 'WIN32' ifFalse:[ |
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
629 |
cursor := Cursor |
2073 | 630 |
sourceForm:(Smalltalk imageFromFileNamed:'VVPanel.xbm' forClass:self) |
631 |
maskForm:(Smalltalk imageFromFileNamed:'VVPanel_m.xbm' forClass:self) |
|
1698
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
632 |
hotX:8 |
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
633 |
hotY:8. |
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
634 |
]. |
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
635 |
|
1158
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
636 |
" |
1698
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
637 |
if bitmaps are not available or under Win95, |
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
638 |
use a standard cursor |
1158
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
639 |
" |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
640 |
cursor isNil ifTrue:[ |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
641 |
"which one looks better ?" |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
642 |
cursor := Cursor upDownArrow |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
643 |
"cursor := Cursor upLimitArrow" |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
644 |
]. |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
645 |
DefaultVCursor := cursor |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
646 |
] |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
647 |
] ifFalse:[ |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
648 |
DefaultHCursor notNil ifTrue:[ |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
649 |
cursor := DefaultHCursor |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
650 |
] ifFalse:[ |
1698
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
651 |
device platformName = 'WIN32' ifFalse:[ |
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
652 |
cursor := Cursor |
2073 | 653 |
sourceForm:(Smalltalk imageFromFileNamed:'VHPanel.xbm' forClass:self) |
654 |
maskForm:(Smalltalk imageFromFileNamed:'VHPanel_m.xbm' forClass:self) |
|
1698
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
655 |
hotX:8 |
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
656 |
hotY:8. |
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
657 |
]. |
1158
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
658 |
" |
1698
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
659 |
if bitmaps are not available or under Win95, |
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
660 |
use a standard cursor |
1158
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
661 |
" |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
662 |
cursor isNil ifTrue:[ |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
663 |
"which one looks better ?" |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
664 |
cursor := Cursor leftRightArrow |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
665 |
"cursor := Cursor leftLimitArrow" |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
666 |
]. |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
667 |
DefaultHCursor := cursor |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
668 |
] |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
669 |
]. |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
670 |
|
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
671 |
^ cursor |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
672 |
|
1698
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
673 |
" |
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
674 |
DefaultVCursor := DefaultHCursor := nil. |
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
675 |
" |
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
676 |
|
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
677 |
"Created: / 30.9.1998 / 18:20:41 / cg" |
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
678 |
"Modified: / 30.9.1998 / 18:23:07 / cg" |
1158
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
679 |
! |
225c0d52068d
cursor default is now a class method.
Claus Gittinger <cg@exept.de>
parents:
1151
diff
changeset
|
680 |
|
295 | 681 |
lightFormOn:aDisplay |
682 |
"use same handle as Scroller" |
|
683 |
||
684 |
^ Scroller handleLightFormOn:aDisplay |
|
685 |
! |
|
686 |
||
687 |
shadowFormOn:aDisplay |
|
688 |
"use same handle as Scroller" |
|
689 |
||
690 |
^ Scroller handleShadowFormOn:aDisplay |
|
691 |
! |
|
692 |
||
2179 | 693 |
snapIcons |
694 |
"returns dictionary of snapIcons |
|
695 |
" |
|
696 |
|upIcon snapIcons| |
|
697 |
||
698 |
DefaultSnapIcons isNil ifTrue:[ |
|
699 |
DefaultSnapIcons := IdentityDictionary new. |
|
2269 | 700 |
|
701 |
DefaultSnapIcons at:#iconUp put:self snapIconUp. |
|
702 |
DefaultSnapIcons at:#iconRight put:self snapIconRight. |
|
703 |
DefaultSnapIcons at:#iconDown put:self snapIconDown. |
|
704 |
DefaultSnapIcons at:#iconLeft put:self snapIconLeft. |
|
2236 | 705 |
|
706 |
DefaultSnapIcons at:#iconUpDown put:self snapIconUpDown. |
|
2269 | 707 |
DefaultSnapIcons at:#iconLeftRight put:self snapIconLeftRight. |
2179 | 708 |
]. |
709 |
^ DefaultSnapIcons |
|
710 |
" |
|
2236 | 711 |
DefaultSnapIcons := nil. |
712 |
self snapIcons |
|
2179 | 713 |
" |
714 |
! |
|
715 |
||
295 | 716 |
updateStyleCache |
441
e170bca66a78
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
397
diff
changeset
|
717 |
"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
|
718 |
|
1388 | 719 |
<resource: #style (#'variablePanel.showHandle' |
1529
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
720 |
#'variablePanel.handleStyle' |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
721 |
#'variablePanel.handleImage' |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
722 |
#'variablePanel.handlePosition' |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
723 |
#'variablePanel.handleLevel' |
2228
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
724 |
#'variablePanel.snapHandlePosition' |
1529
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
725 |
#'variablePanel.trackingLine' |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
726 |
#'variablePanel.trackingStyle' |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
727 |
#'variablePanel.separatingLine' |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
728 |
#'variablePanel.handleColor')> |
441
e170bca66a78
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
397
diff
changeset
|
729 |
|
1129
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
730 |
|lineModeBoolean| |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
731 |
|
2084 | 732 |
DefaultVCursor := DefaultHCursor := nil. |
733 |
||
1869 | 734 |
DefaultShowHandle := StyleSheet at:#'variablePanel.showHandle' default:true. |
4206
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
735 |
DefaultShowHandleWhenEntered := StyleSheet at:#'variablePanel.showHandleWhenEntered' default:false. |
1869 | 736 |
DefaultHandleStyle := StyleSheet at:#'variablePanel.handleStyle'. |
737 |
DefaultHandlePosition := StyleSheet at:#'variablePanel.handlePosition' "default:#right". |
|
1381 | 738 |
DefaultHandlePosition isNil ifTrue:[ |
739 |
DefaultHandlePosition := ScrollableView defaultScrollBarPosition. |
|
740 |
]. |
|
2252 | 741 |
DefaultSnapHandlePosition := StyleSheet at:#'variablePanel.snapHandlePosition' default:DefaultHandlePosition. |
1869 | 742 |
DefaultHandleLevel := StyleSheet at:#'variablePanel.handleLevel' default:2. |
743 |
DefaultTrackingLine := StyleSheet at:#'variablePanel.trackingStyle'. |
|
1129
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
744 |
DefaultTrackingLine isNil ifTrue:[ |
1869 | 745 |
lineModeBoolean := StyleSheet at:#'variablePanel.trackingLine' default:false. |
1129
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
746 |
lineModeBoolean ifTrue:[ |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
747 |
DefaultTrackingLine := #solidLine |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
748 |
] ifFalse:[ |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
749 |
DefaultTrackingLine := #solidRectangle |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
750 |
] |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
751 |
]. |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
752 |
|
1869 | 753 |
DefaultSeparatingLine := StyleSheet at:#'variablePanel.separatingLine' default:false. |
754 |
DefaultHandleColor := StyleSheet colorAt:#'variablePanel.handleColor' default:Black. |
|
441
e170bca66a78
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
397
diff
changeset
|
755 |
|
1869 | 756 |
DefaultHandleImage := StyleSheet at:#'variablePanel.handleImage' |
1529
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
757 |
|
1129
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
758 |
" |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
759 |
VariablePanel updateStyleCache |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
760 |
" |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
761 |
|
4206
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
762 |
"Modified: / 19-12-2010 / 09:39:50 / cg" |
295 | 763 |
! ! |
764 |
||
2269 | 765 |
!VariablePanel class methodsFor:'image specs'! |
766 |
||
767 |
snapIconDown |
|
768 |
"This resource specification was automatically generated |
|
769 |
by the ImageEditor of ST/X." |
|
770 |
||
771 |
"Do not manually edit this!! If it is corrupted, |
|
772 |
the ImageEditor may not be able to read the specification." |
|
773 |
||
774 |
" |
|
775 |
self snapIconDown inspect |
|
776 |
ImageEditor openOnClass:self andSelector:#snapIconDown |
|
777 |
" |
|
778 |
||
779 |
<resource: #image> |
|
780 |
||
781 |
^Icon |
|
2590 | 782 |
constantNamed:#'VariablePanel class snapIconDown' |
783 |
ifAbsentPut:[(Depth2Image new) width: 62; height: 5; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@B(J *F(Z!!*F(Z!!*@@@@@@@!!BDHQ!!FDXQ!!FDXP@@H@@@EPUATEPUATEPUAT@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 68 68 68 255 255 255]; mask:((Depth1Image new) width: 62; height: 5; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@A?LX1#FLX3>C8)R%JT)R''0GA#FLX1#FN@H@@@@@@@@P@@a') ; yourself); yourself] |
|
2482 | 784 |
! |
2269 | 785 |
|
786 |
snapIconLeft |
|
787 |
"This resource specification was automatically generated |
|
788 |
by the ImageEditor of ST/X." |
|
789 |
||
790 |
"Do not manually edit this!! If it is corrupted, |
|
791 |
the ImageEditor may not be able to read the specification." |
|
792 |
||
793 |
" |
|
794 |
self snapIconLeft inspect |
|
795 |
ImageEditor openOnClass:self andSelector:#snapIconLeft |
|
796 |
" |
|
797 |
||
798 |
<resource: #image> |
|
799 |
||
800 |
^Icon |
|
2590 | 801 |
constantNamed:#'VariablePanel class snapIconLeft' |
802 |
ifAbsentPut:[(Depth2Image new) width: 5; height: 62; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
803 |
@C @B@@@@@@@@@@@@@@@@@@P@C@)@BD@IP@@@@@BJP@!!@BT@@@@@@B$HHP %@@@@AP@)@BD@IP@@D@T0JP@!!@BT@@@@ED2$@HP@%@@@@AP@)ARDHIP@@@@T@ |
|
804 |
JP@!!@BT@@A@ELB @HP@E@@@@@C\@@@@@@@@@@@@@@@T@B@@a') ; colorMapFromArray:#[0 0 0 68 68 68 255 255 255]; mask:((Depth1Image new) width: 5; height: 62; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@A@0\OA0LA@D@6UPL@@@XE@0@@A TC@@@FAPL@@@XE@0@@A UCLD@FAPL@@@XE@0@@A TC@@DCA0=''T0D@@b') ; yourself); yourself] |
|
2482 | 805 |
! |
2269 | 806 |
|
807 |
snapIconLeftRight |
|
808 |
"This resource specification was automatically generated |
|
809 |
by the ImageEditor of ST/X." |
|
810 |
||
811 |
"Do not manually edit this!! If it is corrupted, |
|
812 |
the ImageEditor may not be able to read the specification." |
|
813 |
||
814 |
" |
|
815 |
self snapIconLeftRight inspect |
|
816 |
ImageEditor openOnClass:self andSelector:#snapIconLeftRight |
|
817 |
" |
|
818 |
||
819 |
<resource: #image> |
|
820 |
||
821 |
^Icon |
|
2590 | 822 |
constantNamed:#'VariablePanel class snapIconLeftRight' |
823 |
ifAbsentPut:[(Depth2Image new) width: 5; height: 62; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
824 |
@@@@@@@K@AH@@@@@@AX@L@@@@@@(@BD@AQD@B@@FJ#@!!@AT@@@@@@J*@@@@@DP@H@AD*LBD@EP@@@@@@J"\!!B1T@@@@@E"(0HP@U@@@@@@B*$P@H@@X@L@@@ |
|
825 |
J @!!@AT@@@@@@B(RHP UDP@0@@@@@@@@@@@@I0@K@@@@@@@a') ; colorMapFromArray:#[0 0 0 68 68 68 255 255 255]; mask:((Depth1Image new) width: 5; height: 62; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' LC <NK@ @@A@&QPLP@@XE@0@@C<A? A@VAPL@@@XE@0@@A TCL@@O @>@@BXE@0@PY$TCD@@A@0\OA0LAXb') ; yourself); yourself] |
|
2482 | 826 |
! |
2269 | 827 |
|
828 |
snapIconRight |
|
829 |
"This resource specification was automatically generated |
|
830 |
by the ImageEditor of ST/X." |
|
831 |
||
832 |
"Do not manually edit this!! If it is corrupted, |
|
833 |
the ImageEditor may not be able to read the specification." |
|
834 |
||
835 |
" |
|
836 |
self snapIconRight inspect |
|
837 |
ImageEditor openOnClass:self andSelector:#snapIconRight |
|
838 |
" |
|
839 |
||
840 |
<resource: #image> |
|
841 |
||
842 |
^Icon |
|
2590 | 843 |
constantNamed:#'VariablePanel class snapIconRight' |
844 |
ifAbsentPut:[(Depth2Image new) width: 5; height: 62; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
845 |
@@L@@@@@@@@@@@@@@AT@B@@@J@@!!@@T@E@@@@B(QHS@U@AP@@@@*@BD@EP@T@@@@J L!!@AT@E@@@DB(0HP@U@AP@@@@*J"D@EP@T@@@@J @!!B!!TH@@@@@B(@ |
|
846 |
HP@U@@@@@A@*LBD@EP@@@@@@@@X@@@@@@@@@@@@@@@ @B@@a') ; colorMapFromArray:#[0 0 0 68 68 68 255 255 255]; mask:((Depth1Image new) width: 5; height: 62; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@4A \G%2X4@AXE@0@@A TC@E@6AQL@@@XE@0@@A TC@@@6APL@@@XEL0@@A UC\@@VAPL@@@PFA0^''M PP@b') ; yourself); yourself] |
|
2482 | 847 |
! |
2269 | 848 |
|
849 |
snapIconUp |
|
850 |
"This resource specification was automatically generated |
|
851 |
by the ImageEditor of ST/X." |
|
852 |
||
853 |
"Do not manually edit this!! If it is corrupted, |
|
854 |
the ImageEditor may not be able to read the specification." |
|
855 |
||
856 |
" |
|
857 |
self snapIconUp inspect |
|
858 |
ImageEditor openOnClass:self andSelector:#snapIconUp |
|
859 |
" |
|
860 |
||
861 |
<resource: #image> |
|
862 |
||
863 |
^Icon |
|
2590 | 864 |
constantNamed:#'VariablePanel class snapIconUp' |
865 |
ifAbsentPut:[(Depth2Image new) width: 62; height: 5; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@J *B(J *B(J (B @@@@@@BEHT!!REHT!!RDHP!!@@@@@@@EPUATEPUATE@TAP@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 68 68 68 255 255 255]; mask:((Depth1Image new) width: 62; height: 5; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'B@@@@@@@@D@\X1#FLX1 8C9R%JT)R%G0_3FLX1#FL? @@@@@@@@@@@@a') ; yourself); yourself] |
|
2482 | 866 |
! |
2269 | 867 |
|
868 |
snapIconUpDown |
|
869 |
"This resource specification was automatically generated |
|
870 |
by the ImageEditor of ST/X." |
|
871 |
||
872 |
"Do not manually edit this!! If it is corrupted, |
|
873 |
the ImageEditor may not be able to read the specification." |
|
874 |
||
875 |
" |
|
876 |
self snapIconUpDown inspect |
|
877 |
ImageEditor openOnClass:self andSelector:#snapIconUpDown |
|
2590 | 878 |
Icon flushCachedIcons |
2269 | 879 |
" |
880 |
||
881 |
<resource: #image> |
|
882 |
||
883 |
^Icon |
|
2590 | 884 |
constantNamed:#'VariablePanel class snapIconUpDown' |
885 |
ifAbsentPut:[(Depth2Image new) width: 62; height: 5; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@H@@@@@@ @@@@@@@@@B J@BB J@(@HJ@(@@@@@@@!!BDD !!BDHPBBDHP@@@@@@APE@HAPE@T@ E@T@@@@@@@@@@B@@@@@@H@@@@@@@b') ; colorMapFromArray:#[0 0 0 68 68 68 255 255 255]; mask:((Depth1Image new) width: 62; height: 5; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@J@@B @@@PLX)#FJX1?C )R%JT)R#8_A#JLX2#FGC>@@(@@J@@H@@a') ; yourself); yourself] |
|
2482 | 886 |
! ! |
2269 | 887 |
|
295 | 888 |
!VariablePanel methodsFor:'accessing'! |
889 |
||
2650 | 890 |
isHorizontal |
891 |
^ orientation == #horizontal |
|
892 |
! |
|
893 |
||
295 | 894 |
orientation |
485 | 895 |
"return my orientation; either #horizontal or #vertical" |
896 |
||
295 | 897 |
^ orientation |
485 | 898 |
|
899 |
"Modified: 6.3.1996 / 18:08:45 / cg" |
|
295 | 900 |
! |
901 |
||
902 |
orientation:aSymbol |
|
485 | 903 |
"change my orientation; aSymbol must be one of #horizontal or #vertical. |
904 |
Changing implies a resize of my subViews." |
|
905 |
||
906 |
aSymbol ~~ orientation ifTrue:[ |
|
907 |
orientation := aSymbol. |
|
908 |
self initCursor. |
|
909 |
self anyNonRelativeSubviews ifTrue:[ |
|
910 |
self setupSubviews |
|
911 |
]. |
|
912 |
shown ifTrue:[ |
|
913 |
self cursor:cursor. |
|
914 |
self sizeChanged:nil. |
|
2623 | 915 |
self redrawIfShown. |
485 | 916 |
] |
295 | 917 |
] |
485 | 918 |
|
722
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
919 |
"Modified: 29.5.1996 / 16:22:35 / cg" |
2650 | 920 |
! |
921 |
||
922 |
relativeCorners |
|
923 |
^ self subViews |
|
924 |
collect:[:eachView | |
|
925 |
self isHorizontal ifTrue:[ |
|
926 |
eachView relativeCorner x |
|
927 |
] ifFalse:[ |
|
928 |
eachView relativeCorner y |
|
929 |
] |
|
930 |
] |
|
931 |
! |
|
932 |
||
933 |
relativeCorners:aCollection |
|
934 |
|pos| |
|
935 |
||
3278 | 936 |
aCollection size == self subViews size ifFalse:[^ self ]. |
937 |
||
2650 | 938 |
pos := 0.0. |
939 |
self subViews with:aCollection |
|
940 |
do:[:eachView :eachCorner | |
|
941 |
self isHorizontal ifTrue:[ |
|
942 |
eachView origin:(pos @ 0.0) corner:(eachCorner @ 1.0) |
|
943 |
] ifFalse:[ |
|
944 |
eachView origin:(0.0 @ pos) corner:(1.0 @ eachCorner) |
|
945 |
]. |
|
946 |
pos := eachCorner |
|
947 |
] |
|
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
948 |
! ! |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
949 |
|
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
950 |
!VariablePanel methodsFor:'accessing-look'! |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
951 |
|
295 | 952 |
barHeight |
953 |
"return the height of the separating bar" |
|
954 |
||
955 |
^ barHeight |
|
956 |
! |
|
957 |
||
958 |
barHeight:nPixel |
|
959 |
"set the height of the separating bar" |
|
960 |
||
2108
b9322a905330
resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents:
2084
diff
changeset
|
961 |
|bH| |
b9322a905330
resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents:
2084
diff
changeset
|
962 |
|
b9322a905330
resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents:
2084
diff
changeset
|
963 |
bH := nPixel. |
295 | 964 |
|
1207 | 965 |
"make certain bar is visible and catchable" |
2108
b9322a905330
resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents:
2084
diff
changeset
|
966 |
(bH < 4) ifTrue:[ |
b9322a905330
resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents:
2084
diff
changeset
|
967 |
bH := 4 |
295 | 968 |
]. |
969 |
||
876 | 970 |
"make it even, so spacing is equally spreadable among subviews" |
2108
b9322a905330
resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents:
2084
diff
changeset
|
971 |
bH odd ifTrue:[ |
b9322a905330
resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents:
2084
diff
changeset
|
972 |
bH := bH + 1 |
b9322a905330
resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents:
2084
diff
changeset
|
973 |
]. |
b9322a905330
resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents:
2084
diff
changeset
|
974 |
self setBarHeight:bH |
876 | 975 |
|
2108
b9322a905330
resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents:
2084
diff
changeset
|
976 |
"Modified: / 28.4.1997 / 14:30:33 / dq" |
b9322a905330
resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents:
2084
diff
changeset
|
977 |
"Modified: / 30.1.2000 / 22:31:32 / cg" |
876 | 978 |
! |
979 |
||
2623 | 980 |
barLevel:level |
981 |
"set the 3D level of the separating bar" |
|
982 |
||
983 |
barLevel ~~ level ifTrue:[ |
|
984 |
barLevel := level. |
|
985 |
self redrawIfShown. |
|
986 |
] |
|
987 |
! |
|
988 |
||
876 | 989 |
handleImage:aBitmapOrImage |
990 |
"define the handles image" |
|
991 |
||
992 |
shadowForm := aBitmapOrImage. |
|
993 |
lightForm := nil. |
|
994 |
self computeBarHeight. |
|
995 |
||
996 |
"Created: 7.11.1996 / 20:21:10 / cg" |
|
997 |
"Modified: 7.11.1996 / 20:27:22 / cg" |
|
295 | 998 |
! |
999 |
||
871 | 1000 |
handleLabels:aCollectionOfLabels |
1981
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1001 |
"define special handle labels - typically a collection of |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1002 |
bitmap images. Notice, that the first handle is not |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1003 |
drawn, that is, the first element if the argument is useless." |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1004 |
|
871 | 1005 |
orientation == #horizontal ifTrue:[ |
1006 |
self error:'not allowed for horizontal panels' |
|
1007 |
]. |
|
1008 |
||
1009 |
handleLabels := aCollectionOfLabels. |
|
1010 |
self computeBarHeight. |
|
1011 |
self resizeSubviews. |
|
1012 |
||
1981
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1013 |
" |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1014 |
|top panel v1 v2| |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1015 |
|
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1016 |
top := StandardSystemView new. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1017 |
panel := VariableVerticalPanel origin:0.0@0.0 corner:1.0@1.0 in:top. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1018 |
panel add:(EditTextView origin:0.0@0.0 corner:1.0@0.5). |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1019 |
panel add:(EditTextView origin:0.0@0.5 corner:1.0@1.0). |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1020 |
panel handleStyle:nil. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1021 |
panel handleLabels:#('foo' 'bar'). |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1022 |
top open |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1023 |
" |
871 | 1024 |
! |
1025 |
||
295 | 1026 |
handleLevel:aNumber |
1027 |
"define the 3D level of the handle (only with some styles). |
|
1028 |
Normally, this is defined via styleSheet files, but this entry allows |
|
1029 |
individual views to be manipulated." |
|
1030 |
||
2244 | 1031 |
handleLevel ~~ aNumber ifTrue:[ |
1032 |
handleLevel := aNumber. |
|
2623 | 1033 |
self redrawIfShown. |
2242
1aea02d32c96
snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
1034 |
] |
295 | 1035 |
! |
1036 |
||
1037 |
handlePosition |
|
1038 |
"return the position of the handle" |
|
1039 |
||
1040 |
^ handlePosition |
|
1041 |
! |
|
1042 |
||
1043 |
handlePosition:aSymbol |
|
1044 |
"define the position of the handle; the argument aSymbol |
|
2228
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1045 |
may be one of #left, #right or #center. |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1046 |
If never set by the program, the position is controlled by the styleSheet." |
295 | 1047 |
|
2244 | 1048 |
handlePosition ~~ aSymbol ifTrue:[ |
1049 |
handlePosition := aSymbol ? DefaultHandlePosition. |
|
2623 | 1050 |
self redrawIfShown. |
2242
1aea02d32c96
snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
1051 |
] |
295 | 1052 |
! |
1053 |
||
876 | 1054 |
handleShadowImage:shadowImage lightImage:lightImage |
1055 |
"define the handles image; both shadow and light parts" |
|
1056 |
||
1057 |
shadowForm := shadowImage. |
|
1058 |
lightForm := lightImage. |
|
1059 |
self computeBarHeight. |
|
1060 |
||
1061 |
"Created: 7.11.1996 / 20:21:51 / cg" |
|
1062 |
"Modified: 7.11.1996 / 20:27:26 / cg" |
|
1063 |
! |
|
1064 |
||
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
1065 |
handleStyle:styleSymbol |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
1066 |
"define the style of the handle; |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
1067 |
styleSymbol may be #motif to draw a little knob or |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
1068 |
anything else to draw scrollBars handleForm. |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
1069 |
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
|
1070 |
individual views to be manipulated." |
295 | 1071 |
|
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
1072 |
(styleSymbol ~~ handleStyle) ifTrue:[ |
722
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1073 |
handleStyle := styleSymbol. |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1074 |
handleStyle == #next ifTrue:[ |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1075 |
shadowForm := self class shadowFormOn:device. |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1076 |
lightForm := self class lightFormOn:device. |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1077 |
] ifFalse:[ |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1078 |
shadowForm := lightForm := nil |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1079 |
]. |
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
1080 |
|
722
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1081 |
shadowForm notNil ifTrue:[ |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1082 |
(self is3D and:[handleStyle ~~ #motif]) ifTrue:[ |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1083 |
self barHeight:(shadowForm height + 2). |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1084 |
barWidth := shadowForm width |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1085 |
] |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1086 |
]. |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1087 |
shown ifTrue:[ |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1088 |
self resizeSubviews. |
2623 | 1089 |
self redrawIfShown. |
722
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1090 |
] |
295 | 1091 |
] |
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
1092 |
|
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
1093 |
"Created: 24.2.1996 / 19:04:07 / cg" |
722
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1094 |
"Modified: 29.5.1996 / 16:22:24 / cg" |
295 | 1095 |
! |
1096 |
||
1948 | 1097 |
setBarHeight:nPixel |
4187 | 1098 |
"check whether snap matches to extent of bar otherwise disable snap" |
1099 |
||
2179 | 1100 |
snapAdornment notNil ifTrue:[ |
4187 | 1101 |
barHeight := nPixel max:(snapAdornment height ? 0) |
2179 | 1102 |
] ifFalse:[ |
1103 |
barHeight := nPixel max:0 |
|
1104 |
]. |
|
1948 | 1105 |
|
2108
b9322a905330
resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents:
2084
diff
changeset
|
1106 |
realized ifTrue:[ |
2179 | 1107 |
self resizeSubviews |
2108
b9322a905330
resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents:
2084
diff
changeset
|
1108 |
] |
1948 | 1109 |
|
4187 | 1110 |
"Modified: / 31-10-2010 / 13:00:06 / cg" |
1948 | 1111 |
! |
1112 |
||
2114 | 1113 |
showHandle |
4206
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1114 |
"handle-drawing enabled/disable; a Boolean" |
2114 | 1115 |
|
1116 |
^ showHandle |
|
4206
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1117 |
|
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1118 |
"Modified: / 19-12-2010 / 09:28:31 / cg" |
2114 | 1119 |
! |
1120 |
||
1121 |
showHandle:aBoolean |
|
1122 |
"enabled/disable the handle-drawing" |
|
1123 |
||
2244 | 1124 |
showHandle ~~ aBoolean ifTrue:[ |
1125 |
showHandle := aBoolean ? DefaultShowHandle. |
|
4206
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1126 |
self invalidate. "/ redrawIfShown |
2242
1aea02d32c96
snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
1127 |
] |
4206
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1128 |
|
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1129 |
"Modified: / 19-12-2010 / 09:30:49 / cg" |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1130 |
! |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1131 |
|
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1132 |
showHandleWhenEntered |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1133 |
"return aBoolean" |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1134 |
|
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1135 |
^ showHandleWhenEntered |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1136 |
|
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1137 |
"Created: / 19-12-2010 / 09:27:40 / cg" |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1138 |
! |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1139 |
|
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1140 |
showHandleWhenEntered:aBoolean |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1141 |
"enabled/disable the handle-drawing" |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1142 |
|
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1143 |
showHandleWhenEntered ~~ aBoolean ifTrue:[ |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1144 |
showHandleWhenEntered := aBoolean ? DefaultShowHandleWhenEntered. |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1145 |
self invalidate. "/ redrawIfShown |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1146 |
] |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1147 |
|
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1148 |
"Created: / 19-12-2010 / 09:28:04 / cg" |
2114 | 1149 |
! |
1150 |
||
2228
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1151 |
snapHandlePosition |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1152 |
"return the position of the snap-handle" |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1153 |
|
2242
1aea02d32c96
snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
1154 |
^ self handlePosition. "/ ^ snapHandlePosition |
2228
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1155 |
! |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1156 |
|
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1157 |
snapHandlePosition:aSymbol |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1158 |
"define the position of the snap-handle; the argument aSymbol |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1159 |
may be one of #left, #right or #center. |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1160 |
If never set by the program, the position is controlled by the styleSheet." |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1161 |
|
2242
1aea02d32c96
snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
1162 |
self handlePosition:aSymbol. |
1aea02d32c96
snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
1163 |
|
1aea02d32c96
snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
1164 |
"/ snapHandlePosition := aSymbol. |
1aea02d32c96
snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
1165 |
"/ realized ifTrue:[ |
1aea02d32c96
snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
1166 |
"/ self invalidate |
1aea02d32c96
snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
1167 |
"/ ] |
2228
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1168 |
! |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1169 |
|
2179 | 1170 |
snapMode |
1171 |
"allowed modes are: |
|
1172 |
nil no snap |
|
1173 |
||
1174 |
#max on press the view is increased to bottom(vertical) or right(horizontal) |
|
1175 |
#min on press the view is decreased to top (vertical) or left (horizontal) |
|
1176 |
#maxMin on press the view is increased or decreased dependent on its current extent |
|
1177 |
#minMax on press the view is increased or decreased dependent on its current extent |
|
1178 |
" |
|
1179 |
snapAdornment notNil ifTrue:[ |
|
4187 | 1180 |
^ snapAdornment mode |
2179 | 1181 |
]. |
1182 |
^ nil |
|
1183 |
||
4187 | 1184 |
"Modified: / 31-10-2010 / 13:00:16 / cg" |
2179 | 1185 |
! |
1186 |
||
1187 |
snapMode:aMode |
|
1188 |
"allowed modes are: |
|
1189 |
nil no snap |
|
1190 |
||
1191 |
#max on press the view is increased to bottom(vertical) or right(horizontal) |
|
1192 |
#min on press the view is decreased to top (vertical) or left (horizontal) |
|
1193 |
#maxMin on press the view is increased or decreased dependent on its current extent |
|
1194 |
#minMax on press the view is increased or decreased dependent on its current extent |
|
1195 |
" |
|
1196 |
|oldHeight oldMode| |
|
1197 |
||
1198 |
aMode notNil ifTrue:[ |
|
2236 | 1199 |
( #( max min maxMin minMax both) includes:aMode) ifFalse:[ |
2179 | 1200 |
^ self error:('unknown snapMode: ', aMode printString). |
1201 |
] |
|
1202 |
]. |
|
1203 |
(oldMode := self snapMode) == aMode ifTrue:[^ self]. |
|
1204 |
||
1205 |
(snapAdornment notNil and:[aMode notNil]) ifTrue:[ |
|
1206 |
"must only redraw" |
|
4187 | 1207 |
snapAdornment mode:aMode |
2179 | 1208 |
] ifFalse:[ |
1209 |
"must recompute barHeight and redraw" |
|
1210 |
||
1211 |
aMode isNil ifTrue:[ |
|
1212 |
snapAdornment := nil |
|
1213 |
] ifFalse:[ |
|
1214 |
self initSnapAdornment. |
|
4187 | 1215 |
snapAdornment mode:aMode. |
2179 | 1216 |
]. |
1217 |
oldHeight := barHeight. |
|
1218 |
||
1219 |
self computeBarHeight. |
|
1220 |
||
1221 |
oldHeight ~~ barHeight ifTrue:[ |
|
1222 |
"must recompute subViews" |
|
1223 |
self setupSubviews. |
|
1224 |
self resizeSubviews. |
|
1225 |
] |
|
1226 |
]. |
|
4187 | 1227 |
self redrawIfShown. |
1228 |
||
1229 |
"Modified: / 31-10-2010 / 13:00:39 / cg" |
|
2179 | 1230 |
! |
1231 |
||
295 | 1232 |
style:styleSymbol |
1233 |
"define the style of the handle; |
|
1234 |
styleSymbol may be #motif to draw a little knob or |
|
1235 |
anything else to draw scrollBars handleForm. |
|
1236 |
Normally, this is defined via styleSheet files, but this entry allows |
|
1237 |
individual views to be manipulated." |
|
1238 |
||
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
1239 |
self handleStyle:styleSymbol |
295 | 1240 |
|
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
1241 |
"Modified: 24.2.1996 / 19:04:19 / cg" |
295 | 1242 |
! ! |
1243 |
||
2288 | 1244 |
!VariablePanel methodsFor:'adding & removing components'! |
1245 |
||
1246 |
addSubView:aView |
|
1247 |
"a view is added; adjust other subviews sizes" |
|
1248 |
||
1249 |
super addSubView:aView. |
|
1250 |
||
1251 |
realized ifTrue:[ |
|
2482 | 1252 |
self setupSubviews. |
2288 | 1253 |
self resizeSubviews. |
2483 | 1254 |
aView beVisible. |
2288 | 1255 |
] |
1256 |
||
1257 |
"Created: 17.1.1996 / 22:41:00 / cg" |
|
1258 |
"Modified: 24.2.1996 / 19:05:05 / cg" |
|
1259 |
! |
|
1260 |
||
1261 |
removeSubView:aView |
|
1262 |
"a view is removed; adjust other subviews sizes" |
|
1263 |
||
2483 | 1264 |
aView beInvisible. |
2288 | 1265 |
super removeSubView:aView. |
2483 | 1266 |
shown ifTrue:[ |
1267 |
realized |
|
1268 |
"/ (superView isNil or:[superView shown]) |
|
1269 |
ifTrue:[ |
|
2288 | 1270 |
self setupSubviews. |
1271 |
self resizeSubviews. |
|
1272 |
] |
|
1273 |
] |
|
1274 |
! ! |
|
1275 |
||
295 | 1276 |
!VariablePanel methodsFor:'drawing'! |
1277 |
||
871 | 1278 |
drawHandle:hIndex atX:hx y:hy |
295 | 1279 |
"draw a single handle at hx/hy" |
1280 |
||
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1281 |
|h w x y m xm ym lbl maxKnob |
1096 | 1282 |
mar "{ Class: SmallInteger }" |
1283 |
barWidthInt "{ Class: SmallInteger }" |
|
1284 |
barHeightInt "{ Class: SmallInteger }" | |
|
295 | 1285 |
|
1981
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1286 |
((handleStyle isNil or:[handleStyle == #none]) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1287 |
and:[handleLabels isNil]) ifTrue:[^ self]. |
396
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
1288 |
|
1096 | 1289 |
mar := margin. |
1290 |
barHeightInt := barHeight. |
|
1291 |
barWidthInt := barWidth. |
|
871 | 1292 |
|
295 | 1293 |
shadowForm notNil ifTrue:[ |
871 | 1294 |
h := shadowForm height. |
1295 |
w := shadowForm width . |
|
1096 | 1296 |
maxKnob := h min:barHeightInt. |
295 | 1297 |
] ifFalse:[ |
1096 | 1298 |
maxKnob := knobHeight min: barHeightInt. |
876 | 1299 |
maxKnob := maxKnob max:4. |
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1300 |
handleStyle == #full ifTrue:[ |
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1301 |
w := h := maxKnob |
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1302 |
] ifFalse:[ |
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1303 |
w := h := maxKnob - 4. |
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1304 |
] |
295 | 1305 |
]. |
1306 |
||
1307 |
self paint:viewBackground. |
|
1131 | 1308 |
self lineStyle:#solid. |
1309 |
||
295 | 1310 |
orientation == #vertical ifTrue:[ |
1096 | 1311 |
self fillRectangleX:mar y:hy |
1312 |
width:(width - mar - mar) |
|
1313 |
height:barHeightInt. |
|
2623 | 1314 |
(handleStyle notNil |
1315 |
and:[handleStyle ~~ #none]) ifTrue:[ |
|
1981
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1316 |
(handleStyle ~~ #normal |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1317 |
and:[handleStyle ~~ #mswindows]) ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1318 |
m := (maxKnob - h) // 2. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1319 |
|
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1320 |
shadowForm isNil ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1321 |
|
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1322 |
y := hy + (barHeightInt // 2). "/ center of the bar |
871 | 1323 |
|
1981
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1324 |
separatingLine ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1325 |
self paint:shadowColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1326 |
self displayLineFromX:mar y:y toX:(width - mar) y:y. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1327 |
y := y + 1. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1328 |
self paint:lightColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1329 |
self displayLineFromX:mar y:y toX:(width - mar) y:y. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1330 |
self paint:viewBackground. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1331 |
]. |
876 | 1332 |
|
1981
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1333 |
self fillRectangleX:(hx - barWidthInt) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1334 |
y:hy |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1335 |
width:(barWidthInt + barWidthInt) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1336 |
height:h. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1337 |
|
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1338 |
handleStyle == #line ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1339 |
self paint:handleColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1340 |
self displayLineFromX:hx - barWidthInt y:y toX:hx + barWidthInt y:y |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1341 |
] ifFalse:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1342 |
y := hy. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1343 |
handleStyle == #st80 ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1344 |
y := y - 1 |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1345 |
]. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1346 |
ym := y + m. |
295 | 1347 |
|
1981
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1348 |
handleStyle == #full ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1349 |
handleLevel ~~ 0 ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1350 |
self |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1351 |
drawEdgesForX:0 "/ -(handleLevel abs) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1352 |
y:ym "/-1 |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1353 |
width:width "/+(handleLevel+handleLevel)abs |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1354 |
height:h-2 |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1355 |
level:handleLevel |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1356 |
shadow:shadowColor |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1357 |
light:lightColor |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1358 |
halfShadow:nil |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1359 |
halfLight:nil |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1360 |
style:nil |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1361 |
] |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1362 |
] ifFalse:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1363 |
handleLevel ~~ 0 ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1364 |
self drawEdgesForX:(hx - barWidthInt) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1365 |
y:ym |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1366 |
width:(barWidthInt + barWidthInt) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1367 |
height:h |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1368 |
level:handleLevel. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1369 |
]. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1370 |
|
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1371 |
handleStyle == #iris ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1372 |
self paint:handleColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1373 |
self fillDeviceRectangleX:(hx - barWidthInt + 2) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1374 |
y:(ym + 2) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1375 |
width:(barWidthInt + barWidthInt - 4) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1376 |
height:h - 4 |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1377 |
] |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1378 |
] |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1379 |
]. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1380 |
] ifFalse:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1381 |
y := hy. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1382 |
(shadowForm notNil or:[lightForm notNil]) ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1383 |
self drawHandleFormAtX:hx y:(y + m) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1384 |
] |
871 | 1385 |
]. |
1096 | 1386 |
|
1981
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1387 |
handleStyle == #st80 ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1388 |
y := hy - 1. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1389 |
self paint:lightColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1390 |
self displayLineFromX:mar y:y toX:(width - mar - mar - 1) y:y. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1391 |
self displayLineFromX:0 y:hy toX:0 y:(hy + knobHeight - 1). |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1392 |
y := hy + knobHeight - 2. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1393 |
self paint:shadowColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1394 |
self displayLineFromX:mar y:y toX:(width - mar) y:y. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1395 |
"uncomment the -1 if you dont like the notch at the right end" |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1396 |
" VVV" |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1397 |
self displayLineFromX:width-1 y:hy" "-1" " toX:width-1 y:(hy + knobHeight - 1 - 1). |
871 | 1398 |
]. |
1399 |
] ifFalse:[ |
|
1981
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1400 |
y := hy + barHeightInt - 1. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1401 |
self paint:handleColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1402 |
separatingLine ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1403 |
self displayLineFromX:0 y:hy+1 toX:width y:hy+1. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1404 |
self displayLineFromX:0 y:y toX:width y:y. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1405 |
]. |
2623 | 1406 |
self fillRectangleX:hx y:hy width:barWidthInt height:barHeightInt. |
871 | 1407 |
]. |
1408 |
]. |
|
1409 |
lbl := self handleLabelAt:hIndex. |
|
1410 |
lbl notNil ifTrue:[ |
|
1411 |
hIndex ~~ 1 ifTrue:[ |
|
1412 |
self paint:Color black. |
|
2734
ba7f56186e88
correct use of ascentOn: for display
Claus Gittinger <cg@exept.de>
parents:
2650
diff
changeset
|
1413 |
lbl displayOn:self x:mar y:hy + (lbl ascentOn:self) |
ba7f56186e88
correct use of ascentOn: for display
Claus Gittinger <cg@exept.de>
parents:
2650
diff
changeset
|
1414 |
"/ lbl isImageOrForm ifTrue:[ |
ba7f56186e88
correct use of ascentOn: for display
Claus Gittinger <cg@exept.de>
parents:
2650
diff
changeset
|
1415 |
"/ lbl displayOn:self x:mar y:hy |
ba7f56186e88
correct use of ascentOn: for display
Claus Gittinger <cg@exept.de>
parents:
2650
diff
changeset
|
1416 |
"/ ] ifFalse:[ |
ba7f56186e88
correct use of ascentOn: for display
Claus Gittinger <cg@exept.de>
parents:
2650
diff
changeset
|
1417 |
"/ lbl displayOn:self x:mar y:hy + font ascent + 1 |
ba7f56186e88
correct use of ascentOn: for display
Claus Gittinger <cg@exept.de>
parents:
2650
diff
changeset
|
1418 |
"/ ] |
871 | 1419 |
] |
1420 |
]. |
|
1421 |
||
295 | 1422 |
] ifFalse:[ |
1096 | 1423 |
self fillRectangleX:hx y:mar |
1424 |
width:barHeightInt |
|
1425 |
height:(height - mar - mar). |
|
876 | 1426 |
|
2623 | 1427 |
(handleStyle notNil |
1428 |
and:[handleStyle ~~ #none]) ifTrue:[ |
|
1981
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1429 |
(handleStyle ~~ #normal |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1430 |
and:[handleStyle ~~ #mswindows]) ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1431 |
m := (barHeightInt - w) // 2. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1432 |
m := (maxKnob - w) // 2. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1433 |
shadowForm isNil ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1434 |
x := hx + (barHeightInt // 2). |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1435 |
separatingLine ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1436 |
self paint:shadowColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1437 |
self displayLineFromX:x y:mar toX:x y:(height - mar). |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1438 |
x := x + 1. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1439 |
self paint:lightColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1440 |
self displayLineFromX:x y:mar toX:x y:(height - mar). |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1441 |
self paint:viewBackground. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1442 |
]. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1443 |
self fillRectangleX:hx y:(hy - barWidthInt) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1444 |
width:w |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1445 |
height:(barWidthInt + barWidthInt). |
295 | 1446 |
|
1981
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1447 |
handleStyle == #line ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1448 |
self paint:handleColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1449 |
self displayLineFromX:x y:hy - barWidthInt toX:x y:hy + barWidthInt. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1450 |
] ifFalse:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1451 |
x := hx. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1452 |
handleStyle == #st80 ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1453 |
x := x - 1. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1454 |
]. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1455 |
xm := x + m. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1456 |
handleStyle == #full ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1457 |
handleLevel ~~ 0 ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1458 |
self |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1459 |
drawEdgesForX:xm "/-1 |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1460 |
y:0 "/ -handleLevel |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1461 |
width:w-2 |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1462 |
height:height "/ +handleLevel+handleLevel |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1463 |
level:handleLevel |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1464 |
shadow:shadowColor |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1465 |
light:lightColor |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1466 |
halfShadow:nil |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1467 |
halfLight:nil |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1468 |
style:nil |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1469 |
] |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1470 |
] ifFalse:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1471 |
handleLevel ~~ 0 ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1472 |
self drawEdgesForX:xm |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1473 |
y:(hy - barWidthInt) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1474 |
width:w |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1475 |
height:(barWidthInt + barWidthInt) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1476 |
level:handleLevel. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1477 |
]. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1478 |
handleStyle == #iris ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1479 |
self paint:handleColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1480 |
self fillDeviceRectangleX:(xm + 2) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1481 |
y:(hy - barWidthInt + 2) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1482 |
width:w - 4 |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1483 |
height:(barWidthInt + barWidthInt - 4) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1484 |
]. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1485 |
]. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1486 |
] |
871 | 1487 |
] ifFalse:[ |
1488 |
x := hx. |
|
1981
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1489 |
(shadowForm notNil or:[lightForm notNil]) ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1490 |
self drawHandleFormAtX:(x + m) y:hy |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1491 |
] |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1492 |
]. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1493 |
handleStyle == #st80 ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1494 |
x := hx - 1. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1495 |
self paint:lightColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1496 |
self displayLineFromX:x y:mar toX:x y:(height - mar). |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1497 |
self displayLineFromX:hx y:0 toX:(hx + barHeightInt - 1) y:0. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1498 |
x := hx + barHeightInt - 2. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1499 |
self paint:shadowColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1500 |
self displayLineFromX:x y:mar toX:x y:(height - mar). |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1501 |
"uncomment the -1 if you dont like the notch at the bottom end" |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1502 |
" VVV" |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1503 |
self displayLineFromX:hx" "-1" " y:height-1 toX:(hx + barHeightInt - 1) y:height-1. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1504 |
]. |
871 | 1505 |
] ifFalse:[ |
1981
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1506 |
x := hx + barHeightInt - 1. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1507 |
self paint:handleColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1508 |
separatingLine ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1509 |
self displayLineFromX:hx+1 y:0 toX:hx+1 y:height. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1510 |
self displayLineFromX:x y:0 toX:x y:height. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1511 |
]. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1512 |
self fillRectangleX:hx y:hy width:barHeightInt height:barWidthInt |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1513 |
] |
871 | 1514 |
] |
295 | 1515 |
]. |
1516 |
||
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1517 |
"Modified: / 29.7.1998 / 22:48:33 / cg" |
295 | 1518 |
! |
1519 |
||
1520 |
drawHandleFormAtX:hx y:hy |
|
1521 |
"draw a handles bitmap at hx/hy" |
|
1522 |
||
876 | 1523 |
shadowForm notNil ifTrue:[ |
1524 |
self paint:shadowColor. |
|
1525 |
self displayForm:shadowForm x:hx y:hy. |
|
1526 |
]. |
|
1527 |
lightForm notNil ifTrue:[ |
|
1528 |
self paint:lightColor. |
|
1529 |
self displayForm:lightForm x:hx y:hy. |
|
1530 |
]. |
|
295 | 1531 |
self paint:viewBackground |
876 | 1532 |
|
1533 |
"Modified: 7.11.1996 / 20:25:33 / cg" |
|
295 | 1534 |
! |
1535 |
||
2179 | 1536 |
drawSnapAt:anIndex |
4187 | 1537 |
"draw the snap for a handle at an index" |
1538 |
||
1539 |
|snapLayout icon level offLevel paint canChangeExtent |
|
2179 | 1540 |
left "{ Class:SmallInteger }" |
1541 |
top "{ Class:SmallInteger }" |
|
1542 |
width "{ Class:SmallInteger }" |
|
1543 |
height "{ Class:SmallInteger }" |
|
4187 | 1544 |
snapMode leftEdge wEdge topEdge hEdge part wPart hPart| |
1545 |
||
1546 |
(snapLayout := self snapLayoutAt:anIndex) isNil ifTrue:[ |
|
2179 | 1547 |
"snap disabled" |
1548 |
^ self |
|
1549 |
]. |
|
1550 |
||
4187 | 1551 |
left := snapLayout left. |
1552 |
top := snapLayout top. |
|
1553 |
width := snapLayout width. |
|
1554 |
height := snapLayout height. |
|
2236 | 1555 |
snapMode := self snapMode. |
2179 | 1556 |
|
4187 | 1557 |
offLevel := level := (snapAdornment level ? 0). |
2238 | 1558 |
|
2179 | 1559 |
canChangeExtent := self canChangeExtentOfViewAt:anIndex. |
1560 |
canChangeExtent ifTrue:[ |
|
1561 |
(controller isSnapEntered:anIndex) ifTrue:[ |
|
1562 |
controller isSnapPressed ifTrue:[ |
|
4187 | 1563 |
level := snapAdornment selectedLevel ? 0. |
1564 |
paint := snapAdornment selectedBgColor. |
|
2179 | 1565 |
] ifFalse:[ |
4187 | 1566 |
level := snapAdornment enterLevel ? 0. |
1567 |
paint := snapAdornment enterBgColor. |
|
2238 | 1568 |
]. |
2179 | 1569 |
] |
1570 |
]. |
|
4187 | 1571 |
paint isNil ifTrue:[ |
1572 |
paint := viewBackground. |
|
2179 | 1573 |
]. |
4187 | 1574 |
|
2179 | 1575 |
self paint:paint. |
1576 |
||
4187 | 1577 |
"/ level == 0 ifTrue:[ |
1578 |
"/ ]. |
|
2238 | 1579 |
|
1580 |
self fillRectangleX:left+1 y:top+1 width:width-2 height:height-2. |
|
2179 | 1581 |
|
1582 |
level ~~ 0 ifTrue:[ |
|
2236 | 1583 |
leftEdge := left + 1. |
2240 | 1584 |
wEdge := wPart := width - 2. |
2236 | 1585 |
topEdge := top + 1. |
2240 | 1586 |
hEdge := hPart := height - 2. |
2236 | 1587 |
|
2238 | 1588 |
orientation == #vertical ifTrue:[ |
1589 |
wPart := width // 3. |
|
1590 |
] ifFalse:[ |
|
1591 |
hPart := height // 3. |
|
1592 |
]. |
|
1593 |
||
2236 | 1594 |
level < 0 ifTrue:[ |
1595 |
part := (self subViews at:anIndex) objectAttributeAt:#snapPart. |
|
1596 |
part == #left ifTrue:[ |
|
2238 | 1597 |
self drawEdgesForX:leftEdge y:topEdge width:wEdge height:hEdge level:offLevel. |
2243 | 1598 |
wPart := wPart + 1. |
2236 | 1599 |
] ifFalse:[ |
1600 |
part == #middle ifTrue:[ |
|
2238 | 1601 |
self drawEdgesForX:leftEdge y:topEdge width:wEdge height:hEdge level:offLevel. |
2240 | 1602 |
orientation == #vertical ifTrue:[ |
1603 |
leftEdge := leftEdge + wPart. |
|
1604 |
] ifFalse:[ |
|
1605 |
topEdge := topEdge + hPart. |
|
1606 |
] |
|
2236 | 1607 |
] ifFalse:[ |
1608 |
part == #right ifTrue:[ |
|
2238 | 1609 |
self drawEdgesForX:leftEdge y:topEdge width:wEdge height:hEdge level:offLevel. |
2240 | 1610 |
orientation == #vertical ifTrue:[ |
2243 | 1611 |
leftEdge := leftEdge + (width - wPart - 1). |
2240 | 1612 |
] ifFalse:[ |
2243 | 1613 |
topEdge := topEdge + (height - hPart - 1). |
1614 |
]. |
|
1615 |
wPart := wPart - 1. |
|
2236 | 1616 |
] |
1617 |
] |
|
1618 |
]. |
|
2240 | 1619 |
wEdge := wPart. |
1620 |
hEdge := hPart. |
|
2236 | 1621 |
]. |
1622 |
self drawEdgesForX:leftEdge y:topEdge width:wEdge height:hEdge level:level. |
|
2179 | 1623 |
]. |
1624 |
||
1625 |
canChangeExtent ifFalse:[^ self]. |
|
1626 |
||
2236 | 1627 |
snapMode == #both ifTrue:[ |
4187 | 1628 |
icon := (orientation == #vertical) |
1629 |
ifTrue:[snapAdornment iconUpDown] |
|
1630 |
ifFalse:[snapAdornment iconLeftRight] |
|
2179 | 1631 |
] ifFalse:[ |
2236 | 1632 |
(self snapAtIndexWillGrow:anIndex) ifTrue:[ |
4187 | 1633 |
icon := (orientation == #vertical) |
1634 |
ifTrue:[snapAdornment iconDown] |
|
1635 |
ifFalse:[snapAdornment iconRight] |
|
2236 | 1636 |
] ifFalse:[ |
4187 | 1637 |
icon := (orientation == #vertical) |
1638 |
ifTrue:[snapAdornment iconUp] |
|
1639 |
ifFalse:[snapAdornment iconLeft] |
|
2236 | 1640 |
]. |
2179 | 1641 |
]. |
4187 | 1642 |
|
1643 |
icon displayOn:self x:(left + ((width - icon width) // 2)) |
|
1644 |
y:(top + ((height - icon height) // 2)). |
|
1645 |
||
1646 |
"Modified: / 31-10-2010 / 12:58:27 / cg" |
|
2179 | 1647 |
! |
1648 |
||
295 | 1649 |
invertHandleBarAtX:hx y:hy |
1894 | 1650 |
|doLine oldStyle| |
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1651 |
|
1894 | 1652 |
doLine := (trackLine == #solidLine |
1653 |
or:[trackLine == #dashedLine |
|
1654 |
or:[trackLine == #dottedLine]]). |
|
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1655 |
|
1131 | 1656 |
trackLine == #dashedLine ifTrue:[ |
1894 | 1657 |
oldStyle := lineStyle. |
1131 | 1658 |
self lineStyle:#dashed. |
1894 | 1659 |
] ifFalse:[ |
1660 |
trackLine == #dottedLine ifTrue:[ |
|
1661 |
oldStyle := lineStyle. |
|
1662 |
self lineStyle:#dotted. |
|
1663 |
] |
|
1131 | 1664 |
]. |
1665 |
||
1220 | 1666 |
self clippedByChildren:false. |
1131 | 1667 |
|
295 | 1668 |
self xoring:[ |
1129
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1669 |
|yL xL halfHeight| |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1670 |
|
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1671 |
halfHeight := (barHeight // 2) - 1. |
295 | 1672 |
|
1129
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1673 |
orientation == #vertical ifTrue:[ |
1894 | 1674 |
yL := hy + halfHeight. |
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1675 |
doLine ifTrue:[ |
1129
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1676 |
self displayLineFromX:0 y:yL toX:width y:yL. |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1677 |
] ifFalse:[ |
1130 | 1678 |
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
|
1679 |
] |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1680 |
] ifFalse:[ |
1894 | 1681 |
xL := hx + halfHeight. |
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1682 |
doLine ifTrue:[ |
1129
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1683 |
self displayLineFromX:xL y:0 toX:xL y:height. |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1684 |
] ifFalse:[ |
1130 | 1685 |
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
|
1686 |
] |
1130 | 1687 |
]. |
295 | 1688 |
]. |
1220 | 1689 |
self clippedByChildren:true. |
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1690 |
|
1894 | 1691 |
oldStyle notNil ifTrue:[ |
1692 |
self lineStyle:oldStyle. |
|
1131 | 1693 |
]. |
1129
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1694 |
|
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1695 |
"Modified: / 28.4.1997 / 14:56:26 / dq" |
1894 | 1696 |
"Modified: / 3.5.1999 / 18:49:04 / cg" |
295 | 1697 |
! |
1698 |
||
1699 |
lockRedraw |
|
1700 |
redrawLocked := true |
|
1701 |
! |
|
1702 |
||
1703 |
redrawHandlesFrom:start to:stop |
|
4187 | 1704 |
"redraw some handles and snaps" |
1705 |
||
2179 | 1706 |
subViews size ~~ 0 ifTrue:[ |
2623 | 1707 |
self handleOriginsWithIndexFrom:start to:stop do:[:hPoint :hIndex | |
1708 |
|hx hy| |
|
1709 |
||
1710 |
hx := hPoint x. |
|
1711 |
hy := hPoint y. |
|
1712 |
barLevel notNil ifTrue:[ |
|
1713 |
self drawEdgesForX:0 y:hy width:width height:barHeight level:barLevel. |
|
1714 |
]. |
|
4187 | 1715 |
|
1716 |
"/ do not draw handle, if there is a snapper ... |
|
1717 |
self hasSnapHandle ifTrue:[ |
|
1718 |
self drawSnapAt:hIndex-1 |
|
1719 |
] ifFalse:[ |
|
1720 |
showHandle ifTrue:[ |
|
1721 |
self drawHandle:hIndex atX:hx y:hy. |
|
1722 |
]. |
|
2623 | 1723 |
]. |
2179 | 1724 |
]. |
1725 |
]. |
|
4187 | 1726 |
|
1727 |
"Modified: / 31-10-2010 / 12:43:33 / cg" |
|
295 | 1728 |
! |
1729 |
||
1730 |
unlockRedraw |
|
1731 |
redrawLocked := false |
|
1732 |
! ! |
|
1733 |
||
1159 | 1734 |
!VariablePanel methodsFor:'enumerating subviews'! |
1735 |
||
1736 |
changeSequenceOrderFor:aSubView to:anIndex |
|
3884 | 1737 |
"change a subview's position in the subviews collection." |
1738 |
||
1159 | 1739 |
|success| |
1740 |
||
1741 |
success := super changeSequenceOrderFor:aSubView to:anIndex. |
|
1742 |
success ifTrue:[ |
|
1743 |
self setupSubviews. |
|
1744 |
self resizeSubviews. |
|
1745 |
]. |
|
1746 |
^ success |
|
1747 |
! ! |
|
1748 |
||
295 | 1749 |
!VariablePanel methodsFor:'event handling'! |
1750 |
||
4206
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1751 |
pointerEnter:buttonState x:x y:y |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1752 |
showHandleWhenEntered == true ifTrue:[ |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1753 |
self showHandle:true |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1754 |
]. |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1755 |
super pointerEnter:buttonState x:x y:y. |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1756 |
|
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1757 |
"Created: / 19-12-2010 / 09:29:51 / cg" |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1758 |
! |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1759 |
|
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1760 |
pointerLeave:buttonState |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1761 |
showHandleWhenEntered == true ifTrue:[ |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1762 |
self showHandle:false |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1763 |
]. |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1764 |
super pointerLeave:buttonState. |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1765 |
|
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1766 |
"Created: / 19-12-2010 / 09:30:20 / cg" |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1767 |
! |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1768 |
|
295 | 1769 |
sizeChanged:how |
1770 |
"my size has changed; resize my subviews" |
|
1771 |
||
2123
33fda8594eee
must resize children if realized;
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
1772 |
realized ifTrue:[ |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1773 |
(how == #smaller) ifTrue:[ |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1774 |
self resizeSubviews |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1775 |
] ifFalse:[ |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1776 |
"/ |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1777 |
"/ 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
|
1778 |
"/ |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1779 |
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
|
1780 |
] |
295 | 1781 |
]. |
1782 |
self changed:#sizeOfView with:how. |
|
3670
10c6c46e16c2
dont forget the super-sizeChanged
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
1783 |
superView notNil ifTrue:[ |
10c6c46e16c2
dont forget the super-sizeChanged
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
1784 |
superView subViewChangedSize |
10c6c46e16c2
dont forget the super-sizeChanged
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
1785 |
] |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1786 |
|
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1787 |
"Modified: 28.1.1997 / 17:56:30 / cg" |
295 | 1788 |
! ! |
1789 |
||
1821
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1698
diff
changeset
|
1790 |
!VariablePanel methodsFor:'focus handling'! |
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1698
diff
changeset
|
1791 |
|
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1698
diff
changeset
|
1792 |
wantsFocusWithButtonPress |
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1698
diff
changeset
|
1793 |
"no, do not catch the keyboard focus on button click" |
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1698
diff
changeset
|
1794 |
|
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1698
diff
changeset
|
1795 |
^ false |
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1698
diff
changeset
|
1796 |
|
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1698
diff
changeset
|
1797 |
|
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1698
diff
changeset
|
1798 |
! ! |
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1698
diff
changeset
|
1799 |
|
2288 | 1800 |
!VariablePanel methodsFor:'initialization & release'! |
295 | 1801 |
|
871 | 1802 |
computeBarHeight |
958 | 1803 |
"compute the height if the separating bar from either the |
1804 |
form or an explicit height given in the styleSheet" |
|
1805 |
||
1550 | 1806 |
<resource: #style (#'variablePanel.barHeight' |
1807 |
#'variablePanel.barHeightMM')> |
|
924
81f3ca4512bd
allow barHeight to be set in the styleSheet
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1808 |
|
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1809 |
|bH h lvl| |
871 | 1810 |
|
876 | 1811 |
shadowForm notNil ifTrue:[ |
871 | 1812 |
bH := shadowForm height + 2. |
1813 |
] ifFalse:[ |
|
1869 | 1814 |
bH := styleSheet at:#'variablePanel.barHeight'. |
924
81f3ca4512bd
allow barHeight to be set in the styleSheet
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1815 |
bH isNil ifTrue:[ |
1869 | 1816 |
h := styleSheet at:#'variablePanel.barHeightMM' default:2. |
924
81f3ca4512bd
allow barHeight to be set in the styleSheet
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1817 |
bH := (h * device verticalPixelPerMillimeter) rounded. |
81f3ca4512bd
allow barHeight to be set in the styleSheet
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1818 |
]. |
871 | 1819 |
]. |
1869 | 1820 |
lvl := styleSheet at:#'variablePanel.barLevel' default:0. |
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1821 |
lvl ~~ 0 ifTrue:[ |
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1822 |
bH := bH + (lvl abs * 2). |
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1823 |
]. |
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1824 |
|
876 | 1825 |
self barHeight:bH. |
871 | 1826 |
knobHeight := bH. |
1827 |
||
1828 |
handleLabels notNil ifTrue:[ |
|
1987 | 1829 |
font := font onDevice:device. |
871 | 1830 |
bH := handleLabels inject:bH into:[:maxSoFar :thisLabel | |
874 | 1831 |
thisLabel isNil ifTrue:[ |
1832 |
maxSoFar |
|
1833 |
] ifFalse:[ |
|
1834 |
maxSoFar max:(thisLabel heightOn:self) |
|
1835 |
] |
|
1836 |
]. |
|
871 | 1837 |
bH := bH + font descent - 1 |
1838 |
]. |
|
1839 |
||
1840 |
self barHeight:bH. |
|
1841 |
||
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1842 |
"Modified: / 29.7.1998 / 14:47:21 / cg" |
871 | 1843 |
! |
1844 |
||
295 | 1845 |
defaultControllerClass |
1846 |
^ VariablePanelController |
|
1847 |
! |
|
1848 |
||
1849 |
initCursor |
|
1850 |
"set the cursor - a double arrow" |
|
1851 |
||
1698
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
1852 |
cursor := self class |
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
1853 |
cursorForOrientation:orientation |
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
1854 |
onDevice:device |
900 | 1855 |
|
1698
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
1856 |
"Modified: / 30.9.1998 / 18:20:35 / cg" |
295 | 1857 |
! |
1858 |
||
1859 |
initStyle |
|
966 | 1860 |
"setup viewStyle specifics" |
1861 |
||
871 | 1862 |
|mm| |
295 | 1863 |
|
1864 |
super initStyle. |
|
1865 |
||
1987 | 1866 |
handleColor := DefaultHandleColor onDevice:device. |
295 | 1867 |
|
1868 |
DefaultHandleStyle isNil ifTrue:[ |
|
496 | 1869 |
handleStyle := styleSheet name |
295 | 1870 |
] ifFalse:[ |
496 | 1871 |
handleStyle := DefaultHandleStyle |
295 | 1872 |
]. |
1873 |
||
496 | 1874 |
handleLevel := DefaultHandleLevel. |
1875 |
showHandle := DefaultShowHandle. |
|
4206
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1876 |
showHandleWhenEntered := DefaultShowHandleWhenEntered. |
295 | 1877 |
handlePosition := DefaultHandlePosition. |
2242
1aea02d32c96
snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
1878 |
"/ snapHandlePosition := DefaultSnapHandlePosition. |
295 | 1879 |
trackLine := DefaultTrackingLine. |
1880 |
separatingLine := DefaultSeparatingLine. |
|
1881 |
||
1529
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1882 |
DefaultHandleImage notNil ifTrue:[ |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1883 |
shadowForm := DefaultHandleImage onDevice:device. |
496 | 1884 |
barWidth := shadowForm width. |
295 | 1885 |
] ifFalse:[ |
1529
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1886 |
handleStyle == #next ifTrue:[ |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1887 |
DefaultHandleImage notNil ifTrue:[ |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1888 |
shadowForm := DefaultHandleImage onDevice:device. |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1889 |
] ifFalse:[ |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1890 |
shadowForm := self class shadowFormOn:device. |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1891 |
lightForm := self class lightFormOn:device. |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1892 |
]. |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1893 |
barWidth := shadowForm width. |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1894 |
] ifFalse:[ |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1895 |
shadowForm := lightForm := nil. |
496 | 1896 |
|
1529
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1897 |
mm := device verticalPixelPerMillimeter. |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1898 |
barWidth := (1.5 * mm) rounded. "motif style width" |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1899 |
]. |
295 | 1900 |
]. |
871 | 1901 |
self computeBarHeight. |
496 | 1902 |
|
295 | 1903 |
handleStyle == #mswindows ifTrue:[ |
496 | 1904 |
barWidth := (ArrowButton new direction:#up) width + 1 |
295 | 1905 |
]. |
496 | 1906 |
|
4206
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1907 |
"Modified: / 19-12-2010 / 09:31:29 / cg" |
295 | 1908 |
! |
1909 |
||
1910 |
initialize |
|
496 | 1911 |
orientation isNil ifTrue:[orientation := #vertical]. |
295 | 1912 |
super initialize. |
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1913 |
self bitGravity:nil. |
496 | 1914 |
|
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1915 |
"Modified: / 29.7.1998 / 16:07:23 / cg" |
295 | 1916 |
! ! |
1917 |
||
1918 |
!VariablePanel methodsFor:'private'! |
|
1919 |
||
1920 |
anyNonRelativeSubviews |
|
1921 |
"return true, if any of my subviews has no relative origin/extent" |
|
1922 |
||
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1923 |
self subViews do:[:aComponent | |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1924 |
aComponent relativeCorner isNil ifTrue:[^ true]. |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1925 |
aComponent relativeOrigin isNil ifTrue:[^ true] |
295 | 1926 |
]. |
1927 |
^ false |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1928 |
|
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1929 |
"Modified: 28.1.1997 / 17:57:26 / cg" |
295 | 1930 |
! |
1931 |
||
1655 | 1932 |
expandSubView:expandedView |
1933 |
"expand one of my subviews to full size" |
|
1934 |
||
1935 |
|pos subViews| |
|
1936 |
||
1937 |
realRelativeSizes notNil ifTrue:[ |
|
1938 |
"/ already expanded .. |
|
1939 |
^ self |
|
1940 |
]. |
|
1941 |
||
1942 |
pos := 0.0. |
|
1943 |
subViews := self subViews. |
|
1944 |
||
1945 |
orientation == #vertical ifTrue:[ |
|
1946 |
realRelativeSizes := subViews collect:[:v | v relativeCorner y - v relativeOrigin y]. |
|
1947 |
] ifFalse:[ |
|
1948 |
realRelativeSizes := subViews collect:[:v | v relativeCorner x - v relativeOrigin x]. |
|
1949 |
]. |
|
1950 |
||
1951 |
subViews do:[:aSubView | |
|
1952 |
aSubView == expandedView ifTrue:[ |
|
1953 |
aSubView origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
1954 |
pos := 1.0 |
|
1955 |
] ifFalse:[ |
|
3463 | 1956 |
aSubView beInvisible. |
1957 |
||
1655 | 1958 |
orientation == #vertical ifTrue:[ |
1959 |
aSubView origin:(0.0 @ pos) corner:(1.0 @ pos) |
|
1960 |
] ifFalse:[ |
|
1961 |
aSubView origin:(pos @ 0.0) corner:(pos @ 1.0) |
|
1962 |
] |
|
1963 |
] |
|
1964 |
]. |
|
1965 |
self resizeSubviews. |
|
1966 |
||
1967 |
"Modified: 28.1.1997 / 17:56:20 / cg" |
|
1968 |
! |
|
1969 |
||
871 | 1970 |
handleLabelAt:hIndex |
1971 |
handleLabels notNil ifTrue:[ |
|
1972 |
^ handleLabels at:hIndex ifAbsent:nil |
|
1973 |
]. |
|
1974 |
^ nil |
|
1975 |
! |
|
1976 |
||
1977 |
handleOriginsWithIndexDo:aBlock |
|
295 | 1978 |
"evaluate the argument block for every handle-origin" |
1979 |
||
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1980 |
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
|
1981 |
|
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1982 |
"Modified: 28.1.1997 / 17:53:44 / cg" |
295 | 1983 |
! |
1984 |
||
871 | 1985 |
handleOriginsWithIndexFrom:start to:stop do:aBlock |
295 | 1986 |
"evaluate the argument block for some handle-origins" |
1987 |
||
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1988 |
|x y hw hh hDelta vDelta subViews |
295 | 1989 |
first "{ Class: SmallInteger }" |
1990 |
last "{ Class: SmallInteger }"| |
|
1991 |
||
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1992 |
(subViews := self subViews) notNil ifTrue:[ |
871 | 1993 |
shadowForm notNil ifTrue:[ |
1994 |
hw := shadowForm width. |
|
1995 |
hh := shadowForm height. |
|
1996 |
] ifFalse:[ |
|
1997 |
hw := hh := barWidth |
|
1998 |
]. |
|
295 | 1999 |
|
871 | 2000 |
(handleStyle ~~ #normal and:[handleStyle ~~ #mswindows]) ifTrue:[ |
2001 |
hDelta := barWidth // 2. |
|
2002 |
vDelta := barWidth // 2. |
|
2003 |
] ifFalse:[ |
|
2004 |
hDelta := vDelta := 0 |
|
2005 |
]. |
|
295 | 2006 |
|
871 | 2007 |
(handlePosition == #left) ifTrue:[ |
2008 |
x := hDelta. |
|
1381 | 2009 |
y := vDelta. |
2010 |
||
2011 |
orientation == #vertical ifTrue:[ |
|
2012 |
x := x + barWidth |
|
2013 |
] ifFalse:[ |
|
2014 |
y := y + barWidth |
|
2015 |
]. |
|
2016 |
margin ~~ 0 ifTrue:[ |
|
2017 |
x := x + 2 |
|
2018 |
]. |
|
871 | 2019 |
] ifFalse:[ |
2020 |
(handlePosition == #right) ifTrue:[ |
|
2021 |
x := width - hw - margin - hDelta. |
|
2022 |
y := height - hh - margin - vDelta. |
|
2023 |
] ifFalse:[ |
|
2024 |
x := width - barWidth // 2. |
|
2025 |
y := height - barWidth // 2 |
|
2026 |
] |
|
2027 |
]. |
|
2028 |
first := start + 1. |
|
2029 |
last := stop. |
|
1381 | 2030 |
|
871 | 2031 |
first to:last do:[:index | |
2032 |
|view| |
|
295 | 2033 |
|
871 | 2034 |
view := subViews at:index. |
2035 |
orientation == #vertical ifTrue:[ |
|
2036 |
y := view top "origin y" - barHeight + 1. |
|
2037 |
] ifFalse:[ |
|
2038 |
x := view left "origin x" - barHeight + 1. |
|
2039 |
]. |
|
2040 |
aBlock value:(x @ y) value:index |
|
2041 |
] |
|
295 | 2042 |
] |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2043 |
|
1381 | 2044 |
"Modified: / 1.11.1997 / 11:53:40 / cg" |
295 | 2045 |
! |
2046 |
||
2623 | 2047 |
redrawIfShown |
2048 |
shown ifTrue:[ |
|
2049 |
self clear. |
|
2050 |
]. |
|
2051 |
self invalidate |
|
2052 |
! |
|
2053 |
||
2026
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2054 |
resizeSubViewsTo:relativeSizeList |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2055 |
"change subviews sizes as defined in the argument list |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2056 |
(a collection of relative sizes)" |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2057 |
|
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2058 |
|pos subViews| |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2059 |
|
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2060 |
subViews := self subViews. |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2061 |
|
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2062 |
pos := 0.0. |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2063 |
subViews with:relativeSizeList do:[:aSubView :relSize | |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2064 |
orientation == #vertical ifTrue:[ |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2065 |
aSubView origin:(0.0 @ pos) corner:(1.0 @ (pos + relSize)) |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2066 |
] ifFalse:[ |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2067 |
aSubView origin:(pos @ 0.0) corner:((pos + relSize) @ 1.0) |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2068 |
]. |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2069 |
pos := pos + relSize. |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2070 |
]. |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2071 |
self resizeSubviews. |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2072 |
|
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2073 |
! |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2074 |
|
295 | 2075 |
resizeSubviews |
1151
94aff1c7b0aa
Fix comments, eliminate common message sends.
Stefan Vogel <sv@exept.de>
parents:
1131
diff
changeset
|
2076 |
"readjust size of all subviews" |
295 | 2077 |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2078 |
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
|
2079 |
|
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2080 |
"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
|
2081 |
"Modified: 22.3.1997 / 01:01:31 / stefan" |
295 | 2082 |
! |
2083 |
||
2084 |
resizeSubviewsFrom:start to:stop |
|
2085 |
"readjust size of some subviews" |
|
2086 |
||
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2087 |
|step nSubviews subViews| |
295 | 2088 |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2089 |
(subViews := self subViews) size > 0 ifTrue:[ |
871 | 2090 |
(start <= stop) ifTrue:[ |
2091 |
step := 1 |
|
2092 |
] ifFalse:[ |
|
2093 |
step := -1 |
|
2094 |
]. |
|
2095 |
nSubviews := subViews size. |
|
2096 |
start to:stop by:step do:[:index | |
|
2026
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2097 |
|bw view o1 o2 newOrg newCorner newExt| |
295 | 2098 |
|
871 | 2099 |
view := subViews at:index. |
2100 |
bw := view borderWidth. |
|
295 | 2101 |
|
871 | 2102 |
index == 1 ifTrue:[ |
2103 |
o1 := 0. |
|
2104 |
] ifFalse:[ |
|
2105 |
o1 := barHeight // 2 - bw |
|
2106 |
]. |
|
2107 |
index == nSubviews ifTrue:[ |
|
2108 |
o2 := 0. |
|
2109 |
] ifFalse:[ |
|
2110 |
o2 := barHeight // 2 - bw |
|
2111 |
]. |
|
295 | 2112 |
|
871 | 2113 |
newOrg := view computeOrigin. |
2114 |
newOrg notNil ifTrue:[ |
|
2115 |
(index ~~ 1) ifTrue:[ |
|
2116 |
orientation == #vertical ifTrue:[ |
|
2117 |
newOrg y:(newOrg y + o1) |
|
2118 |
] ifFalse:[ |
|
2119 |
newOrg x:(newOrg x + o1) |
|
2120 |
] |
|
2121 |
]. |
|
2122 |
]. |
|
2123 |
newExt := view computeExtent. |
|
2124 |
newExt notNil ifTrue:[ |
|
2125 |
orientation == #vertical ifTrue:[ |
|
2126 |
newExt y:(newExt y - o2 - o1) |
|
2127 |
] ifFalse:[ |
|
2128 |
newExt x:(newExt x - o2 - o1) |
|
2129 |
] |
|
2130 |
]. |
|
2131 |
view pixelOrigin:newOrg extent:newExt. |
|
1550 | 2132 |
]. |
1551 | 2133 |
shown ifTrue:[ |
2134 |
"/ must clear, since handles are copied automatically (by bitGravity) |
|
2135 |
self clear. |
|
2136 |
self invalidate. |
|
2137 |
] |
|
295 | 2138 |
] |
873 | 2139 |
|
2160 | 2140 |
"Modified: / 22.3.1997 / 01:02:21 / stefan" |
2141 |
"Modified: / 23.2.2000 / 18:32:37 / cg" |
|
295 | 2142 |
! |
2143 |
||
1655 | 2144 |
restoreSubViewRatios |
2145 |
"restore my subviews sizes to the state before the full-expand" |
|
2146 |
||
3463 | 2147 |
|pos| |
1655 | 2148 |
|
2149 |
realRelativeSizes == nil ifTrue:[ |
|
2150 |
"/ not expanded - ignore |
|
2151 |
^ self |
|
2152 |
]. |
|
2153 |
||
2154 |
pos := 0.0. |
|
2155 |
self subViews with:realRelativeSizes do:[:aSubView :aRelativeSize | |
|
2156 |
orientation == #vertical ifTrue:[ |
|
2157 |
aSubView origin:(0.0 @ pos) corner:(1.0 @ (pos+aRelativeSize)) |
|
2158 |
] ifFalse:[ |
|
2159 |
aSubView origin:(pos @ 0.0) corner:((pos+aRelativeSize) @ 1.0) |
|
2160 |
]. |
|
3463 | 2161 |
pos := pos + aRelativeSize. |
2162 |
||
2163 |
aSubView shown ifFalse:[ |
|
2164 |
aSubView hiddenOnRealize:false. |
|
2165 |
shown ifTrue:[aSubView beVisible]. |
|
2166 |
]. |
|
1655 | 2167 |
]. |
2168 |
realRelativeSizes := nil. |
|
2169 |
self resizeSubviews. |
|
2170 |
||
2171 |
"Modified: 28.1.1997 / 17:56:20 / cg" |
|
2172 |
! |
|
2173 |
||
295 | 2174 |
setupSubviews |
2175 |
"setup subviews sizes (in case of non-relative sizes)" |
|
2176 |
||
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2177 |
|pos delta subViews nSubViews "{ Class: SmallInteger }"| |
295 | 2178 |
|
300 | 2179 |
"/ setup all subviews to spread evenly ... |
295 | 2180 |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2181 |
subViews := self subViews. |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2182 |
nSubViews := subViews size. |
1043 | 2183 |
nSubViews == 0 ifTrue:[^ self]. |
295 | 2184 |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2185 |
pos := 0.0. |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2186 |
delta := 1.0 / nSubViews. |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2187 |
|
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2188 |
1 to:nSubViews do:[:index | |
2160 | 2189 |
|view org corn| |
295 | 2190 |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2191 |
view := subViews at:index. |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2192 |
orientation == #vertical ifTrue:[ |
2160 | 2193 |
org := (0.0 @ pos). |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2194 |
index == subViews size ifTrue:[ |
2160 | 2195 |
corn := (1.0 @ 1.0) |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2196 |
] ifFalse:[ |
2160 | 2197 |
corn := (1.0 @ (pos + delta)) |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2198 |
]. |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2199 |
] ifFalse:[ |
2160 | 2200 |
org := (pos @ 0.0). |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2201 |
index == subViews size ifTrue:[ |
2160 | 2202 |
corn := (1.0 @ 1.0) |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2203 |
] ifFalse:[ |
2160 | 2204 |
corn := ((pos + delta) @ 1.0) |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2205 |
]. |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2206 |
]. |
2160 | 2207 |
view origin:org corner:corn. |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2208 |
pos := pos + delta |
295 | 2209 |
] |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2210 |
|
2160 | 2211 |
"Modified: / 23.2.2000 / 18:14:01 / cg" |
295 | 2212 |
! ! |
2213 |
||
2743 | 2214 |
!VariablePanel methodsFor:'private-snap queries'! |
2179 | 2215 |
|
2216 |
canChangeExtentOfViewAt:anIndex |
|
2217 |
"returns true if extent at an index is changable |
|
2218 |
" |
|
2219 |
|view| |
|
2220 |
||
2221 |
view := subViews at:anIndex ifAbsent:[^ false]. |
|
2222 |
||
2223 |
orientation == #vertical ifTrue:[ |
|
2224 |
view height > 2 ifFalse:[ |
|
2225 |
view := subViews at:(anIndex + 1) ifAbsent:[^ false]. |
|
2598
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2226 |
^ view height > 2 |
2179 | 2227 |
]. |
2228 |
^ true |
|
2229 |
]. |
|
2230 |
||
2231 |
view width > 2 ifFalse:[ |
|
2232 |
view := subViews at:(anIndex + 1) ifAbsent:[^ false]. |
|
2598
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2233 |
^ view width > 2 |
2179 | 2234 |
]. |
2235 |
^ true |
|
2236 |
! |
|
2237 |
||
2238 |
initSnapAdornment |
|
2239 |
|num icon level enterLevel selectedLevel color| |
|
2240 |
||
4187 | 2241 |
snapAdornment isNil ifTrue:[ |
2242 |
||
2243 |
snapAdornment := SnapAdornment "IdentityDictionary" new. |
|
2244 |
||
2245 |
level := styleSheet at:#'variablePanel.snapLevel' default:1. |
|
2246 |
enterLevel := styleSheet at:#'variablePanel.snapEnterLevel' default:level. |
|
2247 |
selectedLevel := styleSheet at:#'variablePanel.selectedLevel' default:(level negated). |
|
2248 |
||
2249 |
snapAdornment level:level. |
|
2250 |
snapAdornment enterLevel:enterLevel. |
|
2251 |
snapAdornment selectedLevel:selectedLevel. |
|
2252 |
snapAdornment mode:#min. |
|
2253 |
||
2254 |
color := styleSheet |
|
2255 |
colorAt:#'variablePanel.snapSelectedBgColor' |
|
2256 |
default:(StyleSheet colorAt:#'button.activeBackgroundColor'). |
|
2257 |
color notNil ifTrue:[ |
|
2258 |
snapAdornment selectedBgColor:(color onDevice:device) |
|
2259 |
]. |
|
2260 |
||
2261 |
color := StyleSheet |
|
2262 |
colorAt:#'variablePanel.snapEnterBgColor' |
|
2263 |
default:(StyleSheet colorAt:#'button.enteredBackgroundColor'). |
|
2264 |
color notNil ifTrue:[ |
|
2265 |
snapAdornment enterBgColor:(color onDevice:device) |
|
2266 |
]. |
|
2267 |
||
2268 |
self class snapIcons keysAndValuesDo:[:aKey :anIcon| |
|
2269 |
anIcon device == device ifTrue:[ |
|
2270 |
icon := anIcon |
|
2271 |
] ifFalse:[ |
|
2272 |
icon := anIcon copy onDevice:device. |
|
2273 |
icon clearMaskedPixels. |
|
2274 |
device == Display ifTrue:[ |
|
2275 |
self class snapIcons at:aKey put:icon. |
|
2276 |
] |
|
2277 |
]. |
|
2278 |
snapAdornment at:aKey put:icon |
|
2279 |
]. |
|
2280 |
"compute required snap extent including level and margins ..." |
|
2281 |
||
2282 |
num := level abs max:(enterLevel abs). |
|
2283 |
num := num max:(selectedLevel abs). |
|
2284 |
num := (num + 2) "margin into handle := 1" * 2. |
|
2285 |
icon := snapAdornment iconUp. |
|
2286 |
||
2287 |
snapAdornment height:(icon height + num). |
|
2288 |
snapAdornment width:(icon width + num). |
|
2179 | 2289 |
]. |
2290 |
||
2598
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2291 |
^ snapAdornment |
4187 | 2292 |
|
2293 |
"Modified: / 31-10-2010 / 12:59:39 / cg" |
|
2179 | 2294 |
! |
2295 |
||
2296 |
snapAtIndexWillGrow:anIndex |
|
2297 |
"returns true if the view assigned to the snap at an index will grow |
|
2298 |
if pressing the snap |
|
2299 |
" |
|
2300 |
|view mode| |
|
2301 |
||
2302 |
(mode := self snapMode) notNil ifTrue:[ |
|
2303 |
(mode == #max or:[mode == #maxMin]) ifTrue:[ |
|
2304 |
"on press the view is increased to bottom(vertical) or right(horizontal)" |
|
2305 |
view := subViews at:(anIndex + 1) ifAbsent:[^ false]. |
|
2598
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2306 |
^ orientation == #vertical ifTrue:[view height > 2] ifFalse:[view width > 2] |
2179 | 2307 |
]. |
2308 |
||
2309 |
(mode == #min or:[mode == #minMax]) ifTrue:[ |
|
2310 |
"on press the view is decreased to top(vertical) or left (horizontal)" |
|
2311 |
view := subViews at:anIndex ifAbsent:[^ false]. |
|
2598
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2312 |
^ orientation == #vertical ifTrue:[view height <= 2] ifFalse:[view width <= 2] |
2236 | 2313 |
]. |
2314 |
||
2269 | 2315 |
self error:'unexepected snapMode state'. |
2179 | 2316 |
]. |
2598
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2317 |
^ false "snap is disabled" |
2179 | 2318 |
! |
2319 |
||
2320 |
snapLayoutAt:anIndex |
|
2321 |
"returns the layout of the snap at an index |
|
2322 |
or nil if snaps are disabled |
|
2323 |
" |
|
2598
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2324 |
|v1 v2 left top right bot w snapX snapY| |
2179 | 2325 |
|
4187 | 2326 |
self hasSnapHandle ifFalse:[^ nil]. "snap disabled" |
2179 | 2327 |
|
2328 |
v1 := subViews at:anIndex ifAbsent:[^ nil]. |
|
2329 |
v2 := subViews at:anIndex + 1 ifAbsent:[^ nil]. |
|
4187 | 2330 |
w := snapAdornment width ? 0. |
2179 | 2331 |
|
2242
1aea02d32c96
snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
2332 |
handlePosition "snapHandlePosition" == #left ifTrue:[ |
2241
d9c7f1486b7a
draw snap at very left of panel
Claus Gittinger <cg@exept.de>
parents:
2240
diff
changeset
|
2333 |
snapX := snapY := margin. "/ ViewSpacing. |
2228
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
2334 |
] ifFalse:[ |
2242
1aea02d32c96
snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
2335 |
handlePosition "snapHandlePosition" == #right ifTrue:[ |
2228
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
2336 |
snapX := width - w. |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
2337 |
snapY := height - w. |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
2338 |
] ifFalse:[ |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
2339 |
snapX := (width - w) // 2. |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
2340 |
snapY := (height - w) // 2. |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
2341 |
]. |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
2342 |
]. |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
2343 |
|
2179 | 2344 |
orientation == #vertical ifTrue:[ |
2228
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
2345 |
left := snapX. "/ v1 width - w // 2. |
2598
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2346 |
top := v1 bottom + 1. |
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2347 |
right := left + w. |
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2348 |
bot := v2 top. |
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2349 |
] ifFalse:[ |
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2350 |
top := snapY. "/ v1 height - w // 2. |
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2351 |
left := v1 right + 1. |
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2352 |
right := v2 left. |
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2353 |
bot := top + w. |
2179 | 2354 |
]. |
2598
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2355 |
^ Rectangle left:left top:top right:right bottom:bot |
4187 | 2356 |
|
2357 |
"Modified: / 31-10-2010 / 12:47:16 / cg" |
|
2179 | 2358 |
! ! |
2359 |
||
2743 | 2360 |
!VariablePanel methodsFor:'private-tableView protocol'! |
299
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
2361 |
|
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
2362 |
setupSubviewOrigins |
826 | 2363 |
"setup subviews origins |
2364 |
if we only have relative extents |
|
2365 |
(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
|
2366 |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2367 |
|x y e eX eY subViews n "{ Class: SmallInteger }"| |
299
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
2368 |
|
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
2369 |
x := y := 0.0. |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
2370 |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2371 |
subViews := self subViews. |
299
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
2372 |
n := subViews size. |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
2373 |
1 to:n do:[:index | |
826 | 2374 |
|view| |
299
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
2375 |
|
826 | 2376 |
view := subViews at:index. |
2377 |
e := view relativeExtent. |
|
2378 |
e notNil ifTrue:[ |
|
2379 |
view relativeExtent:nil. |
|
2380 |
eX := e x. |
|
2381 |
eY := e y. |
|
2382 |
index == n ifTrue:[ |
|
2383 |
view origin:(x @ y) corner:(1.0 @ 1.0) |
|
2384 |
] ifFalse:[ |
|
2385 |
orientation == #vertical ifTrue:[ |
|
2386 |
view origin:(x @ y) corner:(1.0 @ (y+eY)) |
|
2387 |
] ifFalse:[ |
|
2388 |
view origin:(x @ y) corner:((x+eX) @ 1.0) |
|
2389 |
]. |
|
2390 |
]. |
|
2391 |
orientation == #vertical ifTrue:[ |
|
2392 |
y := y + eY. |
|
2393 |
] ifFalse:[ |
|
2394 |
x := x + eX. |
|
2395 |
] |
|
2396 |
] ifFalse: [ |
|
2397 |
view origin:(x @ y). |
|
2398 |
orientation == #vertical ifTrue:[ |
|
2399 |
y := view relativeCorner y. |
|
2400 |
] ifFalse:[ |
|
2401 |
x := view relativeCorner x. |
|
2402 |
] |
|
2403 |
]. |
|
2404 |
] |
|
2405 |
||
2406 |
"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
|
2407 |
"Modified: 28.1.1997 / 17:55:21 / cg" |
299
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
2408 |
! ! |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
2409 |
|
3864
3b8f1fe89d48
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3670
diff
changeset
|
2410 |
!VariablePanel methodsFor:'queries'! |
3b8f1fe89d48
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3670
diff
changeset
|
2411 |
|
4187 | 2412 |
hasSnapHandle |
2413 |
^ snapAdornment notNil |
|
2414 |
||
2415 |
"Created: / 31-10-2010 / 12:43:21 / cg" |
|
2416 |
! |
|
2417 |
||
3864
3b8f1fe89d48
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3670
diff
changeset
|
2418 |
isLayoutWrapper |
3b8f1fe89d48
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3670
diff
changeset
|
2419 |
"answer true, if this view defines the layout of it's subviews" |
3b8f1fe89d48
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3670
diff
changeset
|
2420 |
|
3b8f1fe89d48
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3670
diff
changeset
|
2421 |
^ true |
3b8f1fe89d48
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3670
diff
changeset
|
2422 |
! ! |
3b8f1fe89d48
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3670
diff
changeset
|
2423 |
|
2288 | 2424 |
!VariablePanel methodsFor:'realization'! |
2425 |
||
2426 |
fixSize |
|
2427 |
super fixSize. |
|
2305
f2850e54b0ab
only access originChanged, extentChanged and cornerChanged
Claus Gittinger <cg@exept.de>
parents:
2288
diff
changeset
|
2428 |
self extentChangedFlag ifTrue:[ |
2288 | 2429 |
self resizeSubviews |
2430 |
]. |
|
2431 |
||
2432 |
"Modified: 22.3.1997 / 01:19:55 / stefan" |
|
2531
6fc09f6a83dd
fix relative sizes when realized
Claus Gittinger <cg@exept.de>
parents:
2483
diff
changeset
|
2433 |
! |
6fc09f6a83dd
fix relative sizes when realized
Claus Gittinger <cg@exept.de>
parents:
2483
diff
changeset
|
2434 |
|
6fc09f6a83dd
fix relative sizes when realized
Claus Gittinger <cg@exept.de>
parents:
2483
diff
changeset
|
2435 |
realize |
6fc09f6a83dd
fix relative sizes when realized
Claus Gittinger <cg@exept.de>
parents:
2483
diff
changeset
|
2436 |
super realize. |
6fc09f6a83dd
fix relative sizes when realized
Claus Gittinger <cg@exept.de>
parents:
2483
diff
changeset
|
2437 |
self anyNonRelativeSubviews ifTrue:[ |
2533 | 2438 |
self setupSubviews. |
2439 |
self sizeChanged:nil. "/ force recomputation of subviews |
|
2531
6fc09f6a83dd
fix relative sizes when realized
Claus Gittinger <cg@exept.de>
parents:
2483
diff
changeset
|
2440 |
]. |
2288 | 2441 |
! ! |
2442 |
||
2443 |
!VariablePanel methodsFor:'redrawing'! |
|
2444 |
||
2445 |
redraw |
|
2446 |
"redraw all of the handles" |
|
2447 |
||
2448 |
redrawLocked ~~ true ifTrue:[ |
|
2449 |
"/ self clear. |
|
2450 |
self redrawHandlesFrom:1 to:(self subViews size) |
|
2451 |
] |
|
2452 |
||
2453 |
"Modified: 28.1.1997 / 17:54:15 / cg" |
|
2454 |
! ! |
|
2455 |
||
4187 | 2456 |
!VariablePanel::SnapAdornment methodsFor:'accessing'! |
2457 |
||
2458 |
enterBgColor |
|
2459 |
^ enterBgColor |
|
2460 |
! |
|
2461 |
||
2462 |
enterBgColor:something |
|
2463 |
enterBgColor := something. |
|
2464 |
! |
|
2465 |
||
2466 |
enterLevel |
|
2467 |
^ enterLevel |
|
2468 |
! |
|
2469 |
||
2470 |
enterLevel:something |
|
2471 |
enterLevel := something. |
|
2472 |
! |
|
2473 |
||
2474 |
height |
|
2475 |
^ height |
|
2476 |
! |
|
2477 |
||
2478 |
height:something |
|
2479 |
height := something. |
|
2480 |
! |
|
2481 |
||
2482 |
iconDown |
|
2483 |
^ iconDown |
|
2484 |
! |
|
2485 |
||
2486 |
iconDown:something |
|
2487 |
iconDown := something. |
|
2488 |
! |
|
2489 |
||
2490 |
iconLeft |
|
2491 |
^ iconLeft |
|
2492 |
! |
|
2493 |
||
2494 |
iconLeft:something |
|
2495 |
iconLeft := something. |
|
2496 |
! |
|
2497 |
||
2498 |
iconLeftRight |
|
2499 |
^ iconLeftRight |
|
2500 |
! |
|
2501 |
||
2502 |
iconLeftRight:something |
|
2503 |
iconLeftRight := something. |
|
2504 |
! |
|
2505 |
||
2506 |
iconRight |
|
2507 |
^ iconRight |
|
2508 |
! |
|
2509 |
||
2510 |
iconRight:something |
|
2511 |
iconRight := something. |
|
2512 |
! |
|
2513 |
||
2514 |
iconUp |
|
2515 |
^ iconUp |
|
2516 |
! |
|
2517 |
||
2518 |
iconUp:something |
|
2519 |
iconUp := something. |
|
2520 |
! |
|
2521 |
||
2522 |
iconUpDown |
|
2523 |
^ iconUpDown |
|
2524 |
! |
|
2525 |
||
2526 |
iconUpDown:something |
|
2527 |
iconUpDown := something. |
|
2528 |
! |
|
2529 |
||
2530 |
level |
|
2531 |
^ level |
|
2532 |
! |
|
2533 |
||
2534 |
level:something |
|
2535 |
level := something. |
|
2536 |
! |
|
2537 |
||
2538 |
mode |
|
2539 |
^ mode |
|
2540 |
! |
|
2541 |
||
2542 |
mode:something |
|
2543 |
mode := something. |
|
2544 |
! |
|
2545 |
||
2546 |
selectedBgColor |
|
2547 |
^ selectedBgColor |
|
2548 |
! |
|
2549 |
||
2550 |
selectedBgColor:something |
|
2551 |
selectedBgColor := something. |
|
2552 |
! |
|
2553 |
||
2554 |
selectedLevel |
|
2555 |
^ selectedLevel |
|
2556 |
! |
|
2557 |
||
2558 |
selectedLevel:something |
|
2559 |
selectedLevel := something. |
|
2560 |
! |
|
2561 |
||
2562 |
width |
|
2563 |
^ width |
|
2564 |
! |
|
2565 |
||
2566 |
width:something |
|
2567 |
width := something. |
|
2568 |
! ! |
|
2569 |
||
2570 |
!VariablePanel::SnapAdornment methodsFor:'backward compatibility'! |
|
2571 |
||
2572 |
at:key |
|
2573 |
^ self perform:key |
|
2574 |
||
2575 |
"Created: / 31-10-2010 / 12:38:58 / cg" |
|
2576 |
! |
|
2577 |
||
2578 |
at:key ifAbsent:default |
|
2579 |
|value| |
|
2580 |
||
2581 |
value := self perform:key. |
|
2582 |
^ value ? default |
|
2583 |
||
2584 |
"Created: / 31-10-2010 / 12:41:10 / cg" |
|
2585 |
! |
|
2586 |
||
2587 |
at:key put:aValue |
|
2588 |
self perform:(key,':') asSymbol with:aValue |
|
2589 |
||
2590 |
"Created: / 31-10-2010 / 12:38:48 / cg" |
|
2591 |
! ! |
|
2592 |
||
871 | 2593 |
!VariablePanel class methodsFor:'documentation'! |
295 | 2594 |
|
2595 |
version |
|
4206
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
2596 |
^ '$Header: /cvs/stx/stx/libwidg/VariablePanel.st,v 1.92 2010-12-19 08:40:16 cg Exp $' |
4043 | 2597 |
! |
2598 |
||
2599 |
version_CVS |
|
4206
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
2600 |
^ '$Header: /cvs/stx/stx/libwidg/VariablePanel.st,v 1.92 2010-12-19 08:40:16 cg Exp $' |
295 | 2601 |
! ! |