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