author | Claus Gittinger <cg@exept.de> |
Wed, 29 Jun 2011 15:17:58 +0200 | |
changeset 4260 | 7acd85d3324f |
parent 4206 | 570f1a1e587e |
child 4433 | d8b26708a2ba |
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 |
|
4260
7acd85d3324f
comment/format in: #relativeCorners
Claus Gittinger <cg@exept.de>
parents:
4206
diff
changeset
|
923 |
"the returned collection gives the corner-fractional value for each component; |
7acd85d3324f
comment/format in: #relativeCorners
Claus Gittinger <cg@exept.de>
parents:
4206
diff
changeset
|
924 |
i.e. for a 20-40-40 look, it would be #(0.2 0.6 1.0)" |
7acd85d3324f
comment/format in: #relativeCorners
Claus Gittinger <cg@exept.de>
parents:
4206
diff
changeset
|
925 |
|
2650 | 926 |
^ self subViews |
927 |
collect:[:eachView | |
|
928 |
self isHorizontal ifTrue:[ |
|
929 |
eachView relativeCorner x |
|
930 |
] ifFalse:[ |
|
931 |
eachView relativeCorner y |
|
932 |
] |
|
933 |
] |
|
934 |
! |
|
935 |
||
4260
7acd85d3324f
comment/format in: #relativeCorners
Claus Gittinger <cg@exept.de>
parents:
4206
diff
changeset
|
936 |
relativeCorners:aCollectionOfRelativeCornerPositions |
7acd85d3324f
comment/format in: #relativeCorners
Claus Gittinger <cg@exept.de>
parents:
4206
diff
changeset
|
937 |
"the argument gives the corner-fractional value for each component; |
7acd85d3324f
comment/format in: #relativeCorners
Claus Gittinger <cg@exept.de>
parents:
4206
diff
changeset
|
938 |
i.e. for a 20-40-40 look, it would be #(0.2 0.6 1.0)" |
7acd85d3324f
comment/format in: #relativeCorners
Claus Gittinger <cg@exept.de>
parents:
4206
diff
changeset
|
939 |
|
2650 | 940 |
|pos| |
941 |
||
4260
7acd85d3324f
comment/format in: #relativeCorners
Claus Gittinger <cg@exept.de>
parents:
4206
diff
changeset
|
942 |
aCollectionOfRelativeCornerPositions size == self subViews size ifFalse:[^ self ]. |
3278 | 943 |
|
2650 | 944 |
pos := 0.0. |
4260
7acd85d3324f
comment/format in: #relativeCorners
Claus Gittinger <cg@exept.de>
parents:
4206
diff
changeset
|
945 |
self subViews with:aCollectionOfRelativeCornerPositions |
2650 | 946 |
do:[:eachView :eachCorner | |
947 |
self isHorizontal ifTrue:[ |
|
948 |
eachView origin:(pos @ 0.0) corner:(eachCorner @ 1.0) |
|
949 |
] ifFalse:[ |
|
950 |
eachView origin:(0.0 @ pos) corner:(1.0 @ eachCorner) |
|
951 |
]. |
|
952 |
pos := eachCorner |
|
4260
7acd85d3324f
comment/format in: #relativeCorners
Claus Gittinger <cg@exept.de>
parents:
4206
diff
changeset
|
953 |
]. |
7acd85d3324f
comment/format in: #relativeCorners
Claus Gittinger <cg@exept.de>
parents:
4206
diff
changeset
|
954 |
self realized ifTrue:[ |
7acd85d3324f
comment/format in: #relativeCorners
Claus Gittinger <cg@exept.de>
parents:
4206
diff
changeset
|
955 |
self resizeSubviews |
7acd85d3324f
comment/format in: #relativeCorners
Claus Gittinger <cg@exept.de>
parents:
4206
diff
changeset
|
956 |
]. |
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
957 |
! ! |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
958 |
|
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
959 |
!VariablePanel methodsFor:'accessing-look'! |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
960 |
|
295 | 961 |
barHeight |
962 |
"return the height of the separating bar" |
|
963 |
||
964 |
^ barHeight |
|
965 |
! |
|
966 |
||
967 |
barHeight:nPixel |
|
968 |
"set the height of the separating bar" |
|
969 |
||
2108
b9322a905330
resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents:
2084
diff
changeset
|
970 |
|bH| |
b9322a905330
resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents:
2084
diff
changeset
|
971 |
|
b9322a905330
resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents:
2084
diff
changeset
|
972 |
bH := nPixel. |
295 | 973 |
|
1207 | 974 |
"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
|
975 |
(bH < 4) ifTrue:[ |
b9322a905330
resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents:
2084
diff
changeset
|
976 |
bH := 4 |
295 | 977 |
]. |
978 |
||
876 | 979 |
"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
|
980 |
bH odd ifTrue:[ |
b9322a905330
resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents:
2084
diff
changeset
|
981 |
bH := bH + 1 |
b9322a905330
resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents:
2084
diff
changeset
|
982 |
]. |
b9322a905330
resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents:
2084
diff
changeset
|
983 |
self setBarHeight:bH |
876 | 984 |
|
2108
b9322a905330
resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents:
2084
diff
changeset
|
985 |
"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
|
986 |
"Modified: / 30.1.2000 / 22:31:32 / cg" |
876 | 987 |
! |
988 |
||
2623 | 989 |
barLevel:level |
990 |
"set the 3D level of the separating bar" |
|
991 |
||
992 |
barLevel ~~ level ifTrue:[ |
|
993 |
barLevel := level. |
|
994 |
self redrawIfShown. |
|
995 |
] |
|
996 |
! |
|
997 |
||
876 | 998 |
handleImage:aBitmapOrImage |
999 |
"define the handles image" |
|
1000 |
||
1001 |
shadowForm := aBitmapOrImage. |
|
1002 |
lightForm := nil. |
|
1003 |
self computeBarHeight. |
|
1004 |
||
1005 |
"Created: 7.11.1996 / 20:21:10 / cg" |
|
1006 |
"Modified: 7.11.1996 / 20:27:22 / cg" |
|
295 | 1007 |
! |
1008 |
||
871 | 1009 |
handleLabels:aCollectionOfLabels |
1981
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1010 |
"define special handle labels - typically a collection of |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1011 |
bitmap images. Notice, that the first handle is not |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1012 |
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
|
1013 |
|
871 | 1014 |
orientation == #horizontal ifTrue:[ |
1015 |
self error:'not allowed for horizontal panels' |
|
1016 |
]. |
|
1017 |
||
1018 |
handleLabels := aCollectionOfLabels. |
|
1019 |
self computeBarHeight. |
|
1020 |
self resizeSubviews. |
|
1021 |
||
1981
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1022 |
" |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1023 |
|top panel v1 v2| |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1024 |
|
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1025 |
top := StandardSystemView new. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1026 |
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
|
1027 |
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
|
1028 |
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
|
1029 |
panel handleStyle:nil. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1030 |
panel handleLabels:#('foo' 'bar'). |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1031 |
top open |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1032 |
" |
871 | 1033 |
! |
1034 |
||
295 | 1035 |
handleLevel:aNumber |
1036 |
"define the 3D level of the handle (only with some styles). |
|
1037 |
Normally, this is defined via styleSheet files, but this entry allows |
|
1038 |
individual views to be manipulated." |
|
1039 |
||
2244 | 1040 |
handleLevel ~~ aNumber ifTrue:[ |
1041 |
handleLevel := aNumber. |
|
2623 | 1042 |
self redrawIfShown. |
2242
1aea02d32c96
snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
1043 |
] |
295 | 1044 |
! |
1045 |
||
1046 |
handlePosition |
|
1047 |
"return the position of the handle" |
|
1048 |
||
1049 |
^ handlePosition |
|
1050 |
! |
|
1051 |
||
1052 |
handlePosition:aSymbol |
|
1053 |
"define the position of the handle; the argument aSymbol |
|
2228
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1054 |
may be one of #left, #right or #center. |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1055 |
If never set by the program, the position is controlled by the styleSheet." |
295 | 1056 |
|
2244 | 1057 |
handlePosition ~~ aSymbol ifTrue:[ |
1058 |
handlePosition := aSymbol ? DefaultHandlePosition. |
|
2623 | 1059 |
self redrawIfShown. |
2242
1aea02d32c96
snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
1060 |
] |
295 | 1061 |
! |
1062 |
||
876 | 1063 |
handleShadowImage:shadowImage lightImage:lightImage |
1064 |
"define the handles image; both shadow and light parts" |
|
1065 |
||
1066 |
shadowForm := shadowImage. |
|
1067 |
lightForm := lightImage. |
|
1068 |
self computeBarHeight. |
|
1069 |
||
1070 |
"Created: 7.11.1996 / 20:21:51 / cg" |
|
1071 |
"Modified: 7.11.1996 / 20:27:26 / cg" |
|
1072 |
! |
|
1073 |
||
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
1074 |
handleStyle:styleSymbol |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
1075 |
"define the style of the handle; |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
1076 |
styleSymbol may be #motif to draw a little knob or |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
1077 |
anything else to draw scrollBars handleForm. |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
1078 |
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
|
1079 |
individual views to be manipulated." |
295 | 1080 |
|
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
1081 |
(styleSymbol ~~ handleStyle) ifTrue:[ |
722
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1082 |
handleStyle := styleSymbol. |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1083 |
handleStyle == #next ifTrue:[ |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1084 |
shadowForm := self class shadowFormOn:device. |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1085 |
lightForm := self class lightFormOn:device. |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1086 |
] ifFalse:[ |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1087 |
shadowForm := lightForm := nil |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1088 |
]. |
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
1089 |
|
722
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1090 |
shadowForm notNil ifTrue:[ |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1091 |
(self is3D and:[handleStyle ~~ #motif]) ifTrue:[ |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1092 |
self barHeight:(shadowForm height + 2). |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1093 |
barWidth := shadowForm width |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1094 |
] |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1095 |
]. |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1096 |
shown ifTrue:[ |
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1097 |
self resizeSubviews. |
2623 | 1098 |
self redrawIfShown. |
722
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1099 |
] |
295 | 1100 |
] |
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
1101 |
|
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
1102 |
"Created: 24.2.1996 / 19:04:07 / cg" |
722
3f297a438fec
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
593
diff
changeset
|
1103 |
"Modified: 29.5.1996 / 16:22:24 / cg" |
295 | 1104 |
! |
1105 |
||
1948 | 1106 |
setBarHeight:nPixel |
4187 | 1107 |
"check whether snap matches to extent of bar otherwise disable snap" |
1108 |
||
2179 | 1109 |
snapAdornment notNil ifTrue:[ |
4187 | 1110 |
barHeight := nPixel max:(snapAdornment height ? 0) |
2179 | 1111 |
] ifFalse:[ |
1112 |
barHeight := nPixel max:0 |
|
1113 |
]. |
|
1948 | 1114 |
|
2108
b9322a905330
resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents:
2084
diff
changeset
|
1115 |
realized ifTrue:[ |
2179 | 1116 |
self resizeSubviews |
2108
b9322a905330
resize when the barWidth is changed while already visible.
Claus Gittinger <cg@exept.de>
parents:
2084
diff
changeset
|
1117 |
] |
1948 | 1118 |
|
4187 | 1119 |
"Modified: / 31-10-2010 / 13:00:06 / cg" |
1948 | 1120 |
! |
1121 |
||
2114 | 1122 |
showHandle |
4206
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1123 |
"handle-drawing enabled/disable; a Boolean" |
2114 | 1124 |
|
1125 |
^ showHandle |
|
4206
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1126 |
|
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1127 |
"Modified: / 19-12-2010 / 09:28:31 / cg" |
2114 | 1128 |
! |
1129 |
||
1130 |
showHandle:aBoolean |
|
1131 |
"enabled/disable the handle-drawing" |
|
1132 |
||
2244 | 1133 |
showHandle ~~ aBoolean ifTrue:[ |
1134 |
showHandle := aBoolean ? DefaultShowHandle. |
|
4206
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1135 |
self invalidate. "/ redrawIfShown |
2242
1aea02d32c96
snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
1136 |
] |
4206
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1137 |
|
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1138 |
"Modified: / 19-12-2010 / 09:30:49 / cg" |
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 |
|
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1141 |
showHandleWhenEntered |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1142 |
"return aBoolean" |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1143 |
|
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1144 |
^ showHandleWhenEntered |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1145 |
|
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1146 |
"Created: / 19-12-2010 / 09:27:40 / cg" |
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 |
|
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1149 |
showHandleWhenEntered:aBoolean |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1150 |
"enabled/disable the handle-drawing" |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1151 |
|
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1152 |
showHandleWhenEntered ~~ aBoolean ifTrue:[ |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1153 |
showHandleWhenEntered := aBoolean ? DefaultShowHandleWhenEntered. |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1154 |
self invalidate. "/ redrawIfShown |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1155 |
] |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1156 |
|
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1157 |
"Created: / 19-12-2010 / 09:28:04 / cg" |
2114 | 1158 |
! |
1159 |
||
2228
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1160 |
snapHandlePosition |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1161 |
"return the position of the snap-handle" |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1162 |
|
2242
1aea02d32c96
snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
1163 |
^ self handlePosition. "/ ^ snapHandlePosition |
2228
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1164 |
! |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1165 |
|
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1166 |
snapHandlePosition:aSymbol |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1167 |
"define the position of the snap-handle; the argument aSymbol |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1168 |
may be one of #left, #right or #center. |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1169 |
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
|
1170 |
|
2242
1aea02d32c96
snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
1171 |
self handlePosition:aSymbol. |
1aea02d32c96
snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
1172 |
|
1aea02d32c96
snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
1173 |
"/ snapHandlePosition := aSymbol. |
1aea02d32c96
snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
1174 |
"/ realized ifTrue:[ |
1aea02d32c96
snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
1175 |
"/ self invalidate |
1aea02d32c96
snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
1176 |
"/ ] |
2228
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1177 |
! |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1178 |
|
2179 | 1179 |
snapMode |
1180 |
"allowed modes are: |
|
1181 |
nil no snap |
|
1182 |
||
1183 |
#max on press the view is increased to bottom(vertical) or right(horizontal) |
|
1184 |
#min on press the view is decreased to top (vertical) or left (horizontal) |
|
1185 |
#maxMin on press the view is increased or decreased dependent on its current extent |
|
1186 |
#minMax on press the view is increased or decreased dependent on its current extent |
|
1187 |
" |
|
1188 |
snapAdornment notNil ifTrue:[ |
|
4187 | 1189 |
^ snapAdornment mode |
2179 | 1190 |
]. |
1191 |
^ nil |
|
1192 |
||
4187 | 1193 |
"Modified: / 31-10-2010 / 13:00:16 / cg" |
2179 | 1194 |
! |
1195 |
||
1196 |
snapMode:aMode |
|
1197 |
"allowed modes are: |
|
1198 |
nil no snap |
|
1199 |
||
1200 |
#max on press the view is increased to bottom(vertical) or right(horizontal) |
|
1201 |
#min on press the view is decreased to top (vertical) or left (horizontal) |
|
1202 |
#maxMin on press the view is increased or decreased dependent on its current extent |
|
1203 |
#minMax on press the view is increased or decreased dependent on its current extent |
|
1204 |
" |
|
1205 |
|oldHeight oldMode| |
|
1206 |
||
1207 |
aMode notNil ifTrue:[ |
|
2236 | 1208 |
( #( max min maxMin minMax both) includes:aMode) ifFalse:[ |
2179 | 1209 |
^ self error:('unknown snapMode: ', aMode printString). |
1210 |
] |
|
1211 |
]. |
|
1212 |
(oldMode := self snapMode) == aMode ifTrue:[^ self]. |
|
1213 |
||
1214 |
(snapAdornment notNil and:[aMode notNil]) ifTrue:[ |
|
1215 |
"must only redraw" |
|
4187 | 1216 |
snapAdornment mode:aMode |
2179 | 1217 |
] ifFalse:[ |
1218 |
"must recompute barHeight and redraw" |
|
1219 |
||
1220 |
aMode isNil ifTrue:[ |
|
1221 |
snapAdornment := nil |
|
1222 |
] ifFalse:[ |
|
1223 |
self initSnapAdornment. |
|
4187 | 1224 |
snapAdornment mode:aMode. |
2179 | 1225 |
]. |
1226 |
oldHeight := barHeight. |
|
1227 |
||
1228 |
self computeBarHeight. |
|
1229 |
||
1230 |
oldHeight ~~ barHeight ifTrue:[ |
|
1231 |
"must recompute subViews" |
|
1232 |
self setupSubviews. |
|
1233 |
self resizeSubviews. |
|
1234 |
] |
|
1235 |
]. |
|
4187 | 1236 |
self redrawIfShown. |
1237 |
||
1238 |
"Modified: / 31-10-2010 / 13:00:39 / cg" |
|
2179 | 1239 |
! |
1240 |
||
295 | 1241 |
style:styleSymbol |
1242 |
"define the style of the handle; |
|
1243 |
styleSymbol may be #motif to draw a little knob or |
|
1244 |
anything else to draw scrollBars handleForm. |
|
1245 |
Normally, this is defined via styleSheet files, but this entry allows |
|
1246 |
individual views to be manipulated." |
|
1247 |
||
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
1248 |
self handleStyle:styleSymbol |
295 | 1249 |
|
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
1250 |
"Modified: 24.2.1996 / 19:04:19 / cg" |
295 | 1251 |
! ! |
1252 |
||
2288 | 1253 |
!VariablePanel methodsFor:'adding & removing components'! |
1254 |
||
1255 |
addSubView:aView |
|
1256 |
"a view is added; adjust other subviews sizes" |
|
1257 |
||
1258 |
super addSubView:aView. |
|
1259 |
||
1260 |
realized ifTrue:[ |
|
2482 | 1261 |
self setupSubviews. |
2288 | 1262 |
self resizeSubviews. |
2483 | 1263 |
aView beVisible. |
2288 | 1264 |
] |
1265 |
||
1266 |
"Created: 17.1.1996 / 22:41:00 / cg" |
|
1267 |
"Modified: 24.2.1996 / 19:05:05 / cg" |
|
1268 |
! |
|
1269 |
||
1270 |
removeSubView:aView |
|
1271 |
"a view is removed; adjust other subviews sizes" |
|
1272 |
||
2483 | 1273 |
aView beInvisible. |
2288 | 1274 |
super removeSubView:aView. |
2483 | 1275 |
shown ifTrue:[ |
1276 |
realized |
|
1277 |
"/ (superView isNil or:[superView shown]) |
|
1278 |
ifTrue:[ |
|
2288 | 1279 |
self setupSubviews. |
1280 |
self resizeSubviews. |
|
1281 |
] |
|
1282 |
] |
|
1283 |
! ! |
|
1284 |
||
295 | 1285 |
!VariablePanel methodsFor:'drawing'! |
1286 |
||
871 | 1287 |
drawHandle:hIndex atX:hx y:hy |
295 | 1288 |
"draw a single handle at hx/hy" |
1289 |
||
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1290 |
|h w x y m xm ym lbl maxKnob |
1096 | 1291 |
mar "{ Class: SmallInteger }" |
1292 |
barWidthInt "{ Class: SmallInteger }" |
|
1293 |
barHeightInt "{ Class: SmallInteger }" | |
|
295 | 1294 |
|
1981
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1295 |
((handleStyle isNil or:[handleStyle == #none]) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1296 |
and:[handleLabels isNil]) ifTrue:[^ self]. |
396
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
1297 |
|
1096 | 1298 |
mar := margin. |
1299 |
barHeightInt := barHeight. |
|
1300 |
barWidthInt := barWidth. |
|
871 | 1301 |
|
295 | 1302 |
shadowForm notNil ifTrue:[ |
871 | 1303 |
h := shadowForm height. |
1304 |
w := shadowForm width . |
|
1096 | 1305 |
maxKnob := h min:barHeightInt. |
295 | 1306 |
] ifFalse:[ |
1096 | 1307 |
maxKnob := knobHeight min: barHeightInt. |
876 | 1308 |
maxKnob := maxKnob max:4. |
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1309 |
handleStyle == #full ifTrue:[ |
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1310 |
w := h := maxKnob |
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1311 |
] ifFalse:[ |
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1312 |
w := h := maxKnob - 4. |
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1313 |
] |
295 | 1314 |
]. |
1315 |
||
1316 |
self paint:viewBackground. |
|
1131 | 1317 |
self lineStyle:#solid. |
1318 |
||
295 | 1319 |
orientation == #vertical ifTrue:[ |
1096 | 1320 |
self fillRectangleX:mar y:hy |
1321 |
width:(width - mar - mar) |
|
1322 |
height:barHeightInt. |
|
2623 | 1323 |
(handleStyle notNil |
1324 |
and:[handleStyle ~~ #none]) ifTrue:[ |
|
1981
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1325 |
(handleStyle ~~ #normal |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1326 |
and:[handleStyle ~~ #mswindows]) ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1327 |
m := (maxKnob - h) // 2. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1328 |
|
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1329 |
shadowForm isNil ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1330 |
|
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1331 |
y := hy + (barHeightInt // 2). "/ center of the bar |
871 | 1332 |
|
1981
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1333 |
separatingLine ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1334 |
self paint:shadowColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1335 |
self displayLineFromX:mar y:y toX:(width - mar) y:y. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1336 |
y := y + 1. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1337 |
self paint:lightColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1338 |
self displayLineFromX:mar y:y toX:(width - mar) y:y. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1339 |
self paint:viewBackground. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1340 |
]. |
876 | 1341 |
|
1981
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1342 |
self fillRectangleX:(hx - barWidthInt) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1343 |
y:hy |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1344 |
width:(barWidthInt + barWidthInt) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1345 |
height:h. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1346 |
|
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1347 |
handleStyle == #line ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1348 |
self paint:handleColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1349 |
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
|
1350 |
] ifFalse:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1351 |
y := hy. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1352 |
handleStyle == #st80 ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1353 |
y := y - 1 |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1354 |
]. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1355 |
ym := y + m. |
295 | 1356 |
|
1981
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1357 |
handleStyle == #full ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1358 |
handleLevel ~~ 0 ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1359 |
self |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1360 |
drawEdgesForX:0 "/ -(handleLevel abs) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1361 |
y:ym "/-1 |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1362 |
width:width "/+(handleLevel+handleLevel)abs |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1363 |
height:h-2 |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1364 |
level:handleLevel |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1365 |
shadow:shadowColor |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1366 |
light:lightColor |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1367 |
halfShadow:nil |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1368 |
halfLight:nil |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1369 |
style:nil |
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 |
] ifFalse:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1372 |
handleLevel ~~ 0 ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1373 |
self drawEdgesForX:(hx - barWidthInt) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1374 |
y:ym |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1375 |
width:(barWidthInt + barWidthInt) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1376 |
height:h |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1377 |
level:handleLevel. |
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 |
handleStyle == #iris ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1381 |
self paint:handleColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1382 |
self fillDeviceRectangleX:(hx - barWidthInt + 2) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1383 |
y:(ym + 2) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1384 |
width:(barWidthInt + barWidthInt - 4) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1385 |
height:h - 4 |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1386 |
] |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1387 |
] |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1388 |
]. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1389 |
] ifFalse:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1390 |
y := hy. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1391 |
(shadowForm notNil or:[lightForm notNil]) ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1392 |
self drawHandleFormAtX:hx y:(y + m) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1393 |
] |
871 | 1394 |
]. |
1096 | 1395 |
|
1981
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1396 |
handleStyle == #st80 ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1397 |
y := hy - 1. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1398 |
self paint:lightColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1399 |
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
|
1400 |
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
|
1401 |
y := hy + knobHeight - 2. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1402 |
self paint:shadowColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1403 |
self displayLineFromX:mar y:y toX:(width - mar) y:y. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1404 |
"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
|
1405 |
" VVV" |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1406 |
self displayLineFromX:width-1 y:hy" "-1" " toX:width-1 y:(hy + knobHeight - 1 - 1). |
871 | 1407 |
]. |
1408 |
] ifFalse:[ |
|
1981
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1409 |
y := hy + barHeightInt - 1. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1410 |
self paint:handleColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1411 |
separatingLine ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1412 |
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
|
1413 |
self displayLineFromX:0 y:y toX:width y:y. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1414 |
]. |
2623 | 1415 |
self fillRectangleX:hx y:hy width:barWidthInt height:barHeightInt. |
871 | 1416 |
]. |
1417 |
]. |
|
1418 |
lbl := self handleLabelAt:hIndex. |
|
1419 |
lbl notNil ifTrue:[ |
|
1420 |
hIndex ~~ 1 ifTrue:[ |
|
1421 |
self paint:Color black. |
|
2734
ba7f56186e88
correct use of ascentOn: for display
Claus Gittinger <cg@exept.de>
parents:
2650
diff
changeset
|
1422 |
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
|
1423 |
"/ lbl isImageOrForm ifTrue:[ |
ba7f56186e88
correct use of ascentOn: for display
Claus Gittinger <cg@exept.de>
parents:
2650
diff
changeset
|
1424 |
"/ lbl displayOn:self x:mar y:hy |
ba7f56186e88
correct use of ascentOn: for display
Claus Gittinger <cg@exept.de>
parents:
2650
diff
changeset
|
1425 |
"/ ] ifFalse:[ |
ba7f56186e88
correct use of ascentOn: for display
Claus Gittinger <cg@exept.de>
parents:
2650
diff
changeset
|
1426 |
"/ 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
|
1427 |
"/ ] |
871 | 1428 |
] |
1429 |
]. |
|
1430 |
||
295 | 1431 |
] ifFalse:[ |
1096 | 1432 |
self fillRectangleX:hx y:mar |
1433 |
width:barHeightInt |
|
1434 |
height:(height - mar - mar). |
|
876 | 1435 |
|
2623 | 1436 |
(handleStyle notNil |
1437 |
and:[handleStyle ~~ #none]) ifTrue:[ |
|
1981
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1438 |
(handleStyle ~~ #normal |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1439 |
and:[handleStyle ~~ #mswindows]) ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1440 |
m := (barHeightInt - w) // 2. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1441 |
m := (maxKnob - w) // 2. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1442 |
shadowForm isNil ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1443 |
x := hx + (barHeightInt // 2). |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1444 |
separatingLine ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1445 |
self paint:shadowColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1446 |
self displayLineFromX:x y:mar toX:x y:(height - mar). |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1447 |
x := x + 1. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1448 |
self paint:lightColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1449 |
self displayLineFromX:x y:mar toX:x y:(height - mar). |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1450 |
self paint:viewBackground. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1451 |
]. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1452 |
self fillRectangleX:hx y:(hy - barWidthInt) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1453 |
width:w |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1454 |
height:(barWidthInt + barWidthInt). |
295 | 1455 |
|
1981
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1456 |
handleStyle == #line ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1457 |
self paint:handleColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1458 |
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
|
1459 |
] ifFalse:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1460 |
x := hx. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1461 |
handleStyle == #st80 ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1462 |
x := x - 1. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1463 |
]. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1464 |
xm := x + m. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1465 |
handleStyle == #full ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1466 |
handleLevel ~~ 0 ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1467 |
self |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1468 |
drawEdgesForX:xm "/-1 |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1469 |
y:0 "/ -handleLevel |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1470 |
width:w-2 |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1471 |
height:height "/ +handleLevel+handleLevel |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1472 |
level:handleLevel |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1473 |
shadow:shadowColor |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1474 |
light:lightColor |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1475 |
halfShadow:nil |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1476 |
halfLight:nil |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1477 |
style:nil |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1478 |
] |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1479 |
] ifFalse:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1480 |
handleLevel ~~ 0 ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1481 |
self drawEdgesForX:xm |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1482 |
y:(hy - barWidthInt) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1483 |
width:w |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1484 |
height:(barWidthInt + barWidthInt) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1485 |
level:handleLevel. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1486 |
]. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1487 |
handleStyle == #iris ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1488 |
self paint:handleColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1489 |
self fillDeviceRectangleX:(xm + 2) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1490 |
y:(hy - barWidthInt + 2) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1491 |
width:w - 4 |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1492 |
height:(barWidthInt + barWidthInt - 4) |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1493 |
]. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1494 |
]. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1495 |
] |
871 | 1496 |
] ifFalse:[ |
1497 |
x := hx. |
|
1981
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1498 |
(shadowForm notNil or:[lightForm notNil]) ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1499 |
self drawHandleFormAtX:(x + m) y:hy |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1500 |
] |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1501 |
]. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1502 |
handleStyle == #st80 ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1503 |
x := hx - 1. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1504 |
self paint:lightColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1505 |
self displayLineFromX:x y:mar toX:x y:(height - mar). |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1506 |
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
|
1507 |
x := hx + barHeightInt - 2. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1508 |
self paint:shadowColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1509 |
self displayLineFromX:x y:mar toX:x y:(height - mar). |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1510 |
"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
|
1511 |
" VVV" |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1512 |
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
|
1513 |
]. |
871 | 1514 |
] ifFalse:[ |
1981
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1515 |
x := hx + barHeightInt - 1. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1516 |
self paint:handleColor. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1517 |
separatingLine ifTrue:[ |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1518 |
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
|
1519 |
self displayLineFromX:x y:0 toX:x y:height. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1520 |
]. |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1521 |
self fillRectangleX:hx y:hy width:barHeightInt height:barWidthInt |
15a646f9e4fb
error: vs. error:mayProceed:
Claus Gittinger <cg@exept.de>
parents:
1948
diff
changeset
|
1522 |
] |
871 | 1523 |
] |
295 | 1524 |
]. |
1525 |
||
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1526 |
"Modified: / 29.7.1998 / 22:48:33 / cg" |
295 | 1527 |
! |
1528 |
||
1529 |
drawHandleFormAtX:hx y:hy |
|
1530 |
"draw a handles bitmap at hx/hy" |
|
1531 |
||
876 | 1532 |
shadowForm notNil ifTrue:[ |
1533 |
self paint:shadowColor. |
|
1534 |
self displayForm:shadowForm x:hx y:hy. |
|
1535 |
]. |
|
1536 |
lightForm notNil ifTrue:[ |
|
1537 |
self paint:lightColor. |
|
1538 |
self displayForm:lightForm x:hx y:hy. |
|
1539 |
]. |
|
295 | 1540 |
self paint:viewBackground |
876 | 1541 |
|
1542 |
"Modified: 7.11.1996 / 20:25:33 / cg" |
|
295 | 1543 |
! |
1544 |
||
2179 | 1545 |
drawSnapAt:anIndex |
4187 | 1546 |
"draw the snap for a handle at an index" |
1547 |
||
1548 |
|snapLayout icon level offLevel paint canChangeExtent |
|
2179 | 1549 |
left "{ Class:SmallInteger }" |
1550 |
top "{ Class:SmallInteger }" |
|
1551 |
width "{ Class:SmallInteger }" |
|
1552 |
height "{ Class:SmallInteger }" |
|
4187 | 1553 |
snapMode leftEdge wEdge topEdge hEdge part wPart hPart| |
1554 |
||
1555 |
(snapLayout := self snapLayoutAt:anIndex) isNil ifTrue:[ |
|
2179 | 1556 |
"snap disabled" |
1557 |
^ self |
|
1558 |
]. |
|
1559 |
||
4187 | 1560 |
left := snapLayout left. |
1561 |
top := snapLayout top. |
|
1562 |
width := snapLayout width. |
|
1563 |
height := snapLayout height. |
|
2236 | 1564 |
snapMode := self snapMode. |
2179 | 1565 |
|
4187 | 1566 |
offLevel := level := (snapAdornment level ? 0). |
2238 | 1567 |
|
2179 | 1568 |
canChangeExtent := self canChangeExtentOfViewAt:anIndex. |
1569 |
canChangeExtent ifTrue:[ |
|
1570 |
(controller isSnapEntered:anIndex) ifTrue:[ |
|
1571 |
controller isSnapPressed ifTrue:[ |
|
4187 | 1572 |
level := snapAdornment selectedLevel ? 0. |
1573 |
paint := snapAdornment selectedBgColor. |
|
2179 | 1574 |
] ifFalse:[ |
4187 | 1575 |
level := snapAdornment enterLevel ? 0. |
1576 |
paint := snapAdornment enterBgColor. |
|
2238 | 1577 |
]. |
2179 | 1578 |
] |
1579 |
]. |
|
4187 | 1580 |
paint isNil ifTrue:[ |
1581 |
paint := viewBackground. |
|
2179 | 1582 |
]. |
4187 | 1583 |
|
2179 | 1584 |
self paint:paint. |
1585 |
||
4187 | 1586 |
"/ level == 0 ifTrue:[ |
1587 |
"/ ]. |
|
2238 | 1588 |
|
1589 |
self fillRectangleX:left+1 y:top+1 width:width-2 height:height-2. |
|
2179 | 1590 |
|
1591 |
level ~~ 0 ifTrue:[ |
|
2236 | 1592 |
leftEdge := left + 1. |
2240 | 1593 |
wEdge := wPart := width - 2. |
2236 | 1594 |
topEdge := top + 1. |
2240 | 1595 |
hEdge := hPart := height - 2. |
2236 | 1596 |
|
2238 | 1597 |
orientation == #vertical ifTrue:[ |
1598 |
wPart := width // 3. |
|
1599 |
] ifFalse:[ |
|
1600 |
hPart := height // 3. |
|
1601 |
]. |
|
1602 |
||
2236 | 1603 |
level < 0 ifTrue:[ |
1604 |
part := (self subViews at:anIndex) objectAttributeAt:#snapPart. |
|
1605 |
part == #left ifTrue:[ |
|
2238 | 1606 |
self drawEdgesForX:leftEdge y:topEdge width:wEdge height:hEdge level:offLevel. |
2243 | 1607 |
wPart := wPart + 1. |
2236 | 1608 |
] ifFalse:[ |
1609 |
part == #middle ifTrue:[ |
|
2238 | 1610 |
self drawEdgesForX:leftEdge y:topEdge width:wEdge height:hEdge level:offLevel. |
2240 | 1611 |
orientation == #vertical ifTrue:[ |
1612 |
leftEdge := leftEdge + wPart. |
|
1613 |
] ifFalse:[ |
|
1614 |
topEdge := topEdge + hPart. |
|
1615 |
] |
|
2236 | 1616 |
] ifFalse:[ |
1617 |
part == #right ifTrue:[ |
|
2238 | 1618 |
self drawEdgesForX:leftEdge y:topEdge width:wEdge height:hEdge level:offLevel. |
2240 | 1619 |
orientation == #vertical ifTrue:[ |
2243 | 1620 |
leftEdge := leftEdge + (width - wPart - 1). |
2240 | 1621 |
] ifFalse:[ |
2243 | 1622 |
topEdge := topEdge + (height - hPart - 1). |
1623 |
]. |
|
1624 |
wPart := wPart - 1. |
|
2236 | 1625 |
] |
1626 |
] |
|
1627 |
]. |
|
2240 | 1628 |
wEdge := wPart. |
1629 |
hEdge := hPart. |
|
2236 | 1630 |
]. |
1631 |
self drawEdgesForX:leftEdge y:topEdge width:wEdge height:hEdge level:level. |
|
2179 | 1632 |
]. |
1633 |
||
1634 |
canChangeExtent ifFalse:[^ self]. |
|
1635 |
||
2236 | 1636 |
snapMode == #both ifTrue:[ |
4187 | 1637 |
icon := (orientation == #vertical) |
1638 |
ifTrue:[snapAdornment iconUpDown] |
|
1639 |
ifFalse:[snapAdornment iconLeftRight] |
|
2179 | 1640 |
] ifFalse:[ |
2236 | 1641 |
(self snapAtIndexWillGrow:anIndex) ifTrue:[ |
4187 | 1642 |
icon := (orientation == #vertical) |
1643 |
ifTrue:[snapAdornment iconDown] |
|
1644 |
ifFalse:[snapAdornment iconRight] |
|
2236 | 1645 |
] ifFalse:[ |
4187 | 1646 |
icon := (orientation == #vertical) |
1647 |
ifTrue:[snapAdornment iconUp] |
|
1648 |
ifFalse:[snapAdornment iconLeft] |
|
2236 | 1649 |
]. |
2179 | 1650 |
]. |
4187 | 1651 |
|
1652 |
icon displayOn:self x:(left + ((width - icon width) // 2)) |
|
1653 |
y:(top + ((height - icon height) // 2)). |
|
1654 |
||
1655 |
"Modified: / 31-10-2010 / 12:58:27 / cg" |
|
2179 | 1656 |
! |
1657 |
||
295 | 1658 |
invertHandleBarAtX:hx y:hy |
1894 | 1659 |
|doLine oldStyle| |
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1660 |
|
1894 | 1661 |
doLine := (trackLine == #solidLine |
1662 |
or:[trackLine == #dashedLine |
|
1663 |
or:[trackLine == #dottedLine]]). |
|
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1664 |
|
1131 | 1665 |
trackLine == #dashedLine ifTrue:[ |
1894 | 1666 |
oldStyle := lineStyle. |
1131 | 1667 |
self lineStyle:#dashed. |
1894 | 1668 |
] ifFalse:[ |
1669 |
trackLine == #dottedLine ifTrue:[ |
|
1670 |
oldStyle := lineStyle. |
|
1671 |
self lineStyle:#dotted. |
|
1672 |
] |
|
1131 | 1673 |
]. |
1674 |
||
1220 | 1675 |
self clippedByChildren:false. |
1131 | 1676 |
|
295 | 1677 |
self xoring:[ |
1129
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1678 |
|yL xL halfHeight| |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1679 |
|
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1680 |
halfHeight := (barHeight // 2) - 1. |
295 | 1681 |
|
1129
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1682 |
orientation == #vertical ifTrue:[ |
1894 | 1683 |
yL := hy + halfHeight. |
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1684 |
doLine ifTrue:[ |
1129
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1685 |
self displayLineFromX:0 y:yL toX:width y:yL. |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1686 |
] ifFalse:[ |
1130 | 1687 |
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
|
1688 |
] |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1689 |
] ifFalse:[ |
1894 | 1690 |
xL := hx + halfHeight. |
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1691 |
doLine ifTrue:[ |
1129
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1692 |
self displayLineFromX:xL y:0 toX:xL y:height. |
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1693 |
] ifFalse:[ |
1130 | 1694 |
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
|
1695 |
] |
1130 | 1696 |
]. |
295 | 1697 |
]. |
1220 | 1698 |
self clippedByChildren:true. |
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1699 |
|
1894 | 1700 |
oldStyle notNil ifTrue:[ |
1701 |
self lineStyle:oldStyle. |
|
1131 | 1702 |
]. |
1129
17a77892f180
added support for dashed-LineTrack
Claus Gittinger <cg@exept.de>
parents:
1119
diff
changeset
|
1703 |
|
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1704 |
"Modified: / 28.4.1997 / 14:56:26 / dq" |
1894 | 1705 |
"Modified: / 3.5.1999 / 18:49:04 / cg" |
295 | 1706 |
! |
1707 |
||
1708 |
lockRedraw |
|
1709 |
redrawLocked := true |
|
1710 |
! |
|
1711 |
||
1712 |
redrawHandlesFrom:start to:stop |
|
4187 | 1713 |
"redraw some handles and snaps" |
1714 |
||
2179 | 1715 |
subViews size ~~ 0 ifTrue:[ |
2623 | 1716 |
self handleOriginsWithIndexFrom:start to:stop do:[:hPoint :hIndex | |
1717 |
|hx hy| |
|
1718 |
||
1719 |
hx := hPoint x. |
|
1720 |
hy := hPoint y. |
|
1721 |
barLevel notNil ifTrue:[ |
|
1722 |
self drawEdgesForX:0 y:hy width:width height:barHeight level:barLevel. |
|
1723 |
]. |
|
4187 | 1724 |
|
1725 |
"/ do not draw handle, if there is a snapper ... |
|
1726 |
self hasSnapHandle ifTrue:[ |
|
1727 |
self drawSnapAt:hIndex-1 |
|
1728 |
] ifFalse:[ |
|
1729 |
showHandle ifTrue:[ |
|
1730 |
self drawHandle:hIndex atX:hx y:hy. |
|
1731 |
]. |
|
2623 | 1732 |
]. |
2179 | 1733 |
]. |
1734 |
]. |
|
4187 | 1735 |
|
1736 |
"Modified: / 31-10-2010 / 12:43:33 / cg" |
|
295 | 1737 |
! |
1738 |
||
1739 |
unlockRedraw |
|
1740 |
redrawLocked := false |
|
1741 |
! ! |
|
1742 |
||
1159 | 1743 |
!VariablePanel methodsFor:'enumerating subviews'! |
1744 |
||
1745 |
changeSequenceOrderFor:aSubView to:anIndex |
|
3884 | 1746 |
"change a subview's position in the subviews collection." |
1747 |
||
1159 | 1748 |
|success| |
1749 |
||
1750 |
success := super changeSequenceOrderFor:aSubView to:anIndex. |
|
1751 |
success ifTrue:[ |
|
1752 |
self setupSubviews. |
|
1753 |
self resizeSubviews. |
|
1754 |
]. |
|
1755 |
^ success |
|
1756 |
! ! |
|
1757 |
||
295 | 1758 |
!VariablePanel methodsFor:'event handling'! |
1759 |
||
4206
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1760 |
pointerEnter:buttonState x:x y:y |
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:true |
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 pointerEnter:buttonState x:x y:y. |
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:29:51 / 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 |
|
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1769 |
pointerLeave:buttonState |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1770 |
showHandleWhenEntered == true ifTrue:[ |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1771 |
self showHandle:false |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1772 |
]. |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1773 |
super pointerLeave:buttonState. |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1774 |
|
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1775 |
"Created: / 19-12-2010 / 09:30:20 / cg" |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1776 |
! |
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1777 |
|
295 | 1778 |
sizeChanged:how |
1779 |
"my size has changed; resize my subviews" |
|
1780 |
||
2123
33fda8594eee
must resize children if realized;
Claus Gittinger <cg@exept.de>
parents:
2114
diff
changeset
|
1781 |
realized ifTrue:[ |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1782 |
(how == #smaller) ifTrue:[ |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1783 |
self resizeSubviews |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1784 |
] ifFalse:[ |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1785 |
"/ |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1786 |
"/ 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
|
1787 |
"/ |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1788 |
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
|
1789 |
] |
295 | 1790 |
]. |
1791 |
self changed:#sizeOfView with:how. |
|
3670
10c6c46e16c2
dont forget the super-sizeChanged
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
1792 |
superView notNil ifTrue:[ |
10c6c46e16c2
dont forget the super-sizeChanged
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
1793 |
superView subViewChangedSize |
10c6c46e16c2
dont forget the super-sizeChanged
Claus Gittinger <cg@exept.de>
parents:
3463
diff
changeset
|
1794 |
] |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1795 |
|
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1796 |
"Modified: 28.1.1997 / 17:56:30 / cg" |
295 | 1797 |
! ! |
1798 |
||
1821
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1698
diff
changeset
|
1799 |
!VariablePanel methodsFor:'focus handling'! |
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1698
diff
changeset
|
1800 |
|
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1698
diff
changeset
|
1801 |
wantsFocusWithButtonPress |
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1698
diff
changeset
|
1802 |
"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
|
1803 |
|
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1698
diff
changeset
|
1804 |
^ false |
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1698
diff
changeset
|
1805 |
|
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1698
diff
changeset
|
1806 |
|
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1698
diff
changeset
|
1807 |
! ! |
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1698
diff
changeset
|
1808 |
|
2288 | 1809 |
!VariablePanel methodsFor:'initialization & release'! |
295 | 1810 |
|
871 | 1811 |
computeBarHeight |
958 | 1812 |
"compute the height if the separating bar from either the |
1813 |
form or an explicit height given in the styleSheet" |
|
1814 |
||
1550 | 1815 |
<resource: #style (#'variablePanel.barHeight' |
1816 |
#'variablePanel.barHeightMM')> |
|
924
81f3ca4512bd
allow barHeight to be set in the styleSheet
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1817 |
|
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1818 |
|bH h lvl| |
871 | 1819 |
|
876 | 1820 |
shadowForm notNil ifTrue:[ |
871 | 1821 |
bH := shadowForm height + 2. |
1822 |
] ifFalse:[ |
|
1869 | 1823 |
bH := styleSheet at:#'variablePanel.barHeight'. |
924
81f3ca4512bd
allow barHeight to be set in the styleSheet
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1824 |
bH isNil ifTrue:[ |
1869 | 1825 |
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
|
1826 |
bH := (h * device verticalPixelPerMillimeter) rounded. |
81f3ca4512bd
allow barHeight to be set in the styleSheet
Claus Gittinger <cg@exept.de>
parents:
900
diff
changeset
|
1827 |
]. |
871 | 1828 |
]. |
1869 | 1829 |
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
|
1830 |
lvl ~~ 0 ifTrue:[ |
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1831 |
bH := bH + (lvl abs * 2). |
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1832 |
]. |
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1833 |
|
876 | 1834 |
self barHeight:bH. |
871 | 1835 |
knobHeight := bH. |
1836 |
||
1837 |
handleLabels notNil ifTrue:[ |
|
1987 | 1838 |
font := font onDevice:device. |
871 | 1839 |
bH := handleLabels inject:bH into:[:maxSoFar :thisLabel | |
874 | 1840 |
thisLabel isNil ifTrue:[ |
1841 |
maxSoFar |
|
1842 |
] ifFalse:[ |
|
1843 |
maxSoFar max:(thisLabel heightOn:self) |
|
1844 |
] |
|
1845 |
]. |
|
871 | 1846 |
bH := bH + font descent - 1 |
1847 |
]. |
|
1848 |
||
1849 |
self barHeight:bH. |
|
1850 |
||
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1851 |
"Modified: / 29.7.1998 / 14:47:21 / cg" |
871 | 1852 |
! |
1853 |
||
295 | 1854 |
defaultControllerClass |
1855 |
^ VariablePanelController |
|
1856 |
! |
|
1857 |
||
1858 |
initCursor |
|
1859 |
"set the cursor - a double arrow" |
|
1860 |
||
1698
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
1861 |
cursor := self class |
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
1862 |
cursorForOrientation:orientation |
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
1863 |
onDevice:device |
900 | 1864 |
|
1698
cab69c6081a8
use windows-like cursors if running on windows
Claus Gittinger <cg@exept.de>
parents:
1655
diff
changeset
|
1865 |
"Modified: / 30.9.1998 / 18:20:35 / cg" |
295 | 1866 |
! |
1867 |
||
1868 |
initStyle |
|
966 | 1869 |
"setup viewStyle specifics" |
1870 |
||
871 | 1871 |
|mm| |
295 | 1872 |
|
1873 |
super initStyle. |
|
1874 |
||
1987 | 1875 |
handleColor := DefaultHandleColor onDevice:device. |
295 | 1876 |
|
1877 |
DefaultHandleStyle isNil ifTrue:[ |
|
496 | 1878 |
handleStyle := styleSheet name |
295 | 1879 |
] ifFalse:[ |
496 | 1880 |
handleStyle := DefaultHandleStyle |
295 | 1881 |
]. |
1882 |
||
496 | 1883 |
handleLevel := DefaultHandleLevel. |
1884 |
showHandle := DefaultShowHandle. |
|
4206
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1885 |
showHandleWhenEntered := DefaultShowHandleWhenEntered. |
295 | 1886 |
handlePosition := DefaultHandlePosition. |
2242
1aea02d32c96
snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
1887 |
"/ snapHandlePosition := DefaultSnapHandlePosition. |
295 | 1888 |
trackLine := DefaultTrackingLine. |
1889 |
separatingLine := DefaultSeparatingLine. |
|
1890 |
||
1529
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1891 |
DefaultHandleImage notNil ifTrue:[ |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1892 |
shadowForm := DefaultHandleImage onDevice:device. |
496 | 1893 |
barWidth := shadowForm width. |
295 | 1894 |
] ifFalse:[ |
1529
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1895 |
handleStyle == #next ifTrue:[ |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1896 |
DefaultHandleImage notNil ifTrue:[ |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1897 |
shadowForm := DefaultHandleImage onDevice:device. |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1898 |
] ifFalse:[ |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1899 |
shadowForm := self class shadowFormOn:device. |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1900 |
lightForm := self class lightFormOn:device. |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1901 |
]. |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1902 |
barWidth := shadowForm width. |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1903 |
] ifFalse:[ |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1904 |
shadowForm := lightForm := nil. |
496 | 1905 |
|
1529
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1906 |
mm := device verticalPixelPerMillimeter. |
509edab0a08b
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1416
diff
changeset
|
1907 |
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
|
1908 |
]. |
295 | 1909 |
]. |
871 | 1910 |
self computeBarHeight. |
496 | 1911 |
|
295 | 1912 |
handleStyle == #mswindows ifTrue:[ |
496 | 1913 |
barWidth := (ArrowButton new direction:#up) width + 1 |
295 | 1914 |
]. |
496 | 1915 |
|
4206
570f1a1e587e
preps for dynamic handle visibility
Claus Gittinger <cg@exept.de>
parents:
4187
diff
changeset
|
1916 |
"Modified: / 19-12-2010 / 09:31:29 / cg" |
295 | 1917 |
! |
1918 |
||
1919 |
initialize |
|
496 | 1920 |
orientation isNil ifTrue:[orientation := #vertical]. |
295 | 1921 |
super initialize. |
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1922 |
self bitGravity:nil. |
496 | 1923 |
|
1628
d5065006e796
fixed / beautified #full handleStyle (used with win95 style)
Claus Gittinger <cg@exept.de>
parents:
1551
diff
changeset
|
1924 |
"Modified: / 29.7.1998 / 16:07:23 / cg" |
295 | 1925 |
! ! |
1926 |
||
1927 |
!VariablePanel methodsFor:'private'! |
|
1928 |
||
1929 |
anyNonRelativeSubviews |
|
1930 |
"return true, if any of my subviews has no relative origin/extent" |
|
1931 |
||
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1932 |
self subViews do:[:aComponent | |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1933 |
aComponent relativeCorner isNil ifTrue:[^ true]. |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1934 |
aComponent relativeOrigin isNil ifTrue:[^ true] |
295 | 1935 |
]. |
1936 |
^ false |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1937 |
|
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1938 |
"Modified: 28.1.1997 / 17:57:26 / cg" |
295 | 1939 |
! |
1940 |
||
1655 | 1941 |
expandSubView:expandedView |
1942 |
"expand one of my subviews to full size" |
|
1943 |
||
1944 |
|pos subViews| |
|
1945 |
||
1946 |
realRelativeSizes notNil ifTrue:[ |
|
1947 |
"/ already expanded .. |
|
1948 |
^ self |
|
1949 |
]. |
|
1950 |
||
1951 |
pos := 0.0. |
|
1952 |
subViews := self subViews. |
|
1953 |
||
1954 |
orientation == #vertical ifTrue:[ |
|
1955 |
realRelativeSizes := subViews collect:[:v | v relativeCorner y - v relativeOrigin y]. |
|
1956 |
] ifFalse:[ |
|
1957 |
realRelativeSizes := subViews collect:[:v | v relativeCorner x - v relativeOrigin x]. |
|
1958 |
]. |
|
1959 |
||
1960 |
subViews do:[:aSubView | |
|
1961 |
aSubView == expandedView ifTrue:[ |
|
1962 |
aSubView origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
1963 |
pos := 1.0 |
|
1964 |
] ifFalse:[ |
|
3463 | 1965 |
aSubView beInvisible. |
1966 |
||
1655 | 1967 |
orientation == #vertical ifTrue:[ |
1968 |
aSubView origin:(0.0 @ pos) corner:(1.0 @ pos) |
|
1969 |
] ifFalse:[ |
|
1970 |
aSubView origin:(pos @ 0.0) corner:(pos @ 1.0) |
|
1971 |
] |
|
1972 |
] |
|
1973 |
]. |
|
1974 |
self resizeSubviews. |
|
1975 |
||
1976 |
"Modified: 28.1.1997 / 17:56:20 / cg" |
|
1977 |
! |
|
1978 |
||
871 | 1979 |
handleLabelAt:hIndex |
1980 |
handleLabels notNil ifTrue:[ |
|
1981 |
^ handleLabels at:hIndex ifAbsent:nil |
|
1982 |
]. |
|
1983 |
^ nil |
|
1984 |
! |
|
1985 |
||
1986 |
handleOriginsWithIndexDo:aBlock |
|
295 | 1987 |
"evaluate the argument block for every handle-origin" |
1988 |
||
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1989 |
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
|
1990 |
|
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1991 |
"Modified: 28.1.1997 / 17:53:44 / cg" |
295 | 1992 |
! |
1993 |
||
871 | 1994 |
handleOriginsWithIndexFrom:start to:stop do:aBlock |
295 | 1995 |
"evaluate the argument block for some handle-origins" |
1996 |
||
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
1997 |
|x y hw hh hDelta vDelta subViews |
295 | 1998 |
first "{ Class: SmallInteger }" |
1999 |
last "{ Class: SmallInteger }"| |
|
2000 |
||
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2001 |
(subViews := self subViews) notNil ifTrue:[ |
871 | 2002 |
shadowForm notNil ifTrue:[ |
2003 |
hw := shadowForm width. |
|
2004 |
hh := shadowForm height. |
|
2005 |
] ifFalse:[ |
|
2006 |
hw := hh := barWidth |
|
2007 |
]. |
|
295 | 2008 |
|
871 | 2009 |
(handleStyle ~~ #normal and:[handleStyle ~~ #mswindows]) ifTrue:[ |
2010 |
hDelta := barWidth // 2. |
|
2011 |
vDelta := barWidth // 2. |
|
2012 |
] ifFalse:[ |
|
2013 |
hDelta := vDelta := 0 |
|
2014 |
]. |
|
295 | 2015 |
|
871 | 2016 |
(handlePosition == #left) ifTrue:[ |
2017 |
x := hDelta. |
|
1381 | 2018 |
y := vDelta. |
2019 |
||
2020 |
orientation == #vertical ifTrue:[ |
|
2021 |
x := x + barWidth |
|
2022 |
] ifFalse:[ |
|
2023 |
y := y + barWidth |
|
2024 |
]. |
|
2025 |
margin ~~ 0 ifTrue:[ |
|
2026 |
x := x + 2 |
|
2027 |
]. |
|
871 | 2028 |
] ifFalse:[ |
2029 |
(handlePosition == #right) ifTrue:[ |
|
2030 |
x := width - hw - margin - hDelta. |
|
2031 |
y := height - hh - margin - vDelta. |
|
2032 |
] ifFalse:[ |
|
2033 |
x := width - barWidth // 2. |
|
2034 |
y := height - barWidth // 2 |
|
2035 |
] |
|
2036 |
]. |
|
2037 |
first := start + 1. |
|
2038 |
last := stop. |
|
1381 | 2039 |
|
871 | 2040 |
first to:last do:[:index | |
2041 |
|view| |
|
295 | 2042 |
|
871 | 2043 |
view := subViews at:index. |
2044 |
orientation == #vertical ifTrue:[ |
|
2045 |
y := view top "origin y" - barHeight + 1. |
|
2046 |
] ifFalse:[ |
|
2047 |
x := view left "origin x" - barHeight + 1. |
|
2048 |
]. |
|
2049 |
aBlock value:(x @ y) value:index |
|
2050 |
] |
|
295 | 2051 |
] |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2052 |
|
1381 | 2053 |
"Modified: / 1.11.1997 / 11:53:40 / cg" |
295 | 2054 |
! |
2055 |
||
2623 | 2056 |
redrawIfShown |
2057 |
shown ifTrue:[ |
|
2058 |
self clear. |
|
2059 |
]. |
|
2060 |
self invalidate |
|
2061 |
! |
|
2062 |
||
2026
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2063 |
resizeSubViewsTo:relativeSizeList |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2064 |
"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
|
2065 |
(a collection of relative sizes)" |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2066 |
|
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2067 |
|pos subViews| |
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 |
subViews := self subViews. |
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 |
pos := 0.0. |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2072 |
subViews with:relativeSizeList do:[:aSubView :relSize | |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2073 |
orientation == #vertical ifTrue:[ |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2074 |
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
|
2075 |
] ifFalse:[ |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2076 |
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
|
2077 |
]. |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2078 |
pos := pos + relSize. |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2079 |
]. |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2080 |
self resizeSubviews. |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2081 |
|
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2082 |
! |
9876789dfba7
added interface to change the subViews sizes programmatically.
Claus Gittinger <cg@exept.de>
parents:
1987
diff
changeset
|
2083 |
|
295 | 2084 |
resizeSubviews |
1151
94aff1c7b0aa
Fix comments, eliminate common message sends.
Stefan Vogel <sv@exept.de>
parents:
1131
diff
changeset
|
2085 |
"readjust size of all subviews" |
295 | 2086 |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2087 |
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
|
2088 |
|
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2089 |
"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
|
2090 |
"Modified: 22.3.1997 / 01:01:31 / stefan" |
295 | 2091 |
! |
2092 |
||
2093 |
resizeSubviewsFrom:start to:stop |
|
2094 |
"readjust size of some subviews" |
|
2095 |
||
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2096 |
|step nSubviews subViews| |
295 | 2097 |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2098 |
(subViews := self subViews) size > 0 ifTrue:[ |
871 | 2099 |
(start <= stop) ifTrue:[ |
2100 |
step := 1 |
|
2101 |
] ifFalse:[ |
|
2102 |
step := -1 |
|
2103 |
]. |
|
2104 |
nSubviews := subViews size. |
|
2105 |
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
|
2106 |
|bw view o1 o2 newOrg newCorner newExt| |
295 | 2107 |
|
871 | 2108 |
view := subViews at:index. |
2109 |
bw := view borderWidth. |
|
295 | 2110 |
|
871 | 2111 |
index == 1 ifTrue:[ |
2112 |
o1 := 0. |
|
2113 |
] ifFalse:[ |
|
2114 |
o1 := barHeight // 2 - bw |
|
2115 |
]. |
|
2116 |
index == nSubviews ifTrue:[ |
|
2117 |
o2 := 0. |
|
2118 |
] ifFalse:[ |
|
2119 |
o2 := barHeight // 2 - bw |
|
2120 |
]. |
|
295 | 2121 |
|
871 | 2122 |
newOrg := view computeOrigin. |
2123 |
newOrg notNil ifTrue:[ |
|
2124 |
(index ~~ 1) ifTrue:[ |
|
2125 |
orientation == #vertical ifTrue:[ |
|
2126 |
newOrg y:(newOrg y + o1) |
|
2127 |
] ifFalse:[ |
|
2128 |
newOrg x:(newOrg x + o1) |
|
2129 |
] |
|
2130 |
]. |
|
2131 |
]. |
|
2132 |
newExt := view computeExtent. |
|
2133 |
newExt notNil ifTrue:[ |
|
2134 |
orientation == #vertical ifTrue:[ |
|
2135 |
newExt y:(newExt y - o2 - o1) |
|
2136 |
] ifFalse:[ |
|
2137 |
newExt x:(newExt x - o2 - o1) |
|
2138 |
] |
|
2139 |
]. |
|
2140 |
view pixelOrigin:newOrg extent:newExt. |
|
1550 | 2141 |
]. |
1551 | 2142 |
shown ifTrue:[ |
2143 |
"/ must clear, since handles are copied automatically (by bitGravity) |
|
2144 |
self clear. |
|
2145 |
self invalidate. |
|
2146 |
] |
|
295 | 2147 |
] |
873 | 2148 |
|
2160 | 2149 |
"Modified: / 22.3.1997 / 01:02:21 / stefan" |
2150 |
"Modified: / 23.2.2000 / 18:32:37 / cg" |
|
295 | 2151 |
! |
2152 |
||
1655 | 2153 |
restoreSubViewRatios |
2154 |
"restore my subviews sizes to the state before the full-expand" |
|
2155 |
||
3463 | 2156 |
|pos| |
1655 | 2157 |
|
2158 |
realRelativeSizes == nil ifTrue:[ |
|
2159 |
"/ not expanded - ignore |
|
2160 |
^ self |
|
2161 |
]. |
|
2162 |
||
2163 |
pos := 0.0. |
|
2164 |
self subViews with:realRelativeSizes do:[:aSubView :aRelativeSize | |
|
2165 |
orientation == #vertical ifTrue:[ |
|
2166 |
aSubView origin:(0.0 @ pos) corner:(1.0 @ (pos+aRelativeSize)) |
|
2167 |
] ifFalse:[ |
|
2168 |
aSubView origin:(pos @ 0.0) corner:((pos+aRelativeSize) @ 1.0) |
|
2169 |
]. |
|
3463 | 2170 |
pos := pos + aRelativeSize. |
2171 |
||
2172 |
aSubView shown ifFalse:[ |
|
2173 |
aSubView hiddenOnRealize:false. |
|
2174 |
shown ifTrue:[aSubView beVisible]. |
|
2175 |
]. |
|
1655 | 2176 |
]. |
2177 |
realRelativeSizes := nil. |
|
2178 |
self resizeSubviews. |
|
2179 |
||
2180 |
"Modified: 28.1.1997 / 17:56:20 / cg" |
|
2181 |
! |
|
2182 |
||
295 | 2183 |
setupSubviews |
2184 |
"setup subviews sizes (in case of non-relative sizes)" |
|
2185 |
||
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2186 |
|pos delta subViews nSubViews "{ Class: SmallInteger }"| |
295 | 2187 |
|
300 | 2188 |
"/ setup all subviews to spread evenly ... |
295 | 2189 |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2190 |
subViews := self subViews. |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2191 |
nSubViews := subViews size. |
1043 | 2192 |
nSubViews == 0 ifTrue:[^ self]. |
295 | 2193 |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2194 |
pos := 0.0. |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2195 |
delta := 1.0 / nSubViews. |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2196 |
|
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2197 |
1 to:nSubViews do:[:index | |
2160 | 2198 |
|view org corn| |
295 | 2199 |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2200 |
view := subViews at:index. |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2201 |
orientation == #vertical ifTrue:[ |
2160 | 2202 |
org := (0.0 @ pos). |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2203 |
index == subViews size ifTrue:[ |
2160 | 2204 |
corn := (1.0 @ 1.0) |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2205 |
] ifFalse:[ |
2160 | 2206 |
corn := (1.0 @ (pos + delta)) |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2207 |
]. |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2208 |
] ifFalse:[ |
2160 | 2209 |
org := (pos @ 0.0). |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2210 |
index == subViews size ifTrue:[ |
2160 | 2211 |
corn := (1.0 @ 1.0) |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2212 |
] ifFalse:[ |
2160 | 2213 |
corn := ((pos + delta) @ 1.0) |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2214 |
]. |
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2215 |
]. |
2160 | 2216 |
view origin:org corner:corn. |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2217 |
pos := pos + delta |
295 | 2218 |
] |
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2219 |
|
2160 | 2220 |
"Modified: / 23.2.2000 / 18:14:01 / cg" |
295 | 2221 |
! ! |
2222 |
||
2743 | 2223 |
!VariablePanel methodsFor:'private-snap queries'! |
2179 | 2224 |
|
2225 |
canChangeExtentOfViewAt:anIndex |
|
2226 |
"returns true if extent at an index is changable |
|
2227 |
" |
|
2228 |
|view| |
|
2229 |
||
2230 |
view := subViews at:anIndex ifAbsent:[^ false]. |
|
2231 |
||
2232 |
orientation == #vertical ifTrue:[ |
|
2233 |
view height > 2 ifFalse:[ |
|
2234 |
view := subViews at:(anIndex + 1) ifAbsent:[^ false]. |
|
2598
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2235 |
^ view height > 2 |
2179 | 2236 |
]. |
2237 |
^ true |
|
2238 |
]. |
|
2239 |
||
2240 |
view width > 2 ifFalse:[ |
|
2241 |
view := subViews at:(anIndex + 1) ifAbsent:[^ false]. |
|
2598
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2242 |
^ view width > 2 |
2179 | 2243 |
]. |
2244 |
^ true |
|
2245 |
! |
|
2246 |
||
2247 |
initSnapAdornment |
|
2248 |
|num icon level enterLevel selectedLevel color| |
|
2249 |
||
4187 | 2250 |
snapAdornment isNil ifTrue:[ |
2251 |
||
2252 |
snapAdornment := SnapAdornment "IdentityDictionary" new. |
|
2253 |
||
2254 |
level := styleSheet at:#'variablePanel.snapLevel' default:1. |
|
2255 |
enterLevel := styleSheet at:#'variablePanel.snapEnterLevel' default:level. |
|
2256 |
selectedLevel := styleSheet at:#'variablePanel.selectedLevel' default:(level negated). |
|
2257 |
||
2258 |
snapAdornment level:level. |
|
2259 |
snapAdornment enterLevel:enterLevel. |
|
2260 |
snapAdornment selectedLevel:selectedLevel. |
|
2261 |
snapAdornment mode:#min. |
|
2262 |
||
2263 |
color := styleSheet |
|
2264 |
colorAt:#'variablePanel.snapSelectedBgColor' |
|
2265 |
default:(StyleSheet colorAt:#'button.activeBackgroundColor'). |
|
2266 |
color notNil ifTrue:[ |
|
2267 |
snapAdornment selectedBgColor:(color onDevice:device) |
|
2268 |
]. |
|
2269 |
||
2270 |
color := StyleSheet |
|
2271 |
colorAt:#'variablePanel.snapEnterBgColor' |
|
2272 |
default:(StyleSheet colorAt:#'button.enteredBackgroundColor'). |
|
2273 |
color notNil ifTrue:[ |
|
2274 |
snapAdornment enterBgColor:(color onDevice:device) |
|
2275 |
]. |
|
2276 |
||
2277 |
self class snapIcons keysAndValuesDo:[:aKey :anIcon| |
|
2278 |
anIcon device == device ifTrue:[ |
|
2279 |
icon := anIcon |
|
2280 |
] ifFalse:[ |
|
2281 |
icon := anIcon copy onDevice:device. |
|
2282 |
icon clearMaskedPixels. |
|
2283 |
device == Display ifTrue:[ |
|
2284 |
self class snapIcons at:aKey put:icon. |
|
2285 |
] |
|
2286 |
]. |
|
2287 |
snapAdornment at:aKey put:icon |
|
2288 |
]. |
|
2289 |
"compute required snap extent including level and margins ..." |
|
2290 |
||
2291 |
num := level abs max:(enterLevel abs). |
|
2292 |
num := num max:(selectedLevel abs). |
|
2293 |
num := (num + 2) "margin into handle := 1" * 2. |
|
2294 |
icon := snapAdornment iconUp. |
|
2295 |
||
2296 |
snapAdornment height:(icon height + num). |
|
2297 |
snapAdornment width:(icon width + num). |
|
2179 | 2298 |
]. |
2299 |
||
2598
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2300 |
^ snapAdornment |
4187 | 2301 |
|
2302 |
"Modified: / 31-10-2010 / 12:59:39 / cg" |
|
2179 | 2303 |
! |
2304 |
||
2305 |
snapAtIndexWillGrow:anIndex |
|
2306 |
"returns true if the view assigned to the snap at an index will grow |
|
2307 |
if pressing the snap |
|
2308 |
" |
|
2309 |
|view mode| |
|
2310 |
||
2311 |
(mode := self snapMode) notNil ifTrue:[ |
|
2312 |
(mode == #max or:[mode == #maxMin]) ifTrue:[ |
|
2313 |
"on press the view is increased to bottom(vertical) or right(horizontal)" |
|
2314 |
view := subViews at:(anIndex + 1) ifAbsent:[^ false]. |
|
2598
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2315 |
^ orientation == #vertical ifTrue:[view height > 2] ifFalse:[view width > 2] |
2179 | 2316 |
]. |
2317 |
||
2318 |
(mode == #min or:[mode == #minMax]) ifTrue:[ |
|
2319 |
"on press the view is decreased to top(vertical) or left (horizontal)" |
|
2320 |
view := subViews at:anIndex ifAbsent:[^ false]. |
|
2598
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2321 |
^ orientation == #vertical ifTrue:[view height <= 2] ifFalse:[view width <= 2] |
2236 | 2322 |
]. |
2323 |
||
2269 | 2324 |
self error:'unexepected snapMode state'. |
2179 | 2325 |
]. |
2598
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2326 |
^ false "snap is disabled" |
2179 | 2327 |
! |
2328 |
||
2329 |
snapLayoutAt:anIndex |
|
2330 |
"returns the layout of the snap at an index |
|
2331 |
or nil if snaps are disabled |
|
2332 |
" |
|
2598
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2333 |
|v1 v2 left top right bot w snapX snapY| |
2179 | 2334 |
|
4187 | 2335 |
self hasSnapHandle ifFalse:[^ nil]. "snap disabled" |
2179 | 2336 |
|
2337 |
v1 := subViews at:anIndex ifAbsent:[^ nil]. |
|
2338 |
v2 := subViews at:anIndex + 1 ifAbsent:[^ nil]. |
|
4187 | 2339 |
w := snapAdornment width ? 0. |
2179 | 2340 |
|
2242
1aea02d32c96
snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
2341 |
handlePosition "snapHandlePosition" == #left ifTrue:[ |
2241
d9c7f1486b7a
draw snap at very left of panel
Claus Gittinger <cg@exept.de>
parents:
2240
diff
changeset
|
2342 |
snapX := snapY := margin. "/ ViewSpacing. |
2228
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
2343 |
] ifFalse:[ |
2242
1aea02d32c96
snapHandlePosition is same as handlePosition
Claus Gittinger <cg@exept.de>
parents:
2241
diff
changeset
|
2344 |
handlePosition "snapHandlePosition" == #right ifTrue:[ |
2228
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
2345 |
snapX := width - w. |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
2346 |
snapY := height - w. |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
2347 |
] ifFalse:[ |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
2348 |
snapX := (width - w) // 2. |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
2349 |
snapY := (height - w) // 2. |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
2350 |
]. |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
2351 |
]. |
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
2352 |
|
2179 | 2353 |
orientation == #vertical ifTrue:[ |
2228
d74b093fe48d
snapHandlePosition adjustable
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
2354 |
left := snapX. "/ v1 width - w // 2. |
2598
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2355 |
top := v1 bottom + 1. |
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2356 |
right := left + w. |
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2357 |
bot := v2 top. |
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2358 |
] ifFalse:[ |
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2359 |
top := snapY. "/ v1 height - w // 2. |
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2360 |
left := v1 right + 1. |
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2361 |
right := v2 left. |
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2362 |
bot := top + w. |
2179 | 2363 |
]. |
2598
6817bf076dc9
beautified CAs UGLY indent style
Claus Gittinger <cg@exept.de>
parents:
2590
diff
changeset
|
2364 |
^ Rectangle left:left top:top right:right bottom:bot |
4187 | 2365 |
|
2366 |
"Modified: / 31-10-2010 / 12:47:16 / cg" |
|
2179 | 2367 |
! ! |
2368 |
||
2743 | 2369 |
!VariablePanel methodsFor:'private-tableView protocol'! |
299
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
2370 |
|
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
2371 |
setupSubviewOrigins |
826 | 2372 |
"setup subviews origins |
2373 |
if we only have relative extents |
|
2374 |
(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
|
2375 |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2376 |
|x y e eX eY subViews n "{ Class: SmallInteger }"| |
299
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
2377 |
|
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
2378 |
x := y := 0.0. |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
2379 |
|
980
6079922a5519
eliminated references to subViews instance variable (will vanish)
Claus Gittinger <cg@exept.de>
parents:
966
diff
changeset
|
2380 |
subViews := self subViews. |
299
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
2381 |
n := subViews size. |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
2382 |
1 to:n do:[:index | |
826 | 2383 |
|view| |
299
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
2384 |
|
826 | 2385 |
view := subViews at:index. |
2386 |
e := view relativeExtent. |
|
2387 |
e notNil ifTrue:[ |
|
2388 |
view relativeExtent:nil. |
|
2389 |
eX := e x. |
|
2390 |
eY := e y. |
|
2391 |
index == n ifTrue:[ |
|
2392 |
view origin:(x @ y) corner:(1.0 @ 1.0) |
|
2393 |
] ifFalse:[ |
|
2394 |
orientation == #vertical ifTrue:[ |
|
2395 |
view origin:(x @ y) corner:(1.0 @ (y+eY)) |
|
2396 |
] ifFalse:[ |
|
2397 |
view origin:(x @ y) corner:((x+eX) @ 1.0) |
|
2398 |
]. |
|
2399 |
]. |
|
2400 |
orientation == #vertical ifTrue:[ |
|
2401 |
y := y + eY. |
|
2402 |
] ifFalse:[ |
|
2403 |
x := x + eX. |
|
2404 |
] |
|
2405 |
] ifFalse: [ |
|
2406 |
view origin:(x @ y). |
|
2407 |
orientation == #vertical ifTrue:[ |
|
2408 |
y := view relativeCorner y. |
|
2409 |
] ifFalse:[ |
|
2410 |
x := view relativeCorner x. |
|
2411 |
] |
|
2412 |
]. |
|
2413 |
] |
|
2414 |
||
2415 |
"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
|
2416 |
"Modified: 28.1.1997 / 17:55:21 / cg" |
299
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
2417 |
! ! |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
2418 |
|
3864
3b8f1fe89d48
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3670
diff
changeset
|
2419 |
!VariablePanel methodsFor:'queries'! |
3b8f1fe89d48
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3670
diff
changeset
|
2420 |
|
4187 | 2421 |
hasSnapHandle |
2422 |
^ snapAdornment notNil |
|
2423 |
||
2424 |
"Created: / 31-10-2010 / 12:43:21 / cg" |
|
2425 |
! |
|
2426 |
||
3864
3b8f1fe89d48
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3670
diff
changeset
|
2427 |
isLayoutWrapper |
3b8f1fe89d48
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3670
diff
changeset
|
2428 |
"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
|
2429 |
|
3b8f1fe89d48
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3670
diff
changeset
|
2430 |
^ true |
3b8f1fe89d48
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3670
diff
changeset
|
2431 |
! ! |
3b8f1fe89d48
UIPainter can now resize subviews of PanelViews
Stefan Vogel <sv@exept.de>
parents:
3670
diff
changeset
|
2432 |
|
2288 | 2433 |
!VariablePanel methodsFor:'realization'! |
2434 |
||
2435 |
fixSize |
|
2436 |
super fixSize. |
|
2305
f2850e54b0ab
only access originChanged, extentChanged and cornerChanged
Claus Gittinger <cg@exept.de>
parents:
2288
diff
changeset
|
2437 |
self extentChangedFlag ifTrue:[ |
2288 | 2438 |
self resizeSubviews |
2439 |
]. |
|
2440 |
||
2441 |
"Modified: 22.3.1997 / 01:19:55 / stefan" |
|
2531
6fc09f6a83dd
fix relative sizes when realized
Claus Gittinger <cg@exept.de>
parents:
2483
diff
changeset
|
2442 |
! |
6fc09f6a83dd
fix relative sizes when realized
Claus Gittinger <cg@exept.de>
parents:
2483
diff
changeset
|
2443 |
|
6fc09f6a83dd
fix relative sizes when realized
Claus Gittinger <cg@exept.de>
parents:
2483
diff
changeset
|
2444 |
realize |
6fc09f6a83dd
fix relative sizes when realized
Claus Gittinger <cg@exept.de>
parents:
2483
diff
changeset
|
2445 |
super realize. |
6fc09f6a83dd
fix relative sizes when realized
Claus Gittinger <cg@exept.de>
parents:
2483
diff
changeset
|
2446 |
self anyNonRelativeSubviews ifTrue:[ |
2533 | 2447 |
self setupSubviews. |
2448 |
self sizeChanged:nil. "/ force recomputation of subviews |
|
2531
6fc09f6a83dd
fix relative sizes when realized
Claus Gittinger <cg@exept.de>
parents:
2483
diff
changeset
|
2449 |
]. |
2288 | 2450 |
! ! |
2451 |
||
2452 |
!VariablePanel methodsFor:'redrawing'! |
|
2453 |
||
2454 |
redraw |
|
2455 |
"redraw all of the handles" |
|
2456 |
||
2457 |
redrawLocked ~~ true ifTrue:[ |
|
2458 |
"/ self clear. |
|
2459 |
self redrawHandlesFrom:1 to:(self subViews size) |
|
2460 |
] |
|
2461 |
||
2462 |
"Modified: 28.1.1997 / 17:54:15 / cg" |
|
2463 |
! ! |
|
2464 |
||
4187 | 2465 |
!VariablePanel::SnapAdornment methodsFor:'accessing'! |
2466 |
||
2467 |
enterBgColor |
|
2468 |
^ enterBgColor |
|
2469 |
! |
|
2470 |
||
2471 |
enterBgColor:something |
|
2472 |
enterBgColor := something. |
|
2473 |
! |
|
2474 |
||
2475 |
enterLevel |
|
2476 |
^ enterLevel |
|
2477 |
! |
|
2478 |
||
2479 |
enterLevel:something |
|
2480 |
enterLevel := something. |
|
2481 |
! |
|
2482 |
||
2483 |
height |
|
2484 |
^ height |
|
2485 |
! |
|
2486 |
||
2487 |
height:something |
|
2488 |
height := something. |
|
2489 |
! |
|
2490 |
||
2491 |
iconDown |
|
2492 |
^ iconDown |
|
2493 |
! |
|
2494 |
||
2495 |
iconDown:something |
|
2496 |
iconDown := something. |
|
2497 |
! |
|
2498 |
||
2499 |
iconLeft |
|
2500 |
^ iconLeft |
|
2501 |
! |
|
2502 |
||
2503 |
iconLeft:something |
|
2504 |
iconLeft := something. |
|
2505 |
! |
|
2506 |
||
2507 |
iconLeftRight |
|
2508 |
^ iconLeftRight |
|
2509 |
! |
|
2510 |
||
2511 |
iconLeftRight:something |
|
2512 |
iconLeftRight := something. |
|
2513 |
! |
|
2514 |
||
2515 |
iconRight |
|
2516 |
^ iconRight |
|
2517 |
! |
|
2518 |
||
2519 |
iconRight:something |
|
2520 |
iconRight := something. |
|
2521 |
! |
|
2522 |
||
2523 |
iconUp |
|
2524 |
^ iconUp |
|
2525 |
! |
|
2526 |
||
2527 |
iconUp:something |
|
2528 |
iconUp := something. |
|
2529 |
! |
|
2530 |
||
2531 |
iconUpDown |
|
2532 |
^ iconUpDown |
|
2533 |
! |
|
2534 |
||
2535 |
iconUpDown:something |
|
2536 |
iconUpDown := something. |
|
2537 |
! |
|
2538 |
||
2539 |
level |
|
2540 |
^ level |
|
2541 |
! |
|
2542 |
||
2543 |
level:something |
|
2544 |
level := something. |
|
2545 |
! |
|
2546 |
||
2547 |
mode |
|
2548 |
^ mode |
|
2549 |
! |
|
2550 |
||
2551 |
mode:something |
|
2552 |
mode := something. |
|
2553 |
! |
|
2554 |
||
2555 |
selectedBgColor |
|
2556 |
^ selectedBgColor |
|
2557 |
! |
|
2558 |
||
2559 |
selectedBgColor:something |
|
2560 |
selectedBgColor := something. |
|
2561 |
! |
|
2562 |
||
2563 |
selectedLevel |
|
2564 |
^ selectedLevel |
|
2565 |
! |
|
2566 |
||
2567 |
selectedLevel:something |
|
2568 |
selectedLevel := something. |
|
2569 |
! |
|
2570 |
||
2571 |
width |
|
2572 |
^ width |
|
2573 |
! |
|
2574 |
||
2575 |
width:something |
|
2576 |
width := something. |
|
2577 |
! ! |
|
2578 |
||
2579 |
!VariablePanel::SnapAdornment methodsFor:'backward compatibility'! |
|
2580 |
||
2581 |
at:key |
|
2582 |
^ self perform:key |
|
2583 |
||
2584 |
"Created: / 31-10-2010 / 12:38:58 / cg" |
|
2585 |
! |
|
2586 |
||
2587 |
at:key ifAbsent:default |
|
2588 |
|value| |
|
2589 |
||
2590 |
value := self perform:key. |
|
2591 |
^ value ? default |
|
2592 |
||
2593 |
"Created: / 31-10-2010 / 12:41:10 / cg" |
|
2594 |
! |
|
2595 |
||
2596 |
at:key put:aValue |
|
2597 |
self perform:(key,':') asSymbol with:aValue |
|
2598 |
||
2599 |
"Created: / 31-10-2010 / 12:38:48 / cg" |
|
2600 |
! ! |
|
2601 |
||
871 | 2602 |
!VariablePanel class methodsFor:'documentation'! |
295 | 2603 |
|
2604 |
version |
|
4260
7acd85d3324f
comment/format in: #relativeCorners
Claus Gittinger <cg@exept.de>
parents:
4206
diff
changeset
|
2605 |
^ '$Header: /cvs/stx/stx/libwidg/VariablePanel.st,v 1.93 2011-06-29 13:17:58 cg Exp $' |
4043 | 2606 |
! |
2607 |
||
2608 |
version_CVS |
|
4260
7acd85d3324f
comment/format in: #relativeCorners
Claus Gittinger <cg@exept.de>
parents:
4206
diff
changeset
|
2609 |
^ '$Header: /cvs/stx/stx/libwidg/VariablePanel.st,v 1.93 2011-06-29 13:17:58 cg Exp $' |
295 | 2610 |
! ! |