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