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