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