author | Claus Gittinger <cg@exept.de> |
Fri, 21 Jul 2000 17:54:55 +0200 | |
changeset 2200 | 8dad27a92dbd |
parent 875 | 2c5dde603098 |
child 2523 | c10ebb01ab09 |
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 |
" |
|
875 | 71 |
VariableHorizontalPanel is simply setting its orientation |
72 |
to #horizontal. See more examples there. |
|
73 |
||
496 | 74 |
dummy example: 2 views side-by-side |
593 | 75 |
[exBegin] |
496 | 76 |
|top p v1 v2| |
77 |
||
78 |
top := StandardSystemView new. |
|
79 |
top extent:300@200. |
|
80 |
||
81 |
p := VariableHorizontalPanel |
|
82 |
origin:0.0 @ 0.0 |
|
83 |
corner:1.0 @ 1.0 |
|
84 |
in:top. |
|
85 |
||
86 |
v1 := View |
|
87 |
origin:0.0 @ 0.0 |
|
88 |
corner:0.5 @ 1.0 |
|
89 |
in:p. |
|
90 |
v1 viewBackground:Color red. |
|
91 |
||
92 |
v2 := View |
|
93 |
origin:0.5 @ 0.0 |
|
94 |
corner:1.0 @ 1.0 |
|
95 |
in:p. |
|
96 |
v2 viewBackground:Color green. |
|
97 |
||
98 |
top open |
|
593 | 99 |
[exEnd] |
496 | 100 |
|
101 |
||
102 |
concrete example: a selectionInListView and a TextView side-by-side |
|
103 |
(not useful - need scrollBars; see next example) |
|
593 | 104 |
[exBegin] |
496 | 105 |
|top p v1 v2| |
106 |
||
107 |
top := StandardSystemView new. |
|
108 |
top extent:400@300. |
|
109 |
||
110 |
p := VariableHorizontalPanel |
|
111 |
origin:0.0 @ 0.0 |
|
112 |
corner:1.0 @ 1.0 |
|
113 |
in:top. |
|
114 |
||
115 |
v1 := SelectionInListView |
|
116 |
origin:0.0 @ 0.0 |
|
117 |
corner:0.5 @ 1.0 |
|
118 |
in:p. |
|
119 |
v1 list:('/etc' asFilename directoryContents). |
|
120 |
v1 useIndex:false. |
|
121 |
v1 action:[:name | v2 contents:('/etc/' , name) |
|
122 |
asFilename contentsOfEntireFile |
|
123 |
]. |
|
124 |
||
125 |
v2 := TextView |
|
126 |
origin:0.5 @ 0.0 |
|
127 |
corner:1.0 @ 1.0 |
|
128 |
in:p. |
|
129 |
||
130 |
top open |
|
593 | 131 |
[exEnd] |
496 | 132 |
|
133 |
||
134 |
better - with scrollBars (but thats another story ... see ScrollableView examples for more): |
|
593 | 135 |
[exBegin] |
496 | 136 |
|top p v1 v2| |
137 |
||
138 |
top := StandardSystemView new. |
|
139 |
top extent:400@300. |
|
140 |
||
141 |
p := VariableHorizontalPanel |
|
142 |
origin:0.0 @ 0.0 |
|
143 |
corner:1.0 @ 1.0 |
|
144 |
in:top. |
|
145 |
||
146 |
v1 := ScrollableView for:SelectionInListView |
|
147 |
origin:0.0 @ 0.0 |
|
148 |
corner:0.5 @ 1.0 |
|
149 |
in:p. |
|
150 |
v1 list:('/etc' asFilename directoryContents). |
|
151 |
v1 useIndex:false. |
|
152 |
v1 action:[:name | v2 contents:('/etc/' , name) |
|
153 |
asFilename contentsOfEntireFile |
|
154 |
]. |
|
155 |
||
156 |
v2 := ScrollableView for:TextView |
|
157 |
origin:0.5 @ 0.0 |
|
158 |
corner:1.0 @ 1.0 |
|
159 |
in:p. |
|
160 |
||
161 |
top open |
|
593 | 162 |
[exEnd] |
496 | 163 |
|
164 |
||
165 |
another stupid example: 3-views side-by-side |
|
593 | 166 |
[exBegin] |
496 | 167 |
|top p v1 v2 v3| |
168 |
||
169 |
top := StandardSystemView new. |
|
170 |
top extent:550@200. |
|
171 |
||
172 |
p := VariableHorizontalPanel |
|
173 |
origin:0.0 @ 0.0 |
|
174 |
corner:1.0 @ 1.0 |
|
175 |
in:top. |
|
176 |
||
177 |
v1 := SelectionInListView |
|
178 |
origin:0.0 @ 0.0 |
|
179 |
corner:0.3 @ 1.0 |
|
180 |
in:p. |
|
181 |
v1 level:-1. |
|
182 |
v1 list:#('one' 'two' 'three' nil 'dont expect' 'something' 'to happen here'). |
|
183 |
||
184 |
v2 := EditTextView |
|
185 |
origin:0.3 @ 0.0 |
|
186 |
corner:0.6 @ 1.0 |
|
187 |
in:p. |
|
188 |
v2 contents:'nonScrollable\EditTextView' withCRs. |
|
189 |
||
190 |
v3 := ScrollableView |
|
191 |
for:TextView |
|
192 |
origin:0.6 @ 0.0 |
|
193 |
corner:1.0 @ 1.0 |
|
194 |
in:p. |
|
195 |
v3 contents:'scrollable\TextView\\(read only)\\\\\\\\\\\\\\\\\concratulations !!\you managed\to scroll down' withCRs. |
|
196 |
top open |
|
593 | 197 |
[exEnd] |
38 | 198 |
" |
202 | 199 |
! ! |
200 |
||
201 |
!VariableHorizontalPanel methodsFor:'initializing'! |
|
202 |
||
294
667773990289
merged all variablePanel code into a common class.
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
203 |
initialize |
496 | 204 |
orientation := #horizontal. |
294
667773990289
merged all variablePanel code into a common class.
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
205 |
super initialize. |
496 | 206 |
|
207 |
"Modified: 7.3.1996 / 14:08:35 / cg" |
|
0 | 208 |
! ! |
209 |
||
205 | 210 |
!VariableHorizontalPanel class methodsFor:'documentation'! |
211 |
||
212 |
version |
|
875 | 213 |
^ '$Header: /cvs/stx/stx/libwidg/VariableHorizontalPanel.st,v 1.22 1996-11-07 16:32:31 cg Exp $' |
205 | 214 |
! ! |