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