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