author | Claus Gittinger <cg@exept.de> |
Thu, 09 Apr 1998 13:32:29 +0200 | |
changeset 1483 | e0fb580b5131 |
parent 875 | 2c5dde603098 |
permissions | -rw-r--r-- |
0 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1991 by Claus Gittinger |
59 | 3 |
All Rights Reserved |
0 | 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 |
||
294
667773990289
merged all variablePanel code into a common class.
Claus Gittinger <cg@exept.de>
parents:
247
diff
changeset
|
13 |
VariablePanel subclass:#VariableVerticalPanel |
585 | 14 |
instanceVariableNames:'' |
15 |
classVariableNames:'' |
|
16 |
poolDictionaries:'' |
|
17 |
category:'Views-Layout' |
|
0 | 18 |
! |
19 |
||
38 | 20 |
!VariableVerticalPanel class methodsFor:'documentation'! |
21 |
||
22 |
copyright |
|
23 |
" |
|
24 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
59 | 25 |
All Rights Reserved |
38 | 26 |
|
27 |
This software is furnished under a license and may be used |
|
28 |
only in accordance with the terms of that license and with the |
|
29 |
inclusion of the above copyright notice. This software may not |
|
30 |
be provided or otherwise made available to, or used by, any |
|
31 |
other person. No title to or ownership of the software is |
|
32 |
hereby transferred. |
|
33 |
" |
|
34 |
! |
|
35 |
||
36 |
documentation |
|
37 |
" |
|
294
667773990289
merged all variablePanel code into a common class.
Claus Gittinger <cg@exept.de>
parents:
247
diff
changeset
|
38 |
This class is only here for backward compatibility; |
667773990289
merged all variablePanel code into a common class.
Claus Gittinger <cg@exept.de>
parents:
247
diff
changeset
|
39 |
all functionality is now in VariablePanel. Its orientation can now |
667773990289
merged all variablePanel code into a common class.
Claus Gittinger <cg@exept.de>
parents:
247
diff
changeset
|
40 |
be changed dynamically. |
667773990289
merged all variablePanel code into a common class.
Claus Gittinger <cg@exept.de>
parents:
247
diff
changeset
|
41 |
|
667773990289
merged all variablePanel code into a common class.
Claus Gittinger <cg@exept.de>
parents:
247
diff
changeset
|
42 |
A View to separate its subviews vertically by a movable bar; |
38 | 43 |
the size-ratios of the subviews can be changed by moving this bar. |
44 |
||
45 |
The bar-handle is either an exposed knob (style == #motif) |
|
46 |
or the forms defined in Scroller (style ~~ #motif) |
|
47 |
or nothing. |
|
48 |
||
49 |
The subvies dimensions MUST be given as relative sizes; |
|
50 |
typically creation is done as: |
|
0 | 51 |
|
585 | 52 |
p := VariableVerticalPanel in:superView. |
53 |
v1 := <someViewClass> origin:0.0 @ 0.0 |
|
54 |
corner:1.0 @ 0.5 |
|
55 |
in:p. |
|
56 |
v2 := <someViewClass> origin:0.0 @ 0.5 |
|
57 |
corner:1.0 @ 0.8 |
|
58 |
in:p. |
|
59 |
v3 := <someViewClass> origin:0.0 @ 0.8 |
|
60 |
corner:1.0 @ 1.0 |
|
61 |
in:p. |
|
38 | 62 |
|
585 | 63 |
|
64 |
[see also:] |
|
65 |
VariableHorizontalPanel |
|
66 |
VerticalPanelView HorizontalPanelView PanelView |
|
67 |
||
68 |
[author:] |
|
69 |
Claus Gittinger |
|
63 | 70 |
" |
71 |
! |
|
72 |
||
73 |
examples |
|
74 |
" |
|
875 | 75 |
VariableVerticalPanel is simply setting its orientation |
76 |
to #vertical. See more examples there. |
|
77 |
||
38 | 78 |
example: |
593 | 79 |
[exBegin] |
80 |
|top p v1 v2 v3| |
|
0 | 81 |
|
593 | 82 |
top := StandardSystemView new. |
83 |
top extent:300@300. |
|
84 |
||
85 |
p := VariableVerticalPanel |
|
86 |
origin:0.0 @ 0.0 |
|
87 |
corner:1.0 @ 1.0 |
|
88 |
in:top. |
|
175 | 89 |
|
593 | 90 |
v1 := View origin:0.0@0.0 corner:1.0@(1/3) in:p. |
91 |
v2 := View origin:0.0@(1/3) corner:1.0@(2/3) in:p. |
|
92 |
v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p. |
|
175 | 93 |
|
593 | 94 |
v1 viewBackground:(Color red). |
95 |
v2 viewBackground:(Color green). |
|
96 |
v3 viewBackground:(Color yellow). |
|
175 | 97 |
|
593 | 98 |
top open |
99 |
[exEnd] |
|
175 | 100 |
|
101 |
||
102 |
||
103 |
example: |
|
593 | 104 |
[exBegin] |
105 |
|top p v1 v2 v3| |
|
175 | 106 |
|
593 | 107 |
top := StandardSystemView new. |
108 |
top extent:300@300. |
|
175 | 109 |
|
593 | 110 |
p := VariableVerticalPanel |
111 |
origin:0.0 @ 0.0 |
|
112 |
corner:1.0 @ 1.0 |
|
113 |
in:top. |
|
114 |
p handleLevel:-1. |
|
175 | 115 |
|
593 | 116 |
v1 := View origin:0.0@0.0 corner:1.0@(1/3) in:p. |
117 |
v2 := View origin:0.0@(1/3) corner:1.0@(2/3) in:p. |
|
118 |
v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p. |
|
175 | 119 |
|
593 | 120 |
v1 viewBackground:(Color red). |
121 |
v2 viewBackground:(Color green). |
|
122 |
v3 viewBackground:(Color yellow). |
|
175 | 123 |
|
593 | 124 |
top open |
125 |
[exEnd] |
|
175 | 126 |
|
127 |
||
128 |
example: |
|
593 | 129 |
[exBegin] |
130 |
|top p v1 v2 v3| |
|
175 | 131 |
|
593 | 132 |
top := StandardSystemView new. |
133 |
top extent:300@300. |
|
134 |
||
135 |
p := VariableVerticalPanel |
|
136 |
origin:0.0 @ 0.0 |
|
137 |
corner:1.0 @ 1.0 |
|
138 |
in:top. |
|
175 | 139 |
|
593 | 140 |
v1 := ScrollableView for:SelectionInListView in:p. |
141 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5. |
|
142 |
v1 list:(FileDirectory directoryNamed:'/etc') contents. |
|
143 |
v1 action:[:selNr | |
|
144 |
|fullName stream text| |
|
145 |
fullName := '/etc/' , v1 selectionValue. |
|
146 |
stream := fullName asFilename readStream. |
|
147 |
stream notNil ifTrue:[ |
|
148 |
text := stream contents. |
|
149 |
v2 contents:text. |
|
150 |
v3 contents:text |
|
151 |
] |
|
152 |
]. |
|
0 | 153 |
|
593 | 154 |
v2 := TextView |
155 |
origin:0.0 @ 0.5 corner:1.0 @ 0.8 in:p. |
|
79 | 156 |
|
593 | 157 |
v3 := ScrollableView |
158 |
for:TextView |
|
159 |
in:p. |
|
160 |
v3 origin:0.0 @ 0.8 corner:1.0 @ 1.0. |
|
161 |
top open |
|
162 |
[exEnd] |
|
202 | 163 |
|
294
667773990289
merged all variablePanel code into a common class.
Claus Gittinger <cg@exept.de>
parents:
247
diff
changeset
|
164 |
example: (dynamically adding/removing views): |
593 | 165 |
[exBegin] |
166 |
|top p v1 v2 b| |
|
202 | 167 |
|
593 | 168 |
top := StandardSystemView new. |
169 |
top extent:300@300. |
|
202 | 170 |
|
593 | 171 |
b := Toggle label:'show' in:top. |
172 |
b showLamp:false. |
|
173 |
b origin:0.0 @ 0.0 corner:(1.0 @ 40). |
|
174 |
b action:[:state | |
|
175 |
state ifTrue:[ |
|
176 |
b label:'hide'. |
|
177 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5. |
|
178 |
v2 := ScrollableView for:EditTextView. |
|
179 |
v2 origin:0.0 @ 0.5 corner:1.0 @ 1.0. |
|
180 |
v2 contents:'another text'. |
|
181 |
p addSubView:v2. |
|
182 |
] ifFalse:[ |
|
183 |
b label:'show'. |
|
184 |
v2 destroy. |
|
185 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 1.0 |
|
186 |
] |
|
187 |
]. |
|
175 | 188 |
|
593 | 189 |
p := VariableVerticalPanel |
190 |
origin:0.0 @ 0.0 |
|
191 |
corner:1.0 @ 1.0 |
|
192 |
in:top. |
|
193 |
p topInset:50. |
|
99 | 194 |
|
593 | 195 |
v1 := ScrollableView for:EditTextView in:p. |
196 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 1.0. |
|
197 |
v1 contents:'some text'. |
|
105 | 198 |
|
593 | 199 |
top open |
200 |
[exEnd] |
|
294
667773990289
merged all variablePanel code into a common class.
Claus Gittinger <cg@exept.de>
parents:
247
diff
changeset
|
201 |
" |
99 | 202 |
! ! |
203 |
||
204 |
!VariableVerticalPanel methodsFor:'initializing'! |
|
205 |
||
202 | 206 |
initialize |
294
667773990289
merged all variablePanel code into a common class.
Claus Gittinger <cg@exept.de>
parents:
247
diff
changeset
|
207 |
orientation := #vertical. |
202 | 208 |
super initialize. |
99 | 209 |
! ! |
210 |
||
205 | 211 |
!VariableVerticalPanel class methodsFor:'documentation'! |
212 |
||
213 |
version |
|
875 | 214 |
^ '$Header: /cvs/stx/stx/libwidg/Attic/VarVPanel.st,v 1.29 1996-11-07 16:32:48 cg Exp $' |
205 | 215 |
! ! |