author | Claus Gittinger <cg@exept.de> |
Fri, 11 Feb 2000 15:57:10 +0100 | |
changeset 2137 | 2642e627bb2a |
parent 2135 | 955901594758 |
child 2144 | 8cfc21c91319 |
permissions | -rw-r--r-- |
0 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
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 |
||
119 | 13 |
SimpleView subclass:#ScrollableView |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
14 |
instanceVariableNames:'scrolledView vScrollBar hScrollBar scrollBarPosition lockUpdates |
1556
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
15 |
hideVScrollBar hideHScrollBar hasHorizontalScrollBar |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
16 |
hasVerticalScrollBar horizontalMini verticalMini vScrollBarHidden |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
17 |
hScrollBarHidden' |
1111 | 18 |
classVariableNames:'DefaultScrolledViewLevel DefaultScrolledViewMargin |
19 |
DefaultScrollBarSpacing DefaultScrolledViewBorderWidth |
|
20 |
DefaultLevel DefaultScrollBarLevel MyDefaultViewBackgroundColor' |
|
444
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
21 |
poolDictionaries:'' |
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
22 |
category:'Views-Basic' |
0 | 23 |
! |
24 |
||
852 | 25 |
!ScrollableView class methodsFor:'documentation'! |
38 | 26 |
|
27 |
copyright |
|
28 |
" |
|
29 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
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 |
" |
|
43 |
a view containing a scrollbar and some other (slave-)view. |
|
130 | 44 |
This view wraps scrollbar(s) around the view to be scrolled. |
65 | 45 |
The scrollbars are setup to send scrollUp/scrollDown/scrollVerticalTo |
46 |
and scrollLeft/scrollRight/scrollHorizontalTo- messages whenever moved. |
|
130 | 47 |
The view itself has to implement these (there is a default implementation |
1459 | 48 |
in the common View class for this - so your widgets usually dont have to |
49 |
care for this). |
|
65 | 50 |
|
51 |
For the scrollbars to know about the full (maximum) size, the view |
|
1459 | 52 |
MUST implement #heightOfContents and/or #widthOfContents. |
53 |
The values returned by those methods are used to compute the fraction |
|
130 | 54 |
which is visible (i.e. the scrollers thumb heights). |
65 | 55 |
|
1459 | 56 |
There are three ways to setup a scrollableView: |
38 | 57 |
if the type of the view to be scrolled is known in advance, |
58 |
use: |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
59 |
v := ScrollableView for:<ViewClass> |
130 | 60 |
or: |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
61 |
v := ScrollableView for:<ViewClass> in:someSuperView |
65 | 62 |
|
1459 | 63 |
|
64 |
otherwise, create an empty scrollableView with: |
|
130 | 65 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
66 |
v := ScrollableView new |
130 | 67 |
or: |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
68 |
v := ScrollableView in:someSuperView |
130 | 69 |
|
65 | 70 |
and define the view later with: |
130 | 71 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
72 |
v scrolledView:aViewToBeScrolled |
65 | 73 |
|
1459 | 74 |
|
130 | 75 |
Finally, if the view to be scrolled has been already created, |
76 |
use: |
|
77 |
||
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
78 |
v := ScrollableView forView:aViewToBeScrolled |
130 | 79 |
or: |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
80 |
v := ScrollableView forView:aViewToBeScrolled in:someSuperView |
65 | 81 |
|
130 | 82 |
It is also possible to change the scrolledView later (even multiple times). |
83 |
This may be useful, if different views are needed to display different types |
|
84 |
of data (see example2) and at creation time, it is not known what type |
|
1459 | 85 |
of view is required (multidocument format applications). |
130 | 86 |
|
1459 | 87 |
If you want to scroll a bucnh of other views (instead of a views contents), |
88 |
you need a companion class (ViewScroller). See the documentation there. |
|
65 | 89 |
|
90 |
If you need horizontal scrolling too, use an instance of HVScrollableView. |
|
113 | 91 |
|
92 |
By default, scrollbars are full size scrollbars - for horizontal scrolling |
|
93 |
(which is less often used), scrollableViews can optionally be created with |
|
94 |
miniscrollers which take up less screen space. |
|
130 | 95 |
|
96 |
TODO: |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
97 |
this is pretty old and needs a rewrite. There are quite some |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
98 |
historic leftovers found here and things can be done better |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
99 |
(especially in initializeFor...) |
584 | 100 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
101 |
Also, it should be rewritten into one class which supports both |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
102 |
Vertical-only, Horizontal-only and HV scrolling. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
103 |
Currently, horizontal-only scrolling is not available. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
104 |
(you have to write your own class ...) |
130 | 105 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
106 |
Finally, some means to hide scrollbars should be added - this would |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
107 |
give more screenspace to the view when all is visible |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
108 |
(and therefore, the scrollbars are not needed, anyway) |
584 | 109 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
110 |
Expect the above things to be fixed in an upcoming version. |
130 | 111 |
|
1459 | 112 |
Recent changes: |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
113 |
Originally, there where two classes, for vertical-only and |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
114 |
horizontal+vertical scrollability. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
115 |
These have now been merged into the common ScrollableView class, |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
116 |
and each scrollability can be controlled individually. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
117 |
The original HVScrollableView class is almost empty, but remains |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
118 |
for backward compatibility (it simply initializes the scrollability |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
119 |
flags for H+V scrollability). |
1459 | 120 |
|
584 | 121 |
[author:] |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
122 |
Claus Gittinger |
130 | 123 |
|
584 | 124 |
[see also:] |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
125 |
ScrollBar Scroller |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
126 |
HVScrollableView |
63 | 127 |
" |
128 |
! |
|
38 | 129 |
|
63 | 130 |
examples |
131 |
" |
|
1138 | 132 |
simple scrolled text: |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
133 |
[exBegin] |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
134 |
|top scr txt| |
0 | 135 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
136 |
top := StandardSystemView label:'scroll example1'. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
137 |
top extent:200@100. |
113 | 138 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
139 |
scr := ScrollableView for:EditTextView in:top. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
140 |
scr origin:0.0@0.0 corner:1.0@1.0. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
141 |
txt := scr scrolledView. |
38 | 142 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
143 |
txt list:#('line1' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
144 |
'line2' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
145 |
'line3' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
146 |
'line4' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
147 |
'line5' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
148 |
'line7' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
149 |
'line8' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
150 |
'line9' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
151 |
'line10' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
152 |
). |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
153 |
top open |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
154 |
[exEnd] |
38 | 155 |
|
65 | 156 |
|
1138 | 157 |
changing the scrolledView later: |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
158 |
[exBegin] |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
159 |
|top scr txtView1 txtView2 browserView| |
38 | 160 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
161 |
top := StandardSystemView label:'scroll example2'. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
162 |
top extent:300@100. |
113 | 163 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
164 |
scr := ScrollableView in:top. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
165 |
scr origin:0.0@0.0 corner:1.0@1.0. |
113 | 166 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
167 |
top open. |
0 | 168 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
169 |
(Delay forSeconds:5) wait. |
38 | 170 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
171 |
txtView1 := EditTextView new. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
172 |
txtView1 list:#( |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
173 |
'wait 5 seconds to see the other text' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
174 |
'line2' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
175 |
'line3' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
176 |
'line4' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
177 |
'line5' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
178 |
'line7' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
179 |
'line8' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
180 |
'line9' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
181 |
'line10' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
182 |
). |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
183 |
scr scrolledView:txtView1. |
38 | 184 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
185 |
(Delay forSeconds:5) wait. |
38 | 186 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
187 |
txtView2 := EditTextView new. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
188 |
txtView2 list:#('this is the other views text' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
189 |
'alternative line2' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
190 |
'alternative line3' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
191 |
'alternative line4' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
192 |
'alternative line5' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
193 |
'alternative line6'). |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
194 |
scr scrolledView:txtView2. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
195 |
[exEnd] |
113 | 196 |
|
197 |
||
198 |
||
199 |
||
1138 | 200 |
using a miniscroller: |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
201 |
[exBegin] |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
202 |
|top scr txt| |
113 | 203 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
204 |
top := StandardSystemView label:'scroll example3'. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
205 |
top extent:200@100. |
113 | 206 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
207 |
scr := ScrollableView for:EditTextView miniScroller:true in:top. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
208 |
scr origin:0.0@0.0 corner:1.0@1.0. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
209 |
txt := scr scrolledView. |
113 | 210 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
211 |
txt list:#('line1' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
212 |
'line2' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
213 |
'line3' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
214 |
'line4' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
215 |
'line5' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
216 |
'line7' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
217 |
'line8' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
218 |
'line9' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
219 |
'line10' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
220 |
). |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
221 |
top open |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
222 |
[exEnd] |
113 | 223 |
|
224 |
||
225 |
||
1138 | 226 |
scrolling in both directions: |
227 |
Notice: HVScrollableView remains existent for backward compatibility; |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
228 |
scrollability can now be controlled in both directions at any |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
229 |
time (see examples below). |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
230 |
[exBegin] |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
231 |
|top scr txt| |
113 | 232 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
233 |
top := StandardSystemView label:'scroll example4'. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
234 |
top extent:200@100. |
113 | 235 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
236 |
scr := HVScrollableView for:EditTextView in:top. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
237 |
scr origin:0.0@0.0 corner:1.0@1.0. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
238 |
txt := scr scrolledView. |
113 | 239 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
240 |
txt list:#('line1' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
241 |
'line2' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
242 |
'line3' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
243 |
'line4' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
244 |
'line5' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
245 |
'line7' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
246 |
'line8' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
247 |
'line9' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
248 |
'line10' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
249 |
). |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
250 |
top open |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
251 |
[exEnd] |
113 | 252 |
|
253 |
||
254 |
||
1138 | 255 |
using a full scroller vertically, miniscroller horizontally: |
256 |
Notice: HVScrollableView remains existent for backward compatibility; |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
257 |
scrollability can now be controlled in both directions at any |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
258 |
time (see examples below). |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
259 |
[exBegin] |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
260 |
|top scr txt| |
113 | 261 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
262 |
top := StandardSystemView label:'scroll example5'. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
263 |
top extent:200@100. |
113 | 264 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
265 |
scr := HVScrollableView for:EditTextView miniScrollerH:true in:top. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
266 |
scr origin:0.0@0.0 corner:1.0@1.0. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
267 |
txt := scr scrolledView. |
113 | 268 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
269 |
txt list:#('line1' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
270 |
'line2' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
271 |
'line3' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
272 |
'line4' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
273 |
'line5' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
274 |
'line7' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
275 |
'line8' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
276 |
'line9' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
277 |
'line10' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
278 |
). |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
279 |
top open |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
280 |
[exEnd] |
113 | 281 |
|
282 |
||
283 |
||
1138 | 284 |
using miniscrollers for both directions: |
285 |
Notice: HVScrollableView remains existent for backward compatibility; |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
286 |
scrollability can now be controlled in both directions at any |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
287 |
time (see examples below). |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
288 |
[exBegin] |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
289 |
|top scr txt| |
113 | 290 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
291 |
top := StandardSystemView label:'scroll example6'. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
292 |
top extent:200@100. |
113 | 293 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
294 |
scr := HVScrollableView for:EditTextView miniScroller:true in:top. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
295 |
scr origin:0.0@0.0 corner:1.0@1.0. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
296 |
txt := scr scrolledView. |
113 | 297 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
298 |
txt list:#('line1' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
299 |
'line2' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
300 |
'line3' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
301 |
'line4' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
302 |
'line5' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
303 |
'line7' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
304 |
'line8' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
305 |
'line9' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
306 |
'line10' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
307 |
). |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
308 |
top open |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
309 |
[exEnd] |
1138 | 310 |
controlling scrollability: |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
311 |
[exBegin] |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
312 |
|top scr txt| |
1138 | 313 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
314 |
top := StandardSystemView label:'scroll example6'. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
315 |
top extent:200@100. |
1138 | 316 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
317 |
txt := EditTextView new. |
1138 | 318 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
319 |
scr := ScrollableView forView:txt in:top. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
320 |
scr origin:0.0@0.0 corner:1.0@1.0. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
321 |
scr horizontalScrollable:true. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
322 |
scr verticalScrollable:false. |
1138 | 323 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
324 |
txt list:#('line1' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
325 |
'line2' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
326 |
'line3' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
327 |
'line4' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
328 |
'line5' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
329 |
'line7' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
330 |
'line8' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
331 |
'line9' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
332 |
'line10' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
333 |
). |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
334 |
top open |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
335 |
[exEnd] |
1138 | 336 |
controlling scrollability and miniScroller: |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
337 |
[exBegin] |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
338 |
|top scr txt| |
1138 | 339 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
340 |
top := StandardSystemView label:'scroll example6'. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
341 |
top extent:200@100. |
1138 | 342 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
343 |
txt := EditTextView new. |
1138 | 344 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
345 |
scr := ScrollableView forView:txt in:top. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
346 |
scr origin:0.0@0.0 corner:1.0@1.0. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
347 |
scr horizontalScrollable:true; horizontalMini:false. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
348 |
scr verticalScrollable:true; verticalMini:true. |
1138 | 349 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
350 |
txt list:#('line1' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
351 |
'line2' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
352 |
'line3' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
353 |
'line4' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
354 |
'line5' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
355 |
'line7' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
356 |
'line8' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
357 |
'line9' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
358 |
'line10' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
359 |
). |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
360 |
top open |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
361 |
[exEnd] |
1459 | 362 |
autohiding scrollbars (edit the text to make scrollbars visible/invisible) |
363 |
(NOTICE: |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
364 |
this is controlled by the styleSheet and |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
365 |
should normally NOT be done by the program): |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
366 |
[exBegin] |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
367 |
|top scr txt| |
1459 | 368 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
369 |
top := StandardSystemView label:'scroll example6'. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
370 |
top extent:200@100. |
1459 | 371 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
372 |
txt := EditTextView new. |
1459 | 373 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
374 |
scr := ScrollableView forView:txt in:top. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
375 |
scr origin:0.0@0.0 corner:1.0@1.0. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
376 |
scr horizontalScrollable:true; horizontalMini:false. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
377 |
scr verticalScrollable:true; verticalMini:true. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
378 |
scr autoHideScrollBars:true. |
1459 | 379 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
380 |
txt list:#('line1' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
381 |
'line2' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
382 |
'line3' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
383 |
'line4' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
384 |
'line5' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
385 |
'line7' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
386 |
'line8' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
387 |
'line9' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
388 |
'line10' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
389 |
). |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
390 |
top open |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
391 |
[exEnd] |
38 | 392 |
" |
393 |
! ! |
|
0 | 394 |
|
852 | 395 |
!ScrollableView class methodsFor:'instance creation'! |
217 | 396 |
|
397 |
for:aViewClass |
|
398 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
399 |
The subview is created here. |
|
400 |
The view will have full scrollbars." |
|
401 |
||
1111 | 402 |
^ self |
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
403 |
for:aViewClass |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
404 |
hasHorizontalScrollBar:self defaultHorizontalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
405 |
hasVerticalScrollBar:self defaultVerticalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
406 |
miniScrollerH:false |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
407 |
miniScrollerV:false |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
408 |
origin:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
409 |
corner:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
410 |
in:nil |
1111 | 411 |
|
412 |
"Created: 6.3.1997 / 18:06:22 / cg" |
|
413 |
"Modified: 6.3.1997 / 23:18:32 / cg" |
|
414 |
! |
|
415 |
||
1183 | 416 |
for:aViewClass hasHorizontalScrollBar:hasH hasVerticalScrollBar:hasV miniScrollerH:miniH miniScrollerV:miniV |
417 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
418 |
The subview is created here. |
|
419 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
420 |
is false, miniscrollers if true." |
|
421 |
||
422 |
|newView| |
|
423 |
||
424 |
aViewClass notNil ifTrue:[ |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
425 |
newView := aViewClass new. |
1183 | 426 |
]. |
427 |
^ self |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
428 |
forView:newView |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
429 |
hasHorizontalScrollBar:hasH |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
430 |
hasVerticalScrollBar:hasV |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
431 |
miniScrollerH:miniH |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
432 |
miniScrollerV:miniV |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
433 |
origin:nil |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
434 |
corner:nil |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
435 |
in:nil |
1183 | 436 |
|
437 |
"Created: 7.4.1997 / 19:00:14 / cg" |
|
438 |
! |
|
439 |
||
1111 | 440 |
for:aViewClass hasHorizontalScrollBar:hasH hasVerticalScrollBar:hasV miniScrollerH:miniH miniScrollerV:miniV origin:org corner:corn in:aView |
441 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
442 |
The subview is created here. |
|
443 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
444 |
is false, miniscrollers if true." |
|
445 |
||
446 |
|newView| |
|
447 |
||
448 |
aViewClass notNil ifTrue:[ |
|
1953 | 449 |
newView := aViewClass new. |
1111 | 450 |
]. |
451 |
^ self |
|
1953 | 452 |
forView:newView |
453 |
hasHorizontalScrollBar:hasH |
|
454 |
hasVerticalScrollBar:hasV |
|
455 |
miniScrollerH:miniH |
|
456 |
miniScrollerV:miniV |
|
457 |
origin:org |
|
458 |
corner:corn |
|
459 |
in:aView |
|
1111 | 460 |
|
461 |
" |
|
462 |
|top scr| |
|
463 |
||
464 |
top := StandardSystemView extent:200@200. |
|
1953 | 465 |
scr := ScrollableView for:nil |
466 |
hasHorizontalScrollBar:true |
|
467 |
hasVerticalScrollBar:true |
|
468 |
miniScrollerH:false |
|
469 |
miniScrollerV:false |
|
470 |
origin:0.0@0.0 |
|
471 |
corner:1.0@1.0 |
|
472 |
in:top. |
|
1111 | 473 |
top open |
474 |
" |
|
475 |
||
476 |
"Modified: 6.3.1997 / 18:36:01 / cg" |
|
217 | 477 |
! |
478 |
||
479 |
for:aViewClass in:aView |
|
480 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
481 |
The subview is created here. |
|
482 |
The view will have full scrollbars." |
|
483 |
||
1111 | 484 |
^ self |
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
485 |
for:aViewClass |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
486 |
hasHorizontalScrollBar:self defaultHorizontalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
487 |
hasVerticalScrollBar:self defaultVerticalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
488 |
miniScrollerH:false |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
489 |
miniScrollerV:false |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
490 |
origin:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
491 |
corner:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
492 |
in:aView |
1111 | 493 |
|
494 |
"Modified: 6.3.1997 / 23:18:41 / cg" |
|
217 | 495 |
! |
496 |
||
497 |
for:aViewClass miniScroller:mini |
|
498 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
499 |
The subview is created here. |
|
500 |
The view will have full scrollbars if mini is false, miniscrollers |
|
501 |
if true." |
|
502 |
||
1111 | 503 |
^ self |
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
504 |
for:aViewClass |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
505 |
hasHorizontalScrollBar:self defaultHorizontalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
506 |
hasVerticalScrollBar:self defaultVerticalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
507 |
miniScrollerH:mini |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
508 |
miniScrollerV:mini |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
509 |
origin:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
510 |
corner:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
511 |
in:nil |
1111 | 512 |
|
513 |
"Modified: 6.3.1997 / 23:18:45 / cg" |
|
217 | 514 |
! |
515 |
||
516 |
for:aViewClass miniScroller:mini in:aView |
|
517 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
518 |
The subview is created here. |
|
519 |
The view will have full scrollbars if mini is false, miniscrollers |
|
520 |
if true." |
|
521 |
||
1111 | 522 |
^ self |
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
523 |
for:aViewClass |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
524 |
hasHorizontalScrollBar:self defaultHorizontalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
525 |
hasVerticalScrollBar:self defaultVerticalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
526 |
miniScrollerH:mini |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
527 |
miniScrollerV:mini |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
528 |
origin:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
529 |
corner:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
530 |
in:aView |
1111 | 531 |
|
532 |
"Modified: 6.3.1997 / 23:18:50 / cg" |
|
217 | 533 |
! |
153 | 534 |
|
546
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
535 |
for:aViewClass miniScroller:mini origin:org corner:corn in:aView |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
536 |
"return a new scrolling view scrolling an instance of aViewClass. |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
537 |
The subview is created here. |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
538 |
The view will have full scrollbars if mini is false, miniscrollers |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
539 |
if true." |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
540 |
|
1111 | 541 |
^ self |
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
542 |
for:aViewClass |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
543 |
hasHorizontalScrollBar:self defaultHorizontalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
544 |
hasVerticalScrollBar:self defaultVerticalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
545 |
miniScrollerH:mini |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
546 |
miniScrollerV:mini |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
547 |
origin:org |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
548 |
corner:corn |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
549 |
in:aView |
546
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
550 |
|
1111 | 551 |
"Modified: 6.3.1997 / 23:18:53 / cg" |
546
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
552 |
! |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
553 |
|
217 | 554 |
for:aViewClass miniScrollerH:miniH |
555 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
556 |
The subview is created here. |
|
557 |
The view will have full scrollbars if miniH is false, |
|
558 |
and a horizontal miniscroller if true." |
|
559 |
||
1111 | 560 |
^ self |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
561 |
for:aViewClass |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
562 |
hasHorizontalScrollBar:true |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
563 |
hasVerticalScrollBar:true |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
564 |
miniScrollerH:miniH |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
565 |
miniScrollerV:false |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
566 |
origin:nil |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
567 |
corner:nil |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
568 |
in:nil |
1111 | 569 |
|
570 |
"Modified: 6.3.1997 / 18:30:15 / cg" |
|
217 | 571 |
! |
572 |
||
573 |
for:aViewClass miniScrollerH:miniH in:aView |
|
574 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
575 |
The subview is created here. |
|
546
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
576 |
The view will have full scrollbars if the corresponding miniH/miniV |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
577 |
is false, miniscrollers if true." |
217 | 578 |
|
1111 | 579 |
^ self |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
580 |
for:aViewClass |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
581 |
hasHorizontalScrollBar:true |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
582 |
hasVerticalScrollBar:true |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
583 |
miniScrollerH:miniH |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
584 |
miniScrollerV:false |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
585 |
origin:nil |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
586 |
corner:nil |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
587 |
in:aView |
546
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
588 |
|
1111 | 589 |
"Modified: 6.3.1997 / 18:30:31 / cg" |
217 | 590 |
! |
153 | 591 |
|
217 | 592 |
for:aViewClass miniScrollerH:miniH miniScrollerV:miniV |
593 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
594 |
The subview is created here. |
|
595 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
596 |
is false, miniscrollers if true." |
|
597 |
||
1111 | 598 |
^ self |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
599 |
for:aViewClass |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
600 |
hasHorizontalScrollBar:true |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
601 |
hasVerticalScrollBar:true |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
602 |
miniScrollerH:miniH |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
603 |
miniScrollerV:miniV |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
604 |
origin:nil |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
605 |
corner:nil |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
606 |
in:nil |
1111 | 607 |
|
608 |
"Modified: 6.3.1997 / 18:30:47 / cg" |
|
217 | 609 |
! |
610 |
||
611 |
for:aViewClass miniScrollerH:miniH miniScrollerV:miniV in:aView |
|
612 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
613 |
The subview is created here. |
|
614 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
615 |
is false, miniscrollers if true." |
|
616 |
||
1111 | 617 |
^ self |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
618 |
for:aViewClass |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
619 |
hasHorizontalScrollBar:true |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
620 |
hasVerticalScrollBar:true |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
621 |
miniScrollerH:miniH |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
622 |
miniScrollerV:miniV |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
623 |
origin:nil |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
624 |
corner:nil |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
625 |
in:aView |
1111 | 626 |
|
627 |
"Modified: 6.3.1997 / 18:31:02 / cg" |
|
628 |
! |
|
629 |
||
630 |
for:aViewClass miniScrollerH:miniH miniScrollerV:miniV origin:org corner:corn in:aView |
|
631 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
632 |
The subview is created here. |
|
633 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
634 |
is false, miniscrollers if true." |
|
635 |
||
636 |
^ self |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
637 |
for:aViewClass |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
638 |
hasHorizontalScrollBar:true |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
639 |
hasVerticalScrollBar:true |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
640 |
miniScrollerH:miniH |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
641 |
miniScrollerV:miniV |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
642 |
origin:org |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
643 |
corner:corn |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
644 |
in:aView |
1111 | 645 |
|
646 |
"Modified: 6.3.1997 / 18:31:17 / cg" |
|
647 |
! |
|
648 |
||
649 |
for:aViewClass miniScrollerH:miniH origin:org corner:corn in:aView |
|
650 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
651 |
The subview is created here. |
|
652 |
The view will have a full horizontal scrollbar if miniH is false, |
|
653 |
a miniscroller if true." |
|
654 |
||
655 |
^ self |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
656 |
for:aViewClass |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
657 |
hasHorizontalScrollBar:true |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
658 |
hasVerticalScrollBar:true |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
659 |
miniScrollerH:miniH |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
660 |
miniScrollerV:false |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
661 |
origin:org |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
662 |
corner:corn |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
663 |
in:aView |
1111 | 664 |
|
665 |
"Modified: 6.3.1997 / 18:31:28 / cg" |
|
666 |
! |
|
667 |
||
668 |
for:aViewClass miniScrollerV:miniV origin:org corner:corn in:aView |
|
669 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
670 |
The subview is created here. |
|
671 |
The view will have a full vertical scrollbar if miniV is false, |
|
672 |
a miniscroller if true." |
|
673 |
||
674 |
^ self |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
675 |
for:aViewClass |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
676 |
hasHorizontalScrollBar:true |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
677 |
hasVerticalScrollBar:true |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
678 |
miniScrollerH:false |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
679 |
miniScrollerV:miniV |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
680 |
origin:org |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
681 |
corner:corn |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
682 |
in:aView |
1111 | 683 |
|
684 |
"Modified: 6.3.1997 / 18:31:41 / cg" |
|
685 |
! |
|
686 |
||
687 |
for:aViewClass origin:org corner:corner in:aView |
|
688 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
689 |
The subview is created here. |
|
690 |
The view will have full scrollbars." |
|
691 |
||
692 |
^ self |
|
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
693 |
for:aViewClass |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
694 |
hasHorizontalScrollBar:self defaultHorizontalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
695 |
hasVerticalScrollBar:self defaultVerticalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
696 |
miniScrollerH:false |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
697 |
miniScrollerV:false |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
698 |
origin:org |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
699 |
corner:corner |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
700 |
in:aView |
1111 | 701 |
|
702 |
"Modified: 6.3.1997 / 23:19:05 / cg" |
|
703 |
! |
|
704 |
||
705 |
forView:aView |
|
706 |
"return a new scrolling view scrolling aView. |
|
707 |
The view will have full scrollbars." |
|
708 |
||
709 |
^ self |
|
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
710 |
forView:aView |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
711 |
hasHorizontalScrollBar:self defaultHorizontalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
712 |
hasVerticalScrollBar:self defaultVerticalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
713 |
miniScrollerH:false |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
714 |
miniScrollerV:false |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
715 |
origin:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
716 |
corner:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
717 |
in:nil |
1111 | 718 |
|
719 |
"Modified: 6.3.1997 / 23:19:08 / cg" |
|
720 |
! |
|
721 |
||
722 |
forView:aScrolledView hasHorizontalScrollBar:hasH hasVerticalScrollBar:hasV miniScrollerH:miniH miniScrollerV:miniV origin:org corner:corn in:aView |
|
723 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
724 |
The subview is created here. |
|
725 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
726 |
is false, miniscrollers if true." |
|
727 |
||
300 | 728 |
|newView dev| |
217 | 729 |
|
730 |
aView notNil ifTrue:[ |
|
1953 | 731 |
dev := aView graphicsDevice |
300 | 732 |
] ifFalse:[ |
1953 | 733 |
dev := Screen current |
300 | 734 |
]. |
735 |
newView := self basicNew device:dev. |
|
1111 | 736 |
newView initialize. |
737 |
newView setupVertical:hasV mini:miniV horizontal:hasH mini:miniH. |
|
738 |
||
739 |
aScrolledView notNil ifTrue:[ |
|
1953 | 740 |
newView scrolledView:aScrolledView. |
1111 | 741 |
]. |
742 |
||
743 |
org notNil ifTrue:[ |
|
1953 | 744 |
newView origin:org |
1111 | 745 |
]. |
746 |
corn notNil ifTrue:[ |
|
1953 | 747 |
newView corner:corn |
1111 | 748 |
]. |
749 |
||
300 | 750 |
aView notNil ifTrue:[ |
1953 | 751 |
aView addSubView:newView |
153 | 752 |
]. |
217 | 753 |
^ newView |
703 | 754 |
|
1111 | 755 |
" |
756 |
|top scr| |
|
546
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
757 |
|
1111 | 758 |
top := StandardSystemView extent:200@200. |
1953 | 759 |
scr := ScrollableView |
760 |
forView:(TextView new) |
|
761 |
hasHorizontalScrollBar:true |
|
762 |
hasVerticalScrollBar:true |
|
763 |
miniScrollerH:false |
|
764 |
miniScrollerV:false |
|
765 |
origin:0.0@0.0 |
|
766 |
corner:1.0@1.0 |
|
767 |
in:top. |
|
768 |
top open |
|
769 |
" |
|
770 |
" |
|
771 |
|top scr| |
|
772 |
||
773 |
top := StandardSystemView extent:200@200. |
|
774 |
scr := ScrollableView |
|
775 |
forView:(TextView new) |
|
776 |
hasHorizontalScrollBar:false |
|
777 |
hasVerticalScrollBar:true |
|
778 |
miniScrollerH:false |
|
779 |
miniScrollerV:false |
|
780 |
origin:0.0@0.0 |
|
781 |
corner:1.0@1.0 |
|
782 |
in:top. |
|
1111 | 783 |
top open |
784 |
" |
|
546
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
785 |
|
1135
acdeed6efc13
Fix prev fix from cg. Send setupDimensions only if scrolledView
Stefan Vogel <sv@exept.de>
parents:
1134
diff
changeset
|
786 |
"Modified: 6.3.1997 / 18:42:40 / cg" |
acdeed6efc13
Fix prev fix from cg. Send setupDimensions only if scrolledView
Stefan Vogel <sv@exept.de>
parents:
1134
diff
changeset
|
787 |
"Modified: 19.3.1997 / 15:32:51 / stefan" |
217 | 788 |
! |
789 |
||
852 | 790 |
forView:aView in:aSuperView |
791 |
"return a new scrolling view scrolling aView. |
|
792 |
The view will have full scrollbars." |
|
793 |
||
1111 | 794 |
^ self |
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
795 |
forView:aView |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
796 |
hasHorizontalScrollBar:self defaultHorizontalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
797 |
hasVerticalScrollBar:self defaultVerticalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
798 |
miniScrollerH:false |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
799 |
miniScrollerV:false |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
800 |
origin:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
801 |
corner:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
802 |
in:aSuperView |
852 | 803 |
|
1111 | 804 |
"Modified: 6.3.1997 / 23:19:12 / cg" |
852 | 805 |
! |
806 |
||
248 | 807 |
forView:aView miniScrollerH:mini |
808 |
"return a new scrolling view scrolling aView. |
|
809 |
The view will have a full vertical scrollbar and a horizontal |
|
810 |
miniScroller if mini is true." |
|
811 |
||
1111 | 812 |
^ self |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
813 |
forView:aView |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
814 |
hasHorizontalScrollBar:true |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
815 |
hasVerticalScrollBar:true |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
816 |
miniScrollerH:mini |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
817 |
miniScrollerV:false |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
818 |
origin:nil |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
819 |
corner:nil |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
820 |
in:nil |
248 | 821 |
|
1111 | 822 |
"Modified: 6.3.1997 / 18:32:58 / cg" |
248 | 823 |
! |
824 |
||
217 | 825 |
forView:scrolledView miniScrollerH:miniH miniScrollerV:miniV in:aView |
826 |
"return a new scrolling view, scrolling aView. |
|
827 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
828 |
is false, miniscrollers if true." |
|
153 | 829 |
|
1111 | 830 |
^ self |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
831 |
forView:scrolledView |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
832 |
hasHorizontalScrollBar:true |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
833 |
hasVerticalScrollBar:true |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
834 |
miniScrollerH:miniH |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
835 |
miniScrollerV:miniV |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
836 |
origin:nil |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
837 |
corner:nil |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
838 |
in:aView |
217 | 839 |
|
1111 | 840 |
"Modified: 6.3.1997 / 18:33:20 / cg" |
217 | 841 |
! |
153 | 842 |
|
217 | 843 |
in:aView |
844 |
"return a new scrolling view to be contained in aView. |
|
845 |
There is no slave view now - this has to be set later via |
|
846 |
the scrolledView: method. |
|
847 |
The view will have full scrollbars." |
|
848 |
||
1111 | 849 |
^ self |
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
850 |
forView:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
851 |
hasHorizontalScrollBar:self defaultHorizontalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
852 |
hasVerticalScrollBar:self defaultVerticalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
853 |
miniScrollerH:false |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
854 |
miniScrollerV:false |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
855 |
origin:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
856 |
corner:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
857 |
in:aView |
1111 | 858 |
|
859 |
"Modified: 6.3.1997 / 23:19:19 / cg" |
|
217 | 860 |
! |
0 | 861 |
|
93 | 862 |
miniScroller:mini |
863 |
"return a new scrolling view. The subview will be created later. |
|
864 |
The view will have full scrollbars if mini is false, |
|
865 |
miniscrollers if true." |
|
866 |
||
1111 | 867 |
^ self |
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
868 |
forView:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
869 |
hasHorizontalScrollBar:self defaultHorizontalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
870 |
hasVerticalScrollBar:self defaultVerticalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
871 |
miniScrollerH:mini |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
872 |
miniScrollerV:mini |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
873 |
origin:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
874 |
corner:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
875 |
in:nil |
1111 | 876 |
|
877 |
"Modified: 6.3.1997 / 23:19:21 / cg" |
|
93 | 878 |
! |
879 |
||
113 | 880 |
miniScrollerH:miniH |
881 |
"return a new scrolling view. The subview will be created later. |
|
882 |
The view will have full scrollbars if miniH is false, |
|
883 |
and a horizontal miniscroller if true." |
|
884 |
||
1111 | 885 |
^ self |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
886 |
forView:nil |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
887 |
hasHorizontalScrollBar:true |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
888 |
hasVerticalScrollBar:true |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
889 |
miniScrollerH:miniH |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
890 |
miniScrollerV:false |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
891 |
origin:nil |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
892 |
corner:nil |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
893 |
in:nil |
1111 | 894 |
|
895 |
"Modified: 6.3.1997 / 18:34:06 / cg" |
|
113 | 896 |
! |
897 |
||
93 | 898 |
miniScrollerH:miniH miniScrollerV:miniV |
899 |
"return a new scrolling view. The subview will be created later. |
|
900 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
113 | 901 |
is false, miniscrollers if true." |
93 | 902 |
|
1111 | 903 |
^ self |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
904 |
forView:nil |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
905 |
hasHorizontalScrollBar:true |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
906 |
hasVerticalScrollBar:true |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
907 |
miniScrollerH:miniH |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
908 |
miniScrollerV:miniV |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
909 |
origin:nil |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
910 |
corner:nil |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
911 |
in:nil |
1111 | 912 |
|
913 |
"Modified: 6.3.1997 / 18:34:16 / cg" |
|
1719
3d4adf98c079
added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents:
1695
diff
changeset
|
914 |
! |
3d4adf98c079
added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents:
1695
diff
changeset
|
915 |
|
3d4adf98c079
added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents:
1695
diff
changeset
|
916 |
new |
3d4adf98c079
added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents:
1695
diff
changeset
|
917 |
"return a new scrolling view. |
3d4adf98c079
added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents:
1695
diff
changeset
|
918 |
There is no slave view now - this has to be set later via |
3d4adf98c079
added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents:
1695
diff
changeset
|
919 |
the scrolledView: method. |
3d4adf98c079
added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents:
1695
diff
changeset
|
920 |
The view will have full scrollbars." |
3d4adf98c079
added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents:
1695
diff
changeset
|
921 |
|
3d4adf98c079
added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents:
1695
diff
changeset
|
922 |
^ self in:nil |
3d4adf98c079
added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents:
1695
diff
changeset
|
923 |
|
3d4adf98c079
added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents:
1695
diff
changeset
|
924 |
"Modified: / 12.11.1998 / 14:55:54 / cg" |
217 | 925 |
! ! |
93 | 926 |
|
852 | 927 |
!ScrollableView class methodsFor:'defaults'! |
217 | 928 |
|
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
929 |
defaultHorizontalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
930 |
^ false |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
931 |
! |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
932 |
|
1378 | 933 |
defaultScrollBarPosition |
934 |
"return the default position of the scrollBar. |
|
935 |
(max be of interest to panels, to make the handlePosition alike)" |
|
936 |
||
937 |
<resource: #style (#'scrollBar.position')> |
|
938 |
||
1870 | 939 |
^ StyleSheet at:#'scrollBar.position' default:#left. |
1378 | 940 |
|
941 |
" |
|
942 |
self defaultScrollBarPosition |
|
943 |
" |
|
944 |
||
945 |
"Modified: / 31.10.1997 / 12:58:15 / cg" |
|
946 |
! |
|
947 |
||
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
948 |
defaultVerticalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
949 |
^ true |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
950 |
! |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
951 |
|
217 | 952 |
updateStyleCache |
444
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
953 |
"extract values from the styleSheet and cache them in class variables" |
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
954 |
|
1354 | 955 |
<resource: #style (#'scrolledView.level' #'scrolledView.margin' |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
956 |
#'scrolledView.borderWidth' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
957 |
#'scrollBar.spacing' #'scrollBar.level' |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
958 |
#'scrollableView.level' #'scrollableView.backgroundColor' )> |
1111 | 959 |
|
960 |
|defLevel defMargin defSpacing| |
|
444
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
961 |
|
1111 | 962 |
StyleSheet is3D ifTrue:[ |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
963 |
defLevel := -1. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
964 |
defMargin := ViewSpacing // 2. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
965 |
defSpacing := defMargin. |
217 | 966 |
] ifFalse:[ |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
967 |
defLevel := 0. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
968 |
defMargin := 0. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
969 |
defSpacing := 0 |
217 | 970 |
]. |
1870 | 971 |
DefaultScrolledViewLevel := StyleSheet at:#'scrolledView.level' default:defLevel. |
972 |
DefaultScrolledViewBorderWidth := StyleSheet at:#'scrolledView.borderWidth' default:nil. |
|
973 |
DefaultScrolledViewMargin := StyleSheet at:#'scrolledView.margin' default:defMargin. |
|
974 |
DefaultScrollBarSpacing := StyleSheet at:#'scrollBar.spacing' default:defSpacing. |
|
975 |
DefaultLevel := StyleSheet at:#'scrollableView.level' default:nil. |
|
976 |
DefaultScrollBarLevel := StyleSheet at:#'scrollBar.level' default:nil. |
|
977 |
MyDefaultViewBackgroundColor := StyleSheet at:#'scrollableView.backgroundColor' default:DefaultViewBackgroundColor. |
|
0 | 978 |
|
1111 | 979 |
" |
980 |
self updateStyleCache |
|
981 |
" |
|
982 |
||
1378 | 983 |
"Modified: / 31.10.1997 / 20:57:10 / cg" |
217 | 984 |
! ! |
985 |
||
1140 | 986 |
!ScrollableView methodsFor:'accessing-behavior'! |
987 |
||
1556
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
988 |
autoHideHorizontalScrollBar:aBoolean |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
989 |
"set/clear the flag which controls if the horizontal scrollBar should |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
990 |
be made invisible dynamically, if there is nothing to scroll |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
991 |
(and shown if there is). |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
992 |
This flags setting is normally controlled by the styleSheet." |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
993 |
|
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
994 |
hideHScrollBar := aBoolean. |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
995 |
|
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
996 |
"Modified: 19.3.1997 / 16:28:42 / cg" |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
997 |
"Created: 19.3.1997 / 17:24:39 / cg" |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
998 |
! |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
999 |
|
1140 | 1000 |
autoHideScrollBars:aBoolean |
1001 |
"set/clear the flag which controls if scrollBars should |
|
1002 |
be made invisible dynamically, if there is nothing to scroll |
|
1003 |
(and shown if there is). |
|
1004 |
This flags setting is normally controlled by the styleSheet." |
|
1005 |
||
1556
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1006 |
hideVScrollBar := hideHScrollBar := aBoolean. |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1007 |
|
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1008 |
"Modified: 19.3.1997 / 16:28:42 / cg" |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1009 |
"Created: 19.3.1997 / 17:24:39 / cg" |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1010 |
! |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1011 |
|
1904 | 1012 |
autoHideVerticalScrollBar:aBoolean |
1556
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1013 |
"set/clear the flag which controls if the vertical scrollBar should |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1014 |
be made invisible dynamically, if there is nothing to scroll |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1015 |
(and shown if there is). |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1016 |
This flags setting is normally controlled by the styleSheet." |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1017 |
|
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1018 |
hideVScrollBar := aBoolean. |
1140 | 1019 |
|
1020 |
"Modified: 19.3.1997 / 16:28:42 / cg" |
|
1021 |
"Created: 19.3.1997 / 17:24:39 / cg" |
|
1022 |
! ! |
|
1023 |
||
1138 | 1024 |
!ScrollableView methodsFor:'accessing-components'! |
119 | 1025 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1026 |
horizontalScrollBar |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1027 |
"return the horizontal scrollbar (or nil, if there is none)" |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1028 |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1029 |
"/ hScrollBar isNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1030 |
"/ self horizontalScrollable:true. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1031 |
"/ ]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1032 |
^ hScrollBar |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1033 |
|
1549
b64b2dd7d5df
create scrollbars, when accessed
Claus Gittinger <cg@exept.de>
parents:
1536
diff
changeset
|
1034 |
"Created: / 6.3.1997 / 18:06:23 / cg" |
b64b2dd7d5df
create scrollbars, when accessed
Claus Gittinger <cg@exept.de>
parents:
1536
diff
changeset
|
1035 |
"Modified: / 25.5.1998 / 12:53:58 / cg" |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1036 |
! |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1037 |
|
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1038 |
removeSubView:aView |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1039 |
super removeSubView:aView. |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1040 |
aView == scrolledView ifTrue:[ |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1041 |
scrolledView := nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1042 |
]. |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1043 |
aView == vScrollBar ifTrue:[ |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1044 |
vScrollBar := nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1045 |
]. |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1046 |
aView == hScrollBar ifTrue:[ |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1047 |
hScrollBar := nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1048 |
]. |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1049 |
|
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1050 |
|
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1051 |
|
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1052 |
|
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1053 |
! |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1054 |
|
217 | 1055 |
scrollBar |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1056 |
"return the vertical scrollbar (or nil, if there is none)" |
217 | 1057 |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1058 |
"/ vScrollBar isNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1059 |
"/ self verticalScrollable:true. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1060 |
"/ ]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1061 |
^ vScrollBar |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1062 |
|
1549
b64b2dd7d5df
create scrollbars, when accessed
Claus Gittinger <cg@exept.de>
parents:
1536
diff
changeset
|
1063 |
"Created: / 6.3.1997 / 18:06:23 / cg" |
b64b2dd7d5df
create scrollbars, when accessed
Claus Gittinger <cg@exept.de>
parents:
1536
diff
changeset
|
1064 |
"Modified: / 25.5.1998 / 12:54:06 / cg" |
119 | 1065 |
! |
1066 |
||
217 | 1067 |
scrolledView |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1068 |
"return the scrolled view (or nil, if there is none)" |
38 | 1069 |
|
217 | 1070 |
^ scrolledView |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1071 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1072 |
"Modified: 6.3.1997 / 16:48:09 / cg" |
1111 | 1073 |
"Created: 6.3.1997 / 18:06:23 / cg" |
113 | 1074 |
! |
1075 |
||
217 | 1076 |
scrolledView:aView |
1077 |
"set the view to scroll" |
|
1078 |
||
1079 |
scrolledView notNil ifTrue:[ |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1080 |
scrolledView removeDependent:self. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1081 |
scrolledView destroy. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1082 |
scrolledView := nil. |
217 | 1083 |
]. |
982 | 1084 |
|
217 | 1085 |
scrolledView := aView. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1086 |
|
1111 | 1087 |
super addSubViewFirst:aView. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1088 |
scrolledView notNil ifTrue:[ |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1089 |
self setScrollActions. |
217 | 1090 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1091 |
realized ifTrue:[ |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1092 |
self setupDimensionsConfigureScrolledView:true. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1093 |
self sizeChanged:nil. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1094 |
scrolledView realize |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1095 |
]. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1096 |
] |
217 | 1097 |
|
1535
b769ae01e418
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
1098 |
"Modified: / 19.3.1997 / 15:32:37 / stefan" |
1536
b8ddd185281a
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1535
diff
changeset
|
1099 |
"Modified: / 21.5.1998 / 00:48:57 / cg" |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1100 |
! |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1101 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1102 |
verticalScrollBar |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1103 |
"return the vertical scrollbar (or nil, if there is none)" |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1104 |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1105 |
"/ vScrollBar isNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1106 |
"/ self verticalScrollable:true. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1107 |
"/ ]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1108 |
^ vScrollBar |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1109 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1110 |
"Modified: 6.3.1997 / 16:59:24 / cg" |
1111 | 1111 |
"Created: 6.3.1997 / 18:06:23 / cg" |
1253 | 1112 |
! |
1113 |
||
1114 |
widget |
|
1115 |
"for ST80 compatibility (where a wrapper returns its wrapped |
|
1116 |
widget), return the scrolledView here" |
|
1117 |
||
1118 |
^ scrolledView |
|
1119 |
||
1120 |
"Created: 20.6.1997 / 14:45:16 / cg" |
|
217 | 1121 |
! ! |
1122 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1123 |
!ScrollableView methodsFor:'accessing-look'! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1124 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1125 |
horizontalMini:aBoolean |
1138 | 1126 |
"control the horizontal scrollBar to be either a miniScroller, |
1127 |
or a full scrollBar." |
|
1128 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1129 |
horizontalMini ~~ aBoolean ifTrue:[ |
1753
d0b1ba76acdb
honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents:
1719
diff
changeset
|
1130 |
horizontalMini := aBoolean. |
1870 | 1131 |
(styleSheet at:#'scrollBar.neverMini' default:false) == true ifTrue:[ |
1753
d0b1ba76acdb
honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents:
1719
diff
changeset
|
1132 |
horizontalMini := false. |
d0b1ba76acdb
honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents:
1719
diff
changeset
|
1133 |
]. |
d0b1ba76acdb
honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents:
1719
diff
changeset
|
1134 |
self setupViews. |
d0b1ba76acdb
honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents:
1719
diff
changeset
|
1135 |
shown ifTrue:[ |
d0b1ba76acdb
honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents:
1719
diff
changeset
|
1136 |
self setupDimensionsConfigureScrolledView:false. |
d0b1ba76acdb
honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents:
1719
diff
changeset
|
1137 |
] |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1138 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1139 |
|
1498 | 1140 |
"Created: / 7.3.1997 / 21:57:02 / cg" |
1502 | 1141 |
"Modified: / 22.4.1998 / 22:42:25 / ca" |
1536
b8ddd185281a
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1535
diff
changeset
|
1142 |
"Modified: / 21.5.1998 / 00:48:25 / cg" |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1143 |
! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1144 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1145 |
horizontalScrollable:aBoolean |
1138 | 1146 |
"enable/disable horizontal scrollability. |
1147 |
If disabled, the horizontal scrollBar is made invisible." |
|
1148 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1149 |
hasHorizontalScrollBar ~~ aBoolean ifTrue:[ |
1953 | 1150 |
hasHorizontalScrollBar := aBoolean. |
1151 |
hScrollBarHidden := false. |
|
1152 |
self setupViews. |
|
1153 |
shown ifTrue:[ |
|
1154 |
self setupDimensionsConfigureScrolledView:false. |
|
1155 |
] |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1156 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1157 |
|
1498 | 1158 |
"Created: / 7.3.1997 / 21:56:28 / cg" |
1536
b8ddd185281a
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1535
diff
changeset
|
1159 |
"Modified: / 21.5.1998 / 00:48:44 / cg" |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1160 |
! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1161 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1162 |
verticalMini:aBoolean |
1138 | 1163 |
"control the vertical scrollBar to be either a miniScroller, |
1164 |
or a full scrollBar." |
|
1165 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1166 |
verticalMini ~~ aBoolean ifTrue:[ |
1753
d0b1ba76acdb
honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents:
1719
diff
changeset
|
1167 |
verticalMini := aBoolean. |
1870 | 1168 |
(styleSheet at:#'scrollBar.neverMini' default:false) == true ifTrue:[ |
1753
d0b1ba76acdb
honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents:
1719
diff
changeset
|
1169 |
verticalMini := false. |
d0b1ba76acdb
honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents:
1719
diff
changeset
|
1170 |
]. |
d0b1ba76acdb
honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents:
1719
diff
changeset
|
1171 |
self setupViews. |
d0b1ba76acdb
honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents:
1719
diff
changeset
|
1172 |
shown ifTrue:[ |
d0b1ba76acdb
honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents:
1719
diff
changeset
|
1173 |
self setupDimensionsConfigureScrolledView:false. |
d0b1ba76acdb
honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents:
1719
diff
changeset
|
1174 |
] |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1175 |
] |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1176 |
|
1498 | 1177 |
"Created: / 7.3.1997 / 21:56:57 / cg" |
1502 | 1178 |
"Modified: / 22.4.1998 / 22:42:32 / ca" |
1536
b8ddd185281a
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1535
diff
changeset
|
1179 |
"Modified: / 21.5.1998 / 00:49:10 / cg" |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1180 |
! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1181 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1182 |
verticalScrollable:aBoolean |
1138 | 1183 |
"enable/disable vertical scrollability. |
1184 |
If disabled, the vertical scrollBar is made invisible." |
|
1185 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1186 |
hasVerticalScrollBar ~~ aBoolean ifTrue:[ |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1187 |
hasVerticalScrollBar := aBoolean. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1188 |
vScrollBarHidden := false. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1189 |
self setupViews. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1190 |
shown ifTrue:[ |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1191 |
self setupDimensionsConfigureScrolledView:false. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1192 |
] |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1193 |
] |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1194 |
|
1498 | 1195 |
"Created: / 7.3.1997 / 21:56:39 / cg" |
1536
b8ddd185281a
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1535
diff
changeset
|
1196 |
"Modified: / 21.5.1998 / 00:49:16 / cg" |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1197 |
! ! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1198 |
|
217 | 1199 |
!ScrollableView methodsFor:'changes '! |
1200 |
||
1201 |
update:something with:argument from:changedObject |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1202 |
"whenever the scrolledView changes its contents, the scroller(s) must |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1203 |
be updated as well" |
132 | 1204 |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1205 |
|doUpdate| |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1206 |
|
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1207 |
doUpdate := false. |
217 | 1208 |
changedObject == scrolledView ifTrue:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1209 |
something == #sizeOfContents ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1210 |
vScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1211 |
vScrollBar setThumbFor:scrolledView. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1212 |
doUpdate := true |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1213 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1214 |
hScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1215 |
hScrollBar setThumbFor:scrolledView. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1216 |
doUpdate := true |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1217 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1218 |
] ifFalse:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1219 |
something == #originOfContents ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1220 |
lockUpdates ifFalse:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1221 |
vScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1222 |
vScrollBar setThumbOriginFor:scrolledView. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1223 |
doUpdate := true |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1224 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1225 |
hScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1226 |
hScrollBar setThumbOriginFor:scrolledView. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1227 |
doUpdate := true |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1228 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1229 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1230 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1231 |
]. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1232 |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1233 |
doUpdate ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1234 |
self updateScrollBarVisibility |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1235 |
] |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1236 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1237 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1238 |
! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1239 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1240 |
updateScrollBarVisibility |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1241 |
"check if any scrollbar needs to be hidden or shown" |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1242 |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1243 |
|anyChange hide| |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1244 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1245 |
anyChange := false. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1246 |
|
1556
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1247 |
hideVScrollBar ~~ false ifTrue:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1248 |
vScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1249 |
hide := vScrollBar thumbHeight >= 100. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1250 |
hide ~~ vScrollBarHidden ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1251 |
vScrollBarHidden := hide. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1252 |
hide ifTrue:[vScrollBar beInvisible] ifFalse:[vScrollBar beVisible]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1253 |
anyChange := true. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1254 |
] |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1255 |
]. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1256 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1257 |
|
1556
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1258 |
hideHScrollBar ~~ false ifTrue:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1259 |
hScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1260 |
hide := hScrollBar thumbHeight >= 100. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1261 |
hide ~~ hScrollBarHidden ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1262 |
hScrollBarHidden := hide. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1263 |
hide ifTrue:[hScrollBar beInvisible] ifFalse:[hScrollBar beVisible]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1264 |
anyChange := true. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1265 |
] |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1266 |
]. |
217 | 1267 |
]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1268 |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1269 |
anyChange ifTrue:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1270 |
self setupDimensionsConfigureScrolledView:false. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1271 |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1272 |
"/ force him to recompute its dimension ... |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1273 |
scrolledView notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1274 |
vScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1275 |
vScrollBar setThumbFor:scrolledView. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1276 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1277 |
hScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1278 |
hScrollBar setThumbFor:scrolledView. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1279 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1280 |
]. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1281 |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1282 |
"/ stupid - showing one may need the other ... |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1283 |
"/ and vice versa; do it again. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1284 |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1285 |
anyChange := false. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1286 |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1287 |
hideVScrollBar ~~ false ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1288 |
vScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1289 |
hide := vScrollBar thumbHeight >= 100. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1290 |
hide ~~ vScrollBarHidden ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1291 |
vScrollBarHidden := hide. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1292 |
hide ifTrue:[vScrollBar beInvisible] ifFalse:[vScrollBar beVisible]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1293 |
anyChange := true. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1294 |
] |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1295 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1296 |
]. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1297 |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1298 |
hideHScrollBar ~~ false ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1299 |
hScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1300 |
hide := hScrollBar thumbHeight >= 100. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1301 |
hide ~~ hScrollBarHidden ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1302 |
hScrollBarHidden := hide. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1303 |
hide ifTrue:[hScrollBar beInvisible] ifFalse:[hScrollBar beVisible]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1304 |
anyChange := true. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1305 |
] |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1306 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1307 |
]. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1308 |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1309 |
anyChange ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1310 |
self setupDimensionsConfigureScrolledView:false. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1311 |
]. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1312 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1313 |
|
1535
b769ae01e418
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
1314 |
"Modified: / 19.3.1997 / 15:33:36 / stefan" |
1536
b8ddd185281a
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1535
diff
changeset
|
1315 |
"Modified: / 21.5.1998 / 00:49:05 / cg" |
217 | 1316 |
! ! |
38 | 1317 |
|
217 | 1318 |
!ScrollableView methodsFor:'event processing'! |
1319 |
||
1320 |
keyPress:key x:x y:y |
|
1321 |
"a key was pressed - handle page-keys here" |
|
1322 |
||
1323 |
<resource: #keyboard ( #Prior #Next ) > |
|
1324 |
||
1325 |
(key == #Prior) ifTrue: [^ self pageUp]. |
|
1326 |
(key == #Next) ifTrue: [^ self pageDown]. |
|
1327 |
||
1328 |
super keyPress:key x:x y:y |
|
1111 | 1329 |
|
1330 |
"Created: 6.3.1997 / 18:06:23 / cg" |
|
38 | 1331 |
! |
1332 |
||
217 | 1333 |
sizeChanged:how |
1138 | 1334 |
"handle size changes - this may change any scrollBars visibility" |
1335 |
||
1986 | 1336 |
|orgX orgY thV thH scrollH scrollV| |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1337 |
|
1111 | 1338 |
"/ resize components manually, in an order which is optimal |
1339 |
||
1340 |
how == #smaller ifTrue:[ |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1341 |
"/ first resize the horizontalScrollBar, |
1111 | 1342 |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1343 |
scrolledView notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1344 |
scrolledView containerChangedSize |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1345 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1346 |
hScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1347 |
hScrollBar containerChangedSize |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1348 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1349 |
vScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1350 |
vScrollBar containerChangedSize |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1351 |
]. |
1111 | 1352 |
] ifFalse:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1353 |
hScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1354 |
hScrollBar containerChangedSize |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1355 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1356 |
vScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1357 |
vScrollBar containerChangedSize |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1358 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1359 |
scrolledView notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1360 |
scrolledView containerChangedSize |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1361 |
]. |
1111 | 1362 |
]. |
819
32ac89843fa8
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
1363 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1364 |
scrolledView isNil ifTrue:[^ self]. |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1365 |
(hScrollBar isNil and:[vScrollBar isNil]) ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1366 |
^ self |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1367 |
]. |
1111 | 1368 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1369 |
vScrollBar notNil ifTrue:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1370 |
vScrollBar setThumbFor:scrolledView. |
1986 | 1371 |
orgY := vScrollBar thumbOrigin. |
1372 |
thV := vScrollBar thumbHeight. |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1373 |
]. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1374 |
hScrollBar notNil ifTrue:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1375 |
hScrollBar setThumbFor:scrolledView. |
1986 | 1376 |
orgX := hScrollBar thumbOrigin. |
1377 |
thH := hScrollBar thumbHeight. |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1378 |
]. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1379 |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1380 |
"/ splitted, since there are optimized scrollProcedures for each case ... |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1381 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1382 |
hScrollBar isNil ifTrue:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1383 |
"/ only care for vertical ... |
1986 | 1384 |
orgY + thV >= 100 ifTrue:[ |
1385 |
vScrollBar thumbOrigin:(100 - thV). |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1386 |
scrolledView scrollVerticalToPercent:vScrollBar thumbOrigin. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1387 |
]. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1388 |
] ifFalse:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1389 |
vScrollBar isNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1390 |
"/ only care for horizontal ... |
1986 | 1391 |
orgX + thH >= 100 ifTrue:[ |
1392 |
hScrollBar thumbOrigin:(100 - thH). |
|
1393 |
scrolledView scrollHorizontalToPercent:hScrollBar thumbOrigin. |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1394 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1395 |
] ifFalse:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1396 |
"/ care for both ... |
113 | 1397 |
|
1986 | 1398 |
scrollH := scrollV := false. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1399 |
|
1986 | 1400 |
orgY + thV >= 100 ifTrue:[ |
1401 |
vScrollBar thumbOrigin:(100 - thV). |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1402 |
orgY := vScrollBar thumbOrigin. |
1986 | 1403 |
scrollV := true. |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1404 |
]. |
1986 | 1405 |
orgX + thH >= 100 ifTrue:[ |
1406 |
hScrollBar thumbOrigin:(100 - thH). |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1407 |
orgX := hScrollBar thumbOrigin. |
1986 | 1408 |
scrollH := true. |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1409 |
]. |
1986 | 1410 |
scrollV ifTrue:[ |
1411 |
scrollH ifTrue:[ |
|
1412 |
scrolledView scrollToPercent:(orgX@orgY). |
|
1413 |
] ifFalse:[ |
|
1414 |
scrolledView scrollVerticalToPercent:orgY. |
|
1415 |
] |
|
1416 |
] ifFalse:[ |
|
1417 |
scrollH ifTrue:[ |
|
1418 |
scrolledView scrollHorizontalToPercent:orgX. |
|
1419 |
] |
|
1420 |
] |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1421 |
] |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1422 |
]. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1423 |
self updateScrollBarVisibility. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1424 |
|
1160
f3204cabcce8
must update scrollBarVisibility in realize
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1425 |
"Modified: 28.3.1997 / 17:25:38 / cg" |
217 | 1426 |
! ! |
1427 |
||
1428 |
!ScrollableView methodsFor:'forced scroll'! |
|
1429 |
||
1430 |
pageDown |
|
1138 | 1431 |
"page down - but only if there is a vertical scrollbar" |
217 | 1432 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1433 |
vScrollBar notNil ifTrue:[ |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1434 |
vScrollBar pageDown |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1435 |
] |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1436 |
|
1111 | 1437 |
"Created: 6.3.1997 / 18:06:23 / cg" |
1138 | 1438 |
"Modified: 19.3.1997 / 16:32:34 / cg" |
1439 |
! |
|
1440 |
||
1441 |
pageLeft |
|
1442 |
"page left - but only if there is a horizontal scrollbar" |
|
1443 |
||
1444 |
hScrollBar notNil ifTrue:[ |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1445 |
hScrollBar pageDown |
1138 | 1446 |
] |
1447 |
||
1448 |
"Created: 19.3.1997 / 16:32:14 / cg" |
|
1449 |
"Modified: 19.3.1997 / 16:32:44 / cg" |
|
1450 |
! |
|
1451 |
||
1452 |
pageRight |
|
1453 |
"page right - but only if there is a horizontal scrollbar" |
|
1454 |
||
1455 |
hScrollBar notNil ifTrue:[ |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1456 |
hScrollBar pageUp |
1138 | 1457 |
] |
1458 |
||
1459 |
"Created: 19.3.1997 / 16:32:22 / cg" |
|
1460 |
"Modified: 19.3.1997 / 16:32:48 / cg" |
|
113 | 1461 |
! |
1462 |
||
217 | 1463 |
pageUp |
1138 | 1464 |
"page up - but only if there is a vertical scrollbar" |
0 | 1465 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1466 |
vScrollBar notNil ifTrue:[ |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1467 |
vScrollBar pageUp |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1468 |
] |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1469 |
|
1111 | 1470 |
"Created: 6.3.1997 / 18:06:23 / cg" |
1138 | 1471 |
"Modified: 19.3.1997 / 16:32:38 / cg" |
0 | 1472 |
! ! |
1473 |
||
1474 |
!ScrollableView methodsFor:'initialization'! |
|
1475 |
||
217 | 1476 |
initStyle |
958 | 1477 |
"initialize style specifics" |
1478 |
||
1362 | 1479 |
<resource: #style (#'scrollBar.position' #'scrollBar.hiding')> |
608 | 1480 |
|
217 | 1481 |
super initStyle. |
1482 |
||
1111 | 1483 |
viewBackground := MyDefaultViewBackgroundColor. |
1870 | 1484 |
scrollBarPosition := styleSheet at:#'scrollBar.position' default:#left. |
1485 |
hideHScrollBar := hideVScrollBar := styleSheet at:#'scrollBar.hiding' default:false. |
|
1536
b8ddd185281a
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1535
diff
changeset
|
1486 |
DefaultLevel notNil ifTrue:[self level:DefaultLevel]. |
608 | 1487 |
|
1362 | 1488 |
"Created: / 6.3.1997 / 18:06:23 / cg" |
1536
b8ddd185281a
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1535
diff
changeset
|
1489 |
"Modified: / 21.5.1998 / 00:52:26 / cg" |
0 | 1490 |
! |
1491 |
||
1247 | 1492 |
initialize |
1493 |
"setup some default" |
|
1494 |
||
1495 |
verticalMini := horizontalMini := false. |
|
1496 |
hasVerticalScrollBar := hasHorizontalScrollBar := false. |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1497 |
vScrollBarHidden := hScrollBarHidden := true. |
1247 | 1498 |
super initialize. |
1499 |
! |
|
1500 |
||
0 | 1501 |
realize |
1161
5142fbafeb92
must set dimensions in updateScrollBarVisibility
Claus Gittinger <cg@exept.de>
parents:
1160
diff
changeset
|
1502 |
"realize (i.e. make me visible). |
5142fbafeb92
must set dimensions in updateScrollBarVisibility
Claus Gittinger <cg@exept.de>
parents:
1160
diff
changeset
|
1503 |
Since scrolledView may have done something to its contents |
0 | 1504 |
during init-time we had no chance yet to catch contents- |
1161
5142fbafeb92
must set dimensions in updateScrollBarVisibility
Claus Gittinger <cg@exept.de>
parents:
1160
diff
changeset
|
1505 |
changes; do it now" |
1160
f3204cabcce8
must update scrollBarVisibility in realize
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1506 |
|
1536
b8ddd185281a
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1535
diff
changeset
|
1507 |
self setupDimensionsConfigureScrolledView:true. |
1176
29d0a646cbdf
must realize before setting scroller values
Claus Gittinger <cg@exept.de>
parents:
1161
diff
changeset
|
1508 |
super realize. |
1201
e7f1cf0180ca
must updateScrollBarVisibility in realize
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1509 |
|
38 | 1510 |
scrolledView notNil ifTrue:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1511 |
vScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1512 |
vScrollBar setThumbFor:scrolledView |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1513 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1514 |
hScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1515 |
hScrollBar setThumbFor:scrolledView |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1516 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1517 |
self updateScrollBarVisibility. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1518 |
]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1519 |
|
1536
b8ddd185281a
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1535
diff
changeset
|
1520 |
"Modified: / 21.5.1998 / 00:52:18 / cg" |
1111 | 1521 |
! |
1522 |
||
1523 |
releaseHorizontalScrollBar |
|
1524 |
"destroy any horizontal scrollBar" |
|
1525 |
||
1526 |
hScrollBar notNil ifTrue:[ |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1527 |
hScrollBar destroy. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1528 |
hScrollBar := nil |
1111 | 1529 |
]. |
1530 |
||
1531 |
"Modified: 6.3.1997 / 17:43:20 / cg" |
|
1532 |
"Created: 6.3.1997 / 18:06:23 / cg" |
|
1533 |
! |
|
1534 |
||
1535 |
releaseVerticalScrollBar |
|
1536 |
"destroy any vertical scrollBar" |
|
1537 |
||
1538 |
vScrollBar notNil ifTrue:[ |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1539 |
vScrollBar destroy. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1540 |
vScrollBar := nil |
1111 | 1541 |
]. |
1542 |
||
1543 |
"Created: 6.3.1997 / 18:06:23 / cg" |
|
1097 | 1544 |
! |
7 | 1545 |
|
1546 |
setScrollActions |
|
1547 |
"lock prevents repositioning the scroller to the |
|
1548 |
actual (often rounded) position while scrolling, |
|
1549 |
and keeps it instead at the pointer position. |
|
1550 |
||
1551 |
(this avoids run-away scroller when scrolling |
|
1552 |
textviews, when the text is aligned line-wise). |
|
38 | 1553 |
Consider this as a kludge." |
7 | 1554 |
|
65 | 1555 |
lockUpdates := false. |
7 | 1556 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1557 |
vScrollBar notNil ifTrue:[ |
1695
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1558 |
vScrollBar scrollAction:[:position | |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1559 |
lockUpdates := true. |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1560 |
scrolledView scrollVerticalToPercent:position. |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1561 |
lockUpdates := false |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1562 |
]. |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1563 |
vScrollBar |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1564 |
scrollUpAction:[|sensor| |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1565 |
((sensor := self sensor) notNil |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1566 |
and:[sensor shiftDown or:[sensor ctrlDown]]) ifTrue:[ |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1567 |
scrolledView scrollToTop |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1568 |
] ifFalse:[ |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1569 |
scrolledView scrollUp |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1570 |
] |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1571 |
]. |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1572 |
vScrollBar |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1573 |
scrollDownAction:[|sensor| |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1574 |
((sensor := self sensor) notNil |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1575 |
and:[sensor shiftDown or:[sensor ctrlDown]]) ifTrue:[ |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1576 |
scrolledView scrollToBottom |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1577 |
] ifFalse:[ |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1578 |
scrolledView scrollDown |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1579 |
] |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1580 |
]. |
7 | 1581 |
]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1582 |
hScrollBar notNil ifTrue:[ |
1695
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1583 |
hScrollBar scrollAction:[:position | |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1584 |
lockUpdates := true. |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1585 |
scrolledView scrollHorizontalToPercent:position. |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1586 |
lockUpdates := false |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1587 |
]. |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1588 |
hScrollBar |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1589 |
scrollUpAction:[|sensor| |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1590 |
((sensor := self sensor) notNil |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1591 |
and:[sensor shiftDown or:[sensor ctrlDown]]) ifTrue:[ |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1592 |
scrolledView scrollToLeft |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1593 |
] ifFalse:[ |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1594 |
scrolledView scrollLeft |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1595 |
] |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1596 |
]. |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1597 |
hScrollBar |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1598 |
scrollDownAction:[|sensor| |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1599 |
((sensor := self sensor) notNil |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1600 |
and:[sensor shiftDown or:[sensor ctrlDown]]) ifTrue:[ |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1601 |
scrolledView scrollToRight |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1602 |
] ifFalse:[ |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1603 |
scrolledView scrollRight |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1604 |
] |
c289e9656d9d
shift-click or ctrl-click on scrollBars arrow buttons will
Claus Gittinger <cg@exept.de>
parents:
1694
diff
changeset
|
1605 |
]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1606 |
]. |
7 | 1607 |
|
65 | 1608 |
scrolledView addDependent:self. |
814 | 1609 |
|
1610 |
" |
|
1611 |
pass my keyboard input (and other subviews input) |
|
1612 |
to the scrolled view ... |
|
1613 |
" |
|
1614 |
self delegate:(KeyboardForwarder toView:scrolledView). |
|
1615 |
||
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1616 |
"Modified: 6.3.1997 / 17:03:43 / cg" |
1111 | 1617 |
"Created: 6.3.1997 / 18:06:23 / cg" |
1618 |
! |
|
1619 |
||
1536
b8ddd185281a
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1535
diff
changeset
|
1620 |
setupDimensionsConfigureScrolledView:configureScrolledView |
1138 | 1621 |
"set the components dimensions (i.e. layouts) according to |
1536
b8ddd185281a
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1535
diff
changeset
|
1622 |
the scrollability and hidden settings. |
b8ddd185281a
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1535
diff
changeset
|
1623 |
This may heavily move around the parts ..." |
1138 | 1624 |
|
1486 | 1625 |
|scrolledViewMargin scrollBarSpacing hasV hasH |
1111 | 1626 |
scrolledViewLayout hScrollBarLayout vScrollBarLayout |
1627 |
vBd "{ Class: SmallInteger }" |
|
1628 |
hBd "{ Class: SmallInteger }" |
|
1629 |
sBd "{ Class: SmallInteger }" |
|
1630 |
wVScroll "{ Class: SmallInteger }" |
|
1631 |
hHScroll "{ Class: SmallInteger }" |
|
1632 |
hLeftOffs "{ Class: SmallInteger }" |
|
1633 |
hRightOffs "{ Class: SmallInteger }" |
|
1634 |
hTopOffs "{ Class: SmallInteger }" |
|
1635 |
hBottomOffs "{ Class: SmallInteger }" |
|
1636 |
sLeftOffs "{ Class: SmallInteger }" |
|
1637 |
sRightOffs "{ Class: SmallInteger }" |
|
1638 |
sTopOffs "{ Class: SmallInteger }" |
|
1639 |
sBottomOffs "{ Class: SmallInteger }" |
|
1640 |
vLeftOffs "{ Class: SmallInteger }" |
|
1641 |
vRightOffs "{ Class: SmallInteger }" |
|
1642 |
vTopOffs "{ Class: SmallInteger }" |
|
1643 |
vBottomOffs "{ Class: SmallInteger }" |
|
1644 |
addMargin "{ Class: SmallInteger }"| |
|
1645 |
||
1646 |
sBd := 0. |
|
1647 |
DefaultScrolledViewBorderWidth notNil ifTrue:[ |
|
1895 | 1648 |
sBd := DefaultScrolledViewBorderWidth. |
1649 |
scrolledView notNil ifTrue:[ |
|
1650 |
scrolledView borderWidth:DefaultScrolledViewBorderWidth. |
|
1651 |
] |
|
1111 | 1652 |
] ifFalse:[ |
1895 | 1653 |
scrolledView notNil ifTrue:[ |
1654 |
sBd := scrolledView borderWidth |
|
1655 |
] |
|
1111 | 1656 |
]. |
1657 |
||
1486 | 1658 |
(hasV := (vScrollBar notNil and:[vScrollBarHidden not])) ifTrue:[ |
1895 | 1659 |
vBd := vScrollBar borderWidth. |
1660 |
wVScroll := vScrollBar widthIncludingBorder. |
|
1111 | 1661 |
] ifFalse:[ |
1895 | 1662 |
vBd := wVScroll := 0. |
1111 | 1663 |
]. |
1664 |
||
1486 | 1665 |
(hasH := (hScrollBar notNil and:[hScrollBarHidden not])) ifTrue:[ |
1895 | 1666 |
hBd := hScrollBar borderWidth. |
1667 |
hHScroll := hScrollBar heightIncludingBorder. |
|
1111 | 1668 |
] ifFalse:[ |
1895 | 1669 |
hBd := hHScroll := 0. |
1111 | 1670 |
]. |
1671 |
||
1672 |
"/ the raw layout ... |
|
1673 |
||
1674 |
scrolledViewLayout := ((0.0 @ 0.0) corner:(1.0@1.0)) asLayout. |
|
1675 |
hScrollBarLayout := ((0.0 @ 1.0) corner:(1.0@1.0)) asLayout. |
|
1676 |
||
1677 |
"/ the painful details; mostly complicated for 2D styles, |
|
1678 |
"/ where the positions are setUp to overlay borders ... |
|
1679 |
"/ (well, with 3D styles, a single pixel error will not be noticed; |
|
1680 |
"/ but 2D styles are very sensitive to those; |
|
1681 |
"/ the code below may not work correctly with different borderWidths). |
|
1682 |
||
1683 |
scrolledViewMargin := DefaultScrolledViewMargin. |
|
1684 |
scrollBarSpacing := DefaultScrollBarSpacing. |
|
1685 |
||
1686 |
vTopOffs := 0 - vBd + scrolledViewMargin + margin. |
|
1668
2b2a006faedd
tight fitt into outer view with win95 style.
Claus Gittinger <cg@exept.de>
parents:
1593
diff
changeset
|
1687 |
|
1111 | 1688 |
scrolledViewMargin == 0 ifTrue:[ |
1895 | 1689 |
vBottomOffs := vBd - scrolledViewMargin - sBd. |
1111 | 1690 |
] ifFalse:[ |
1895 | 1691 |
vBottomOffs := vBd - scrolledViewMargin + sBd. |
1111 | 1692 |
]. |
1693 |
||
1694 |
hLeftOffs := 0 - hBd + scrolledViewMargin + margin. |
|
1286 | 1695 |
hRightOffs := hBd - scrolledViewMargin - sBd. |
1111 | 1696 |
|
1697 |
sLeftOffs := 0 - hBd + scrolledViewMargin + margin. |
|
1286 | 1698 |
sRightOffs := hBd - scrolledViewMargin - sBd - sBd - sBd. |
1111 | 1699 |
|
1700 |
scrolledViewMargin == 0 ifTrue:[ |
|
1895 | 1701 |
sTopOffs := 0 - sBd + margin. |
1702 |
sBottomOffs := sBd - sBd. |
|
1111 | 1703 |
] ifFalse:[ |
1895 | 1704 |
sTopOffs := 0 + scrolledViewMargin + margin. |
1705 |
sBottomOffs := sBd - scrolledViewMargin - sBd - sBd - sBd. |
|
1111 | 1706 |
]. |
1707 |
||
2137
2642e627bb2a
eliminated styleSheet name = win95 queries
Claus Gittinger <cg@exept.de>
parents:
2135
diff
changeset
|
1708 |
"/ kludge - for now |
2642e627bb2a
eliminated styleSheet name = win95 queries
Claus Gittinger <cg@exept.de>
parents:
2135
diff
changeset
|
1709 |
(styleSheet at:#'scrolledView.zeroOffsets') == true ifTrue:[ |
2642e627bb2a
eliminated styleSheet name = win95 queries
Claus Gittinger <cg@exept.de>
parents:
2135
diff
changeset
|
1710 |
vTopOffs := 0. |
2642e627bb2a
eliminated styleSheet name = win95 queries
Claus Gittinger <cg@exept.de>
parents:
2135
diff
changeset
|
1711 |
hLeftOffs := 0. |
2642e627bb2a
eliminated styleSheet name = win95 queries
Claus Gittinger <cg@exept.de>
parents:
2135
diff
changeset
|
1712 |
sLeftOffs := 0. |
2642e627bb2a
eliminated styleSheet name = win95 queries
Claus Gittinger <cg@exept.de>
parents:
2135
diff
changeset
|
1713 |
sTopOffs := 0. |
2642e627bb2a
eliminated styleSheet name = win95 queries
Claus Gittinger <cg@exept.de>
parents:
2135
diff
changeset
|
1714 |
]. |
1668
2b2a006faedd
tight fitt into outer view with win95 style.
Claus Gittinger <cg@exept.de>
parents:
1593
diff
changeset
|
1715 |
|
1111 | 1716 |
addMargin := 0. |
1717 |
"/ DefaultScrollBarLevel == DefaultScrolledViewLevel |
|
1718 |
"/ addMargin := 1. |
|
1719 |
"/ ]. |
|
1720 |
||
1486 | 1721 |
hasV ifTrue:[ |
1895 | 1722 |
scrollBarPosition == #right ifTrue:[ |
1723 |
"/ right/bottom |
|
1724 |
vScrollBarLayout := ((1.0 @ 0.0) corner:(1.0@1.0)) asLayout. |
|
1111 | 1725 |
|
1895 | 1726 |
vRightOffs := 0 - scrolledViewMargin + margin "???". |
1727 |
vLeftOffs := vRightOffs - wVScroll. |
|
1111 | 1728 |
|
1895 | 1729 |
sRightOffs := sRightOffs - scrollBarSpacing - wVScroll + sBd. |
1111 | 1730 |
|
1895 | 1731 |
hRightOffs := hRightOffs - wVScroll - scrollBarSpacing - sBd. |
1111 | 1732 |
|
1895 | 1733 |
sRightOffs := sRightOffs - addMargin |
1734 |
] ifFalse:[ |
|
1735 |
"/ left/bottom |
|
1736 |
vScrollBarLayout := ((0.0 @ 0.0) corner:(0.0@1.0)) asLayout. |
|
1111 | 1737 |
|
1895 | 1738 |
vLeftOffs := 0 - vBd + scrolledViewMargin + margin. |
1739 |
vRightOffs := vLeftOffs + wVScroll + margin. |
|
1111 | 1740 |
|
1895 | 1741 |
sLeftOffs := wVScroll + scrolledViewMargin + scrollBarSpacing + margin. |
1742 |
sRightOffs := 0 - scrolledViewMargin - margin. |
|
1743 |
hLeftOffs := hLeftOffs + wVScroll + vBd + scrollBarSpacing. |
|
1111 | 1744 |
|
1895 | 1745 |
sLeftOffs := sLeftOffs + addMargin |
1746 |
]. |
|
1111 | 1747 |
]. |
1748 |
||
1486 | 1749 |
hasH ifTrue:[ |
1895 | 1750 |
hBottomOffs := 0 - scrolledViewMargin - hBd + margin "???". |
1751 |
hTopOffs := hBottomOffs - hHScroll. |
|
1752 |
scrolledViewMargin == 0 ifTrue:[ |
|
1753 |
hTopOffs := hTopOffs + sBd + sBd |
|
1754 |
]. |
|
1755 |
sBottomOffs := sBottomOffs - scrollBarSpacing - hHScroll. |
|
1756 |
(vScrollBar notNil and:[vScrollBarHidden not]) ifTrue:[ |
|
1757 |
vBottomOffs := vBottomOffs - scrollBarSpacing - hHScroll. |
|
1758 |
]. |
|
1111 | 1759 |
|
1895 | 1760 |
sBottomOffs := sBottomOffs - addMargin. |
1761 |
hRightOffs := hRightOffs - addMargin. |
|
1111 | 1762 |
]. |
1763 |
||
1357 | 1764 |
(hScrollBar notNil |
1765 |
and:[ hScrollBar borderWidth == 0 |
|
1766 |
and:[sBd ~~ 0 |
|
1767 |
and:[scrollBarPosition == #right]]]) ifTrue:[ |
|
1895 | 1768 |
hRightOffs := hRightOffs + sBd + sBd. |
1357 | 1769 |
]. |
1770 |
||
1111 | 1771 |
scrolledView notNil ifTrue:[ |
1895 | 1772 |
scrolledViewLayout leftOffset:sLeftOffs. |
1773 |
scrolledViewLayout rightOffset:sRightOffs. |
|
1774 |
scrolledViewLayout topOffset:sTopOffs. |
|
1775 |
scrolledViewLayout bottomOffset:sBottomOffs. |
|
1111 | 1776 |
|
1895 | 1777 |
configureScrolledView ifTrue:[ |
1778 |
((hideVScrollBar or:[hideHScrollBar]) not |
|
1779 |
and:[(hScrollBar isNil or:[hScrollBarHidden]) |
|
1780 |
and:[(vScrollBar isNil or:[vScrollBarHidden])]]) ifTrue:[ |
|
1781 |
scrolledView level:0 |
|
1782 |
] ifFalse:[ |
|
1783 |
scrolledView level:DefaultScrolledViewLevel. |
|
1784 |
]. |
|
1785 |
]. |
|
1786 |
scrolledView layout:scrolledViewLayout. |
|
1111 | 1787 |
]. |
1486 | 1788 |
hasH ifTrue:[ |
1895 | 1789 |
hScrollBarLayout leftOffset:hLeftOffs. |
1790 |
hScrollBarLayout rightOffset:hRightOffs. |
|
1791 |
hScrollBarLayout topOffset:hTopOffs. |
|
1792 |
hScrollBarLayout bottomOffset:hBottomOffs. |
|
1111 | 1793 |
|
1895 | 1794 |
hScrollBar level:DefaultScrollBarLevel. |
1795 |
hScrollBar layout:hScrollBarLayout. |
|
1796 |
||
1797 |
"/ scrollBarPosition == #right ifTrue:[ |
|
1798 |
"/ "/ right/bottom |
|
1799 |
"/ hScrollBar viewGravity:#SouthWest. |
|
1800 |
"/ ] ifFalse:[ |
|
1801 |
"/ hScrollBar viewGravity:#NorthWest. |
|
1802 |
"/ ] |
|
1111 | 1803 |
]. |
2135 | 1804 |
(hasV and:[vScrollBar notNil and:[vScrollBarHidden not]]) ifTrue:[ |
1895 | 1805 |
vScrollBarLayout leftOffset:vLeftOffs. |
1806 |
vScrollBarLayout rightOffset:vRightOffs. |
|
1807 |
vScrollBarLayout topOffset:vTopOffs. |
|
1808 |
vScrollBarLayout bottomOffset:vBottomOffs. |
|
1111 | 1809 |
|
1895 | 1810 |
vScrollBar level:DefaultScrollBarLevel. |
1811 |
vScrollBar layout:vScrollBarLayout. |
|
1812 |
||
1813 |
"/ scrollBarPosition == #right ifTrue:[ |
|
1814 |
"/ "/ right/bottom |
|
1815 |
"/ vScrollBar viewGravity:#NorthEast. |
|
1816 |
"/ ] ifFalse:[ |
|
1817 |
"/ vScrollBar viewGravity:#NorthWest. |
|
1818 |
"/ ] |
|
1111 | 1819 |
]. |
1820 |
||
1536
b8ddd185281a
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1535
diff
changeset
|
1821 |
"Created: / 21.5.1998 / 00:48:35 / cg" |
2135 | 1822 |
"Modified: / 11.2.2000 / 00:00:36 / cg" |
1111 | 1823 |
! |
1824 |
||
1825 |
setupVertical:isVertical mini:miniV horizontal:isHorizontal mini:miniH |
|
1826 |
"setup scrollbars as specified in the arguments" |
|
1827 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1828 |
|noMiniScrollers| |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1829 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1830 |
vScrollBarHidden := hScrollBarHidden := false. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1831 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1832 |
hasVerticalScrollBar := isVertical. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1833 |
hasHorizontalScrollBar := isHorizontal. |
1111 | 1834 |
|
1870 | 1835 |
noMiniScrollers := styleSheet at:#'scrollBar.neverMini' default:false. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1836 |
verticalMini := miniV. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1837 |
horizontalMini := miniH. |
1753
d0b1ba76acdb
honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents:
1719
diff
changeset
|
1838 |
|
d0b1ba76acdb
honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents:
1719
diff
changeset
|
1839 |
noMiniScrollers == true ifTrue:[ |
d0b1ba76acdb
honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents:
1719
diff
changeset
|
1840 |
verticalMini := false. |
d0b1ba76acdb
honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents:
1719
diff
changeset
|
1841 |
horizontalMini := false. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1842 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1843 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1844 |
self setupViews. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1845 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1846 |
"Modified: 7.3.1997 / 22:09:12 / cg" |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1847 |
! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1848 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1849 |
setupViews |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1850 |
"setup scrollbars as specified in the arguments" |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1851 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1852 |
|cls| |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1853 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1854 |
hasVerticalScrollBar ifTrue:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1855 |
cls := ScrollBar. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1856 |
verticalMini ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1857 |
cls := MiniScroller |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1858 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1859 |
(vScrollBar notNil |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1860 |
and:[vScrollBar class ~~ cls]) ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1861 |
self releaseVerticalScrollBar |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1862 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1863 |
vScrollBar isNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1864 |
vScrollBar := cls in:self. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1865 |
realized ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1866 |
vScrollBar realize "/ beVisible |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1867 |
] |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1868 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1869 |
vScrollBar thumbOrigin:0 thumbHeight:100. |
1111 | 1870 |
] ifFalse:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1871 |
vScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1872 |
self releaseVerticalScrollBar |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1873 |
] |
1111 | 1874 |
]. |
1875 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1876 |
hasHorizontalScrollBar ifTrue:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1877 |
cls := HorizontalScrollBar. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1878 |
horizontalMini ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1879 |
cls := HorizontalMiniScroller |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1880 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1881 |
(hScrollBar notNil |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1882 |
and:[hScrollBar class ~~ cls]) ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1883 |
self releaseHorizontalScrollBar |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1884 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1885 |
hScrollBar isNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1886 |
hScrollBar := cls in:self. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1887 |
realized ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1888 |
hScrollBar realize "/ beVisible |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1889 |
] |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1890 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1891 |
hScrollBar thumbOrigin:0 thumbHeight:100. |
1111 | 1892 |
] ifFalse:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1893 |
hScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1894 |
self releaseHorizontalScrollBar |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1895 |
] |
1111 | 1896 |
]. |
1897 |
||
1898 |
scrolledView notNil ifTrue:[ |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1899 |
self setScrollActions. |
1111 | 1900 |
] |
1901 |
||
1902 |
"Created: 6.3.1997 / 18:06:23 / cg" |
|
1184
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1903 |
"Modified: 8.4.1997 / 00:44:33 / cg" |
7 | 1904 |
! ! |
1905 |
||
217 | 1906 |
!ScrollableView methodsFor:'queries'! |
38 | 1907 |
|
819
32ac89843fa8
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
1908 |
isHorizontalScrollable |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1909 |
"return true if I am horizontally scrollable" |
819
32ac89843fa8
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
1910 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1911 |
^ hScrollBar notNil |
819
32ac89843fa8
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
1912 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1913 |
"Modified: 6.3.1997 / 17:03:49 / cg" |
1111 | 1914 |
"Created: 6.3.1997 / 18:06:23 / cg" |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1915 |
! |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1916 |
|
1593
a77a10ecde65
added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
1917 |
isScrollWrapper |
a77a10ecde65
added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
1918 |
^ true |
a77a10ecde65
added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
1919 |
|
a77a10ecde65
added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
1920 |
"Created: / 20.6.1998 / 14:15:42 / cg" |
a77a10ecde65
added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
1921 |
! |
a77a10ecde65
added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
1922 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1923 |
isVerticalScrollable |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1924 |
"return true if I am vertically scrollable" |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1925 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1926 |
^ vScrollBar notNil |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1927 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1928 |
"Modified: 6.3.1997 / 17:03:52 / cg" |
1111 | 1929 |
"Created: 6.3.1997 / 18:06:23 / cg" |
819
32ac89843fa8
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
1930 |
! |
32ac89843fa8
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
1931 |
|
217 | 1932 |
preferredExtent |
572 | 1933 |
"return my preferredExtent from the scrolledViews prefExtent |
1934 |
plus the size of the scrollBar" |
|
1935 |
||
1855 | 1936 |
|slavesPref prefX prefY margin| |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1937 |
|
799 | 1938 |
"/ If I have an explicit preferredExtent .. |
1939 |
||
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
703
diff
changeset
|
1940 |
preferredExtent notNil ifTrue:[ |
1855 | 1941 |
^ preferredExtent |
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
703
diff
changeset
|
1942 |
]. |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
703
diff
changeset
|
1943 |
|
217 | 1944 |
scrolledView notNil ifTrue:[ |
1855 | 1945 |
slavesPref := scrolledView preferredExtent. |
1946 |
prefX := slavesPref x. |
|
1947 |
prefY := slavesPref y. |
|
1948 |
margin := (DefaultScrolledViewMargin * 2) + DefaultScrollBarSpacing. |
|
1949 |
vScrollBar notNil ifTrue:[ |
|
1950 |
prefX := prefX + vScrollBar width + margin. |
|
1951 |
]. |
|
1952 |
hScrollBar notNil ifTrue:[ |
|
1953 |
prefY := prefY + hScrollBar height + margin. |
|
1954 |
]. |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1955 |
|
1855 | 1956 |
^ prefX @ prefY. |
0 | 1957 |
]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1958 |
|
217 | 1959 |
^ super preferredExtent. |
572 | 1960 |
|
1111 | 1961 |
"Created: 6.3.1997 / 18:06:24 / cg" |
1962 |
"Modified: 6.3.1997 / 22:34:09 / cg" |
|
678
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
1963 |
! |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
1964 |
|
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
1965 |
preferredExtentForLines:numLines cols:numCols |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1966 |
"return my preferredExtent from the scrolledViews prefExtent |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1967 |
plus the size of the scrollBar" |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1968 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1969 |
|slavesPref prefX prefY| |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1970 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1971 |
"/ If I have an explicit preferredExtent .. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1972 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1973 |
preferredExtent notNil ifTrue:[ |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1974 |
^ preferredExtent |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1975 |
]. |
678
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
1976 |
|
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
1977 |
scrolledView notNil ifTrue:[ |
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1978 |
slavesPref := scrolledView preferredExtentForLines:numLines cols:numCols. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1979 |
prefX := slavesPref x. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1980 |
prefY := slavesPref y. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1981 |
vScrollBar notNil ifTrue:[ |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1982 |
prefX := prefX + vScrollBar width + (DefaultScrolledViewMargin * 2) + DefaultScrollBarSpacing. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1983 |
]. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1984 |
hScrollBar notNil ifTrue:[ |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1985 |
prefY := prefY + hScrollBar height + (DefaultScrolledViewMargin * 2) + DefaultScrollBarSpacing. |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1986 |
]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1987 |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
1988 |
^ prefX @ prefY. |
678
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
1989 |
]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1990 |
|
678
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
1991 |
^ super preferredExtent. |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
1992 |
|
1111 | 1993 |
"Created: 6.3.1997 / 18:06:24 / cg" |
1994 |
"Modified: 6.3.1997 / 22:34:30 / cg" |
|
1231 | 1995 |
! |
1996 |
||
1997 |
specClass |
|
1378 | 1998 |
"redefined, since my subclasses also want ScrollableViewSpecs" |
1999 |
||
1231 | 2000 |
^ ScrollableViewSpec |
2001 |
||
1378 | 2002 |
"Modified: / 31.10.1997 / 19:48:48 / cg" |
0 | 2003 |
! ! |
2004 |
||
2005 |
!ScrollableView methodsFor:'slave-view messages'! |
|
2006 |
||
1024 | 2007 |
clear |
1138 | 2008 |
"convenient method: forward this to the scrolledView" |
2009 |
||
1073 | 2010 |
scrolledView notNil ifTrue:[scrolledView clear] |
1024 | 2011 |
|
1111 | 2012 |
"Created: 6.3.1997 / 18:06:24 / cg" |
1138 | 2013 |
"Modified: 19.3.1997 / 16:34:19 / cg" |
1024 | 2014 |
! |
2015 |
||
217 | 2016 |
doesNotUnderstand:aMessage |
2017 |
"this is funny: all message we do not understand, are passed |
|
2018 |
on to the scrolledView - so we do not have to care for all |
|
2019 |
possible messages ...(thanks to the Message class)" |
|
2020 |
||
2021 |
scrolledView isNil ifFalse:[ |
|
1694
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
2022 |
^ scrolledView perform:(aMessage selector) |
61bcd88d3721
geometry beautified for win32 style
Claus Gittinger <cg@exept.de>
parents:
1668
diff
changeset
|
2023 |
withArguments:(aMessage arguments) |
1111 | 2024 |
]. |
2025 |
^ super doesNotUnderstand:aMessage |
|
2026 |
||
2027 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
2028 |
"Modified: 6.3.1997 / 18:38:54 / cg" |
|
217 | 2029 |
! |
2030 |
||
0 | 2031 |
leftButtonMenu |
38 | 2032 |
"return scrolledViews leftbuttonmenu" |
2033 |
||
2034 |
scrolledView isNil ifTrue:[^ nil]. |
|
0 | 2035 |
^ scrolledView leftButtonMenu |
1111 | 2036 |
|
2037 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
0 | 2038 |
! |
2039 |
||
2040 |
leftButtonMenu:aMenu |
|
2041 |
"pass on leftbuttonmenu to scrolledView" |
|
2042 |
||
2043 |
scrolledView leftButtonMenu:aMenu |
|
1111 | 2044 |
|
2045 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
0 | 2046 |
! |
2047 |
||
2048 |
middleButtonMenu |
|
38 | 2049 |
"return scrolledViews middlebuttonmenu" |
2050 |
||
2051 |
scrolledView isNil ifTrue:[^ nil]. |
|
0 | 2052 |
^ scrolledView middleButtonMenu |
1111 | 2053 |
|
2054 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
0 | 2055 |
! |
2056 |
||
2057 |
middleButtonMenu:aMenu |
|
2058 |
"pass on middlebuttonmenu to scrolledView" |
|
2059 |
||
2060 |
scrolledView middleButtonMenu:aMenu |
|
1111 | 2061 |
|
2062 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
0 | 2063 |
! |
2064 |
||
562 | 2065 |
model |
754 | 2066 |
"return my scrolledViews model" |
2067 |
||
1085 | 2068 |
scrolledView isNil ifTrue:[^ nil]. |
562 | 2069 |
^ scrolledView model |
2070 |
||
1085 | 2071 |
"Modified: 1.3.1997 / 01:38:07 / cg" |
1111 | 2072 |
"Created: 6.3.1997 / 18:06:24 / cg" |
562 | 2073 |
! |
2074 |
||
2075 |
model:aModel |
|
754 | 2076 |
"forward model change to my scrolledViews" |
2077 |
||
562 | 2078 |
^ scrolledView model:aModel |
2079 |
||
754 | 2080 |
"Modified: 5.6.1996 / 17:09:50 / cg" |
1111 | 2081 |
"Created: 6.3.1997 / 18:06:24 / cg" |
562 | 2082 |
! |
2083 |
||
1827 | 2084 |
requestFocus |
2085 |
^ scrolledView requestFocus |
|
2086 |
! |
|
2087 |
||
0 | 2088 |
rightButtonMenu |
38 | 2089 |
"return scrolledViews rightbuttonmenu" |
2090 |
||
2091 |
scrolledView isNil ifTrue:[^ nil]. |
|
0 | 2092 |
^ scrolledView rightButtonMenu |
1111 | 2093 |
|
2094 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
0 | 2095 |
! |
2096 |
||
2097 |
rightButtonMenu:aMenu |
|
2098 |
"pass on rightbuttonmenu to scrolledView" |
|
2099 |
||
2100 |
scrolledView rightButtonMenu:aMenu |
|
1111 | 2101 |
|
2102 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
38 | 2103 |
! ! |
2104 |
||
852 | 2105 |
!ScrollableView class methodsFor:'documentation'! |
0 | 2106 |
|
217 | 2107 |
version |
2137
2642e627bb2a
eliminated styleSheet name = win95 queries
Claus Gittinger <cg@exept.de>
parents:
2135
diff
changeset
|
2108 |
^ '$Header: /cvs/stx/stx/libwidg/ScrollableView.st,v 1.102 2000-02-11 14:56:18 cg Exp $' |
0 | 2109 |
! ! |