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