author | Claus Gittinger <cg@exept.de> |
Wed, 12 Jun 1996 14:57:41 +0200 | |
changeset 762 | 832730063164 |
parent 593 | 86dd024ed773 |
child 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 |
" |
|
38 | 75 |
example: |
593 | 76 |
[exBegin] |
77 |
|top p v1 v2 v3| |
|
0 | 78 |
|
593 | 79 |
top := StandardSystemView new. |
80 |
top extent:300@300. |
|
81 |
||
82 |
p := VariableVerticalPanel |
|
83 |
origin:0.0 @ 0.0 |
|
84 |
corner:1.0 @ 1.0 |
|
85 |
in:top. |
|
175 | 86 |
|
593 | 87 |
v1 := View origin:0.0@0.0 corner:1.0@(1/3) in:p. |
88 |
v2 := View origin:0.0@(1/3) corner:1.0@(2/3) in:p. |
|
89 |
v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p. |
|
175 | 90 |
|
593 | 91 |
v1 viewBackground:(Color red). |
92 |
v2 viewBackground:(Color green). |
|
93 |
v3 viewBackground:(Color yellow). |
|
175 | 94 |
|
593 | 95 |
top open |
96 |
[exEnd] |
|
175 | 97 |
|
98 |
||
99 |
||
100 |
example: |
|
593 | 101 |
[exBegin] |
102 |
|top p v1 v2 v3| |
|
175 | 103 |
|
593 | 104 |
top := StandardSystemView new. |
105 |
top extent:300@300. |
|
175 | 106 |
|
593 | 107 |
p := VariableVerticalPanel |
108 |
origin:0.0 @ 0.0 |
|
109 |
corner:1.0 @ 1.0 |
|
110 |
in:top. |
|
111 |
p handleLevel:-1. |
|
175 | 112 |
|
593 | 113 |
v1 := View origin:0.0@0.0 corner:1.0@(1/3) in:p. |
114 |
v2 := View origin:0.0@(1/3) corner:1.0@(2/3) in:p. |
|
115 |
v3 := View origin:0.0@(2/3) corner:1.0@1.0 in:p. |
|
175 | 116 |
|
593 | 117 |
v1 viewBackground:(Color red). |
118 |
v2 viewBackground:(Color green). |
|
119 |
v3 viewBackground:(Color yellow). |
|
175 | 120 |
|
593 | 121 |
top open |
122 |
[exEnd] |
|
175 | 123 |
|
124 |
||
125 |
example: |
|
593 | 126 |
[exBegin] |
127 |
|top p v1 v2 v3| |
|
175 | 128 |
|
593 | 129 |
top := StandardSystemView new. |
130 |
top extent:300@300. |
|
131 |
||
132 |
p := VariableVerticalPanel |
|
133 |
origin:0.0 @ 0.0 |
|
134 |
corner:1.0 @ 1.0 |
|
135 |
in:top. |
|
175 | 136 |
|
593 | 137 |
v1 := ScrollableView for:SelectionInListView in:p. |
138 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5. |
|
139 |
v1 list:(FileDirectory directoryNamed:'/etc') contents. |
|
140 |
v1 action:[:selNr | |
|
141 |
|fullName stream text| |
|
142 |
fullName := '/etc/' , v1 selectionValue. |
|
143 |
stream := fullName asFilename readStream. |
|
144 |
stream notNil ifTrue:[ |
|
145 |
text := stream contents. |
|
146 |
v2 contents:text. |
|
147 |
v3 contents:text |
|
148 |
] |
|
149 |
]. |
|
0 | 150 |
|
593 | 151 |
v2 := TextView |
152 |
origin:0.0 @ 0.5 corner:1.0 @ 0.8 in:p. |
|
79 | 153 |
|
593 | 154 |
v3 := ScrollableView |
155 |
for:TextView |
|
156 |
in:p. |
|
157 |
v3 origin:0.0 @ 0.8 corner:1.0 @ 1.0. |
|
158 |
top open |
|
159 |
[exEnd] |
|
202 | 160 |
|
294
667773990289
merged all variablePanel code into a common class.
Claus Gittinger <cg@exept.de>
parents:
247
diff
changeset
|
161 |
example: (dynamically adding/removing views): |
593 | 162 |
[exBegin] |
163 |
|top p v1 v2 b| |
|
202 | 164 |
|
593 | 165 |
top := StandardSystemView new. |
166 |
top extent:300@300. |
|
202 | 167 |
|
593 | 168 |
b := Toggle label:'show' in:top. |
169 |
b showLamp:false. |
|
170 |
b origin:0.0 @ 0.0 corner:(1.0 @ 40). |
|
171 |
b action:[:state | |
|
172 |
state ifTrue:[ |
|
173 |
b label:'hide'. |
|
174 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5. |
|
175 |
v2 := ScrollableView for:EditTextView. |
|
176 |
v2 origin:0.0 @ 0.5 corner:1.0 @ 1.0. |
|
177 |
v2 contents:'another text'. |
|
178 |
p addSubView:v2. |
|
179 |
] ifFalse:[ |
|
180 |
b label:'show'. |
|
181 |
v2 destroy. |
|
182 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 1.0 |
|
183 |
] |
|
184 |
]. |
|
175 | 185 |
|
593 | 186 |
p := VariableVerticalPanel |
187 |
origin:0.0 @ 0.0 |
|
188 |
corner:1.0 @ 1.0 |
|
189 |
in:top. |
|
190 |
p topInset:50. |
|
99 | 191 |
|
593 | 192 |
v1 := ScrollableView for:EditTextView in:p. |
193 |
v1 origin:0.0 @ 0.0 corner:1.0 @ 1.0. |
|
194 |
v1 contents:'some text'. |
|
105 | 195 |
|
593 | 196 |
top open |
197 |
[exEnd] |
|
294
667773990289
merged all variablePanel code into a common class.
Claus Gittinger <cg@exept.de>
parents:
247
diff
changeset
|
198 |
" |
99 | 199 |
! ! |
200 |
||
201 |
!VariableVerticalPanel methodsFor:'initializing'! |
|
202 |
||
202 | 203 |
initialize |
294
667773990289
merged all variablePanel code into a common class.
Claus Gittinger <cg@exept.de>
parents:
247
diff
changeset
|
204 |
orientation := #vertical. |
202 | 205 |
super initialize. |
99 | 206 |
! ! |
207 |
||
205 | 208 |
!VariableVerticalPanel class methodsFor:'documentation'! |
209 |
||
210 |
version |
|
593 | 211 |
^ '$Header: /cvs/stx/stx/libwidg/VariableVerticalPanel.st,v 1.28 1996-04-27 18:20:10 cg Exp $' |
205 | 212 |
! ! |