author | Claus Gittinger <cg@exept.de> |
Sat, 24 Feb 1996 19:07:06 +0100 | |
changeset 396 | 973d4a9fa32c |
parent 395 | db172e0f3d56 |
child 397 | 7038c3c38ced |
permissions | -rw-r--r-- |
295 | 1 |
" |
2 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
SimpleView subclass:#VariablePanel |
|
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
14 |
instanceVariableNames:'barHeight barWidth separatingLine shadowForm lightForm showHandle |
295 | 15 |
handlePosition handleColor handleStyle handleLevel noColor |
16 |
trackLine redrawLocked orientation' |
|
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
17 |
classVariableNames:'DefaultShowHandle DefaultHandleStyle DefaultHandlePosition |
295 | 18 |
DefaultTrackingLine DefaultSeparatingLine DefaultHandleColor |
19 |
DefaultHandleLevel DefaultVCursor DefaultHCursor' |
|
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
20 |
poolDictionaries:'' |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
21 |
category:'Views-Layout' |
295 | 22 |
! |
23 |
||
24 |
!VariablePanel class methodsFor:'documentation'! |
|
25 |
||
396
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
26 |
amples |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
27 |
" |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
28 |
example (setting the orientation later makes it equally space its views): |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
29 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
30 |
|top p v1 v2 v3| |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
31 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
32 |
top := StandardSystemView new. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
33 |
top extent:300@300. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
34 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
35 |
p := VariablePanel |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
36 |
origin:0.0 @ 0.0 |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
37 |
corner:1.0 @ 1.0 |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
38 |
in:top. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
39 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
40 |
v1 := View in:p. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
41 |
v2 := View in:p. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
42 |
v3 := View in:p. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
43 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
44 |
v1 viewBackground:(Color red). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
45 |
v2 viewBackground:(Color green). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
46 |
v3 viewBackground:(Color yellow). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
47 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
48 |
p orientation:#vertical. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
49 |
top open. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
50 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
51 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
52 |
example (setting orientation first, req's that subviews have relative bounds): |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
53 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
54 |
|top p v1 v2 v3| |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
55 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
56 |
top := StandardSystemView new. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
57 |
top extent:300@300. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
58 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
59 |
p := VariablePanel |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
60 |
origin:0.0 @ 0.0 |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
61 |
corner:1.0 @ 1.0 |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
62 |
in:top. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
63 |
p orientation:#vertical. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
64 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
65 |
v1 := View origin:0.0@0.0 corner:1.0@(1/2) in:p. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
66 |
v2 := View origin:0.0@(1/2) corner:1.0@(2/3) in:p. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
67 |
v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
68 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
69 |
v1 viewBackground:(Color red). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
70 |
v2 viewBackground:(Color green). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
71 |
v3 viewBackground:(Color yellow). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
72 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
73 |
top open |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
74 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
75 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
76 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
77 |
example (change the handles level): |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
78 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
79 |
|top p v1 v2 v3| |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
80 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
81 |
top := StandardSystemView new. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
82 |
top extent:300@300. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
83 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
84 |
p := VariablePanel |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
85 |
origin:0.0 @ 0.0 |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
86 |
corner:1.0 @ 1.0 |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
87 |
in:top. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
88 |
p orientation:#vertical. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
89 |
p handleLevel:-1. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
90 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
91 |
v1 := View origin:0.0@0.0 corner:1.0@(1/3) in:p. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
92 |
v2 := View origin:0.0@(1/3) corner:1.0@(2/3) in:p. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
93 |
v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
94 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
95 |
v1 viewBackground:(Color red). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
96 |
v2 viewBackground:(Color green). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
97 |
v3 viewBackground:(Color yellow). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
98 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
99 |
top open |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
100 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
101 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
102 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
103 |
example (change the handles style to nil makes it invisible): |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
104 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
105 |
|top p v1 v2 v3| |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
106 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
107 |
top := StandardSystemView new. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
108 |
top extent:300@300. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
109 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
110 |
p := VariablePanel |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
111 |
origin:0.0 @ 0.0 |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
112 |
corner:1.0 @ 1.0 |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
113 |
in:top. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
114 |
p orientation:#vertical. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
115 |
p handleStyle:nil. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
116 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
117 |
v1 := View origin:0.0@0.0 corner:1.0@(1/3) in:p. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
118 |
v2 := View origin:0.0@(1/3) corner:1.0@(2/3) in:p. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
119 |
v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
120 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
121 |
v1 viewBackground:(Color red). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
122 |
v2 viewBackground:(Color green). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
123 |
v3 viewBackground:(Color yellow). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
124 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
125 |
top open |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
126 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
127 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
128 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
129 |
example (placing scrolled and unscrolled views into a variablePanel): |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
130 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
131 |
|top p v1 v2 v3| |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
132 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
133 |
top := StandardSystemView new. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
134 |
top extent:300@300. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
135 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
136 |
p := VariablePanel |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
137 |
origin:0.0 @ 0.0 |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
138 |
corner:1.0 @ 1.0 |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
139 |
in:top. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
140 |
p orientation:#vertical. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
141 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
142 |
v1 := ScrollableView for:SelectionInListView in:p. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
143 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
144 |
v1 list:(FileDirectory directoryNamed:'/etc') contents. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
145 |
v1 action:[:selNr | |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
146 |
|fullName stream text| |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
147 |
fullName := '/etc/' , v1 selectionValue. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
148 |
stream := fullName asFilename readStream. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
149 |
stream notNil ifTrue:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
150 |
text := stream contents. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
151 |
v2 contents:text. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
152 |
v3 contents:text |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
153 |
] |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
154 |
]. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
155 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
156 |
v2 := TextView origin:0.0 @ 0.5 corner:1.0 @ 0.8 in:p. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
157 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
158 |
v3 := ScrollableView for:TextView in:p. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
159 |
v3 origin:0.0 @ 0.8 corner:1.0 @ 1.0. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
160 |
top open |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
161 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
162 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
163 |
example: (dynamically adding/removing views): |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
164 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
165 |
|top p v1 v2 b| |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
166 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
167 |
top := StandardSystemView new. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
168 |
top extent:300@300. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
169 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
170 |
b := Toggle label:'show' in:top. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
171 |
b showLamp:false. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
172 |
b origin:0.0 @ 0.0 corner:(1.0 @ 40). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
173 |
b action:[:state | |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
174 |
state ifTrue:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
175 |
b label:'hide'. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
176 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
177 |
v2 := ScrollableView for:EditTextView. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
178 |
v2 origin:0.0 @ 0.5 corner:1.0 @ 1.0. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
179 |
v2 contents:'another text'. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
180 |
p addSubView:v2. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
181 |
v2 realize. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
182 |
] ifFalse:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
183 |
b label:'show'. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
184 |
v2 destroy. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
185 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 1.0 |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
186 |
] |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
187 |
]. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
188 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
189 |
p := VariablePanel |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
190 |
origin:0.0 @ 0.0 |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
191 |
corner:1.0 @ 1.0 |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
192 |
in:top. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
193 |
p orientation:#vertical. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
194 |
p topInset:50. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
195 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
196 |
v1 := ScrollableView for:EditTextView in:p. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
197 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 1.0. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
198 |
v1 contents:'some text'. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
199 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
200 |
top open |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
201 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
202 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
203 |
example: (dynamically flipping orientation): |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
204 |
Notice: you have to change the relative bounds of the subviews first. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
205 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
206 |
|top p v1 v2 b| |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
207 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
208 |
top := StandardSystemView new. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
209 |
top extent:300@300. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
210 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
211 |
b := Toggle label:'flip' in:top. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
212 |
b showLamp:false. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
213 |
b origin:0.0 @ 0.0 corner:(1.0 @ 40). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
214 |
b action:[:state | |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
215 |
state ifTrue:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
216 |
v1 origin:0.0 @ 0.0 corner:0.5 @ 1.0. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
217 |
v2 origin:0.5 @ 0.0 corner:1.0 @ 1.0. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
218 |
p orientation:#horizontal. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
219 |
] ifFalse:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
220 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
221 |
v2 origin:0.0 @ 0.5 corner:1.0 @ 1.0. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
222 |
p orientation:#vertical. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
223 |
]. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
224 |
]. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
225 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
226 |
p := VariablePanel |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
227 |
origin:0.0 @ 0.0 |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
228 |
corner:1.0 @ 1.0 |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
229 |
in:top. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
230 |
p orientation:#vertical. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
231 |
p topInset:50. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
232 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
233 |
v1 := ScrollableView for:EditTextView in:p. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
234 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
235 |
v1 contents:'some text'. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
236 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
237 |
v2 := ScrollableView for:EditTextView in:p. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
238 |
v2 origin:0.0 @ 0.5 corner:1.0 @ 1.0. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
239 |
v2 contents:'another text'. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
240 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
241 |
top open |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
242 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
243 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
244 |
example (combining fix-size with variable size): |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
245 |
(need 3 extra frame-views to place the extra labels into) |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
246 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
247 |
|top p v1 l1 v2 l2 v3 l3 f1 f2 f3| |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
248 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
249 |
top := StandardSystemView new. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
250 |
top extent:300@300. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
251 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
252 |
p := VariablePanel |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
253 |
origin:0.0 @ 0.0 |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
254 |
corner:1.0 @ 1.0 |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
255 |
in:top. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
256 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
257 |
f1 := View in:p. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
258 |
f2 := View in:p. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
259 |
f3 := View in:p. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
260 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
261 |
v1 := View origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:f1. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
262 |
v2 := View origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:f2. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
263 |
v3 := View origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:f3. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
264 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
265 |
l1 := Label label:'sub1' in:f1. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
266 |
l2 := Label label:'sub2' in:f2. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
267 |
l3 := Label label:'sub3' in:f3. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
268 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
269 |
l1 origin:0.0 @ 0.0 corner:1.0 @ 0.0 ; |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
270 |
bottomInset:(l1 preferredExtent y negated). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
271 |
l2 origin:0.0 @ 0.0 corner:1.0 @ 0.0 ; |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
272 |
bottomInset:(l2 preferredExtent y negated). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
273 |
l3 origin:0.0 @ 0.0 corner:1.0 @ 0.0 ; |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
274 |
bottomInset:(l3 preferredExtent y negated). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
275 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
276 |
v1 topInset:(l1 preferredExtent y); level:-1. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
277 |
v2 topInset:(l2 preferredExtent y); level:-1. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
278 |
v3 topInset:(l3 preferredExtent y); level:-1. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
279 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
280 |
v1 viewBackground:(Color red). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
281 |
v2 viewBackground:(Color green). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
282 |
v3 viewBackground:(Color yellow). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
283 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
284 |
p orientation:#vertical. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
285 |
top open |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
286 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
287 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
288 |
BAD EXAMPLE (wrong relative sizes - repaired on handle move): |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
289 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
290 |
|top p v1 v2 v3| |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
291 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
292 |
top := StandardSystemView new. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
293 |
top extent:300@300. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
294 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
295 |
p := VariablePanel |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
296 |
origin:0.0 @ 0.0 |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
297 |
corner:1.0 @ 1.0 |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
298 |
in:top. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
299 |
p orientation:#vertical. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
300 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
301 |
v1 := View origin:0.0 @ 0.0 corner:1.0 @ (1/4) in:p. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
302 |
v2 := View origin:0.0 @ (1/2) corner:1.0 @ (3/4) in:p. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
303 |
v3 := View origin:0.0 @ (3/4) corner:1.0 @ 1.0 in:p. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
304 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
305 |
v1 viewBackground:(Color red). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
306 |
v2 viewBackground:(Color green). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
307 |
v3 viewBackground:(Color yellow). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
308 |
|
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
309 |
top open |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
310 |
" |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
311 |
! |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
312 |
|
295 | 313 |
copyright |
314 |
" |
|
315 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
316 |
All Rights Reserved |
|
317 |
||
318 |
This software is furnished under a license and may be used |
|
319 |
only in accordance with the terms of that license and with the |
|
320 |
inclusion of the above copyright notice. This software may not |
|
321 |
be provided or otherwise made available to, or used by, any |
|
322 |
other person. No title to or ownership of the software is |
|
323 |
hereby transferred. |
|
324 |
" |
|
325 |
! |
|
326 |
||
327 |
documentation |
|
328 |
" |
|
329 |
a View to separate its subviews vertically by a movable bar; |
|
330 |
the size-ratios of the subviews can be changed by moving this bar. |
|
331 |
||
332 |
In order to correctly setup this kind of view, the subviews must |
|
333 |
be created with a relative origin & relative corner. |
|
334 |
The panel does not verify the relative subview bounds; |
|
335 |
therefore, it is your responsibility to set those relative sizes to fit |
|
336 |
according the orientation (see bad example below). |
|
337 |
||
338 |
The bar-handle is either an exposed knob (style == #motif) |
|
339 |
or the form defined in Scroller (style ~~ #motif) |
|
340 |
or nothing. |
|
341 |
||
342 |
Typically creation is done as: |
|
343 |
||
344 |
p := VariablePanel in:superView. |
|
345 |
p orientation:#vertical. |
|
346 |
||
347 |
v1 := <someViewClass> origin:0.0 @ 0.0 |
|
348 |
corner:1.0 @ 0.5 |
|
349 |
in:p. |
|
350 |
v2 := <someViewClass> origin:0.0 @ 0.5 |
|
351 |
corner:1.0 @ 0.8 |
|
352 |
in:p. |
|
353 |
v3 := <someViewClass> origin:0.0 @ 0.8 |
|
354 |
corner:1.0 @ 1.0 |
|
355 |
in:p. |
|
356 |
||
357 |
Notice: if it is required to insert a fixed-size view in the panel, |
|
358 |
use an extra view & insets, and place the subview into that extra view. |
|
359 |
||
360 |
see examples. |
|
361 |
" |
|
362 |
! |
|
363 |
||
364 |
examples |
|
365 |
" |
|
366 |
example (setting the orientation later makes it equally space its views): |
|
367 |
||
368 |
|top p v1 v2 v3| |
|
369 |
||
370 |
top := StandardSystemView new. |
|
371 |
top extent:300@300. |
|
372 |
||
373 |
p := VariablePanel |
|
374 |
origin:0.0 @ 0.0 |
|
375 |
corner:1.0 @ 1.0 |
|
376 |
in:top. |
|
377 |
||
378 |
v1 := View in:p. |
|
379 |
v2 := View in:p. |
|
380 |
v3 := View in:p. |
|
381 |
||
382 |
v1 viewBackground:(Color red). |
|
383 |
v2 viewBackground:(Color green). |
|
384 |
v3 viewBackground:(Color yellow). |
|
385 |
||
386 |
p orientation:#vertical. |
|
387 |
top open. |
|
388 |
||
389 |
||
390 |
example (setting orientation first, req's that subviews have relative bounds): |
|
391 |
||
392 |
|top p v1 v2 v3| |
|
393 |
||
394 |
top := StandardSystemView new. |
|
395 |
top extent:300@300. |
|
396 |
||
397 |
p := VariablePanel |
|
398 |
origin:0.0 @ 0.0 |
|
399 |
corner:1.0 @ 1.0 |
|
400 |
in:top. |
|
401 |
p orientation:#vertical. |
|
402 |
||
403 |
v1 := View origin:0.0@0.0 corner:1.0@(1/2) in:p. |
|
404 |
v2 := View origin:0.0@(1/2) corner:1.0@(2/3) in:p. |
|
405 |
v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p. |
|
406 |
||
407 |
v1 viewBackground:(Color red). |
|
408 |
v2 viewBackground:(Color green). |
|
409 |
v3 viewBackground:(Color yellow). |
|
410 |
||
411 |
top open |
|
412 |
||
413 |
||
414 |
||
415 |
example (change the handles level): |
|
416 |
||
417 |
|top p v1 v2 v3| |
|
418 |
||
419 |
top := StandardSystemView new. |
|
420 |
top extent:300@300. |
|
421 |
||
422 |
p := VariablePanel |
|
423 |
origin:0.0 @ 0.0 |
|
424 |
corner:1.0 @ 1.0 |
|
425 |
in:top. |
|
426 |
p orientation:#vertical. |
|
427 |
p handleLevel:-1. |
|
428 |
||
429 |
v1 := View origin:0.0@0.0 corner:1.0@(1/3) in:p. |
|
430 |
v2 := View origin:0.0@(1/3) corner:1.0@(2/3) in:p. |
|
431 |
v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p. |
|
432 |
||
433 |
v1 viewBackground:(Color red). |
|
434 |
v2 viewBackground:(Color green). |
|
435 |
v3 viewBackground:(Color yellow). |
|
436 |
||
437 |
top open |
|
438 |
||
439 |
||
440 |
||
441 |
example (placing scrolled and unscrolled views into a variablePanel): |
|
442 |
||
443 |
|top p v1 v2 v3| |
|
444 |
||
445 |
top := StandardSystemView new. |
|
446 |
top extent:300@300. |
|
447 |
||
448 |
p := VariablePanel |
|
449 |
origin:0.0 @ 0.0 |
|
450 |
corner:1.0 @ 1.0 |
|
451 |
in:top. |
|
452 |
p orientation:#vertical. |
|
453 |
||
454 |
v1 := ScrollableView for:SelectionInListView in:p. |
|
455 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5. |
|
456 |
v1 list:(FileDirectory directoryNamed:'/etc') contents. |
|
457 |
v1 action:[:selNr | |
|
458 |
|fullName stream text| |
|
459 |
fullName := '/etc/' , v1 selectionValue. |
|
460 |
stream := fullName asFilename readStream. |
|
461 |
stream notNil ifTrue:[ |
|
462 |
text := stream contents. |
|
463 |
v2 contents:text. |
|
464 |
v3 contents:text |
|
465 |
] |
|
466 |
]. |
|
467 |
||
468 |
v2 := TextView origin:0.0 @ 0.5 corner:1.0 @ 0.8 in:p. |
|
469 |
||
470 |
v3 := ScrollableView for:TextView in:p. |
|
471 |
v3 origin:0.0 @ 0.8 corner:1.0 @ 1.0. |
|
472 |
top open |
|
473 |
||
474 |
||
475 |
example: (dynamically adding/removing views): |
|
476 |
||
477 |
|top p v1 v2 b| |
|
478 |
||
479 |
top := StandardSystemView new. |
|
480 |
top extent:300@300. |
|
481 |
||
482 |
b := Toggle label:'show' in:top. |
|
483 |
b showLamp:false. |
|
484 |
b origin:0.0 @ 0.0 corner:(1.0 @ 40). |
|
485 |
b action:[:state | |
|
486 |
state ifTrue:[ |
|
487 |
b label:'hide'. |
|
488 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5. |
|
489 |
v2 := ScrollableView for:EditTextView. |
|
490 |
v2 origin:0.0 @ 0.5 corner:1.0 @ 1.0. |
|
491 |
v2 contents:'another text'. |
|
492 |
p addSubView:v2. |
|
300 | 493 |
v2 realize. |
295 | 494 |
] ifFalse:[ |
495 |
b label:'show'. |
|
496 |
v2 destroy. |
|
497 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 1.0 |
|
498 |
] |
|
499 |
]. |
|
500 |
||
501 |
p := VariablePanel |
|
502 |
origin:0.0 @ 0.0 |
|
503 |
corner:1.0 @ 1.0 |
|
504 |
in:top. |
|
505 |
p orientation:#vertical. |
|
506 |
p topInset:50. |
|
507 |
||
508 |
v1 := ScrollableView for:EditTextView in:p. |
|
509 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 1.0. |
|
510 |
v1 contents:'some text'. |
|
511 |
||
512 |
top open |
|
513 |
||
514 |
||
515 |
example: (dynamically flipping orientation): |
|
516 |
Notice: you have to change the relative bounds of the subviews first. |
|
517 |
||
518 |
|top p v1 v2 b| |
|
519 |
||
520 |
top := StandardSystemView new. |
|
521 |
top extent:300@300. |
|
522 |
||
523 |
b := Toggle label:'flip' in:top. |
|
524 |
b showLamp:false. |
|
525 |
b origin:0.0 @ 0.0 corner:(1.0 @ 40). |
|
526 |
b action:[:state | |
|
527 |
state ifTrue:[ |
|
528 |
v1 origin:0.0 @ 0.0 corner:0.5 @ 1.0. |
|
529 |
v2 origin:0.5 @ 0.0 corner:1.0 @ 1.0. |
|
530 |
p orientation:#horizontal. |
|
531 |
] ifFalse:[ |
|
532 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5. |
|
533 |
v2 origin:0.0 @ 0.5 corner:1.0 @ 1.0. |
|
534 |
p orientation:#vertical. |
|
535 |
]. |
|
536 |
]. |
|
537 |
||
538 |
p := VariablePanel |
|
539 |
origin:0.0 @ 0.0 |
|
540 |
corner:1.0 @ 1.0 |
|
541 |
in:top. |
|
542 |
p orientation:#vertical. |
|
543 |
p topInset:50. |
|
544 |
||
545 |
v1 := ScrollableView for:EditTextView in:p. |
|
546 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5. |
|
547 |
v1 contents:'some text'. |
|
548 |
||
549 |
v2 := ScrollableView for:EditTextView in:p. |
|
550 |
v2 origin:0.0 @ 0.5 corner:1.0 @ 1.0. |
|
551 |
v2 contents:'another text'. |
|
552 |
||
553 |
top open |
|
554 |
||
555 |
||
556 |
example (combining fix-size with variable size): |
|
557 |
(need 3 extra frame-views to place the extra labels into) |
|
558 |
||
559 |
|top p v1 l1 v2 l2 v3 l3 f1 f2 f3| |
|
560 |
||
561 |
top := StandardSystemView new. |
|
562 |
top extent:300@300. |
|
563 |
||
564 |
p := VariablePanel |
|
565 |
origin:0.0 @ 0.0 |
|
566 |
corner:1.0 @ 1.0 |
|
567 |
in:top. |
|
568 |
||
569 |
f1 := View in:p. |
|
570 |
f2 := View in:p. |
|
571 |
f3 := View in:p. |
|
572 |
||
573 |
v1 := View origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:f1. |
|
574 |
v2 := View origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:f2. |
|
575 |
v3 := View origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:f3. |
|
576 |
||
577 |
l1 := Label label:'sub1' in:f1. |
|
578 |
l2 := Label label:'sub2' in:f2. |
|
579 |
l3 := Label label:'sub3' in:f3. |
|
580 |
||
581 |
l1 origin:0.0 @ 0.0 corner:1.0 @ 0.0 ; |
|
582 |
bottomInset:(l1 preferredExtent y negated). |
|
583 |
l2 origin:0.0 @ 0.0 corner:1.0 @ 0.0 ; |
|
584 |
bottomInset:(l2 preferredExtent y negated). |
|
585 |
l3 origin:0.0 @ 0.0 corner:1.0 @ 0.0 ; |
|
586 |
bottomInset:(l3 preferredExtent y negated). |
|
587 |
||
588 |
v1 topInset:(l1 preferredExtent y); level:-1. |
|
589 |
v2 topInset:(l2 preferredExtent y); level:-1. |
|
590 |
v3 topInset:(l3 preferredExtent y); level:-1. |
|
591 |
||
592 |
v1 viewBackground:(Color red). |
|
593 |
v2 viewBackground:(Color green). |
|
594 |
v3 viewBackground:(Color yellow). |
|
595 |
||
596 |
p orientation:#vertical. |
|
597 |
top open |
|
598 |
||
599 |
||
600 |
BAD EXAMPLE (wrong relative sizes - repaired on handle move): |
|
601 |
||
602 |
|top p v1 v2 v3| |
|
603 |
||
604 |
top := StandardSystemView new. |
|
605 |
top extent:300@300. |
|
606 |
||
607 |
p := VariablePanel |
|
608 |
origin:0.0 @ 0.0 |
|
609 |
corner:1.0 @ 1.0 |
|
610 |
in:top. |
|
611 |
p orientation:#vertical. |
|
612 |
||
613 |
v1 := View origin:0.0 @ 0.0 corner:1.0 @ (1/4) in:p. |
|
614 |
v2 := View origin:0.0 @ (1/2) corner:1.0 @ (3/4) in:p. |
|
615 |
v3 := View origin:0.0 @ (3/4) corner:1.0 @ 1.0 in:p. |
|
616 |
||
617 |
v1 viewBackground:(Color red). |
|
618 |
v2 viewBackground:(Color green). |
|
619 |
v3 viewBackground:(Color yellow). |
|
620 |
||
621 |
top open |
|
622 |
" |
|
623 |
! ! |
|
624 |
||
625 |
!VariablePanel class methodsFor:'defaults'! |
|
626 |
||
627 |
lightFormOn:aDisplay |
|
628 |
"use same handle as Scroller" |
|
629 |
||
630 |
^ Scroller handleLightFormOn:aDisplay |
|
631 |
! |
|
632 |
||
633 |
shadowFormOn:aDisplay |
|
634 |
"use same handle as Scroller" |
|
635 |
||
636 |
^ Scroller handleShadowFormOn:aDisplay |
|
637 |
! |
|
638 |
||
639 |
updateStyleCache |
|
640 |
DefaultShowHandle := StyleSheet at:'variablePanelShowHandle' default:true. |
|
641 |
DefaultHandleStyle := StyleSheet at:'variablePanelHandleStyle'. |
|
642 |
DefaultHandlePosition := StyleSheet at:'variablePanelHandlePosition' default:#right. |
|
643 |
DefaultHandleLevel := StyleSheet at:'variablePanelHandleLevel' default:2. |
|
644 |
DefaultTrackingLine := StyleSheet at:'variablePanelTrackingLine' default:false. |
|
645 |
DefaultSeparatingLine := StyleSheet at:'variablePanelSeparatingLine' default:false. |
|
646 |
DefaultHandleColor := StyleSheet colorAt:'variablePanelHandleColor' default:Black. |
|
647 |
! ! |
|
648 |
||
649 |
!VariablePanel methodsFor:'accessing'! |
|
650 |
||
651 |
addSubView:aView |
|
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
652 |
"a view is added; adjust other subviews sizes" |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
653 |
|
295 | 654 |
super addSubView:aView. |
655 |
realized ifTrue:[ |
|
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
656 |
self resizeSubviews. |
295 | 657 |
] |
658 |
||
659 |
"Created: 17.1.1996 / 22:41:00 / cg" |
|
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
660 |
"Modified: 24.2.1996 / 19:05:05 / cg" |
295 | 661 |
! |
662 |
||
663 |
orientation |
|
664 |
^ orientation |
|
665 |
! |
|
666 |
||
667 |
orientation:aSymbol |
|
668 |
orientation := aSymbol. |
|
669 |
self initCursor. |
|
670 |
self anyNonRelativeSubviews ifTrue:[ |
|
671 |
self setupSubviews |
|
672 |
]. |
|
673 |
shown ifTrue:[ |
|
674 |
self cursor:cursor. |
|
675 |
self sizeChanged:nil. |
|
676 |
self redraw. |
|
677 |
] |
|
678 |
! |
|
679 |
||
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
680 |
removeSubView:aView |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
681 |
"a view is removed; adjust other subviews sizes" |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
682 |
|
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
683 |
super removeSubView:aView. |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
684 |
shown ifTrue:[ |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
685 |
(superView isNil or:[superView shown]) ifTrue:[ |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
686 |
self setupSubviews |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
687 |
] |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
688 |
] |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
689 |
! ! |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
690 |
|
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
691 |
!VariablePanel methodsFor:'accessing-look'! |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
692 |
|
295 | 693 |
barHeight |
694 |
"return the height of the separating bar" |
|
695 |
||
696 |
^ barHeight |
|
697 |
! |
|
698 |
||
699 |
barHeight:nPixel |
|
700 |
"set the height of the separating bar" |
|
701 |
||
702 |
barHeight := nPixel. |
|
703 |
||
704 |
"if screen is very low-res, make certain bar is visible and catchable" |
|
705 |
(barHeight < 4) ifTrue:[ |
|
706 |
barHeight := 4 |
|
707 |
]. |
|
708 |
||
709 |
"make it even so spacing is equally spreadable among subviews" |
|
710 |
barHeight odd ifTrue:[ |
|
711 |
barHeight := barHeight + 1 |
|
712 |
] |
|
713 |
! |
|
714 |
||
715 |
handleLevel:aNumber |
|
716 |
"define the 3D level of the handle (only with some styles). |
|
717 |
Normally, this is defined via styleSheet files, but this entry allows |
|
718 |
individual views to be manipulated." |
|
719 |
||
720 |
handleLevel := aNumber |
|
721 |
! |
|
722 |
||
723 |
handlePosition |
|
724 |
"return the position of the handle" |
|
725 |
||
726 |
^ handlePosition |
|
727 |
! |
|
728 |
||
729 |
handlePosition:aSymbol |
|
730 |
"define the position of the handle; the argument aSymbol |
|
731 |
may be one of #left, #right or #center" |
|
732 |
||
733 |
handlePosition := aSymbol |
|
734 |
! |
|
735 |
||
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
736 |
handleStyle:styleSymbol |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
737 |
"define the style of the handle; |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
738 |
styleSymbol may be #motif to draw a little knob or |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
739 |
anything else to draw scrollBars handleForm. |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
740 |
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
|
741 |
individual views to be manipulated." |
295 | 742 |
|
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
743 |
(styleSymbol ~~ handleStyle) ifTrue:[ |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
744 |
handleStyle := styleSymbol. |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
745 |
handleStyle == #next ifTrue:[ |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
746 |
shadowForm := self class shadowFormOn:device. |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
747 |
lightForm := self class lightFormOn:device. |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
748 |
] ifFalse:[ |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
749 |
shadowForm := lightForm := nil |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
750 |
]. |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
751 |
|
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
752 |
shadowForm notNil ifTrue:[ |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
753 |
(self is3D and:[handleStyle ~~ #motif]) ifTrue:[ |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
754 |
self barHeight:(shadowForm height + 2). |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
755 |
barWidth := shadowForm width |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
756 |
] |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
757 |
]. |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
758 |
shown ifTrue:[ |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
759 |
self resizeSubviews. |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
760 |
self redraw |
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
761 |
] |
295 | 762 |
] |
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
763 |
|
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
764 |
"Created: 24.2.1996 / 19:04:07 / cg" |
295 | 765 |
! |
766 |
||
767 |
style:styleSymbol |
|
768 |
"define the style of the handle; |
|
769 |
styleSymbol may be #motif to draw a little knob or |
|
770 |
anything else to draw scrollBars handleForm. |
|
771 |
Normally, this is defined via styleSheet files, but this entry allows |
|
772 |
individual views to be manipulated." |
|
773 |
||
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
774 |
self handleStyle:styleSymbol |
295 | 775 |
|
395
db172e0f3d56
renamed #style: to #handleStyle:
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
776 |
"Modified: 24.2.1996 / 19:04:19 / cg" |
295 | 777 |
! ! |
778 |
||
779 |
!VariablePanel methodsFor:'drawing'! |
|
780 |
||
781 |
drawHandleAtX:hx y:hy |
|
782 |
"draw a single handle at hx/hy" |
|
783 |
||
784 |
|h w x y m| |
|
785 |
||
396
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
786 |
handleStyle isNil ifTrue:[^ self]. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
787 |
|
295 | 788 |
shadowForm notNil ifTrue:[ |
396
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
789 |
h := shadowForm height. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
790 |
w := shadowForm width . |
295 | 791 |
] ifFalse:[ |
396
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
792 |
h := w := barHeight - 4. |
295 | 793 |
]. |
794 |
||
795 |
self paint:viewBackground. |
|
796 |
orientation == #vertical ifTrue:[ |
|
396
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
797 |
self fillRectangleX:margin y:hy |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
798 |
width:(width - margin - margin) |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
799 |
height:barHeight. |
295 | 800 |
|
396
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
801 |
(handleStyle ~~ #normal and:[handleStyle ~~ #mswindows]) ifTrue:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
802 |
m := (barHeight - h) // 2. |
295 | 803 |
|
396
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
804 |
shadowForm isNil ifTrue:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
805 |
y := hy + (barHeight // 2). |
295 | 806 |
|
396
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
807 |
separatingLine ifTrue:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
808 |
self paint:shadowColor. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
809 |
self displayLineFromX:margin y:y toX:(width - margin) y:y. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
810 |
y := y + 1. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
811 |
self paint:lightColor. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
812 |
self displayLineFromX:margin y:y toX:(width - margin) y:y. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
813 |
]. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
814 |
self paint:viewBackground. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
815 |
self fillRectangleX:(hx - barWidth) y:hy |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
816 |
width:(barWidth + barWidth) |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
817 |
height:h. |
295 | 818 |
|
396
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
819 |
handleStyle == #line ifTrue:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
820 |
self paint:handleColor. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
821 |
self displayLineFromX:hx - barWidth y:y toX:hx + barWidth y:y |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
822 |
] ifFalse:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
823 |
y := hy. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
824 |
handleStyle == #st80 ifTrue:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
825 |
y := y - 1 |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
826 |
]. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
827 |
self drawEdgesForX:(hx - barWidth) |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
828 |
y:(y + m) |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
829 |
width:(barWidth + barWidth) |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
830 |
height:h |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
831 |
level:handleLevel. |
295 | 832 |
|
396
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
833 |
handleStyle == #iris ifTrue:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
834 |
self paint:handleColor. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
835 |
self fillDeviceRectangleX:(hx - barWidth + 2) |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
836 |
y:(y + m + 2) |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
837 |
width:(barWidth + barWidth - 4) |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
838 |
height:h - 4 |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
839 |
] |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
840 |
]. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
841 |
] ifFalse:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
842 |
y := hy. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
843 |
self drawHandleFormAtX:hx y:(y + m) |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
844 |
]. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
845 |
handleStyle == #st80 ifTrue:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
846 |
y := hy - 1. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
847 |
self paint:lightColor. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
848 |
self displayLineFromX:margin y:y toX:(width - margin - margin - 1) y:y. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
849 |
self displayLineFromX:0 y:hy toX:0 y:(hy + barHeight - 1). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
850 |
y := hy + barHeight - 2. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
851 |
self paint:shadowColor. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
852 |
self displayLineFromX:margin y:y toX:(width - margin) y:y. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
853 |
"uncomment the -1 if you dont like the notch at the right end" |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
854 |
" VVV" |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
855 |
self displayLineFromX:width-1 y:hy" "-1" " toX:width-1 y:(hy + barHeight - 1). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
856 |
]. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
857 |
] ifFalse:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
858 |
y := hy + barHeight - 1. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
859 |
self paint:handleColor. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
860 |
separatingLine ifTrue:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
861 |
self displayLineFromX:0 y:hy+1 toX:width y:hy+1. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
862 |
self displayLineFromX:0 y:y toX:width y:y. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
863 |
]. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
864 |
self fillRectangleX:hx y:hy width:barWidth height:barHeight |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
865 |
] |
295 | 866 |
] ifFalse:[ |
396
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
867 |
self fillRectangleX:hx y:margin |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
868 |
width:barHeight |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
869 |
height:(height - margin - margin). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
870 |
(handleStyle ~~ #normal and:[handleStyle ~~ #mswindows]) ifTrue:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
871 |
m := (barHeight - w) // 2. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
872 |
shadowForm isNil ifTrue:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
873 |
x := hx + (barHeight // 2). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
874 |
separatingLine ifTrue:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
875 |
self paint:shadowColor. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
876 |
self displayLineFromX:x y:margin toX:x y:(height - margin). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
877 |
x := x + 1. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
878 |
self paint:lightColor. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
879 |
self displayLineFromX:x y:margin toX:x y:(height - margin). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
880 |
]. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
881 |
self paint:viewBackground. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
882 |
self fillRectangleX:hx y:(hy - barWidth) |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
883 |
width:w |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
884 |
height:(barWidth + barWidth). |
295 | 885 |
|
396
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
886 |
handleStyle == #line ifTrue:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
887 |
self paint:handleColor. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
888 |
self displayLineFromX:x y:hy - barWidth toX:x y:hy + barWidth. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
889 |
] ifFalse:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
890 |
x := hx. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
891 |
handleStyle == #st80 ifTrue:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
892 |
x := x - 1. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
893 |
]. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
894 |
self drawEdgesForX:(x + m) |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
895 |
y:(hy - barWidth) |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
896 |
width:w |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
897 |
height:(barWidth + barWidth) |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
898 |
level:handleLevel. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
899 |
handleStyle == #iris ifTrue:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
900 |
self paint:handleColor. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
901 |
self fillDeviceRectangleX:(x + m + 2) |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
902 |
y:(hy - barWidth + 2) |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
903 |
width:w - 4 |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
904 |
height:(barWidth + barWidth - 4) |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
905 |
]. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
906 |
] |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
907 |
] ifFalse:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
908 |
x := hx. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
909 |
self drawHandleFormAtX:(x + m) y:hy |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
910 |
]. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
911 |
handleStyle == #st80 ifTrue:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
912 |
x := hx - 1. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
913 |
self paint:lightColor. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
914 |
self displayLineFromX:x y:margin toX:x y:(height - margin). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
915 |
self displayLineFromX:hx y:0 toX:(hx + barHeight - 1) y:0. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
916 |
x := hx + barHeight - 2. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
917 |
self paint:shadowColor. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
918 |
self displayLineFromX:x y:margin toX:x y:(height - margin). |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
919 |
"uncomment the -1 if you dont like the notch at the bottom end" |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
920 |
" VVV" |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
921 |
self displayLineFromX:hx" "-1" " y:height-1 toX:(hx + barHeight - 1) y:height-1. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
922 |
]. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
923 |
] ifFalse:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
924 |
x := hx + barHeight - 1. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
925 |
self paint:handleColor. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
926 |
separatingLine ifTrue:[ |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
927 |
self displayLineFromX:hx+1 y:0 toX:hx+1 y:height. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
928 |
self displayLineFromX:x y:0 toX:x y:height. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
929 |
]. |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
930 |
self fillRectangleX:hx y:hy width:barHeight height:barWidth |
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
931 |
] |
295 | 932 |
]. |
933 |
||
396
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
934 |
"Modified: 24.2.1996 / 19:05:52 / cg" |
295 | 935 |
! |
936 |
||
937 |
drawHandleFormAtX:hx y:hy |
|
938 |
"draw a handles bitmap at hx/hy" |
|
939 |
||
940 |
self paint:shadowColor. |
|
941 |
self displayForm:shadowForm x:hx y:hy. |
|
942 |
self paint:lightColor. |
|
943 |
self displayForm:lightForm x:hx y:hy. |
|
944 |
self paint:viewBackground |
|
945 |
! |
|
946 |
||
947 |
invertHandleBarAtX:hx y:hy |
|
948 |
self noClipByChildren. |
|
949 |
self xoring:[ |
|
950 |
|y x| |
|
951 |
||
952 |
orientation == #vertical ifTrue:[ |
|
953 |
trackLine ifTrue:[ |
|
954 |
y := hy + (barHeight // 2). |
|
955 |
self displayLineFromX:0 y:y toX:width y:y. |
|
956 |
] ifFalse:[ |
|
957 |
self fillRectangleX:0 y:hy width:width height:barHeight |
|
958 |
] |
|
959 |
] ifFalse:[ |
|
960 |
trackLine ifTrue:[ |
|
961 |
x := hx + (barHeight // 2). |
|
962 |
self displayLineFromX:x y:0 toX:x y:height. |
|
963 |
] ifFalse:[ |
|
964 |
self fillRectangleX:hx y:0 width:barHeight height:height |
|
965 |
] |
|
966 |
] |
|
967 |
]. |
|
968 |
self clipByChildren. |
|
969 |
! |
|
970 |
||
971 |
lockRedraw |
|
972 |
redrawLocked := true |
|
973 |
! |
|
974 |
||
975 |
redraw |
|
976 |
"redraw all of the handles" |
|
977 |
||
978 |
redrawLocked ~~ true ifTrue:[ |
|
979 |
self redrawHandlesFrom:1 to:(subViews size) |
|
980 |
] |
|
981 |
! |
|
982 |
||
983 |
redrawHandlesFrom:start to:stop |
|
984 |
"redraw some handles" |
|
985 |
||
986 |
subViews notNil ifTrue:[ |
|
987 |
showHandle ifTrue:[ |
|
988 |
self handleOriginsFrom:start to:stop do:[:hPoint | |
|
989 |
self drawHandleAtX:(hPoint x) y:(hPoint y) |
|
990 |
]. |
|
991 |
] |
|
992 |
] |
|
993 |
! |
|
994 |
||
995 |
unlockRedraw |
|
996 |
redrawLocked := false |
|
997 |
! ! |
|
998 |
||
999 |
!VariablePanel methodsFor:'event handling'! |
|
1000 |
||
1001 |
sizeChanged:how |
|
1002 |
"my size has changed; resize my subviews" |
|
1003 |
||
1004 |
shown ifTrue:[ |
|
1005 |
(how == #smaller) ifTrue:[ |
|
1006 |
self resizeSubviews |
|
1007 |
] ifFalse:[ |
|
1008 |
"/ |
|
1009 |
"/ do it in reverse order, to avoid some redraws |
|
1010 |
"/ |
|
1011 |
self resizeSubviewsFrom:(subViews size) to:1 |
|
1012 |
] |
|
1013 |
]. |
|
1014 |
self changed:#sizeOfView with:how. |
|
1015 |
! ! |
|
1016 |
||
1017 |
!VariablePanel methodsFor:'initializing'! |
|
1018 |
||
1019 |
defaultControllerClass |
|
1020 |
^ VariablePanelController |
|
1021 |
! |
|
1022 |
||
1023 |
fixSize |
|
1024 |
extentChanged ifTrue:[ |
|
1025 |
super fixSize. |
|
1026 |
self resizeSubviews |
|
1027 |
] ifFalse:[ |
|
1028 |
super fixSize |
|
1029 |
] |
|
1030 |
! |
|
1031 |
||
1032 |
initCursor |
|
1033 |
"set the cursor - a double arrow" |
|
1034 |
||
1035 |
orientation == #vertical ifTrue:[ |
|
1036 |
DefaultVCursor notNil ifTrue:[ |
|
1037 |
cursor := DefaultVCursor |
|
1038 |
] ifFalse:[ |
|
1039 |
cursor := Cursor sourceForm:(Form fromFile:'VVPanel.xbm') |
|
1040 |
maskForm:(Form fromFile:'VVPanel_m.xbm') |
|
1041 |
hotX:8 |
|
1042 |
hotY:8. |
|
1043 |
" |
|
1044 |
if bitmaps are not available, use a standard cursor |
|
1045 |
" |
|
1046 |
cursor isNil ifTrue:[ |
|
1047 |
"which one looks better ?" |
|
1048 |
cursor := Cursor upDownArrow |
|
1049 |
"cursor := Cursor upLimitArrow" |
|
1050 |
]. |
|
1051 |
DefaultVCursor := cursor |
|
1052 |
] |
|
1053 |
] ifFalse:[ |
|
1054 |
DefaultHCursor notNil ifTrue:[ |
|
1055 |
cursor := DefaultHCursor |
|
1056 |
] ifFalse:[ |
|
1057 |
cursor := Cursor sourceForm:(Form fromFile:'VHPanel.xbm') |
|
1058 |
maskForm:(Form fromFile:'VHPanel_m.xbm') |
|
1059 |
hotX:8 |
|
1060 |
hotY:8. |
|
1061 |
" |
|
1062 |
if bitmaps are not available, use a standard cursor |
|
1063 |
" |
|
1064 |
cursor isNil ifTrue:[ |
|
1065 |
"which one looks better ?" |
|
1066 |
cursor := Cursor leftRightArrow |
|
1067 |
"cursor := Cursor leftLimitArrow" |
|
1068 |
]. |
|
1069 |
DefaultHCursor := cursor |
|
1070 |
] |
|
1071 |
] |
|
1072 |
! |
|
1073 |
||
1074 |
initStyle |
|
1075 |
|mm| |
|
1076 |
||
1077 |
super initStyle. |
|
1078 |
||
1079 |
handleColor := DefaultHandleColor on:device. |
|
1080 |
handleLevel := DefaultHandleLevel. |
|
1081 |
||
1082 |
showHandle := DefaultShowHandle. |
|
1083 |
||
1084 |
DefaultHandleStyle isNil ifTrue:[ |
|
1085 |
handleStyle := styleSheet name |
|
1086 |
] ifFalse:[ |
|
1087 |
handleStyle := DefaultHandleStyle |
|
1088 |
]. |
|
1089 |
handleStyle == #next ifTrue:[ |
|
1090 |
shadowForm := self class shadowFormOn:device. |
|
1091 |
lightForm := self class lightFormOn:device. |
|
1092 |
||
1093 |
self barHeight:(shadowForm height + 2). |
|
1094 |
barWidth := shadowForm width. |
|
1095 |
] ifFalse:[ |
|
1096 |
shadowForm := lightForm := nil. |
|
1097 |
]. |
|
1098 |
||
1099 |
handlePosition := DefaultHandlePosition. |
|
1100 |
trackLine := DefaultTrackingLine. |
|
1101 |
separatingLine := DefaultSeparatingLine. |
|
1102 |
||
1103 |
mm := device verticalPixelPerMillimeter. |
|
1104 |
self is3D ifTrue:[ |
|
1105 |
self barHeight:(3 * mm) rounded |
|
1106 |
] ifFalse:[ |
|
1107 |
self barHeight:(2 * mm) rounded |
|
1108 |
]. |
|
1109 |
barWidth := (2 * mm) rounded. "motif style width" |
|
1110 |
handleStyle == #mswindows ifTrue:[ |
|
1111 |
barWidth := (ArrowButton new direction:#up) width + 1 |
|
1112 |
]. |
|
1113 |
! |
|
1114 |
||
1115 |
initialize |
|
1116 |
super initialize. |
|
1117 |
orientation := #vertical. |
|
1118 |
noColor := Color noColor. |
|
1119 |
! ! |
|
1120 |
||
1121 |
!VariablePanel methodsFor:'private'! |
|
1122 |
||
1123 |
anyNonRelativeSubviews |
|
1124 |
"return true, if any of my subviews has no relative origin/extent" |
|
1125 |
||
1126 |
1 to:(subViews size) do:[:index | |
|
1127 |
|view| |
|
1128 |
||
1129 |
view := subViews at:index. |
|
1130 |
view relativeCorner isNil ifTrue:[^ true]. |
|
1131 |
view relativeOrigin isNil ifTrue:[^ true] |
|
1132 |
]. |
|
1133 |
^ false |
|
1134 |
! |
|
1135 |
||
1136 |
handleOriginsDo:aBlock |
|
1137 |
"evaluate the argument block for every handle-origin" |
|
1138 |
||
1139 |
self handleOriginsFrom:1 to:(subViews size) do:aBlock |
|
1140 |
! |
|
1141 |
||
1142 |
handleOriginsFrom:start to:stop do:aBlock |
|
1143 |
"evaluate the argument block for some handle-origins" |
|
1144 |
||
1145 |
|x y hw hh hDelta vDelta |
|
1146 |
first "{ Class: SmallInteger }" |
|
1147 |
last "{ Class: SmallInteger }"| |
|
1148 |
||
1149 |
subViews notNil ifTrue:[ |
|
1150 |
shadowForm notNil ifTrue:[ |
|
1151 |
hw := shadowForm width. |
|
1152 |
hh := shadowForm height. |
|
1153 |
] ifFalse:[ |
|
1154 |
hw := hh := barWidth |
|
1155 |
]. |
|
1156 |
||
1157 |
(handleStyle ~~ #normal and:[handleStyle ~~ #mswindows]) ifTrue:[ |
|
1158 |
hDelta := barWidth // 2. |
|
1159 |
vDelta := barWidth // 2. |
|
1160 |
] ifFalse:[ |
|
1161 |
hDelta := vDelta := 0 |
|
1162 |
]. |
|
1163 |
||
1164 |
(handlePosition == #left) ifTrue:[ |
|
1165 |
x := hDelta. |
|
1166 |
y := vDelta |
|
1167 |
] ifFalse:[ |
|
1168 |
(handlePosition == #right) ifTrue:[ |
|
1169 |
x := width - hw - margin - hDelta. |
|
1170 |
y := height - hh - margin - vDelta. |
|
1171 |
] ifFalse:[ |
|
1172 |
x := width - barWidth // 2. |
|
1173 |
y := height - barWidth // 2 |
|
1174 |
] |
|
1175 |
]. |
|
1176 |
first := start + 1. |
|
1177 |
last := stop. |
|
1178 |
first to:last do:[:index | |
|
1179 |
|view| |
|
1180 |
||
1181 |
view := subViews at:index. |
|
1182 |
orientation == #vertical ifTrue:[ |
|
1183 |
y := view top "origin y" - barHeight + 1. |
|
1184 |
] ifFalse:[ |
|
1185 |
x := view left "origin x" - barHeight + 1. |
|
1186 |
]. |
|
1187 |
aBlock value:(x @ y) |
|
1188 |
] |
|
1189 |
] |
|
1190 |
! |
|
1191 |
||
1192 |
resizeSubviews |
|
1193 |
"readjust size of some subviews" |
|
1194 |
||
1195 |
self resizeSubviewsFrom:1 to:(subViews size) |
|
1196 |
! |
|
1197 |
||
1198 |
resizeSubviewsFrom:start to:stop |
|
1199 |
"readjust size of some subviews" |
|
1200 |
||
1201 |
|step nSubviews| |
|
1202 |
||
1203 |
subViews notNil ifTrue:[ |
|
1204 |
(start <= stop) ifTrue:[ |
|
1205 |
step := 1 |
|
1206 |
] ifFalse:[ |
|
1207 |
step := -1 |
|
1208 |
]. |
|
1209 |
nSubviews := subViews size. |
|
1210 |
start to:stop by:step do:[:index | |
|
1211 |
|bw view o1 o2 relOrg relCorner newOrg newCorner newExt| |
|
1212 |
||
1213 |
view := subViews at:index. |
|
1214 |
bw := view borderWidth. |
|
1215 |
||
1216 |
index == 1 ifTrue:[ |
|
1217 |
o1 := 0. |
|
1218 |
] ifFalse:[ |
|
1219 |
o1 := barHeight // 2 - bw |
|
1220 |
]. |
|
1221 |
index == nSubviews ifTrue:[ |
|
1222 |
o2 := 0. |
|
1223 |
] ifFalse:[ |
|
1224 |
o2 := barHeight // 2 - bw |
|
1225 |
]. |
|
1226 |
||
1227 |
" |
|
1228 |
relCorner := view relativeCorner. |
|
1229 |
relCorner isNil ifTrue:[ |
|
1230 |
self error:'subview must have relative corner' |
|
1231 |
]. |
|
1232 |
newCorner := view cornerFromRelativeCorner. |
|
1233 |
newCorner notNil ifTrue:[ |
|
1234 |
newCorner y:(newCorner y - o2) |
|
1235 |
]. |
|
1236 |
||
1237 |
relOrg := view relativeOrigin. |
|
1238 |
relOrg isNil ifTrue:[ |
|
1239 |
self error:'subview must have relative origin' |
|
1240 |
]. |
|
1241 |
newOrg := view originFromRelativeOrigin. |
|
1242 |
newOrg notNil ifTrue:[ |
|
1243 |
(index ~~ 1) ifTrue:[ |
|
1244 |
newOrg y:(newOrg y + o1) |
|
1245 |
]. |
|
1246 |
]. |
|
1247 |
view pixelOrigin:newOrg corner:newCorner |
|
1248 |
" |
|
1249 |
newOrg := view computeOrigin. |
|
1250 |
newOrg notNil ifTrue:[ |
|
1251 |
(index ~~ 1) ifTrue:[ |
|
1252 |
orientation == #vertical ifTrue:[ |
|
1253 |
newOrg y:(newOrg y + o1) |
|
1254 |
] ifFalse:[ |
|
1255 |
newOrg x:(newOrg x + o1) |
|
1256 |
] |
|
1257 |
]. |
|
1258 |
]. |
|
1259 |
newExt := view computeExtent. |
|
1260 |
newExt notNil ifTrue:[ |
|
1261 |
orientation == #vertical ifTrue:[ |
|
1262 |
newExt y:(newExt y - o2 - o1) |
|
1263 |
] ifFalse:[ |
|
1264 |
newExt x:(newExt x - o2 - o1) |
|
1265 |
] |
|
1266 |
]. |
|
1267 |
view pixelOrigin:newOrg extent:newExt. |
|
1268 |
] |
|
1269 |
] |
|
1270 |
! |
|
1271 |
||
1272 |
setupSubviews |
|
1273 |
"setup subviews sizes (in case of non-relative sizes)" |
|
1274 |
||
1275 |
|pos delta| |
|
1276 |
||
300 | 1277 |
"/ setup all subviews to spread evenly ... |
295 | 1278 |
|
300 | 1279 |
pos := 0.0. |
1280 |
delta := 1.0 / (subViews size). |
|
295 | 1281 |
|
300 | 1282 |
1 to:(subViews size) do:[:index | |
1283 |
|view| |
|
295 | 1284 |
|
300 | 1285 |
view := subViews at:index. |
1286 |
orientation == #vertical ifTrue:[ |
|
1287 |
index == subViews size ifTrue:[ |
|
1288 |
view origin:(0.0 @ pos) corner:(1.0 @ 1.0) |
|
295 | 1289 |
] ifFalse:[ |
300 | 1290 |
view origin:(0.0 @ pos) corner:(1.0 @ (pos + delta)) |
295 | 1291 |
]. |
300 | 1292 |
] ifFalse:[ |
1293 |
index == subViews size ifTrue:[ |
|
1294 |
view origin:(pos @ 0.0) corner:(1.0 @ 1.0) |
|
1295 |
] ifFalse:[ |
|
1296 |
view origin:(pos @ 0.0) corner:((pos + delta) @ 1.0) |
|
1297 |
]. |
|
1298 |
]. |
|
1299 |
pos := pos + delta |
|
295 | 1300 |
] |
1301 |
! ! |
|
1302 |
||
299
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1303 |
!VariablePanel methodsFor:'private tableView protocol'! |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1304 |
|
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1305 |
setupSubviewOrigins |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1306 |
"setup subviews origins (SV 16.1.95)" |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1307 |
|
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1308 |
|x y e eX eY n "{ Class: SmallInteger }"| |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1309 |
|
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1310 |
x := y := 0.0. |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1311 |
|
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1312 |
n := subViews size. |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1313 |
1 to:n do:[:index | |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1314 |
|view| |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1315 |
|
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1316 |
view := subViews at:index. |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1317 |
e := view relativeExtent. |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1318 |
e notNil ifTrue:[ |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1319 |
view relativeExtent:nil. |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1320 |
eX := e x. |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1321 |
eY := e y. |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1322 |
index == n ifTrue:[ |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1323 |
view origin:(x @ y) corner:(1.0 @ 1.0) |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1324 |
] ifFalse:[ |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1325 |
orientation == #vertical ifTrue:[ |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1326 |
view origin:(x @ y) corner:(1.0 @ (y+eY)) |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1327 |
] ifFalse:[ |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1328 |
view origin:(x @ y) corner:((x+eX) @ 1.0) |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1329 |
]. |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1330 |
]. |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1331 |
orientation == #vertical ifTrue:[ |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1332 |
y := y + eY. |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1333 |
] ifFalse:[ |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1334 |
x := x + eX. |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1335 |
] |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1336 |
] ifFalse: [ |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1337 |
view origin:(x @ y). |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1338 |
orientation == #vertical ifTrue:[ |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1339 |
y := view relativeCorner y. |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1340 |
] ifFalse:[ |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1341 |
x := view relativeCorner x. |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1342 |
] |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1343 |
]. |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1344 |
] |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1345 |
! ! |
d2f955840ad5
oops - tableViews private interface was lost - reintroduced
ah
parents:
295
diff
changeset
|
1346 |
|
295 | 1347 |
!VariablePanel class methodsFor:'documentation'! |
1348 |
||
1349 |
version |
|
396
973d4a9fa32c
setting handleStyle to nil disables handleDrawing
Claus Gittinger <cg@exept.de>
parents:
395
diff
changeset
|
1350 |
^ '$Header: /cvs/stx/stx/libwidg/VariablePanel.st,v 1.5 1996-02-24 18:07:06 cg Exp $' |
295 | 1351 |
! ! |