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