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