author | Claus Gittinger <cg@exept.de> |
Sat, 20 Jun 2009 10:47:07 +0200 | |
changeset 3901 | 113dd960ba11 |
parent 2523 | c10ebb01ab09 |
child 4315 | 2fae654d2a11 |
permissions | -rw-r--r-- |
0 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1992 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:
205
diff
changeset
|
15 |
VariablePanel subclass:#VariableHorizontalPanel |
496 | 16 |
instanceVariableNames:'' |
17 |
classVariableNames:'' |
|
18 |
poolDictionaries:'' |
|
19 |
category:'Views-Layout' |
|
0 | 20 |
! |
21 |
||
38 | 22 |
!VariableHorizontalPanel class methodsFor:'documentation'! |
23 |
||
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 1992 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:
205
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:
205
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:
205
diff
changeset
|
42 |
be changed dynamically. |
667773990289
merged all variablePanel code into a common class.
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
43 |
|
667773990289
merged all variablePanel code into a common class.
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
44 |
A View to separate its subviews horizontally by a movable bar |
38 | 45 |
to adjust the size-ratios. |
46 |
The bar-handle is either an exposed knob (knobStyle == #motif) |
|
47 |
or the forms defined in Scroller (knobStyle ~~ #motif) |
|
48 |
or nothing. |
|
49 |
||
50 |
The subvies dimensions MUST be given as relative sizes; |
|
51 |
typically creation is done as: |
|
0 | 52 |
|
496 | 53 |
p := VariableHorizontalPanel in:superView. |
54 |
v1 := <someViewClass> origin:0.0 @ 0.0 |
|
55 |
corner:0.5 @ 1.0 |
|
56 |
in:p. |
|
57 |
v2 := <someViewClass> origin:0.5 @ 0.0 |
|
58 |
corner:0.8 @ 1.0 |
|
59 |
in:p. |
|
60 |
v3 := <someViewClass> origin:0.8 @ 0.0 |
|
61 |
corner:1.0 @ 1.0 |
|
62 |
in:p. |
|
63 |
||
64 |
See examples. |
|
585 | 65 |
|
66 |
[author:] |
|
67 |
Claus Gittinger |
|
63 | 68 |
" |
69 |
! |
|
70 |
||
71 |
examples |
|
72 |
" |
|
875 | 73 |
VariableHorizontalPanel is simply setting its orientation |
74 |
to #horizontal. See more examples there. |
|
75 |
||
496 | 76 |
dummy example: 2 views side-by-side |
593 | 77 |
[exBegin] |
496 | 78 |
|top p v1 v2| |
79 |
||
80 |
top := StandardSystemView new. |
|
81 |
top extent:300@200. |
|
82 |
||
83 |
p := VariableHorizontalPanel |
|
84 |
origin:0.0 @ 0.0 |
|
85 |
corner:1.0 @ 1.0 |
|
86 |
in:top. |
|
87 |
||
88 |
v1 := View |
|
89 |
origin:0.0 @ 0.0 |
|
90 |
corner:0.5 @ 1.0 |
|
91 |
in:p. |
|
92 |
v1 viewBackground:Color red. |
|
93 |
||
94 |
v2 := View |
|
95 |
origin:0.5 @ 0.0 |
|
96 |
corner:1.0 @ 1.0 |
|
97 |
in:p. |
|
98 |
v2 viewBackground:Color green. |
|
99 |
||
100 |
top open |
|
593 | 101 |
[exEnd] |
496 | 102 |
|
103 |
||
104 |
concrete example: a selectionInListView and a TextView side-by-side |
|
105 |
(not useful - need scrollBars; see next example) |
|
593 | 106 |
[exBegin] |
496 | 107 |
|top p v1 v2| |
108 |
||
109 |
top := StandardSystemView new. |
|
110 |
top extent:400@300. |
|
111 |
||
112 |
p := VariableHorizontalPanel |
|
113 |
origin:0.0 @ 0.0 |
|
114 |
corner:1.0 @ 1.0 |
|
115 |
in:top. |
|
116 |
||
117 |
v1 := SelectionInListView |
|
118 |
origin:0.0 @ 0.0 |
|
119 |
corner:0.5 @ 1.0 |
|
120 |
in:p. |
|
121 |
v1 list:('/etc' asFilename directoryContents). |
|
122 |
v1 useIndex:false. |
|
123 |
v1 action:[:name | v2 contents:('/etc/' , name) |
|
124 |
asFilename contentsOfEntireFile |
|
125 |
]. |
|
126 |
||
127 |
v2 := TextView |
|
128 |
origin:0.5 @ 0.0 |
|
129 |
corner:1.0 @ 1.0 |
|
130 |
in:p. |
|
131 |
||
132 |
top open |
|
593 | 133 |
[exEnd] |
496 | 134 |
|
135 |
||
136 |
better - with scrollBars (but thats another story ... see ScrollableView examples for more): |
|
593 | 137 |
[exBegin] |
496 | 138 |
|top p v1 v2| |
139 |
||
140 |
top := StandardSystemView new. |
|
141 |
top extent:400@300. |
|
142 |
||
143 |
p := VariableHorizontalPanel |
|
144 |
origin:0.0 @ 0.0 |
|
145 |
corner:1.0 @ 1.0 |
|
146 |
in:top. |
|
147 |
||
148 |
v1 := ScrollableView for:SelectionInListView |
|
149 |
origin:0.0 @ 0.0 |
|
150 |
corner:0.5 @ 1.0 |
|
151 |
in:p. |
|
152 |
v1 list:('/etc' asFilename directoryContents). |
|
153 |
v1 useIndex:false. |
|
154 |
v1 action:[:name | v2 contents:('/etc/' , name) |
|
155 |
asFilename contentsOfEntireFile |
|
156 |
]. |
|
157 |
||
158 |
v2 := ScrollableView for:TextView |
|
159 |
origin:0.5 @ 0.0 |
|
160 |
corner:1.0 @ 1.0 |
|
161 |
in:p. |
|
162 |
||
163 |
top open |
|
593 | 164 |
[exEnd] |
496 | 165 |
|
166 |
||
167 |
another stupid example: 3-views side-by-side |
|
593 | 168 |
[exBegin] |
496 | 169 |
|top p v1 v2 v3| |
170 |
||
171 |
top := StandardSystemView new. |
|
172 |
top extent:550@200. |
|
173 |
||
174 |
p := VariableHorizontalPanel |
|
175 |
origin:0.0 @ 0.0 |
|
176 |
corner:1.0 @ 1.0 |
|
177 |
in:top. |
|
178 |
||
179 |
v1 := SelectionInListView |
|
180 |
origin:0.0 @ 0.0 |
|
181 |
corner:0.3 @ 1.0 |
|
182 |
in:p. |
|
183 |
v1 level:-1. |
|
184 |
v1 list:#('one' 'two' 'three' nil 'dont expect' 'something' 'to happen here'). |
|
185 |
||
186 |
v2 := EditTextView |
|
187 |
origin:0.3 @ 0.0 |
|
188 |
corner:0.6 @ 1.0 |
|
189 |
in:p. |
|
190 |
v2 contents:'nonScrollable\EditTextView' withCRs. |
|
191 |
||
192 |
v3 := ScrollableView |
|
193 |
for:TextView |
|
194 |
origin:0.6 @ 0.0 |
|
195 |
corner:1.0 @ 1.0 |
|
196 |
in:p. |
|
197 |
v3 contents:'scrollable\TextView\\(read only)\\\\\\\\\\\\\\\\\concratulations !!\you managed\to scroll down' withCRs. |
|
198 |
top open |
|
593 | 199 |
[exEnd] |
38 | 200 |
" |
202 | 201 |
! ! |
202 |
||
2523 | 203 |
!VariableHorizontalPanel methodsFor:'initialization'! |
202 | 204 |
|
294
667773990289
merged all variablePanel code into a common class.
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
205 |
initialize |
496 | 206 |
orientation := #horizontal. |
294
667773990289
merged all variablePanel code into a common class.
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
207 |
super initialize. |
496 | 208 |
|
209 |
"Modified: 7.3.1996 / 14:08:35 / cg" |
|
0 | 210 |
! ! |
211 |
||
205 | 212 |
!VariableHorizontalPanel class methodsFor:'documentation'! |
213 |
||
214 |
version |
|
2523 | 215 |
^ '$Header: /cvs/stx/stx/libwidg/VariableHorizontalPanel.st,v 1.23 2002-03-01 15:17:06 cg Exp $' |
205 | 216 |
! ! |