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