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