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