author | ca |
Mon, 13 Sep 2004 17:04:24 +0200 | |
changeset 3017 | 8acd72001dd6 |
parent 2913 | bdf4fb09cfc0 |
child 3019 | 6cfaf60fd8ea |
permissions | -rw-r--r-- |
0 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
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 |
||
2171 | 13 |
"{ Package: 'stx:libwidg' }" |
14 |
||
0 | 15 |
View subclass:#Scroller |
1011 | 16 |
instanceVariableNames:'thumbOrigin thumbHeight thumbColor thumbFrameColor scrollAction |
17 |
orientation thumbFrame thumbLevel scrolling pressOffset |
|
18 |
synchronousOperation shadowForm lightForm inset thumbShadowColor |
|
19 |
thumbLightColor thumbEdgeStyle thumbHalfShadowColor |
|
20 |
thumbHalfLightColor thumbEnteredColor thumbFrameSizeDifference |
|
21 |
tallyLevel tallyMarks fixThumbHeight frameBeforeMove ghostColor |
|
22 |
ghostFrameColor ghostLevel rangeStart rangeEnd rangeStep entered |
|
1830 | 23 |
thumbActiveLevel originBeforeMove thumbImage enabled keyboardStep |
2594
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
24 |
autoRepeat repeatBlock initialRepeatDelay repeatDelay |
2609 | 25 |
lastMousePosition thumbActiveColor' |
1011 | 26 |
classVariableNames:'HandleShadowForm HandleLightForm DefaultViewBackground |
27 |
DefaultShadowColor DefaultLightColor DefaultThumbColor |
|
28 |
DefaultThumbShadowColor DefaultThumbLightColor |
|
29 |
DefaultThumbHalfShadowColor DefaultThumbHalfLightColor |
|
30 |
DefaultHalfShadowColor DefaultHalfLightColor DefaultTallyMarks |
|
31 |
DefaultTallyLevel DefaultLevel DefaultBorderWidth |
|
32 |
DefaultThumbLevel DefaultInset DefaultThumbFrameColor |
|
33 |
DefaultGhostColor DefaultGhostFrameColor DefaultGhostLevel |
|
34 |
DefaultFixThumbHeight DefaultEdgeStyle DefaultFullViewBackground |
|
2609 | 35 |
DefaultThumbEnteredColor DefaultThumbActiveColor |
36 |
DefaultThumbActiveLevel SnapBackDistance DefaultMiddleButtonJump |
|
37 |
NewCursors DefaultThumbImage HandleImage DefaultHScrollerHeight |
|
38 |
DefaultVScrollerWidth DefaultStopPagerAtThumb DefaultTallyInset |
|
39 |
MinThumbSize DefaultTallyDistance' |
|
1011 | 40 |
poolDictionaries:'' |
41 |
category:'Views-Interactors' |
|
0 | 42 |
! |
43 |
||
897 | 44 |
!Scroller class methodsFor:'documentation'! |
3 | 45 |
|
38 | 46 |
copyright |
47 |
" |
|
48 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
49 |
All Rights Reserved |
38 | 50 |
|
51 |
This software is furnished under a license and may be used |
|
52 |
only in accordance with the terms of that license and with the |
|
53 |
inclusion of the above copyright notice. This software may not |
|
54 |
be provided or otherwise made available to, or used by, any |
|
55 |
other person. No title to or ownership of the software is |
|
56 |
hereby transferred. |
|
57 |
" |
|
58 |
! |
|
59 |
||
3 | 60 |
documentation |
61 |
" |
|
38 | 62 |
this class implements the scroller for scrollbars. |
63 |
it can also be used by itself for scrollbars without step-buttons. |
|
63 | 64 |
When moved, either a predefined action is performed (scrollAction), |
119 | 65 |
or a model is informed via the changeMsg (which is #value: by default). |
63 | 66 |
|
38 | 67 |
The scroller can work synchronous (i.e. every move leads to an immediate evaluation |
68 |
of the action, or asynchronous (i.e. perform action on end-of move). |
|
63 | 69 |
By default, scrollers are synchronous. Asynchronous operation makes sense, |
70 |
if the scroll operation (redraw) is expensive and takes a long time. |
|
0 | 71 |
|
127 | 72 |
This class is used both for concrete instances (vertical scrollers) |
73 |
and as an abstract superclass for horizontalScrollers, sliders and |
|
74 |
miniScrollers. |
|
75 |
||
448
e23465aad9e8
use new defaultExtent protocol
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
76 |
range: |
e23465aad9e8
use new defaultExtent protocol
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
77 |
the value passed to the model or via the action blocks is scaled according |
e23465aad9e8
use new defaultExtent protocol
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
78 |
to the min/maxRange instance variables. |
e23465aad9e8
use new defaultExtent protocol
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
79 |
These default to 0..100 for percentage values. |
e23465aad9e8
use new defaultExtent protocol
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
80 |
It does not make sense to change the range for scrollbar-scrollers, |
e23465aad9e8
use new defaultExtent protocol
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
81 |
but may be useful with Sliders or in special applications. |
e23465aad9e8
use new defaultExtent protocol
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
82 |
|
e23465aad9e8
use new defaultExtent protocol
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
83 |
style stuff: |
e23465aad9e8
use new defaultExtent protocol
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
84 |
|
e23465aad9e8
use new defaultExtent protocol
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
85 |
Beside the obvious 3D rectangle, a scroller may draw a know-form |
e23465aad9e8
use new defaultExtent protocol
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
86 |
(as in NeXT) or little tally marks (as on SGI) in itself. |
e23465aad9e8
use new defaultExtent protocol
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
87 |
These are controlled by the shadowForm, lightForm, tallyLevel and tallyMarks |
1302 | 88 |
instance variables. All of this is initialized from the styleSheet. |
448
e23465aad9e8
use new defaultExtent protocol
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
89 |
|
585 | 90 |
[Instance variables:] |
0 | 91 |
|
38 | 92 |
thumbOrigin <Number> origin of thumb (in percent) |
93 |
thumbHeight <Number> height of thumb (in percent) |
|
94 |
thumbColor <Color> color of thumb |
|
95 |
thumbFrameColor <Color> color of the frame around the thumb |
|
96 |
scrollAction <Block> 1 arg block to be evaluated when scrolled |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
97 |
(arg is position in percent) |
119 | 98 |
orientation <Symbol> #horizontal or #vertical |
38 | 99 |
thumbFrame <Rectangle> frame of thumb in pixels (cached) |
100 |
thumbLevel <Number> level of thumb if 3d |
|
101 |
scrolling <Boolean> true during scroll |
|
102 |
pressOffset <Number> temporary (offset into frame when move started) |
|
103 |
synchronousOperation <Boolean> true if synchronous (i.e. dont wait till release |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
104 |
to perform action) |
38 | 105 |
shadowForm <Form> bitmap of knob if any (shadow part) |
106 |
lightForm <Form> bitmap of knob if any (light part) |
|
107 |
inset <Integer> number of pixels to inset thumb from view borders |
|
108 |
thumbShadowColor <Color> color do draw dark parts of thumb |
|
109 |
thumblightColor <Color> color to draw light parts of thumb |
|
63 | 110 |
thumbEdgeStyle <SymbolOrNil> #soft or nil |
38 | 111 |
thumbHalfShadowColor <Color> used to draw smooth edges |
112 |
thumbHalfLightColor <Color> used to draw smooth edges |
|
113 |
thumbFrameSizeDifference <Integer> number of pixels the thumb is larger than |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
114 |
it should be (can be negative for mswin-style) |
38 | 115 |
tallyLevel <Integer> if not zero, specifies if tally-marks should |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
116 |
go into or out of the display (actually only <0/>0 is checked) |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
117 |
I dont know of a better word for these ... |
38 | 118 |
tallyMarks <Integer> number of tally marks |
119 |
fixThumbHeight <Boolean> perform 'wrong' height computation a la mswindows |
|
117 | 120 |
rangeStart <Number> the range of the scroller |
121 |
rangeEnd (defaults to 0..100) |
|
119 | 122 |
rangeStep not currently implemented |
63 | 123 |
|
585 | 124 |
[style settings:] |
63 | 125 |
|
126 |
scrollerLevel <Integer> the level of the scroller w.r.t. its enclosing view |
|
127 |
scrollerBorderWidth <Integer> the borderWidth (ignored for 3D styles) |
|
128 |
||
129 |
scrollerViewBackground <Color> the viewBackground (color or image) |
|
130 |
scrollerShadowColor <Color> the color of 3D shadowed edges (ignored in 2D styles) |
|
131 |
scrollerLightColor <Color> the color of 3D lighted edges (ignored in 2D styles) |
|
132 |
||
133 |
scrollerThumbColor <Color> the thumbs color (color or image) |
|
134 |
scrollerThumbShadowColor <Color> the color of the thumbs shadowed edges (ignored in 2D styles) |
|
135 |
scrollerThumbLightColor <Color> the color of the thumbs shadowed edges (ignored in 2D styles) |
|
136 |
scrollerThumbEdgeStyle <Symbol> the edge style for the thumb (#soft or nil) |
|
137 |
scrollerThumbLevel <Integer> the 3D height of the thumb |
|
138 |
scrollerThumbHalfShadowColor<Color> the halfShadow for soft edged thumbs |
|
139 |
scrollerThumbHalfLightColor <Color> the halfLight for soft edged thumbs |
|
140 |
scrollerThumbFrameColor <Color> if non-nil, a rectangle is drawn around the thumb is this color |
|
141 |
scrollerThumbInset <Integer> inset of thumb from the scrollers boundary |
|
142 |
scrollerThumbFixHeight <Boolean> if true, use a fix thumb height (as in mswindows) |
|
143 |
scrollerGhostColor <Color> the color in which a ghost-rectangle is drawn |
|
144 |
scrollerGhostFrameColor <Color> if non-nil, a rectangle is drawn around the ghost is this color |
|
145 |
scrollerGhostLevel <Color> the 3D level of the ghost rectangle |
|
146 |
scrollerNTallyMarks <Integer> number of tally-marks to draw on the thumb |
|
1302 | 147 |
scrollerTallyLevel <Integer> the 3D level of any tally marks |
148 |
scrollerSnapBack <Boolean> win95 behavior: snap back to original position if scrollers view |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
149 |
is left by mouse (with some distance) |
1302 | 150 |
scrollerMiddleButtonJump <Boolean> xterm behavior: middle button has shift-click behavior |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
151 |
(positions absolute to click position) |
63 | 152 |
|
38 | 153 |
notice: for mswindows style, we force a WRONG thumb-frame |
154 |
computation, to make the thumb have constant size; |
|
1302 | 155 |
if you dont like that (I do not :-), |
156 |
set scrollerThumbFixHeight to false (in the StyleSheet). |
|
585 | 157 |
|
158 |
[author:] |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
159 |
Claus Gittinger |
585 | 160 |
|
161 |
[see also:] |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
162 |
ScrollBar |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
163 |
ScrollableView HVScrollableView |
3 | 164 |
" |
117 | 165 |
! |
166 |
||
167 |
examples |
|
168 |
" |
|
133 | 169 |
basic scroller setup: |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
170 |
[exBegin] |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
171 |
|top s| |
133 | 172 |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
173 |
top := StandardSystemView new extent:200@200. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
174 |
s := Scroller in:top. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
175 |
s origin:(0.0@0.0) corner:(20@1.0). |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
176 |
s thumbHeight:10. 'percent'. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
177 |
top open |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
178 |
[exEnd] |
133 | 179 |
|
180 |
setting its thumb-height: |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
181 |
[exBegin] |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
182 |
|top s| |
133 | 183 |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
184 |
top := StandardSystemView new extent:200@200. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
185 |
s := Scroller in:top. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
186 |
s origin:(0.0@0.0) corner:(20@1.0). |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
187 |
s thumbHeight:50. 'percent'. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
188 |
top open |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
189 |
[exEnd] |
133 | 190 |
|
191 |
setting its thumb-origin: |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
192 |
[exBegin] |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
193 |
|top s| |
133 | 194 |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
195 |
top := StandardSystemView new extent:200@200. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
196 |
s := Scroller in:top. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
197 |
s origin:(0.0@0.0) corner:(20@1.0). |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
198 |
s thumbHeight:10. 'percent'. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
199 |
s thumbOrigin:30. 'percent'. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
200 |
top open |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
201 |
[exEnd] |
133 | 202 |
|
117 | 203 |
a scroller with action block (ST/X style): |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
204 |
[exBegin] |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
205 |
|top s| |
448
e23465aad9e8
use new defaultExtent protocol
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
206 |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
207 |
top := StandardSystemView new extent:200@200. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
208 |
s := Scroller in:top. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
209 |
s origin:(0.0@0.0) corner:(20@1.0). |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
210 |
s thumbHeight:10. 'percent'. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
211 |
s scrollAction:[:percent | Transcript show:'moved to: '; showCR:percent asFloat]. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
212 |
top open |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
213 |
[exEnd] |
117 | 214 |
|
448
e23465aad9e8
use new defaultExtent protocol
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
215 |
setting its range: |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
216 |
[exBegin] |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
217 |
|top s| |
448
e23465aad9e8
use new defaultExtent protocol
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
218 |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
219 |
top := StandardSystemView new extent:200@200. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
220 |
s := Scroller in:top. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
221 |
s origin:(0.0@0.0) corner:(20@1.0). |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
222 |
s thumbHeight:10. 'percent'. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
223 |
s scrollAction:[:percent | Transcript show:'moved to: '; showCR:percent asFloat]. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
224 |
s start:0 stop:1. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
225 |
top open |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
226 |
[exEnd] |
117 | 227 |
|
130 | 228 |
create a scroller in its default extent and have it positioned |
448
e23465aad9e8
use new defaultExtent protocol
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
229 |
at the side; beside another view: |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
230 |
[exBegin] |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
231 |
|top s v| |
130 | 232 |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
233 |
top := StandardSystemView new extent:200@200. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
234 |
s := Scroller in:top. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
235 |
s origin:(0.0@0.0) corner:(0.0@1.0). |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
236 |
s rightInset:(s preferredExtent x negated). |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
237 |
s thumbHeight:10. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
238 |
s level:1. |
130 | 239 |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
240 |
v := View in:top. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
241 |
v origin:0.0@0.0 corner:1.0@1.0. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
242 |
v leftInset:(s preferredExtent x). |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
243 |
v viewBackground:Color red. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
244 |
v level:2. |
130 | 245 |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
246 |
top open |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
247 |
[exEnd] |
130 | 248 |
|
117 | 249 |
using a model (ST-80 style): |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
250 |
[exBegin] |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
251 |
|top s m| |
448
e23465aad9e8
use new defaultExtent protocol
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
252 |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
253 |
m := 0 asValue. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
254 |
InspectorView openOn:m monitor:'value'. 'look at value'. |
117 | 255 |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
256 |
top := StandardSystemView new extent:200@200. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
257 |
s := Scroller in:top. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
258 |
s origin:(0.0@0.0) corner:(20@1.0). |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
259 |
s thumbHeight:10. 'percent'. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
260 |
s model:m. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
261 |
top open |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
262 |
[exEnd] |
119 | 263 |
|
117 | 264 |
using a different changeSelector: |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
265 |
[exBegin] |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
266 |
|top s1 s2 m| |
117 | 267 |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
268 |
m := Plug new. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
269 |
m respondTo:#value1: with:[:v | Transcript show:'scroller 1 moved to: '; showCR:v]. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
270 |
m respondTo:#value2: with:[:v | Transcript show:'scroller 2 moved to: '; showCR:v]. |
117 | 271 |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
272 |
top := StandardSystemView new extent:200@200. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
273 |
s1 := Scroller in:top. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
274 |
s1 origin:(0.0@0.0) corner:(20@1.0). |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
275 |
s1 thumbHeight:10. 'percent'. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
276 |
s1 model:m; change:#value1:. |
117 | 277 |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
278 |
s2 := Scroller in:top. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
279 |
s2 origin:(30@0.0) corner:(50@1.0). |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
280 |
s2 thumbHeight:10. 'percent'. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
281 |
s2 model:m; change:#value2:. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
282 |
top open |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
283 |
[exEnd] |
117 | 284 |
" |
3 | 285 |
! ! |
0 | 286 |
|
897 | 287 |
!Scroller class methodsFor:'defaults'! |
0 | 288 |
|
205 | 289 |
handleLightFormOn:aDisplay |
290 |
"answer the form used for the handles light area; |
|
291 |
cache the one for Display for the next round" |
|
292 |
||
293 |
|f| |
|
294 |
||
295 |
((aDisplay == Display) and:[HandleLightForm notNil]) ifTrue:[ |
|
2061
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
296 |
^ HandleLightForm |
205 | 297 |
]. |
2075 | 298 |
f := Smalltalk imageFromFileNamed:'HandleLight.xbm' forClass:self. |
2061
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
299 |
f notNil ifTrue:[ |
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
300 |
f := f onDevice:aDisplay |
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
301 |
] ifFalse:[ |
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
302 |
f := Form width:8 height:8 fromArray:#[2r00000000 |
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
303 |
2r00000010 |
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
304 |
2r00000011 |
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
305 |
2r00000011 |
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
306 |
2r00000011 |
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
307 |
2r00000011 |
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
308 |
2r00000110 |
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
309 |
2r00111100] |
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
310 |
on:aDisplay |
205 | 311 |
]. |
312 |
(aDisplay == Display) ifTrue:[ |
|
2061
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
313 |
HandleLightForm := f |
205 | 314 |
]. |
315 |
^ f |
|
897 | 316 |
|
317 |
"Modified: 23.10.2031 / 01:00:00 / cg" |
|
205 | 318 |
! |
319 |
||
320 |
handleShadowFormOn:aDisplay |
|
321 |
"answer the form used for the handles shadow area; |
|
322 |
cache the one for Display for the next round" |
|
323 |
||
324 |
|f| |
|
325 |
||
326 |
((aDisplay == Display) and:[HandleShadowForm notNil]) ifTrue:[ |
|
2061
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
327 |
^ HandleShadowForm |
205 | 328 |
]. |
2075 | 329 |
f := Smalltalk imageFromFileNamed:'HandleShadow.xbm' forClass:self. |
2061
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
330 |
f notNil ifTrue:[ |
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
331 |
f := f onDevice:aDisplay |
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
332 |
] ifFalse:[ |
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
333 |
f := Form width:8 height:8 fromArray:#[2r00111100 |
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
334 |
2r01100000 |
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
335 |
2r11000000 |
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
336 |
2r11000000 |
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
337 |
2r11000000 |
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
338 |
2r11000000 |
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
339 |
2r01000000 |
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
340 |
2r00000000] |
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
341 |
on:aDisplay |
205 | 342 |
]. |
343 |
(aDisplay == Display) ifTrue:[ |
|
2061
fd67d71cc107
try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
2032
diff
changeset
|
344 |
HandleShadowForm := f |
205 | 345 |
]. |
346 |
^ f |
|
897 | 347 |
|
348 |
"Modified: 19.12.1996 / 01:00:00 / cg" |
|
205 | 349 |
! |
350 |
||
59 | 351 |
updateStyleCache |
441
e170bca66a78
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
352 |
"extract values from the styleSheet and cache them in class variables" |
e170bca66a78
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
353 |
|
1347
dc1bf0e46865
new viewStyle resource naming
Claus Gittinger <cg@exept.de>
parents:
1315
diff
changeset
|
354 |
<resource: #style (#'scroller.viewBackground' #'scroller.fullViewBackground' |
2594
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
355 |
#'scroller.thumbColor' |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
356 |
#'scroller.shadowColor' #'scroller.lightColor' |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
357 |
#'scroller.thumbShadowColor' #'scroller.thumbLightColor' |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
358 |
#'scroller.thumbHalfShadowColor' #'scroller.thumbHalfLightColor' |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
359 |
#'scroller.thumbFrameColor' #'scroller.ghostColor' |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
360 |
#'scroller.ghostLevel' #'scroller.ghostFrameColor' |
2609 | 361 |
#'scroller.NTallyMarks' #'scroller.tallyLevel' #'scroller.tallyInset' |
2594
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
362 |
#'scroller.level' #'scroller.borderWidth' |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
363 |
#'scroller.thumbLevel' #'scroller.thumbInset' |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
364 |
#'scroller.thumbFixHeight' #'scroller.thumbEdgeStyle' |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
365 |
#'scroller.thumbEnteredColor' #'scroller.thumbActiveLevel' |
2609 | 366 |
#'scroller.thumbActiveColor' |
2594
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
367 |
#'scroller.middleButtonJump' |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
368 |
#'scroller.newCursors' |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
369 |
#'scroller.thumbImage' #'scroller.handleImage' |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
370 |
#'scroller.vScrollerWidth' #'scroller.hScrollerHeight' |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
371 |
#'scroller.stopPagerAtThumb' |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
372 |
)> |
441
e170bca66a78
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
373 |
|
1870 | 374 |
DefaultViewBackground := StyleSheet colorAt:#'scroller.viewBackground'. |
375 |
DefaultFullViewBackground := StyleSheet colorAt:#'scroller.fullViewBackground'. |
|
376 |
DefaultThumbColor := StyleSheet colorAt:#'scroller.thumbColor'. |
|
377 |
DefaultThumbEnteredColor := StyleSheet colorAt:#'scroller.thumbEnteredColor'. |
|
2609 | 378 |
DefaultThumbActiveColor := StyleSheet colorAt:#'scroller.thumbActiveColor'. |
1870 | 379 |
DefaultShadowColor := StyleSheet colorAt:#'scroller.shadowColor'. |
380 |
DefaultLightColor := StyleSheet colorAt:#'scroller.lightColor'. |
|
381 |
DefaultThumbShadowColor := StyleSheet colorAt:#'scroller.thumbShadowColor'. |
|
382 |
DefaultThumbLightColor := StyleSheet colorAt:#'scroller.thumbLightColor'. |
|
383 |
DefaultThumbHalfShadowColor := StyleSheet colorAt:#'scroller.thumbHalfShadowColor'. |
|
384 |
DefaultThumbHalfLightColor := StyleSheet colorAt:#'scroller.thumbHalfLightColor'. |
|
385 |
DefaultThumbFrameColor := StyleSheet colorAt:#'scroller.thumbFrameColor'. |
|
386 |
DefaultGhostColor := StyleSheet colorAt:#'scroller.ghostColor' default:nil. |
|
387 |
DefaultGhostFrameColor := StyleSheet colorAt:#'scroller.ghostFrameColor' default:nil. |
|
388 |
DefaultGhostLevel := StyleSheet at:#'scroller.ghostLevel' default:0. |
|
389 |
DefaultTallyMarks := StyleSheet at:#'scroller.NTallyMarks' default:0. |
|
2609 | 390 |
|
391 |
DefaultTallyLevel := DefaultTallyInset := 0. |
|
59 | 392 |
DefaultTallyMarks ~~ 0 ifTrue:[ |
2594
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
393 |
DefaultTallyLevel := StyleSheet at:#'scroller.tallyLevel' default:1. |
2609 | 394 |
DefaultTallyInset := StyleSheet at:#'scroller.tallyInset' default:0. |
2612 | 395 |
DefaultTallyDistance := StyleSheet at:#'scroller.tallyDistance'. |
59 | 396 |
]. |
1870 | 397 |
DefaultLevel := StyleSheet at:#'scroller.level' default:0. |
398 |
DefaultBorderWidth := StyleSheet at:#'scroller.borderWidth' default:(StyleSheet at:#'borderWidth'). |
|
399 |
DefaultThumbLevel := StyleSheet at:#'scroller.thumbLevel' default:0. |
|
400 |
DefaultThumbActiveLevel := StyleSheet at:#'scroller.thumbActiveLevel' default:DefaultThumbLevel. |
|
401 |
DefaultInset := StyleSheet at:#'scroller.thumbInset' default:0. |
|
402 |
DefaultFixThumbHeight := StyleSheet at:#'scroller.thumbFixHeight' default:false. |
|
403 |
DefaultEdgeStyle := StyleSheet at:#'scroller.thumbEdgeStyle'. |
|
404 |
DefaultMiddleButtonJump := StyleSheet at:#'scroller.middleButtonJump' default:false. |
|
405 |
NewCursors := StyleSheet at:#'scroller.newCursors' default:true. |
|
406 |
DefaultThumbImage := StyleSheet at:#'scroller.thumbImage'. |
|
407 |
HandleImage := StyleSheet at:#'scroller.handleImage'. |
|
130 | 408 |
|
1886 | 409 |
DefaultVScrollerWidth := StyleSheet at:#'scroller.vScrollerWidth' default:nil. |
410 |
DefaultHScrollerHeight := StyleSheet at:#'scroller.hScrollerHeight' default:nil. |
|
411 |
||
130 | 412 |
StyleSheet fileReadFailed ifTrue:[ |
2594
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
413 |
DefaultViewBackground := Grey. |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
414 |
DefaultThumbColor := White. |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
415 |
DefaultThumbFrameColor := Black. |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
416 |
DefaultInset := 1. |
1203 | 417 |
]. |
418 |
||
2594
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
419 |
DefaultStopPagerAtThumb := StyleSheet at:#'scroller.stopPagerAtThumb' default:true. |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
420 |
|
2609 | 421 |
SnapBackDistance := StyleSheet at:#'scroller.snapBackDistance' default:30. |
422 |
MinThumbSize := StyleSheet at:#'scroller.minThumbSize' default:8. |
|
441
e170bca66a78
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
423 |
|
1121 | 424 |
" |
425 |
self updateStyleCache |
|
426 |
" |
|
427 |
||
1887
3e9d0074808d
allow for forced scrollBar width/height (instead of computing)
Claus Gittinger <cg@exept.de>
parents:
1886
diff
changeset
|
428 |
"Modified: / 28.4.1999 / 19:23:24 / cg" |
205 | 429 |
! ! |
59 | 430 |
|
205 | 431 |
!Scroller methodsFor:'accessing'! |
0 | 432 |
|
1737
1b57cb702892
preps for separate keyboardStep value.
Claus Gittinger <cg@exept.de>
parents:
1731
diff
changeset
|
433 |
keyboardStep |
1b57cb702892
preps for separate keyboardStep value.
Claus Gittinger <cg@exept.de>
parents:
1731
diff
changeset
|
434 |
"return the scrollers keyboard step. If non-nil, |
1b57cb702892
preps for separate keyboardStep value.
Claus Gittinger <cg@exept.de>
parents:
1731
diff
changeset
|
435 |
thats the stepping value used with cursorUp/cursorDown keys. |
1b57cb702892
preps for separate keyboardStep value.
Claus Gittinger <cg@exept.de>
parents:
1731
diff
changeset
|
436 |
(not used with Scrollers, but provided for subclasses)" |
1b57cb702892
preps for separate keyboardStep value.
Claus Gittinger <cg@exept.de>
parents:
1731
diff
changeset
|
437 |
|
1b57cb702892
preps for separate keyboardStep value.
Claus Gittinger <cg@exept.de>
parents:
1731
diff
changeset
|
438 |
^ keyboardStep |
1b57cb702892
preps for separate keyboardStep value.
Claus Gittinger <cg@exept.de>
parents:
1731
diff
changeset
|
439 |
! |
1b57cb702892
preps for separate keyboardStep value.
Claus Gittinger <cg@exept.de>
parents:
1731
diff
changeset
|
440 |
|
1b57cb702892
preps for separate keyboardStep value.
Claus Gittinger <cg@exept.de>
parents:
1731
diff
changeset
|
441 |
keyboardStep:aNumber |
1b57cb702892
preps for separate keyboardStep value.
Claus Gittinger <cg@exept.de>
parents:
1731
diff
changeset
|
442 |
"set the scrollers keyboard step. If non-nil, |
1b57cb702892
preps for separate keyboardStep value.
Claus Gittinger <cg@exept.de>
parents:
1731
diff
changeset
|
443 |
thats the stepping value used with cursorUp/cursorDown keys. |
1b57cb702892
preps for separate keyboardStep value.
Claus Gittinger <cg@exept.de>
parents:
1731
diff
changeset
|
444 |
(not used with Scrollers, but provided for subclasses)" |
1b57cb702892
preps for separate keyboardStep value.
Claus Gittinger <cg@exept.de>
parents:
1731
diff
changeset
|
445 |
|
1b57cb702892
preps for separate keyboardStep value.
Claus Gittinger <cg@exept.de>
parents:
1731
diff
changeset
|
446 |
keyboardStep := aNumber |
1b57cb702892
preps for separate keyboardStep value.
Claus Gittinger <cg@exept.de>
parents:
1731
diff
changeset
|
447 |
! |
1b57cb702892
preps for separate keyboardStep value.
Claus Gittinger <cg@exept.de>
parents:
1731
diff
changeset
|
448 |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
449 |
start |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
450 |
"return the scrollers range min. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
451 |
(not used with Scrollers, but provided for subclasses)" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
452 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
453 |
^ rangeStart |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
454 |
! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
455 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
456 |
start:start |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
457 |
"set the scrollers range min. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
458 |
(not used with Scrollers, but provided for subclasses)" |
205 | 459 |
|
679
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
460 |
self start:start stop:rangeEnd. |
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
461 |
|
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
462 |
"Modified: 25.5.1996 / 11:28:22 / cg" |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
463 |
! |
448
e23465aad9e8
use new defaultExtent protocol
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
464 |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
465 |
start:start stop:stop |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
466 |
"set the range. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
467 |
(not used with Scrollers, but provided for subclasses)" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
468 |
|
679
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
469 |
|org| |
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
470 |
|
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
471 |
org := self thumbOrigin. |
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
472 |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
473 |
rangeStart := start. |
679
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
474 |
rangeEnd := stop. |
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
475 |
|
1424
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
476 |
rangeStart = rangeEnd ifTrue:[ |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
477 |
self halt:'invalud slider range (start = stop)'. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
478 |
rangeStep isNil ifTrue:[ |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
479 |
rangeEnd := rangeStart + 1 |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
480 |
] ifFalse:[ |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
481 |
rangeEnd := rangeStart + rangeStep. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
482 |
] |
1424
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
483 |
]. |
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
484 |
|
679
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
485 |
org < rangeStart ifTrue:[ |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
486 |
org := rangeStart |
679
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
487 |
] ifFalse:[ |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
488 |
org > rangeEnd ifTrue:[ |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
489 |
org := rangeEnd |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
490 |
] |
679
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
491 |
]. |
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
492 |
self thumbOrigin:org. |
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
493 |
|
1424
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
494 |
"Modified: / 21.1.1998 / 19:22:07 / cg" |
679
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
495 |
! |
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
496 |
|
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
497 |
start:start stop:stop step:step |
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
498 |
"set the range. |
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
499 |
(not used with Scrollers, but provided for subclasses)" |
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
500 |
|
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
501 |
self start:start stop:stop. |
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
502 |
rangeStep := step. |
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
503 |
|
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
504 |
"Created: 25.5.1996 / 11:24:09 / cg" |
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
505 |
"Modified: 25.5.1996 / 11:27:43 / cg" |
205 | 506 |
! |
507 |
||
508 |
step |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
509 |
"return the scrollers range step. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
510 |
(not used with Scrollers, but provided for subclasses)" |
446 | 511 |
|
205 | 512 |
^ rangeStep |
105 | 513 |
! |
514 |
||
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
515 |
step:step |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
516 |
"set the scrollers range step. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
517 |
(not used with Scrollers, but provided for subclasses)" |
205 | 518 |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
519 |
rangeStep := step |
205 | 520 |
! |
105 | 521 |
|
205 | 522 |
stop |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
523 |
"return the scrollers range max. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
524 |
(not used with Scrollers, but provided for subclasses)" |
446 | 525 |
|
205 | 526 |
^ rangeEnd |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
527 |
! |
446 | 528 |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
529 |
stop:stop |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
530 |
"set the scrollers range max. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
531 |
(not used with Scrollers, but provided for subclasses)" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
532 |
|
679
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
533 |
self start:rangeStart stop:stop. |
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
534 |
|
c702b3d82f01
recompute frame, when range changes
Claus Gittinger <cg@exept.de>
parents:
655
diff
changeset
|
535 |
"Modified: 25.5.1996 / 11:28:35 / cg" |
205 | 536 |
! |
0 | 537 |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
538 |
thumbFrame |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
539 |
"return the area used by the thumbFrame (in device coordinates). |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
540 |
Allows access to the thumbs physical screen position, for |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
541 |
example to position a label below (see Slider-Examples)" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
542 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
543 |
thumbFrame isNil ifTrue:[ self computeThumbFrame]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
544 |
^ thumbFrame |
119 | 545 |
! |
546 |
||
205 | 547 |
thumbHeight |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
548 |
"answer the thumbs height (in percent by default)" |
119 | 549 |
|
1424
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
550 |
^ thumbHeight * (rangeEnd - rangeStart) abs / 100 |
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
551 |
|
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
552 |
"Modified: / 21.1.1998 / 19:25:33 / cg" |
119 | 553 |
! |
554 |
||
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
555 |
thumbHeight:aNumber |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
556 |
"set the thumbs height (in percent by default)" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
557 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
558 |
|newHeight realNewHeight oldFrame nBg| |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
559 |
|
1424
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
560 |
newHeight := aNumber / ((rangeEnd - rangeStart) abs / 100). |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
561 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
562 |
(newHeight > 100) ifTrue:[ |
2175
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
563 |
realNewHeight := 100 |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
564 |
] ifFalse:[ |
2175
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
565 |
realNewHeight := newHeight |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
566 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
567 |
((realNewHeight ~= thumbHeight) or:[thumbFrame isNil]) ifTrue:[ |
2175
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
568 |
thumbHeight := realNewHeight. |
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
569 |
|
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
570 |
(DefaultFullViewBackground notNil |
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
571 |
and:[DefaultViewBackground notNil |
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
572 |
and:[DefaultFullViewBackground ~~ DefaultViewBackground]]) ifTrue:[ |
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
573 |
realNewHeight >= 100 ifTrue:[ |
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
574 |
nBg := DefaultFullViewBackground. |
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
575 |
] ifFalse:[ |
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
576 |
nBg := DefaultViewBackground |
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
577 |
]. |
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
578 |
nBg := nBg onDevice:device. |
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
579 |
nBg ~~ viewBackground ifTrue:[ |
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
580 |
self viewBackground:nBg. |
2913
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
581 |
self invalidate. |
2175
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
582 |
] |
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
583 |
]. |
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
584 |
|
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
585 |
shown ifTrue:[ |
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
586 |
oldFrame := thumbFrame. |
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
587 |
self computeThumbFrame. |
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
588 |
oldFrame ~= thumbFrame ifTrue:[ |
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
589 |
self invalidate. |
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
590 |
] |
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
591 |
] ifFalse:[ |
2913
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
592 |
thumbFrame := nil. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
593 |
self invalidate. |
2175
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
594 |
] |
119 | 595 |
] |
1127 | 596 |
|
1709 | 597 |
"Modified: / 21.10.1998 / 22:35:31 / cg" |
119 | 598 |
! |
599 |
||
205 | 600 |
thumbOrigin |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
601 |
"answer the thumbs origin (in percent by default)" |
205 | 602 |
|
1424
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
603 |
|org| |
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
604 |
|
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
605 |
org := thumbOrigin * (rangeEnd - rangeStart) / 100 + rangeStart. |
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
606 |
rangeStep notNil ifTrue:[ |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
607 |
org := org roundTo:rangeStep. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
608 |
rangeStep isInteger ifTrue:[ |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
609 |
org := org asInteger |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
610 |
] |
1424
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
611 |
]. |
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
612 |
^ org |
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
613 |
|
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
614 |
"Modified: / 21.1.1998 / 19:13:48 / cg" |
448
e23465aad9e8
use new defaultExtent protocol
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
615 |
! |
e23465aad9e8
use new defaultExtent protocol
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
616 |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
617 |
thumbOrigin:aNumber |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
618 |
"set the thumbs origin (in percent by default)" |
448
e23465aad9e8
use new defaultExtent protocol
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
619 |
|
1424
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
620 |
|org newOrigin realNewOrigin |
119 | 621 |
oldFrame oldTop oldBot oldLeft oldRight |
622 |
thumbTop thumbBot thumbLeft thumbRight |
|
105 | 623 |
tH "{ Class: SmallInteger }" |
1897 | 624 |
tW "{ Class: SmallInteger }" |
132 | 625 |
delta needFullDraw |
119 | 626 |
bgLeft bgTop bgWidth bgHeight| |
105 | 627 |
|
1250
5e4f96c330de
handle a nil thumbOrigin argument (uninitialized model)
Claus Gittinger <cg@exept.de>
parents:
1203
diff
changeset
|
628 |
aNumber isNil ifTrue:[ |
2913
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
629 |
newOrigin := 0 |
1250
5e4f96c330de
handle a nil thumbOrigin argument (uninitialized model)
Claus Gittinger <cg@exept.de>
parents:
1203
diff
changeset
|
630 |
] ifFalse:[ |
2913
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
631 |
org := aNumber. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
632 |
rangeStep notNil ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
633 |
org := org roundTo:rangeStep. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
634 |
rangeStep isInteger ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
635 |
org := org asInteger |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
636 |
] |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
637 |
]. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
638 |
newOrigin := (org - rangeStart) asFloat / (rangeEnd - rangeStart / 100). |
1250
5e4f96c330de
handle a nil thumbOrigin argument (uninitialized model)
Claus Gittinger <cg@exept.de>
parents:
1203
diff
changeset
|
639 |
]. |
117 | 640 |
|
105 | 641 |
((newOrigin + thumbHeight) > 100) ifTrue:[ |
2913
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
642 |
realNewOrigin := 100 - thumbHeight |
105 | 643 |
] ifFalse: [ |
2913
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
644 |
realNewOrigin := newOrigin |
105 | 645 |
]. |
646 |
(realNewOrigin > 100) ifTrue:[ |
|
2913
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
647 |
realNewOrigin := 100 |
105 | 648 |
] ifFalse: [ |
2913
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
649 |
(realNewOrigin < 0) ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
650 |
realNewOrigin := 0 |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
651 |
] |
105 | 652 |
]. |
653 |
((realNewOrigin ~= thumbOrigin) or:[thumbFrame isNil]) ifTrue:[ |
|
2913
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
654 |
thumbOrigin := realNewOrigin. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
655 |
|
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
656 |
shown ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
657 |
oldFrame := thumbFrame. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
658 |
self computeThumbFrame. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
659 |
(thumbHeight = 100) ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
660 |
"/ full: don't draw |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
661 |
^ self |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
662 |
]. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
663 |
|
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
664 |
(thumbFrame ~= oldFrame) ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
665 |
oldFrame isNil ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
666 |
self invalidate. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
667 |
^ self |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
668 |
]. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
669 |
tH := thumbFrame height. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
670 |
tW := thumbFrame width. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
671 |
|
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
672 |
oldTop := oldFrame top. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
673 |
oldBot := oldTop + tH. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
674 |
oldLeft := oldFrame left. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
675 |
oldRight := oldLeft + tW. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
676 |
|
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
677 |
thumbTop := thumbFrame top. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
678 |
thumbBot := thumbTop + tH. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
679 |
thumbLeft := thumbFrame left. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
680 |
thumbRight := thumbLeft + tW. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
681 |
|
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
682 |
needFullDraw := self exposeEventPending |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
683 |
or:[((orientation == #vertical) and:[oldBot >= height]) |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
684 |
or:[((orientation ~~ #vertical) and:[oldRight >= width])]]. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
685 |
|
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
686 |
needFullDraw ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
687 |
" |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
688 |
cannot copy since thumb was below the end |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
689 |
or may be not available for the copy |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
690 |
" |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
691 |
self invalidate. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
692 |
^ self |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
693 |
]. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
694 |
|
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
695 |
self catchExpose. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
696 |
" |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
697 |
copy the thumbs pixels |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
698 |
" |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
699 |
(orientation == #vertical) ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
700 |
self |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
701 |
copyFrom:self |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
702 |
x:thumbLeft y:oldTop |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
703 |
toX:thumbLeft y:thumbTop |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
704 |
width:tW height:tH |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
705 |
async:true. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
706 |
] ifFalse:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
707 |
self |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
708 |
copyFrom:self |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
709 |
x:oldLeft y:thumbTop |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
710 |
toX:thumbLeft y:thumbTop |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
711 |
width:tW height:tH |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
712 |
async:true. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
713 |
]. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
714 |
|
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
715 |
" |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
716 |
clear some of the previous thumbs area to background |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
717 |
" |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
718 |
(orientation == #vertical) ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
719 |
bgLeft := thumbLeft. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
720 |
bgWidth := tW. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
721 |
oldTop > thumbTop ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
722 |
delta := oldTop - thumbTop. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
723 |
oldTop > thumbBot ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
724 |
bgTop := oldTop. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
725 |
bgHeight := tH + 1 |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
726 |
] ifFalse:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
727 |
bgTop := thumbBot. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
728 |
bgHeight := delta |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
729 |
] |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
730 |
] ifFalse:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
731 |
delta := thumbTop - oldTop. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
732 |
oldBot < thumbTop ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
733 |
bgTop := oldTop. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
734 |
bgHeight := tH + 1 |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
735 |
] ifFalse:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
736 |
bgTop := oldTop. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
737 |
bgHeight := delta |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
738 |
] |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
739 |
]. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
740 |
] ifFalse:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
741 |
bgTop := thumbTop. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
742 |
bgHeight := tH. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
743 |
oldLeft > thumbLeft ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
744 |
delta := oldLeft - thumbLeft. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
745 |
oldLeft > thumbRight ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
746 |
bgLeft := oldLeft. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
747 |
bgWidth := tW + 1. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
748 |
] ifFalse:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
749 |
bgLeft := thumbRight. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
750 |
bgWidth := delta. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
751 |
] |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
752 |
] ifFalse:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
753 |
delta := thumbLeft - oldLeft. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
754 |
oldRight < thumbLeft ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
755 |
bgLeft := oldLeft. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
756 |
bgWidth := tW + 1. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
757 |
] ifFalse:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
758 |
bgLeft := oldLeft. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
759 |
bgWidth := delta. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
760 |
] |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
761 |
]. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
762 |
]. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
763 |
self drawThumbBackgroundInX:bgLeft y:bgTop width:bgWidth height:bgHeight. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
764 |
self waitForExpose |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
765 |
] |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
766 |
] ifFalse:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
767 |
thumbFrame := nil |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
768 |
] |
105 | 769 |
] |
983 | 770 |
|
1897 | 771 |
"Modified: / 4.5.1999 / 18:57:28 / cg" |
105 | 772 |
! |
773 |
||
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
774 |
thumbOrigin:originNumber thumbHeight:heightNumber |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
775 |
"set both thumbs height and origin (in percent by default)" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
776 |
|
1424
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
777 |
|newHeight newOrigin realNewOrigin realNewHeight old new changed |
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
778 |
nBg range| |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
779 |
|
1424
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
780 |
range := rangeEnd - rangeStart. |
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
781 |
|
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
782 |
newOrigin := originNumber - rangeStart / (range / 100). |
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
783 |
newHeight := heightNumber / (range abs / 100). |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
784 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
785 |
(newHeight > 100) ifTrue:[ |
2178
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
786 |
realNewHeight := 100 |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
787 |
] ifFalse:[ |
2178
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
788 |
realNewHeight := newHeight |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
789 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
790 |
((newOrigin + realNewHeight) > 100) ifTrue:[ |
2178
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
791 |
realNewOrigin := 100 - realNewHeight |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
792 |
] ifFalse: [ |
2178
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
793 |
realNewOrigin := newOrigin |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
794 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
795 |
(realNewOrigin < 0) ifTrue: [ |
2178
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
796 |
realNewOrigin := 0 |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
797 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
798 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
799 |
changed := (realNewHeight ~= thumbHeight) or:[realNewOrigin ~= thumbOrigin]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
800 |
(changed or:[thumbFrame isNil]) ifTrue:[ |
2178
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
801 |
old := self absFromPercent:thumbOrigin. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
802 |
new := self absFromPercent:realNewOrigin. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
803 |
changed := old ~~ new. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
804 |
changed ifFalse:[ |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
805 |
old := self absFromPercent:thumbHeight. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
806 |
new := self absFromPercent:realNewHeight. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
807 |
changed := (old ~~ new) |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
808 |
]. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
809 |
(changed or:[thumbFrame isNil]) ifTrue:[ |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
810 |
thumbOrigin := realNewOrigin. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
811 |
thumbHeight := realNewHeight. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
812 |
|
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
813 |
(DefaultFullViewBackground notNil |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
814 |
and:[DefaultViewBackground notNil |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
815 |
and:[DefaultFullViewBackground ~~ DefaultViewBackground]]) ifTrue:[ |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
816 |
realNewHeight >= 100 ifTrue:[ |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
817 |
nBg := DefaultFullViewBackground. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
818 |
] ifFalse:[ |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
819 |
nBg := DefaultViewBackground |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
820 |
]. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
821 |
nBg := nBg onDevice:device. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
822 |
nBg ~~ viewBackground ifTrue:[ |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
823 |
self viewBackground:nBg. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
824 |
] |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
825 |
]. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
826 |
|
2913
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
827 |
thumbFrame := nil. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
828 |
self invalidate. |
2178
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
829 |
] |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
830 |
] |
1189
909fd985eb2c
use asynchronous invalidate, instead of syncronous redraws.
Claus Gittinger <cg@exept.de>
parents:
1167
diff
changeset
|
831 |
|
1424
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
832 |
"Modified: / 21.1.1998 / 19:32:41 / cg" |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
833 |
! ! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
834 |
|
454 | 835 |
!Scroller methodsFor:'accessing-behavior'! |
836 |
||
837 |
action:aBlock |
|
838 |
"for protocol compatibility; same as scrollAction:" |
|
839 |
||
840 |
self scrollAction:aBlock |
|
841 |
! |
|
842 |
||
843 |
asynchronousOperation |
|
3017 | 844 |
self obsoleteMethodWarning:'use #beAsynchronous'. |
845 |
self beAsynchronous |
|
846 |
! |
|
847 |
||
848 |
beAsynchronous |
|
849 |
"set scroll-mode to be asynchronous - scroll action is only performed after |
|
850 |
scrolling, when mouse-button is finally released (no tracking)." |
|
454 | 851 |
|
852 |
synchronousOperation := false |
|
853 |
! |
|
854 |
||
3017 | 855 |
beSynchronous |
856 |
"set scroll-mode to be synchronous - scroll action is performed for |
|
857 |
every movement of thumb (tracking)." |
|
858 |
||
859 |
synchronousOperation := true |
|
860 |
! |
|
861 |
||
1830 | 862 |
enabled |
863 |
"return enable/disable state of the scoller" |
|
1652 | 864 |
|
1830 | 865 |
^ enabled |
866 |
||
867 |
"Created: / 30.3.1999 / 15:24:50 / stefan" |
|
1652 | 868 |
! |
869 |
||
1830 | 870 |
enabled:aBoolean |
871 |
"enable/disable the scoller" |
|
1652 | 872 |
|
1830 | 873 |
enabled ~~ aBoolean ifTrue:[ |
2010 | 874 |
enabled := aBoolean. |
875 |
self updateBackground. |
|
876 |
aBoolean ifFalse:[ |
|
877 |
self cursor: Cursor normal |
|
878 |
] |
|
1652 | 879 |
] |
880 |
||
1830 | 881 |
"Created: / 30.3.1999 / 15:23:14 / stefan" |
1652 | 882 |
! |
883 |
||
3017 | 884 |
isSynchronous |
885 |
"return true if the scroll-mode is synchronous. |
|
886 |
If true, the scroll action is performed for every movement of the thumb (tracking). |
|
887 |
If false, the scroll action is only performed at the end." |
|
888 |
||
889 |
^ synchronousOperation |
|
890 |
! |
|
891 |
||
454 | 892 |
scrollAction |
893 |
"answer the scroll action block" |
|
894 |
||
895 |
^ scrollAction |
|
896 |
! |
|
897 |
||
898 |
scrollAction:aBlock |
|
899 |
"set the scroll action, aBlock which is evaluated when scrolled" |
|
900 |
||
901 |
scrollAction := aBlock |
|
902 |
! |
|
903 |
||
904 |
scrollDownAction:aBlock |
|
905 |
"ignored - |
|
906 |
but implemented, so that scroller can be used in place of a scrollbar" |
|
907 |
! |
|
908 |
||
909 |
scrollUpAction:aBlock |
|
910 |
"ignored - |
|
911 |
but implemented, so that scroller can be used in place of a scrollbar" |
|
912 |
! |
|
913 |
||
914 |
synchronousOperation |
|
3017 | 915 |
self obsoleteMethodWarning:'use #beSynchronous'. |
916 |
self beSynchronous |
|
454 | 917 |
! ! |
918 |
||
1652 | 919 |
!Scroller methodsFor:'accessing-bg & border'! |
920 |
||
921 |
allViewBackground:something |
|
1957 | 922 |
"ignore here for all scrollers (I want my own background)" |
923 |
||
2456 | 924 |
"/ ^ super allViewBackground:something |
1652 | 925 |
! ! |
926 |
||
454 | 927 |
!Scroller methodsFor:'accessing-look'! |
928 |
||
929 |
is3D |
|
958 | 930 |
"return true, if I use a 3D style" |
931 |
||
764 | 932 |
<resource: #style (#name)> |
933 |
||
454 | 934 |
styleSheet name = #mswindows ifTrue:[^ true]. |
935 |
^ super is3D |
|
764 | 936 |
|
958 | 937 |
"Modified: 17.1.1997 / 23:21:42 / cg" |
454 | 938 |
! |
939 |
||
940 |
orientation |
|
941 |
"return the scrollers orientation (#vertical or #horizontal)" |
|
942 |
||
943 |
^ orientation |
|
944 |
! |
|
945 |
||
1167
90104d2f94d6
allow the orientation to be changed dynamically
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
946 |
orientation:aSymbol |
90104d2f94d6
allow the orientation to be changed dynamically
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
947 |
"set the scrollers orientation (#vertical or #horizontal)" |
90104d2f94d6
allow the orientation to be changed dynamically
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
948 |
|
90104d2f94d6
allow the orientation to be changed dynamically
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
949 |
|oldFrame| |
90104d2f94d6
allow the orientation to be changed dynamically
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
950 |
|
90104d2f94d6
allow the orientation to be changed dynamically
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
951 |
orientation := aSymbol. |
90104d2f94d6
allow the orientation to be changed dynamically
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
952 |
preferredExtent := nil. |
90104d2f94d6
allow the orientation to be changed dynamically
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
953 |
|
90104d2f94d6
allow the orientation to be changed dynamically
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
954 |
shown ifTrue:[ |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
955 |
oldFrame := thumbFrame. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
956 |
self computeThumbFrame. |
1167
90104d2f94d6
allow the orientation to be changed dynamically
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
957 |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
958 |
oldFrame ~= thumbFrame ifTrue:[ |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
959 |
self invalidate. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
960 |
] |
1167
90104d2f94d6
allow the orientation to be changed dynamically
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
961 |
] |
90104d2f94d6
allow the orientation to be changed dynamically
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
962 |
|
90104d2f94d6
allow the orientation to be changed dynamically
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
963 |
"Created: 1.4.1997 / 12:18:32 / cg" |
90104d2f94d6
allow the orientation to be changed dynamically
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
964 |
"Modified: 1.4.1997 / 12:20:46 / cg" |
90104d2f94d6
allow the orientation to be changed dynamically
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
965 |
! |
90104d2f94d6
allow the orientation to be changed dynamically
Claus Gittinger <cg@exept.de>
parents:
1166
diff
changeset
|
966 |
|
689 | 967 |
thumb |
968 |
"for compatibility with scrollBars, return the receiver" |
|
969 |
||
970 |
^ self |
|
971 |
||
972 |
"Created: 26.5.1996 / 12:21:12 / cg" |
|
973 |
! |
|
974 |
||
454 | 975 |
thumbColor |
976 |
"return the thumbs color" |
|
977 |
||
978 |
^ thumbColor |
|
979 |
! |
|
980 |
||
981 |
thumbColor:aColor |
|
982 |
"change the color of the thumb" |
|
983 |
||
764 | 984 |
<resource: #style (#name)> |
985 |
||
1875
745aed60b0b2
when lighting/darkening colors, take the average in the topLeft
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
986 |
|avgColor| |
745aed60b0b2
when lighting/darkening colors, take the average in the topLeft
Claus Gittinger <cg@exept.de>
parents:
1870
diff
changeset
|
987 |
|
1988 | 988 |
thumbColor := aColor onDevice:device. |
454 | 989 |
(styleSheet name ~~ #normal) ifTrue:[ |
2010 | 990 |
avgColor := aColor averageColorIn:(0@0 corner:7@7). |
991 |
thumbShadowColor := avgColor darkened onDevice:device. |
|
992 |
thumbLightColor := avgColor lightened onDevice:device. |
|
993 |
thumbHalfShadowColor := thumbShadowColor darkened onDevice:device. |
|
994 |
thumbHalfLightColor := thumbLightColor lightened onDevice:device. |
|
454 | 995 |
]. |
993 | 996 |
self invalidate |
721
4a01084cf643
use #invalidate instead of #redraw
Claus Gittinger <cg@exept.de>
parents:
713
diff
changeset
|
997 |
|
993 | 998 |
"Modified: 8.2.1997 / 15:15:58 / cg" |
454 | 999 |
! ! |
1000 |
||
1794 | 1001 |
!Scroller methodsFor:'autoRepeat'! |
1002 |
||
2313
c3c2415333bb
make sure, that autorepeat happens AFTER damages have been
Claus Gittinger <cg@exept.de>
parents:
2301
diff
changeset
|
1003 |
installRepeat |
2514
cf29e8120cad
care for initialRepeat time in autopager
Claus Gittinger <cg@exept.de>
parents:
2509
diff
changeset
|
1004 |
self installRepeat:repeatDelay. |
cf29e8120cad
care for initialRepeat time in autopager
Claus Gittinger <cg@exept.de>
parents:
2509
diff
changeset
|
1005 |
! |
cf29e8120cad
care for initialRepeat time in autopager
Claus Gittinger <cg@exept.de>
parents:
2509
diff
changeset
|
1006 |
|
cf29e8120cad
care for initialRepeat time in autopager
Claus Gittinger <cg@exept.de>
parents:
2509
diff
changeset
|
1007 |
installRepeat:repeatDelay |
2321 | 1008 |
repeatBlock notNil ifTrue:[ |
1009 |
self windowGroup repairDamage. |
|
1010 |
Processor addTimedBlock:repeatBlock afterSeconds:repeatDelay |
|
1011 |
] |
|
2313
c3c2415333bb
make sure, that autorepeat happens AFTER damages have been
Claus Gittinger <cg@exept.de>
parents:
2301
diff
changeset
|
1012 |
! |
c3c2415333bb
make sure, that autorepeat happens AFTER damages have been
Claus Gittinger <cg@exept.de>
parents:
2301
diff
changeset
|
1013 |
|
2594
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1014 |
pagedAbovePointer |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1015 |
lastMousePosition notNil ifTrue:[ |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1016 |
orientation == #horizontal ifTrue:[ |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1017 |
^ lastMousePosition x > thumbFrame center x |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1018 |
] ifFalse:[ |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1019 |
^ lastMousePosition y > thumbFrame center y |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1020 |
]. |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1021 |
]. |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1022 |
^ false. |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1023 |
! |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1024 |
|
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1025 |
pagedBelowPointer |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1026 |
lastMousePosition notNil ifTrue:[ |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1027 |
orientation == #horizontal ifTrue:[ |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1028 |
^ lastMousePosition x < thumbFrame center x |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1029 |
] ifFalse:[ |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1030 |
^ lastMousePosition y < thumbFrame center y |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1031 |
]. |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1032 |
]. |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1033 |
^ false. |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1034 |
! |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1035 |
|
1794 | 1036 |
repeatPageDown |
2321 | 1037 |
repeatBlock notNil ifTrue:[ |
2594
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1038 |
"stop scroll" |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1039 |
(DefaultStopPagerAtThumb and:[self pagedBelowPointer]) ifTrue:[^ self]. |
2333 | 1040 |
self windowGroup repairDamage. |
2321 | 1041 |
self pageDown. |
1042 |
self installRepeat. |
|
1043 |
] |
|
1794 | 1044 |
! |
1045 |
||
1046 |
repeatPageUp |
|
2321 | 1047 |
repeatBlock notNil ifTrue:[ |
2594
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1048 |
"stop scroll" |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1049 |
(DefaultStopPagerAtThumb and:[self pagedAbovePointer]) ifTrue:[^ self]. |
2333 | 1050 |
self windowGroup repairDamage. |
2321 | 1051 |
self pageUp. |
1052 |
self installRepeat. |
|
1053 |
] |
|
1794 | 1054 |
! ! |
1055 |
||
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1056 |
!Scroller methodsFor:'drawing'! |
446 | 1057 |
|
2609 | 1058 |
drawEdgedLineFrom:x1 y:y1 toX:x2 y:y2 level:lvl |
1059 |
|color1 color2 x y| |
|
1060 |
||
1061 |
"iris style - draw tallys" |
|
1062 |
||
1063 |
lvl > 0 ifTrue:[ |
|
1064 |
color1 := thumbLightColor. |
|
1065 |
color2 := thumbShadowColor. |
|
1066 |
] ifFalse:[ |
|
1067 |
color1 := thumbShadowColor. |
|
1068 |
color2 := thumbLightColor. |
|
1069 |
]. |
|
1070 |
||
1071 |
self paint:color1. |
|
1072 |
self displayLineFromX:x1 y:y1 toX:x2 y:y2. |
|
1073 |
self paint:color2. |
|
1074 |
x1 = x2 ifTrue:[ |
|
1075 |
"/ vertical |
|
1076 |
x := x1 + 1. |
|
1077 |
self displayLineFromX:x y:y1 toX:x y:y2. |
|
1078 |
] ifFalse:[ |
|
1079 |
"/ horizontal |
|
1080 |
y := y1 + 1. |
|
1081 |
self displayLineFromX:x1 y:y toX:x2 y:y. |
|
1082 |
]. |
|
1083 |
! |
|
1084 |
||
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1085 |
drawHandleFormAtX:x y:y |
1988 | 1086 |
thumbShadowColor := thumbShadowColor onDevice:device. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1087 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1088 |
self paint:thumbShadowColor. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1089 |
self displayForm:shadowForm x:x y:y. |
1531
c5f2cfee9998
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1518
diff
changeset
|
1090 |
lightForm notNil ifTrue:[ |
2010 | 1091 |
thumbLightColor := thumbLightColor onDevice:device. |
1092 |
self paint:thumbLightColor. |
|
1093 |
self displayForm:lightForm x:x y:y. |
|
1531
c5f2cfee9998
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1518
diff
changeset
|
1094 |
]. |
c5f2cfee9998
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1518
diff
changeset
|
1095 |
|
c5f2cfee9998
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1518
diff
changeset
|
1096 |
"Modified: / 19.5.1998 / 16:26:49 / cg" |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1097 |
! |
446 | 1098 |
|
2609 | 1099 |
drawTallyMarks |
1100 |
"draw the thumb" |
|
1101 |
||
1102 |
|color1 color2 |
|
1103 |
lvl "{ Class: SmallInteger }" |
|
1104 |
t "{ Class: SmallInteger }" |
|
1105 |
l "{ Class: SmallInteger }" |
|
1106 |
w "{ Class: SmallInteger }" |
|
1107 |
h "{ Class: SmallInteger }" |
|
1108 |
x "{ Class: SmallInteger }" |
|
1109 |
y "{ Class: SmallInteger }" |
|
1110 |
xL xR yT yB dist |
|
1111 |
| |
|
1112 |
||
1113 |
"iris style - draw tallys" |
|
1114 |
||
1115 |
lvl := thumbLevel. |
|
1116 |
scrolling ifTrue:[ |
|
1117 |
lvl := thumbActiveLevel |
|
1118 |
]. |
|
1119 |
||
1120 |
w := thumbFrame width. |
|
1121 |
h := thumbFrame height. |
|
1122 |
l := thumbFrame left. |
|
1123 |
t := thumbFrame top. |
|
1124 |
||
1125 |
tallyLevel > 0 ifTrue:[ |
|
1126 |
color1 := thumbLightColor. |
|
1127 |
color2 := thumbShadowColor. |
|
1128 |
] ifFalse:[ |
|
1129 |
color1 := thumbShadowColor. |
|
1130 |
color2 := thumbLightColor. |
|
1131 |
]. |
|
1132 |
||
1133 |
"draw tally marks" |
|
1134 |
||
1135 |
(orientation == #vertical) ifTrue:[ |
|
1136 |
y := t + (h // 2) - 1. |
|
1137 |
xL := l + lvl - 1 + DefaultTallyInset. |
|
1138 |
xR := l + w - lvl "+ 1" - DefaultTallyInset. |
|
1139 |
||
1140 |
self drawEdgedLineFrom:xL y:y toX:xR y:y level:tallyLevel. |
|
1141 |
||
1142 |
tallyMarks > 1 ifTrue:[ |
|
1143 |
"dont draw other marks if there is not enough space" |
|
1144 |
||
1145 |
dist := DefaultTallyDistance ? device verticalPixelPerMillimeter rounded. |
|
1146 |
h > (dist * (tallyMarks * 2)) ifTrue:[ |
|
1147 |
self drawEdgedLineFrom:xL y:(y - dist) toX:xR y:(y - dist) level:tallyLevel. |
|
1148 |
self drawEdgedLineFrom:xL y:(y + dist) toX:xR y:(y + dist) level:tallyLevel. |
|
1149 |
] |
|
1150 |
] |
|
1151 |
] ifFalse:[ |
|
1152 |
x := l + (w // 2) - 1. |
|
1153 |
yT := t + lvl - 1 + DefaultTallyInset. |
|
1154 |
yB := t + h - lvl "+ 1" - DefaultTallyInset. |
|
1155 |
||
1156 |
self drawEdgedLineFrom:x y:yT toX:x y:yB level:tallyLevel. |
|
1157 |
||
1158 |
tallyMarks > 1 ifTrue:[ |
|
1159 |
"dont draw other marks if there is not enough space" |
|
1160 |
||
1161 |
dist := DefaultTallyDistance ? device horizontalPixelPerMillimeter rounded. |
|
1162 |
w > (dist * (tallyMarks * 2)) ifTrue:[ |
|
1163 |
self drawEdgedLineFrom:(x - dist) y:yT toX:(x - dist) y:yB level:tallyLevel. |
|
1164 |
self drawEdgedLineFrom:(x + dist) y:yT toX:(x + dist) y:yB level:tallyLevel. |
|
1165 |
] |
|
1166 |
] |
|
1167 |
] |
|
1168 |
||
1169 |
"Modified: / 29.4.1999 / 09:35:52 / cg" |
|
1170 |
! |
|
1171 |
||
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1172 |
drawThumb |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1173 |
"draw the thumb" |
446 | 1174 |
|
505
e13ee348dcc4
added thumbActiveLevel styleSheet variable
Claus Gittinger <cg@exept.de>
parents:
483
diff
changeset
|
1175 |
|handleX handleY l t lvl |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1176 |
w "{ Class: SmallInteger }" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1177 |
h "{ Class: SmallInteger }" |
2609 | 1178 |
clr| |
446 | 1179 |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1180 |
(thumbHeight >= 100) ifTrue:[^ self]. |
2177
f554919e10ab
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2176
diff
changeset
|
1181 |
thumbFrame isNil ifTrue:[^ self]. |
1890 | 1182 |
|
1183 |
w := thumbFrame width. |
|
1184 |
h := thumbFrame height. |
|
2176
7069af4213d6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2175
diff
changeset
|
1185 |
l := thumbFrame left. |
7069af4213d6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2175
diff
changeset
|
1186 |
t := thumbFrame top. |
1890 | 1187 |
|
2609 | 1188 |
clr := entered ifTrue:[thumbEnteredColor] ifFalse:[thumbColor]. |
1189 |
(scrolling and:[thumbActiveColor notNil]) ifTrue:[clr := thumbActiveColor]. |
|
1190 |
||
1191 |
self paint:clr. |
|
1192 |
self fillRectangleX:l y:t width:w height:h. |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1193 |
|
505
e13ee348dcc4
added thumbActiveLevel styleSheet variable
Claus Gittinger <cg@exept.de>
parents:
483
diff
changeset
|
1194 |
lvl := thumbLevel. |
e13ee348dcc4
added thumbActiveLevel styleSheet variable
Claus Gittinger <cg@exept.de>
parents:
483
diff
changeset
|
1195 |
scrolling ifTrue:[ |
2176
7069af4213d6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2175
diff
changeset
|
1196 |
lvl := thumbActiveLevel |
505
e13ee348dcc4
added thumbActiveLevel styleSheet variable
Claus Gittinger <cg@exept.de>
parents:
483
diff
changeset
|
1197 |
]. |
e13ee348dcc4
added thumbActiveLevel styleSheet variable
Claus Gittinger <cg@exept.de>
parents:
483
diff
changeset
|
1198 |
|
2609 | 1199 |
lvl ~~ 0 ifTrue:[ |
1200 |
self drawEdgesForX:l y:t width:w height:h level:lvl |
|
1201 |
shadow:thumbShadowColor light:thumbLightColor |
|
1202 |
halfShadow:thumbHalfShadowColor halfLight:thumbHalfLightColor |
|
1203 |
style:thumbEdgeStyle. |
|
1204 |
||
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1205 |
]. |
105 | 1206 |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1207 |
thumbFrameColor notNil ifTrue:[ |
2176
7069af4213d6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2175
diff
changeset
|
1208 |
self paint:thumbFrameColor. |
7069af4213d6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2175
diff
changeset
|
1209 |
self displayRectangleX:l y:t width:w height:h. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1210 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1211 |
|
1518
6d8e1461f119
removed unused: thumbUsable;
Claus Gittinger <cg@exept.de>
parents:
1514
diff
changeset
|
1212 |
thumbImage notNil ifTrue:[ |
2176
7069af4213d6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2175
diff
changeset
|
1213 |
thumbImage displayOn:self x:l y:t |
1518
6d8e1461f119
removed unused: thumbUsable;
Claus Gittinger <cg@exept.de>
parents:
1514
diff
changeset
|
1214 |
]. |
6d8e1461f119
removed unused: thumbUsable;
Claus Gittinger <cg@exept.de>
parents:
1514
diff
changeset
|
1215 |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1216 |
(tallyLevel == 0 or:[tallyMarks == 0]) ifTrue:[ |
2176
7069af4213d6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2175
diff
changeset
|
1217 |
shadowForm notNil ifTrue:[ |
2609 | 1218 |
"next style - draw tally bitmap" |
2176
7069af4213d6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2175
diff
changeset
|
1219 |
handleX := l + ((w - 8) // 2). |
7069af4213d6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2175
diff
changeset
|
1220 |
handleY := t + ((h - 8) // 2). |
7069af4213d6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2175
diff
changeset
|
1221 |
self drawHandleFormAtX:handleX y:handleY |
7069af4213d6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2175
diff
changeset
|
1222 |
]. |
7069af4213d6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2175
diff
changeset
|
1223 |
^ self |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1224 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1225 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1226 |
"iris style - draw tallys" |
2609 | 1227 |
self drawTallyMarks. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1228 |
! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1229 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1230 |
drawThumbBackgroundInX:x y:y width:w height:h |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1231 |
"draw part of the thumbs background; defined as a separate |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1232 |
method, to allow drawing of arbitrary patterns under thumb |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1233 |
(see ColorSlider)." |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1234 |
|
699 | 1235 |
|oldClip gX gY gW gH| |
1236 |
||
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1237 |
shown ifTrue:[ |
2178
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1238 |
oldClip := self clippingRectangleOrNil. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1239 |
self clippingRectangle:(Rectangle left:x top:y width:w height:h). |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1240 |
self clearDeviceRectangleX:x y:y width:w height:h. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1241 |
|
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1242 |
frameBeforeMove notNil ifTrue:[ |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1243 |
(ghostColor notNil |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1244 |
or:[ghostFrameColor notNil |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1245 |
or:[ghostLevel ~~ 0]]) ifTrue:[ |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1246 |
(frameBeforeMove intersects:(x@y extent:w@h)) ifTrue:[ |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1247 |
gX := frameBeforeMove left. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1248 |
gY := frameBeforeMove top. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1249 |
gW := frameBeforeMove width. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1250 |
gH := frameBeforeMove height. |
1896 | 1251 |
|
2178
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1252 |
ghostColor notNil ifTrue:[ |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1253 |
self paint:ghostColor. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1254 |
self fillRectangle:frameBeforeMove. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1255 |
]. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1256 |
(ghostLevel ~~ 0) ifTrue:[ |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1257 |
self drawEdgesForX:gX y:gY width:gW height:gH level:ghostLevel |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1258 |
]. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1259 |
ghostFrameColor notNil ifTrue:[ |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1260 |
self paint:ghostFrameColor. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1261 |
self displayRectangleX:gX y:gY width:gW height:gH |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1262 |
]. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1263 |
] |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1264 |
] |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1265 |
]. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1266 |
self clippingRectangle:oldClip |
205 | 1267 |
] |
695 | 1268 |
|
1896 | 1269 |
"Modified: / 4.5.1999 / 18:51:53 / cg" |
205 | 1270 |
! ! |
1271 |
||
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1272 |
!Scroller methodsFor:'event handling'! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1273 |
|
2297
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1274 |
buttonControlPress:button x:x y:y |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1275 |
"mouse-click with control - jump to top/bottom" |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1276 |
|
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1277 |
|curr limit1 limit2| |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1278 |
|
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1279 |
thumbFrame isNil ifTrue:[ |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1280 |
self computeThumbFrame. |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1281 |
thumbFrame isNil ifTrue:[ |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1282 |
^ self. |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1283 |
] |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1284 |
]. |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1285 |
(orientation == #vertical) ifTrue:[ |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1286 |
curr := y. |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1287 |
limit1 := thumbFrame top. |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1288 |
limit2 := thumbFrame bottom |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1289 |
] ifFalse:[ |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1290 |
curr := x. |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1291 |
limit1 := thumbFrame left. |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1292 |
limit2 := thumbFrame right |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1293 |
]. |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1294 |
|
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1295 |
(curr < limit1) ifTrue:[ |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1296 |
"to top" |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1297 |
self thumbOrigin:0. |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1298 |
self tellOthers |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1299 |
] ifFalse:[ |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1300 |
(curr > limit2) ifTrue:[ |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1301 |
"to bottom" |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1302 |
self thumbOrigin:100. |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1303 |
self tellOthers |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1304 |
] |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1305 |
]. |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1306 |
! |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1307 |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1308 |
buttonMotion:state x:x y:y |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1309 |
"mouse-button was moved while pressed; |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1310 |
redraw thumb at its new position and, if scroll-mode is asynchronous, |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1311 |
the scroll action is performed" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1312 |
|
1800 | 1313 |
<resource: #style (#name |
2178
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1314 |
#'scroller.snapBack')> |
1800 | 1315 |
|
2730
61a2f1981ac6
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2612
diff
changeset
|
1316 |
|pos curr limit prevOrigin newOrigin snap| |
2351
26bcce60314c
defer scroll, if more motion events are pending.
Claus Gittinger <cg@exept.de>
parents:
2342
diff
changeset
|
1317 |
|
2594
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1318 |
lastMousePosition := x@y. |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1319 |
|
2730
61a2f1981ac6
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2612
diff
changeset
|
1320 |
(self sensor hasButtonMotionEventFor:self) ifTrue:[ |
61a2f1981ac6
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2612
diff
changeset
|
1321 |
^ self. |
2351
26bcce60314c
defer scroll, if more motion events are pending.
Claus Gittinger <cg@exept.de>
parents:
2342
diff
changeset
|
1322 |
]. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1323 |
|
1652 | 1324 |
enabled ifFalse:[^ self]. |
1325 |
||
483
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1326 |
scrolling ifFalse: [ |
2178
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1327 |
thumbFrame notNil ifTrue:[ |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1328 |
self highlightThumbForPointerX:x y:y. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1329 |
]. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1330 |
^ self |
483
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1331 |
]. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1332 |
|
483
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1333 |
entered := true. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1334 |
frameBeforeMove isNil ifTrue:[ |
2178
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1335 |
self startMove. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1336 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1337 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1338 |
(orientation == #vertical) ifTrue:[ |
2178
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1339 |
curr := y. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1340 |
limit := height. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1341 |
snap := (x < SnapBackDistance negated) or:[x > (width + SnapBackDistance)]. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1342 |
] ifFalse:[ |
2178
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1343 |
curr := x. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1344 |
limit := width. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1345 |
snap := (y < SnapBackDistance negated) or:[y > (height + SnapBackDistance)]. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1346 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1347 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1348 |
(curr < 0) ifTrue:[ "check against limits" |
2178
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1349 |
pos := 0 |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1350 |
] ifFalse:[ |
2178
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1351 |
(curr > limit) ifTrue:[ |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1352 |
pos := limit |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1353 |
] ifFalse:[ |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1354 |
pos := curr |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1355 |
] |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1356 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1357 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1358 |
prevOrigin := self thumbOrigin. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1359 |
newOrigin := self percentFromAbs:(pos - pressOffset). |
1133
4395bae7e94e
added snapBack (win95 behavior)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1360 |
|
4395bae7e94e
added snapBack (win95 behavior)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1361 |
snap ifTrue:[ |
2178
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1362 |
(styleSheet at:#'scroller.snapBack' default:false) ifTrue:[ |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1363 |
newOrigin := originBeforeMove. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1364 |
] |
1133
4395bae7e94e
added snapBack (win95 behavior)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1365 |
]. |
4395bae7e94e
added snapBack (win95 behavior)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1366 |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1367 |
prevOrigin ~= newOrigin ifTrue:[ |
2178
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1368 |
self thumbOrigin:newOrigin. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1369 |
|
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1370 |
synchronousOperation ifTrue: [ |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1371 |
self tellOthers. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1372 |
] |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1373 |
] |
483
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1374 |
|
1485
5716db1ccb4e
care for nil thumbFrame (race condition)
Claus Gittinger <cg@exept.de>
parents:
1444
diff
changeset
|
1375 |
"Modified: / 14.4.1998 / 18:37:34 / cg" |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1376 |
! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1377 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1378 |
buttonPress:button x:x y:y |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1379 |
"button was pressed - if above thumb, page up; if below thumb, page down; |
1301 | 1380 |
otherwise start scrolling. |
1381 |
If either shift is pressed, or the 'scrollerMiddleButtonJump' styleSheet |
|
1382 |
value is true and its the middle button, do a jump to the clicked position." |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1383 |
|
1514 | 1384 |
|curr limit1 limit2 sensor| |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1385 |
|
1652 | 1386 |
enabled ifFalse:[^ self]. |
1387 |
||
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1388 |
shown ifFalse:[^ self]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1389 |
|
1420
e9999993396f
ignore other button press/release while scrolling
Claus Gittinger <cg@exept.de>
parents:
1366
diff
changeset
|
1390 |
scrolling ifTrue:[^ self]. |
e9999993396f
ignore other button press/release while scrolling
Claus Gittinger <cg@exept.de>
parents:
1366
diff
changeset
|
1391 |
|
1514 | 1392 |
sensor := self sensor. |
2730
61a2f1981ac6
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2612
diff
changeset
|
1393 |
(sensor shiftDown |
61a2f1981ac6
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2612
diff
changeset
|
1394 |
or:[DefaultMiddleButtonJump and:[button ~~ #select and:[button ~~ 1]]]) ifTrue:[ |
2146 | 1395 |
^ self buttonShiftPress:button x:x y:y |
811
7271a0746af6
Display no longer sends buttonShiftPress messages
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
1396 |
]. |
2730
61a2f1981ac6
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2612
diff
changeset
|
1397 |
sensor ctrlDown ifTrue:[ |
2297
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1398 |
^ self buttonControlPress:button x:x y:y |
b09f0d274532
ctrl-click: move to top/bottom
Claus Gittinger <cg@exept.de>
parents:
2215
diff
changeset
|
1399 |
]. |
2301 | 1400 |
(button ~~ #select and:[button ~~ 1]) ifTrue:[ |
2146 | 1401 |
^ self |
1441 | 1402 |
]. |
811
7271a0746af6
Display no longer sends buttonShiftPress messages
Claus Gittinger <cg@exept.de>
parents:
797
diff
changeset
|
1403 |
|
1295 | 1404 |
thumbFrame isNil ifTrue:[ |
2146 | 1405 |
self computeThumbFrame. |
1406 |
thumbFrame isNil ifTrue:[^ self]. |
|
1295 | 1407 |
]. |
1408 |
||
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1409 |
(orientation == #vertical) ifTrue:[ |
2146 | 1410 |
curr := y. |
1411 |
limit1 := thumbFrame top. |
|
1412 |
limit2 := thumbFrame bottom |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1413 |
] ifFalse:[ |
2146 | 1414 |
curr := x. |
1415 |
limit1 := thumbFrame left. |
|
1416 |
limit2 := thumbFrame right |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1417 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1418 |
|
1799
7d3daeab6afe
fixed shift-scroll-motion (scrollOffset)
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
1419 |
self highlightThumbForPointerX:x y:y. |
7d3daeab6afe
fixed shift-scroll-motion (scrollOffset)
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
1420 |
self changeCursorFor:(x@y). |
7d3daeab6afe
fixed shift-scroll-motion (scrollOffset)
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
1421 |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1422 |
(curr < limit1) ifTrue:[ |
2146 | 1423 |
"page up/left" |
1424 |
self pageUp. |
|
1425 |
autoRepeat ifTrue:[ |
|
1426 |
repeatBlock notNil ifTrue:[ |
|
1427 |
Processor removeTimedBlock:repeatBlock. |
|
1428 |
]. |
|
2730
61a2f1981ac6
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2612
diff
changeset
|
1429 |
repeatBlock := [self sensor pushUserEvent:#repeatPageUp for:self]. |
2514
cf29e8120cad
care for initialRepeat time in autopager
Claus Gittinger <cg@exept.de>
parents:
2509
diff
changeset
|
1430 |
sensor pushUserEvent:#installRepeat: for:self withArgument:initialRepeatDelay. |
2313
c3c2415333bb
make sure, that autorepeat happens AFTER damages have been
Claus Gittinger <cg@exept.de>
parents:
2301
diff
changeset
|
1431 |
"/ Processor addTimedBlock:repeatBlock afterSeconds:initialRepeatDelay |
2146 | 1432 |
] |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1433 |
] ifFalse:[ |
2146 | 1434 |
(curr > limit2) ifTrue:[ |
1435 |
"page down/right" |
|
1436 |
self pageDown. |
|
1437 |
autoRepeat ifTrue:[ |
|
1438 |
repeatBlock notNil ifTrue:[ |
|
1439 |
Processor removeTimedBlock:repeatBlock. |
|
1440 |
]. |
|
2730
61a2f1981ac6
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2612
diff
changeset
|
1441 |
repeatBlock := [self sensor pushUserEvent:#repeatPageDown for:self]. |
2514
cf29e8120cad
care for initialRepeat time in autopager
Claus Gittinger <cg@exept.de>
parents:
2509
diff
changeset
|
1442 |
sensor pushUserEvent:#installRepeat: for:self withArgument:initialRepeatDelay. |
2313
c3c2415333bb
make sure, that autorepeat happens AFTER damages have been
Claus Gittinger <cg@exept.de>
parents:
2301
diff
changeset
|
1443 |
"/ Processor addTimedBlock:repeatBlock afterSeconds:initialRepeatDelay |
2146 | 1444 |
] |
1445 |
] ifFalse:[ |
|
1446 |
pressOffset := curr - limit1. |
|
2609 | 1447 |
scrolling := true. |
1448 |
(thumbActiveColor notNil and:[thumbColor ~~ thumbActiveColor]) ifTrue:[ |
|
1449 |
self drawThumb |
|
1450 |
] |
|
2146 | 1451 |
] |
483
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1452 |
]. |
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1453 |
|
1441 | 1454 |
"Modified: / 2.2.1998 / 23:30:26 / stefan" |
1514 | 1455 |
"Modified: / 7.5.1998 / 02:05:41 / cg" |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1456 |
! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1457 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1458 |
buttonRelease:button x:x y:y |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1459 |
"mouse-button was released - if scroll-mode is asynchronous, the scroll |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1460 |
action is now performed" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1461 |
|
505
e13ee348dcc4
added thumbActiveLevel styleSheet variable
Claus Gittinger <cg@exept.de>
parents:
483
diff
changeset
|
1462 |
|rect mustDrawThumb| |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1463 |
|
2594
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1464 |
lastMousePosition := nil. |
48b325aac887
stop scroller at thumb implemented
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
1465 |
|
1794 | 1466 |
repeatBlock notNil ifTrue:[ |
2321 | 1467 |
repeatBlock := nil. |
2301 | 1468 |
Processor removeTimedBlock:repeatBlock. |
1469 |
repeatBlock := nil |
|
1794 | 1470 |
]. |
1471 |
||
2301 | 1472 |
(button == 1 or:[button == #select or:[DefaultMiddleButtonJump]]) |
1799
7d3daeab6afe
fixed shift-scroll-motion (scrollOffset)
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
1473 |
ifFalse:[ |
2301 | 1474 |
^ super buttonRelease:button x:x y:y |
1799
7d3daeab6afe
fixed shift-scroll-motion (scrollOffset)
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
1475 |
]. |
1420
e9999993396f
ignore other button press/release while scrolling
Claus Gittinger <cg@exept.de>
parents:
1366
diff
changeset
|
1476 |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1477 |
scrolling ifTrue:[ |
2301 | 1478 |
scrolling := false. |
1479 |
thumbFrame notNil ifTrue:[ |
|
1480 |
mustDrawThumb := false. |
|
1481 |
||
1482 |
frameBeforeMove notNil ifTrue:[ |
|
1483 |
rect := frameBeforeMove. |
|
1484 |
frameBeforeMove := nil. |
|
1485 |
self drawThumbBackgroundInX:rect left |
|
1486 |
y:rect top |
|
1487 |
width:rect width |
|
1488 |
height:rect height. |
|
1489 |
||
1490 |
(rect intersects:thumbFrame) ifTrue:[ |
|
1491 |
mustDrawThumb := true. |
|
1492 |
] |
|
1493 |
]. |
|
1494 |
thumbLevel ~~ thumbActiveLevel ifTrue:[ |
|
1495 |
mustDrawThumb := true |
|
1496 |
]. |
|
2609 | 1497 |
(thumbActiveColor notNil and:[thumbColor ~~ thumbActiveColor]) ifTrue:[ |
1498 |
mustDrawThumb := true |
|
1499 |
]. |
|
2301 | 1500 |
mustDrawThumb ifTrue:[ |
1501 |
self drawThumb |
|
1502 |
]. |
|
505
e13ee348dcc4
added thumbActiveLevel styleSheet variable
Claus Gittinger <cg@exept.de>
parents:
483
diff
changeset
|
1503 |
|
e13ee348dcc4
added thumbActiveLevel styleSheet variable
Claus Gittinger <cg@exept.de>
parents:
483
diff
changeset
|
1504 |
"/ scrolling := false. |
2301 | 1505 |
synchronousOperation ifFalse: [ |
1506 |
self tellOthers. |
|
1507 |
] |
|
1508 |
] |
|
1359 | 1509 |
]. |
1510 |
self changeCursorFor:(x@y) |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1511 |
|
1420
e9999993396f
ignore other button press/release while scrolling
Claus Gittinger <cg@exept.de>
parents:
1366
diff
changeset
|
1512 |
"Modified: / 19.1.1998 / 13:45:59 / cg" |
1441 | 1513 |
"Modified: / 2.2.1998 / 23:37:27 / stefan" |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1514 |
! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1515 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1516 |
buttonShiftPress:button x:x y:y |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1517 |
"mouse-click with shift - jump to position" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1518 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1519 |
|pos curr curr2 limit1 limit2| |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1520 |
|
2189 | 1521 |
thumbFrame isNil ifTrue:[ |
1522 |
self computeThumbFrame. |
|
1523 |
thumbFrame isNil ifTrue:[ |
|
1524 |
^ self. |
|
1525 |
] |
|
1526 |
]. |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1527 |
(orientation == #vertical) ifTrue:[ |
2189 | 1528 |
curr := y. |
1529 |
curr2 := y - (thumbFrame height // 2). |
|
1530 |
limit1 := height. |
|
1531 |
limit2 := thumbFrame top |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1532 |
] ifFalse:[ |
2189 | 1533 |
curr := x. |
1534 |
curr2 := x - (thumbFrame width // 2). |
|
1535 |
limit1 := width. |
|
1536 |
limit2 := thumbFrame left |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1537 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1538 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1539 |
(curr2 < 0) ifTrue:[ "check against limits" |
2189 | 1540 |
pos := 0 |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1541 |
] ifFalse:[ |
2189 | 1542 |
(curr2 > limit1) ifTrue:[ |
1543 |
pos := limit1 |
|
1544 |
] ifFalse:[ |
|
1545 |
pos := curr2 |
|
1546 |
] |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1547 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1548 |
|
1799
7d3daeab6afe
fixed shift-scroll-motion (scrollOffset)
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
1549 |
self startMove. |
1432 | 1550 |
|
1551 |
self thumbOrigin:(self percentFromAbs:pos). |
|
1552 |
self tellOthers. |
|
1553 |
||
1799
7d3daeab6afe
fixed shift-scroll-motion (scrollOffset)
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
1554 |
(orientation == #vertical) ifTrue:[ |
2189 | 1555 |
limit2 := thumbFrame top |
1799
7d3daeab6afe
fixed shift-scroll-motion (scrollOffset)
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
1556 |
] ifFalse:[ |
2189 | 1557 |
limit2 := thumbFrame left |
1799
7d3daeab6afe
fixed shift-scroll-motion (scrollOffset)
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
1558 |
]. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1559 |
pressOffset := curr - limit2. |
1441 | 1560 |
scrolling := true. |
1133
4395bae7e94e
added snapBack (win95 behavior)
Claus Gittinger <cg@exept.de>
parents:
1127
diff
changeset
|
1561 |
|
1801 | 1562 |
self changeCursorFor:(x@y). |
1563 |
||
1564 |
||
1441 | 1565 |
"Modified: / 19.3.1997 / 11:29:08 / cg" |
1566 |
"Modified: / 2.2.1998 / 23:35:18 / stefan" |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1567 |
! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1568 |
|
1359 | 1569 |
changeCursorFor:p |
1570 |
"update the mouse cursor" |
|
1571 |
||
1808 | 1572 |
|frm sensor which| |
1359 | 1573 |
|
1799
7d3daeab6afe
fixed shift-scroll-motion (scrollOffset)
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
1574 |
enabled ifFalse:[ |
2215
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1575 |
self cursor:Cursor normal. |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1576 |
^ self |
1799
7d3daeab6afe
fixed shift-scroll-motion (scrollOffset)
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
1577 |
]. |
1359 | 1578 |
NewCursors ifFalse:[^ self]. |
1579 |
||
1580 |
frm := self thumbFrame. |
|
2215
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1581 |
frm isNil ifTrue:[^ self]. |
1359 | 1582 |
|
1583 |
thumbHeight = 100 ifTrue:[ |
|
2215
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1584 |
which := #normal. |
1359 | 1585 |
] ifFalse:[ |
2215
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1586 |
sensor := self sensor. |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1587 |
|
2730
61a2f1981ac6
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2612
diff
changeset
|
1588 |
(((frm containsPoint:p) and:[sensor leftButtonPressed]) |
61a2f1981ac6
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
2612
diff
changeset
|
1589 |
"or:[sensor shiftDown]") ifTrue:[ |
2215
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1590 |
orientation == #horizontal ifTrue:[ |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1591 |
which := #xMarker |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1592 |
] ifFalse:[ |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1593 |
which := #marker |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1594 |
]. |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1595 |
] ifFalse:[ |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1596 |
orientation == #horizontal ifTrue:[ |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1597 |
p x > frm right ifTrue:[ |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1598 |
which := #right |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1599 |
] ifFalse:[ |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1600 |
p x < frm left ifTrue:[ |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1601 |
which := #left |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1602 |
] ifFalse:[ |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1603 |
which := #hand |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1604 |
] |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1605 |
] |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1606 |
] ifFalse:[ |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1607 |
p y > frm bottom ifTrue:[ |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1608 |
which := #down |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1609 |
] ifFalse:[ |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1610 |
p y < frm top ifTrue:[ |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1611 |
which := #up |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1612 |
] ifFalse:[ |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1613 |
which := #hand |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1614 |
] |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1615 |
] |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1616 |
] |
7757d56a38ab
care for nil thumbFrame in changeCursor
Claus Gittinger <cg@exept.de>
parents:
2189
diff
changeset
|
1617 |
] |
1359 | 1618 |
]. |
1619 |
self cursor:(Cursor perform:which). |
|
1620 |
||
1514 | 1621 |
"Created: / 23.10.1997 / 03:55:24 / cg" |
1622 |
"Modified: / 7.5.1998 / 02:06:10 / cg" |
|
1359 | 1623 |
! |
1624 |
||
483
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1625 |
highlightThumbForPointerX:x y:y |
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1626 |
"if x/y is within the thumb frame, highlight it" |
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1627 |
|
2010 | 1628 |
|frm in| |
483
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1629 |
|
1359 | 1630 |
in := (frm := self thumbFrame) containsPoint:(x@y). |
505
e13ee348dcc4
added thumbActiveLevel styleSheet variable
Claus Gittinger <cg@exept.de>
parents:
483
diff
changeset
|
1631 |
(in ~~ entered |
e13ee348dcc4
added thumbActiveLevel styleSheet variable
Claus Gittinger <cg@exept.de>
parents:
483
diff
changeset
|
1632 |
or:[thumbLevel ~~ thumbActiveLevel]) ifTrue:[ |
2609 | 1633 |
entered := in. |
1634 |
(thumbColor ~~ thumbEnteredColor |
|
1635 |
or:[thumbLevel ~~ thumbActiveLevel]) ifTrue: [ |
|
1636 |
self drawThumb |
|
1637 |
]. |
|
483
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1638 |
]. |
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1639 |
|
1359 | 1640 |
self changeCursorFor:(x@y) |
1641 |
||
483
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1642 |
"Created: 6.3.1996 / 17:35:07 / cg" |
1359 | 1643 |
"Modified: 23.10.1997 / 03:56:31 / cg" |
1644 |
! |
|
1645 |
||
1646 |
keyPress:key x:x y:y |
|
1799
7d3daeab6afe
fixed shift-scroll-motion (scrollOffset)
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
1647 |
"/ stupid - due to delegation, this is never invoked ... |
1652 | 1648 |
enabled ifFalse:[^ self]. |
1649 |
||
1359 | 1650 |
self changeCursorFor:(x@y). |
1651 |
super keyPress:key x:x y:y |
|
1652 |
||
1653 |
"Created: 23.10.1997 / 03:57:34 / cg" |
|
1654 |
! |
|
1655 |
||
1656 |
keyRelease:key x:x y:y |
|
1799
7d3daeab6afe
fixed shift-scroll-motion (scrollOffset)
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
1657 |
"/ stupid - due to delegation, this is never invoked ... |
1359 | 1658 |
self changeCursorFor:(x@y). |
1659 |
super keyRelease:key x:x y:y |
|
1660 |
||
1661 |
"Created: 23.10.1997 / 03:58:25 / cg" |
|
483
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1662 |
! |
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1663 |
|
1706
eb2f9e689f5e
when reentering with no button pressed,
Claus Gittinger <cg@exept.de>
parents:
1673
diff
changeset
|
1664 |
pointerEnter:state x:x y:y |
eb2f9e689f5e
when reentering with no button pressed,
Claus Gittinger <cg@exept.de>
parents:
1673
diff
changeset
|
1665 |
"mouse-button left view |
eb2f9e689f5e
when reentering with no button pressed,
Claus Gittinger <cg@exept.de>
parents:
1673
diff
changeset
|
1666 |
redraw thumb if enteredColor ~~ thumbColor" |
eb2f9e689f5e
when reentering with no button pressed,
Claus Gittinger <cg@exept.de>
parents:
1673
diff
changeset
|
1667 |
|
eb2f9e689f5e
when reentering with no button pressed,
Claus Gittinger <cg@exept.de>
parents:
1673
diff
changeset
|
1668 |
scrolling ifTrue:[ |
2010 | 1669 |
(state bitAnd:(device anyButtonMotionMask)) == 0 ifTrue: [ |
1670 |
self buttonRelease:1 x:x y:y |
|
1671 |
]. |
|
1706
eb2f9e689f5e
when reentering with no button pressed,
Claus Gittinger <cg@exept.de>
parents:
1673
diff
changeset
|
1672 |
]. |
eb2f9e689f5e
when reentering with no button pressed,
Claus Gittinger <cg@exept.de>
parents:
1673
diff
changeset
|
1673 |
super pointerEnter:state x:x y:y |
eb2f9e689f5e
when reentering with no button pressed,
Claus Gittinger <cg@exept.de>
parents:
1673
diff
changeset
|
1674 |
|
eb2f9e689f5e
when reentering with no button pressed,
Claus Gittinger <cg@exept.de>
parents:
1673
diff
changeset
|
1675 |
"Modified: / 14.10.1998 / 15:40:51 / cg" |
eb2f9e689f5e
when reentering with no button pressed,
Claus Gittinger <cg@exept.de>
parents:
1673
diff
changeset
|
1676 |
! |
eb2f9e689f5e
when reentering with no button pressed,
Claus Gittinger <cg@exept.de>
parents:
1673
diff
changeset
|
1677 |
|
483
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1678 |
pointerLeave:state |
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1679 |
"mouse-button left view |
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1680 |
redraw thumb if enteredColor ~~ thumbColor" |
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1681 |
|
759
9defb0b4883a
oops - ignore caps-lock/scroll-lock etc. in pointerLeave
Claus Gittinger <cg@exept.de>
parents:
721
diff
changeset
|
1682 |
(entered and:[(state bitAnd:(device anyButtonMotionMask)) == 0]) ifTrue: [ |
2010 | 1683 |
entered := false. |
1684 |
thumbEnteredColor ~= thumbColor ifTrue:[ |
|
1685 |
self invalidate. |
|
1686 |
"/ self drawThumb |
|
1687 |
] |
|
483
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1688 |
]. |
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1689 |
|
1673
ff43258f2224
only redraw in pointerLeave, if thumbColor will change
Claus Gittinger <cg@exept.de>
parents:
1662
diff
changeset
|
1690 |
"Created: / 6.3.1996 / 17:31:16 / cg" |
ff43258f2224
only redraw in pointerLeave, if thumbColor will change
Claus Gittinger <cg@exept.de>
parents:
1662
diff
changeset
|
1691 |
"Modified: / 11.9.1998 / 00:13:53 / cg" |
483
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1692 |
! |
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1693 |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1694 |
redraw |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1695 |
"redraw" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1696 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1697 |
self redrawX:0 y:0 width:width height:height. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1698 |
self redrawEdges |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1699 |
! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1700 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1701 |
redrawX:x y:y width:w height:h |
2913
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1702 |
shown ifFalse:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1703 |
^ self. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1704 |
]. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1705 |
|
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1706 |
thumbFrame isNil ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1707 |
self computeThumbFrame |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1708 |
]. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1709 |
self drawThumbBackgroundInX:x y:y width:w height:h. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1710 |
thumbFrame isNil ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1711 |
"/ thumb hidden |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1712 |
^ self |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1713 |
]. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1714 |
|
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1715 |
orientation == #vertical ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1716 |
(y > thumbFrame bottom) ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1717 |
^ self |
2175
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
1718 |
]. |
2913
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1719 |
((y + h) < thumbFrame top) ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1720 |
^ self |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1721 |
]. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1722 |
] ifFalse:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1723 |
(x > thumbFrame right) ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1724 |
^ self |
2175
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
1725 |
]. |
2913
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1726 |
((x + w) < thumbFrame left) ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1727 |
^ self |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1728 |
]. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1729 |
]. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1730 |
|
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1731 |
self drawThumb |
767
c96a1130b833
oops - tiny bug in redraw-optimization
Claus Gittinger <cg@exept.de>
parents:
764
diff
changeset
|
1732 |
|
1366 | 1733 |
"Modified: / 29.10.1997 / 15:48:48 / cg" |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1734 |
! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1735 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1736 |
sizeChanged:how |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1737 |
"size of scroller changed - recompute thumbs frame and redraw it" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1738 |
|
1908 | 1739 |
|oldThumbFrame oldTop oldBot newTop newBot oldLeft oldRight newLeft newRight| |
1718 | 1740 |
|
1741 |
oldThumbFrame := thumbFrame. |
|
1444
eff7016070f8
no need for invalidate on sizeChange (will get expose event anyway)
Claus Gittinger <cg@exept.de>
parents:
1441
diff
changeset
|
1742 |
thumbFrame := nil. |
2913
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1743 |
shown ifFalse:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1744 |
thumbFrame := nil. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1745 |
self invalidate. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1746 |
^ self. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1747 |
]. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1748 |
self computeThumbFrame. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1749 |
|
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1750 |
"/ any change ? |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1751 |
thumbFrame = oldThumbFrame ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1752 |
^ self |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1753 |
]. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1754 |
thumbFrame isNil ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1755 |
self invalidate. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1756 |
^ self |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1757 |
]. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1758 |
oldThumbFrame isNil ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1759 |
self invalidate:thumbFrame. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1760 |
^ self. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1761 |
]. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1762 |
|
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1763 |
"/ try to redraw as little as possible |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1764 |
|
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1765 |
oldTop := oldThumbFrame top. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1766 |
oldBot := oldThumbFrame bottom. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1767 |
newTop := thumbFrame top. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1768 |
newBot := thumbFrame bottom. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1769 |
oldLeft := oldThumbFrame left. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1770 |
oldRight := oldThumbFrame right. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1771 |
newLeft := thumbFrame left. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1772 |
newRight := thumbFrame right. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1773 |
|
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1774 |
(orientation == #vertical |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1775 |
and:[oldLeft == newLeft |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1776 |
and:[oldRight == newRight]]) ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1777 |
(oldTop == newTop) ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1778 |
oldBot < newBot ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1779 |
"/ thumb became larger, but origin remains |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1780 |
"/ (view became smaller) |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1781 |
self invalidate:(Rectangle |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1782 |
left:newLeft top:oldBot-thumbLevel |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1783 |
right:newRight bottom:newBot). |
2178
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1784 |
^ self. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
1785 |
]. |
2913
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1786 |
oldBot > newBot ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1787 |
"/ thumb became smaller, but origin remains |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1788 |
"/ (view became larger) |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1789 |
self invalidate:(Rectangle |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1790 |
left:newLeft top:newBot-thumbLevel |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1791 |
right:newRight bottom:oldBot). |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1792 |
^ self. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1793 |
]. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1794 |
]. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1795 |
(oldBot == newBot) ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1796 |
newTop < oldTop ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1797 |
"/ thumb became larger, but corner remains |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1798 |
"/ (view became smaller) |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1799 |
self invalidate:(Rectangle |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1800 |
left:newLeft top:newTop |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1801 |
right:newRight bottom:oldTop+thumbLevel). |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1802 |
^ self. |
2175
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
1803 |
]. |
2913
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1804 |
newTop > oldTop ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1805 |
"/ thumb became smaller, but corner remains |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1806 |
"/ (view became larger) |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1807 |
self invalidate:(Rectangle |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1808 |
left:newLeft top:oldTop |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1809 |
right:newRight bottom:newTop+thumbLevel). |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1810 |
^ self. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1811 |
] |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1812 |
]. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1813 |
]. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1814 |
|
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1815 |
(orientation == #horizontal |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1816 |
and:[oldTop == newTop |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1817 |
and:[oldBot == newBot]]) ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1818 |
(oldLeft == newLeft) ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1819 |
oldRight < newRight ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1820 |
"/ thumb became larger, but origin remains |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1821 |
"/ (view became smaller) |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1822 |
self invalidate:(Rectangle |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1823 |
left:oldRight-thumbLevel top:newTop |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1824 |
right:newRight bottom:newBot). |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1825 |
^ self. |
2175
5042e15f3cf6
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2171
diff
changeset
|
1826 |
]. |
2913
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1827 |
oldRight > newRight ifTrue:[ |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1828 |
"/ thumb became smaller, but origin remains |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1829 |
"/ (view became larger) |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1830 |
self invalidate:(Rectangle |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1831 |
left:newRight-thumbLevel top:newTop |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1832 |
right:oldRight bottom:newBot). |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1833 |
^ self. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1834 |
]. |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1835 |
]. |
1507 | 1836 |
]. |
1127 | 1837 |
|
2913
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1838 |
self invalidate:(oldThumbFrame merge: thumbFrame). |
bdf4fb09cfc0
invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents:
2742
diff
changeset
|
1839 |
|
1913
37653d123b68
redraw optimizations when resized.
Claus Gittinger <cg@exept.de>
parents:
1908
diff
changeset
|
1840 |
"Modified: / 23.5.1999 / 13:50:41 / cg" |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1841 |
! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1842 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1843 |
update:something with:aParameter from:changedObject |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1844 |
"handle update from a model (if any)" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1845 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1846 |
(changedObject == model |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1847 |
"and:[something == aspectMsg]") ifTrue:[ |
2010 | 1848 |
self thumbOrigin:(model value). |
1849 |
^ self |
|
1652 | 1850 |
]. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1851 |
super update:something with:aParameter from:changedObject |
1830 | 1852 |
|
1853 |
"Modified: / 30.3.1999 / 14:26:28 / stefan" |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1854 |
! ! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1855 |
|
1821
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1808
diff
changeset
|
1856 |
!Scroller methodsFor:'focus handling'! |
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1808
diff
changeset
|
1857 |
|
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1808
diff
changeset
|
1858 |
wantsFocusWithButtonPress |
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1808
diff
changeset
|
1859 |
"no, do not catch the keyboard focus on button click" |
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1808
diff
changeset
|
1860 |
|
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1808
diff
changeset
|
1861 |
^ false |
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1808
diff
changeset
|
1862 |
|
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1808
diff
changeset
|
1863 |
|
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1808
diff
changeset
|
1864 |
! ! |
b57cc9dc2c08
changed request-focus-with-Button press
Claus Gittinger <cg@exept.de>
parents:
1808
diff
changeset
|
1865 |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1866 |
!Scroller methodsFor:'forced scroll'! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1867 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1868 |
pageDown |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1869 |
"page down/right" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1870 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1871 |
self thumbOrigin:(thumbOrigin + thumbHeight). |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1872 |
self tellOthers |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1873 |
! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1874 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1875 |
pageUp |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1876 |
"page up/left" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1877 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1878 |
self thumbOrigin:(thumbOrigin - thumbHeight). |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1879 |
self tellOthers |
483
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1880 |
! |
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1881 |
|
2383 | 1882 |
scrollDown:amountToScroll |
1883 |
"compatibility with SimpleView. This allows mouse wheel actions on Scrollers |
|
1884 |
Note: this is used for horizontal scrollers, too (scrollRight)" |
|
1885 |
||
1886 |
self scrollStep:amountToScroll |
|
1887 |
! |
|
1888 |
||
1493
3b76c81608e5
moved #scrollStep: from SteppingSlider
Claus Gittinger <cg@exept.de>
parents:
1485
diff
changeset
|
1889 |
scrollStep:delta |
3b76c81608e5
moved #scrollStep: from SteppingSlider
Claus Gittinger <cg@exept.de>
parents:
1485
diff
changeset
|
1890 |
"step by some delta" |
3b76c81608e5
moved #scrollStep: from SteppingSlider
Claus Gittinger <cg@exept.de>
parents:
1485
diff
changeset
|
1891 |
|
3b76c81608e5
moved #scrollStep: from SteppingSlider
Claus Gittinger <cg@exept.de>
parents:
1485
diff
changeset
|
1892 |
|oldOrg newOrg| |
3b76c81608e5
moved #scrollStep: from SteppingSlider
Claus Gittinger <cg@exept.de>
parents:
1485
diff
changeset
|
1893 |
|
3b76c81608e5
moved #scrollStep: from SteppingSlider
Claus Gittinger <cg@exept.de>
parents:
1485
diff
changeset
|
1894 |
oldOrg := self thumbOrigin. |
3b76c81608e5
moved #scrollStep: from SteppingSlider
Claus Gittinger <cg@exept.de>
parents:
1485
diff
changeset
|
1895 |
newOrg := ((oldOrg + delta) max:rangeStart) min:rangeEnd. |
3b76c81608e5
moved #scrollStep: from SteppingSlider
Claus Gittinger <cg@exept.de>
parents:
1485
diff
changeset
|
1896 |
oldOrg ~= newOrg ifTrue:[ |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
1897 |
self thumbOrigin:newOrg. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
1898 |
self tellOthers. |
1493
3b76c81608e5
moved #scrollStep: from SteppingSlider
Claus Gittinger <cg@exept.de>
parents:
1485
diff
changeset
|
1899 |
] |
3b76c81608e5
moved #scrollStep: from SteppingSlider
Claus Gittinger <cg@exept.de>
parents:
1485
diff
changeset
|
1900 |
|
3b76c81608e5
moved #scrollStep: from SteppingSlider
Claus Gittinger <cg@exept.de>
parents:
1485
diff
changeset
|
1901 |
"Created: / 21.4.1998 / 20:51:57 / cg" |
3b76c81608e5
moved #scrollStep: from SteppingSlider
Claus Gittinger <cg@exept.de>
parents:
1485
diff
changeset
|
1902 |
"Modified: / 21.4.1998 / 20:52:22 / cg" |
3b76c81608e5
moved #scrollStep: from SteppingSlider
Claus Gittinger <cg@exept.de>
parents:
1485
diff
changeset
|
1903 |
! |
3b76c81608e5
moved #scrollStep: from SteppingSlider
Claus Gittinger <cg@exept.de>
parents:
1485
diff
changeset
|
1904 |
|
483
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1905 |
scrollToBeginning |
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1906 |
"scroll to the beginning" |
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1907 |
|
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1908 |
self thumbOrigin:rangeStart. |
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1909 |
self tellOthers |
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1910 |
|
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1911 |
"Created: 6.3.1996 / 17:55:13 / cg" |
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1912 |
! |
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1913 |
|
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1914 |
scrollToEnd |
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1915 |
"scroll to the end" |
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1916 |
|
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1917 |
self thumbOrigin:rangeEnd. |
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1918 |
self tellOthers |
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1919 |
|
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
1920 |
"Created: 6.3.1996 / 17:55:25 / cg" |
2383 | 1921 |
! |
1922 |
||
1923 |
scrollUp:amountToScroll |
|
1924 |
"compatibility with SimpleView. This allows mouse wheel actions on Scrollers |
|
1925 |
Note: this is used for horizontal scrollers, too (scrollLeft)" |
|
1926 |
||
1927 |
self scrollStep:amountToScroll negated |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1928 |
! ! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1929 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1930 |
!Scroller methodsFor:'forwarding changed origin'! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1931 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1932 |
tellOthers |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1933 |
|org| |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1934 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1935 |
org := self thumbOrigin. |
1011 | 1936 |
|
1937 |
" |
|
1938 |
the ST-80 way of notifying scrolls |
|
1939 |
" |
|
1940 |
self sendChangeMessageWith:org. |
|
1941 |
||
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1942 |
" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1943 |
the ST/X way of notifying scrolls |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1944 |
" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1945 |
scrollAction notNil ifTrue:[ |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
1946 |
scrollAction value:org |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1947 |
]. |
1011 | 1948 |
|
1949 |
"/ |
|
1950 |
"/ this will vanish - the scroller should share |
|
1951 |
"/ a valueHolder with the scrolledView. |
|
1952 |
"/ |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1953 |
self changed:#scrollerPosition. |
1011 | 1954 |
|
1424
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
1955 |
"Modified: / 21.1.1998 / 19:12:55 / cg" |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1956 |
! ! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1957 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1958 |
!Scroller methodsFor:'initialization'! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1959 |
|
453
dc035dd8b9eb
oops - checked in corrupted files
Claus Gittinger <cg@exept.de>
parents:
452
diff
changeset
|
1960 |
defaultExtent |
571 | 1961 |
"compute my extent from sub-components" |
1962 |
||
453
dc035dd8b9eb
oops - checked in corrupted files
Claus Gittinger <cg@exept.de>
parents:
452
diff
changeset
|
1963 |
^ self preferredExtent |
571 | 1964 |
|
1965 |
"Modified: 22.4.1996 / 23:37:53 / cg" |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1966 |
! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1967 |
|
930 | 1968 |
fetchDeviceResources |
931 | 1969 |
"fetch device colors, to avoid reallocation at redraw time" |
930 | 1970 |
|
931 | 1971 |
super fetchDeviceResources. |
930 | 1972 |
|
1988 | 1973 |
thumbShadowColor notNil ifTrue:[thumbShadowColor := thumbShadowColor onDevice:device]. |
1974 |
thumbLightColor notNil ifTrue:[thumbLightColor := thumbLightColor onDevice:device]. |
|
1975 |
thumbHalfShadowColor notNil ifTrue:[thumbHalfShadowColor := thumbHalfShadowColor onDevice:device]. |
|
1976 |
thumbHalfLightColor notNil ifTrue:[thumbHalfLightColor := thumbHalfLightColor onDevice:device]. |
|
1977 |
||
1978 |
thumbEnteredColor notNil ifTrue:[thumbEnteredColor := thumbEnteredColor onDevice:device]. |
|
1979 |
ghostColor notNil ifTrue:[ghostColor := ghostColor onDevice:device]. |
|
1980 |
ghostFrameColor notNil ifTrue:[ghostFrameColor := ghostFrameColor onDevice:device]. |
|
930 | 1981 |
|
931 | 1982 |
"Modified: 13.1.1997 / 21:56:38 / cg" |
930 | 1983 |
! |
1984 |
||
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1985 |
initCursor |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1986 |
"set the cursor - a hand" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1987 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1988 |
cursor := Cursor hand |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1989 |
! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1990 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1991 |
initStyle |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1992 |
"initialize style dep. stuff" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
1993 |
|
1794 | 1994 |
<resource: #style (#name |
2321 | 1995 |
#'scroller.autoRepeat' |
1996 |
#'scroller.initialRepeatDelay' |
|
1997 |
#'scroller.repeatDelay')> |
|
764 | 1998 |
|
1999 |
|nm| |
|
2000 |
||
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2001 |
super initStyle. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2002 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2003 |
DefaultViewBackground notNil ifTrue:[ |
2321 | 2004 |
viewBackground := DefaultViewBackground onDevice:device. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2005 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2006 |
DefaultShadowColor notNil ifTrue:[ |
2321 | 2007 |
shadowColor := DefaultShadowColor onDevice:device. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2008 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2009 |
DefaultLightColor notNil ifTrue:[ |
2321 | 2010 |
lightColor := DefaultLightColor onDevice:device. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2011 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2012 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2013 |
tallyMarks := DefaultTallyMarks. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2014 |
tallyLevel := DefaultTallyLevel. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2015 |
DefaultLevel ~~ level ifTrue:[ |
2321 | 2016 |
self level:DefaultLevel. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2017 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2018 |
DefaultBorderWidth ~~ borderWidth ifTrue:[ |
2321 | 2019 |
self borderWidth:DefaultBorderWidth. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2020 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2021 |
thumbLevel := DefaultThumbLevel. |
505
e13ee348dcc4
added thumbActiveLevel styleSheet variable
Claus Gittinger <cg@exept.de>
parents:
483
diff
changeset
|
2022 |
thumbActiveLevel := DefaultThumbActiveLevel. |
2609 | 2023 |
thumbActiveColor := DefaultThumbActiveColor. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2024 |
inset := DefaultInset. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2025 |
fixThumbHeight := DefaultFixThumbHeight. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2026 |
thumbEdgeStyle := DefaultEdgeStyle. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2027 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2028 |
DefaultGhostColor notNil ifTrue:[ |
2321 | 2029 |
ghostColor := DefaultGhostColor onDevice:device. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2030 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2031 |
DefaultGhostFrameColor notNil ifTrue:[ |
2321 | 2032 |
ghostFrameColor := DefaultGhostFrameColor onDevice:device. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2033 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2034 |
ghostLevel := DefaultGhostLevel. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2035 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2036 |
DefaultThumbFrameColor notNil ifTrue:[ |
2321 | 2037 |
thumbFrameColor := DefaultThumbFrameColor onDevice:device. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2038 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2039 |
DefaultThumbShadowColor notNil ifTrue:[ |
2321 | 2040 |
thumbShadowColor := DefaultThumbShadowColor |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2041 |
] ifFalse:[ |
2321 | 2042 |
thumbShadowColor := shadowColor. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2043 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2044 |
DefaultThumbLightColor notNil ifTrue:[ |
2321 | 2045 |
thumbLightColor := DefaultThumbLightColor |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2046 |
] ifFalse:[ |
2321 | 2047 |
thumbLightColor := lightColor. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2048 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2049 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2050 |
thumbEdgeStyle notNil ifTrue:[ |
2321 | 2051 |
DefaultThumbHalfShadowColor notNil ifTrue:[ |
2052 |
thumbHalfShadowColor := DefaultThumbHalfShadowColor |
|
2053 |
]. |
|
2054 |
||
2055 |
DefaultThumbHalfLightColor notNil ifTrue:[ |
|
2056 |
thumbHalfLightColor := DefaultThumbHalfLightColor |
|
2057 |
]. |
|
446 | 2058 |
]. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2059 |
|
764 | 2060 |
nm := styleSheet name. |
2061 |
||
709 | 2062 |
device hasGrayscales ifFalse:[ |
2321 | 2063 |
thumbEdgeStyle notNil ifTrue:[ |
2064 |
thumbHalfShadowColor := Color darkGray. |
|
2065 |
thumbHalfLightColor := White |
|
2066 |
]. |
|
2067 |
||
2068 |
thumbShadowColor := Black. |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2069 |
"/ thumbLightColor := White. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2070 |
|
2321 | 2071 |
nm = #motif ifTrue:[ |
2072 |
DefaultThumbColor isNil ifTrue:[ |
|
2073 |
thumbColor := White . |
|
2074 |
]. |
|
2075 |
] |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2076 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2077 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2078 |
DefaultThumbColor notNil ifTrue:[ |
2321 | 2079 |
thumbColor := DefaultThumbColor onDevice:device |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2080 |
] ifFalse:[ |
2321 | 2081 |
thumbColor := White. |
2082 |
nm ~= #normal ifTrue:[ |
|
2083 |
device hasGrayscales ifFalse:[ |
|
2084 |
thumbColor := Color grey |
|
2085 |
]. |
|
2086 |
]. |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2087 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2088 |
|
1988 | 2089 |
thumbColor := thumbColor onDevice:device. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2090 |
thumbShadowColor notNil ifTrue:[ |
2321 | 2091 |
thumbShadowColor := thumbShadowColor onDevice:device. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2092 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2093 |
thumbLightColor notNil ifTrue:[ |
2321 | 2094 |
thumbLightColor := thumbLightColor onDevice:device. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2095 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2096 |
thumbHalfShadowColor notNil ifTrue:[ |
2321 | 2097 |
thumbHalfShadowColor := thumbHalfShadowColor onDevice:device. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2098 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2099 |
thumbHalfLightColor notNil ifTrue:[ |
2321 | 2100 |
thumbHalfLightColor := thumbHalfLightColor onDevice:device. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2101 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2102 |
thumbEdgeStyle notNil ifTrue:[ |
2321 | 2103 |
thumbHalfShadowColor isNil ifTrue:[ |
2104 |
thumbHalfShadowColor := thumbShadowColor lightened onDevice:device |
|
2105 |
] |
|
483
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
2106 |
]. |
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
2107 |
|
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
2108 |
DefaultThumbEnteredColor notNil ifTrue:[ |
2321 | 2109 |
thumbEnteredColor := DefaultThumbEnteredColor onDevice:device. |
1366 | 2110 |
] ifFalse:[ |
2321 | 2111 |
thumbEnteredColor := thumbColor. |
1366 | 2112 |
]. |
2113 |
||
2114 |
(DefaultThumbEnteredColor notNil or:[NewCursors]) ifTrue:[ |
|
2321 | 2115 |
self enableMotionEvents. |
2116 |
self enableEnterLeaveEvents. |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2117 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2118 |
|
1518
6d8e1461f119
removed unused: thumbUsable;
Claus Gittinger <cg@exept.de>
parents:
1514
diff
changeset
|
2119 |
DefaultThumbImage notNil ifTrue:[ |
2321 | 2120 |
thumbImage := DefaultThumbImage onDevice:device. |
2121 |
fixThumbHeight := true. |
|
1518
6d8e1461f119
removed unused: thumbUsable;
Claus Gittinger <cg@exept.de>
parents:
1514
diff
changeset
|
2122 |
]. |
6d8e1461f119
removed unused: thumbUsable;
Claus Gittinger <cg@exept.de>
parents:
1514
diff
changeset
|
2123 |
|
1531
c5f2cfee9998
allow handleImage to be specified in styleSheet
Claus Gittinger <cg@exept.de>
parents:
1518
diff
changeset
|
2124 |
HandleImage notNil ifTrue:[ |
2321 | 2125 |
shadowForm := HandleImage onDevice:device. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2126 |
] ifFalse:[ |
2321 | 2127 |
nm = #next ifTrue:[ |
2128 |
shadowForm := self class handleShadowFormOn:device. |
|
2129 |
lightForm := self class handleLightFormOn:device |
|
2130 |
] ifFalse:[ |
|
2131 |
shadowForm := lightForm := nil |
|
2132 |
]. |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2133 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2134 |
drawableId notNil ifTrue:[ |
2321 | 2135 |
self computeThumbFrame |
1794 | 2136 |
]. |
2137 |
||
2138 |
autoRepeat := styleSheet at:#'scroller.autoRepeat' default:true. |
|
2514
cf29e8120cad
care for initialRepeat time in autopager
Claus Gittinger <cg@exept.de>
parents:
2509
diff
changeset
|
2139 |
initialRepeatDelay := styleSheet at:#'scroller.initialRepeatDelay' default:0.3. |
2321 | 2140 |
repeatDelay := styleSheet at:#'scroller.repeatDelay' default:0.15. |
483
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
2141 |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2142 |
"Modified: / 5.9.1998 / 20:21:41 / cg" |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2143 |
! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2144 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2145 |
initialize |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2146 |
"initialize - setup instvars from defaults" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2147 |
|
1768 | 2148 |
orientation isNil ifTrue:[orientation := #vertical]. |
453
dc035dd8b9eb
oops - checked in corrupted files
Claus Gittinger <cg@exept.de>
parents:
452
diff
changeset
|
2149 |
|
1768 | 2150 |
super initialize. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2151 |
|
1652 | 2152 |
scrolling := entered := false. |
2153 |
enabled := synchronousOperation := true. |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2154 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2155 |
thumbOrigin := 0. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2156 |
thumbHeight := 100. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2157 |
thumbFrameSizeDifference := 0. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2158 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2159 |
rangeStart := 0. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2160 |
rangeEnd := 100. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2161 |
rangeStep := nil. "/ meaning: arbitrary precision |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2162 |
"/ inset := 1. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2163 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2164 |
"/ self computeThumbFrame |
483
368b5f8862b1
added scrollToBeginning/scrollToEnd & enteredColor stuff (for SGI)
Claus Gittinger <cg@exept.de>
parents:
454
diff
changeset
|
2165 |
|
1768 | 2166 |
"Modified: / 7.3.1999 / 00:07:32 / cg" |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2167 |
! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2168 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2169 |
realize |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2170 |
super realize. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2171 |
model notNil ifTrue:[ |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2172 |
self thumbOrigin:(model value). |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2173 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2174 |
! ! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2175 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2176 |
!Scroller methodsFor:'private'! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2177 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2178 |
absFromPercent:percent |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2179 |
"given a percentage, compute number of pixels" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2180 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2181 |
|fullSize| |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2182 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2183 |
(orientation == #vertical) ifTrue:[ |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2184 |
fullSize := height |
446 | 2185 |
] ifFalse:[ |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2186 |
fullSize := width |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2187 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2188 |
|
1115 | 2189 |
"/ avoid hitting the boundary if no frame and no level (i.e. st80 style) |
2190 |
(thumbLevel == 0 and:[thumbFrameColor isNil]) ifTrue:[ |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2191 |
fullSize := fullSize - 1 |
1115 | 2192 |
]. |
2193 |
||
2194 |
^ ((percent * (fullSize - thumbFrameSizeDifference - (margin * 2))) / 100) rounded |
|
2195 |
||
2196 |
"Modified: 7.3.1997 / 16:05:57 / cg" |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2197 |
! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2198 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2199 |
computeThumbFrame |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2200 |
"compute the thumbs frame (a rectangle) whenever thumb is moved, |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2201 |
changed height or the scrollers size has changed. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2202 |
We take care, that the thumb will not become too small (i.e. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2203 |
invisible or uncatchable). |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2204 |
Also, for mswindows style, its height/width is constant." |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2205 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2206 |
|newPos1 newPos2 newSize1 newSize2 nh nw ny nx |
2177
f554919e10ab
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2176
diff
changeset
|
2207 |
computedSize minSz sz1 sz2 nb nr| |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2208 |
|
2178
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
2209 |
thumbHeight >= 100 ifTrue:[ |
2342 | 2210 |
self thumbOrigin ~= 0.0 ifTrue:[ |
2211 |
self thumbOrigin:0 |
|
2212 |
]. |
|
2213 |
||
2178
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
2214 |
thumbFrame := nil. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
2215 |
^ self |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
2216 |
]. |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
2217 |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2218 |
"compute position & size" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2219 |
newPos1 := (self absFromPercent:thumbOrigin) + margin. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2220 |
newSize1 := computedSize := self absFromPercent:thumbHeight. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2221 |
(orientation == #vertical) ifTrue:[ |
2171 | 2222 |
sz1 := height. |
2223 |
sz2 := width |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2224 |
] ifFalse:[ |
2171 | 2225 |
sz1 := width. |
2226 |
sz2 := height |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2227 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2228 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2229 |
" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2230 |
do we have to adjust the computed size ? |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2231 |
" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2232 |
newPos2 := margin + inset. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2233 |
newSize2 := sz2 - (2 * newPos2). |
1662
1b1401869566
make certain thumb is visible (at least 2 pixels wide)
Claus Gittinger <cg@exept.de>
parents:
1657
diff
changeset
|
2234 |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2235 |
"/ (style ~~ #normal) ifTrue:[ |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2236 |
thumbLevel ~~ 0 ifTrue:[ |
2171 | 2237 |
" |
2238 |
do not make thumb too small (for handle & to be catchable) |
|
2239 |
" |
|
2609 | 2240 |
minSz := MinThumbSize "10" + (2 * thumbLevel) |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2241 |
] ifFalse:[ |
2171 | 2242 |
" |
2243 |
do not make thumb too small (uncatchable) |
|
2244 |
" |
|
2609 | 2245 |
minSz := MinThumbSize "4" |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2246 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2247 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2248 |
(newSize1 < minSz) ifTrue:[ |
2171 | 2249 |
newSize1 := minSz. |
2250 |
thumbFrameSizeDifference := newSize1 - computedSize |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2251 |
] ifFalse:[ |
2171 | 2252 |
thumbFrameSizeDifference := 0. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2253 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2254 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2255 |
fixThumbHeight ifTrue:[ |
2171 | 2256 |
"have a fix-size thumb (i.e. mswindows style)" |
2257 |
||
2258 |
newSize1 := sz2 - (2 * inset). "make it square" |
|
2259 |
thumbImage notNil ifTrue:[ |
|
2260 |
newSize1 := (newSize1 max:(thumbImage height)) max:(thumbImage width) |
|
2261 |
]. |
|
2262 |
thumbFrameSizeDifference := newSize1 - computedSize. |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2263 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2264 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2265 |
" |
2171 | 2266 |
oops - if height does not reflect real visibible area, we have to adjust the origin |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2267 |
" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2268 |
(thumbFrameSizeDifference == 0) ifFalse:[ |
2171 | 2269 |
newPos1 := (self absFromPercent:thumbOrigin) + margin. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2270 |
"/ newPos1 := ((thumbOrigin * (sz1 - thumbFrameSizeDifference - (margin * 2))) / 100) rounded + margin |
446 | 2271 |
]. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2272 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2273 |
(orientation == #vertical) ifTrue:[ |
2178
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
2274 |
ny := newPos1 max:margin. |
2171 | 2275 |
nx := newPos2. |
2276 |
nh := newSize1. |
|
2277 |
nw := newSize2 max:2. |
|
2178
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
2278 |
ny + nh >= (height - margin) ifTrue:[ |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
2279 |
ny := (height - 1 - margin - nh) max:margin. |
2171 | 2280 |
]. |
2281 |
(nx+nw) >= width ifTrue:[ |
|
2282 |
nx := ((width - nw) // 2) max:0. |
|
2283 |
]. |
|
2177
f554919e10ab
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2176
diff
changeset
|
2284 |
|
f554919e10ab
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2176
diff
changeset
|
2285 |
nb := ny + nh - 1. |
f554919e10ab
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2176
diff
changeset
|
2286 |
nb >= (height - margin) ifTrue:[ |
f554919e10ab
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2176
diff
changeset
|
2287 |
ny <= margin ifTrue:[ |
f554919e10ab
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2176
diff
changeset
|
2288 |
thumbFrame := nil. |
f554919e10ab
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2176
diff
changeset
|
2289 |
^ self |
f554919e10ab
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2176
diff
changeset
|
2290 |
] |
f554919e10ab
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2176
diff
changeset
|
2291 |
]. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2292 |
] ifFalse:[ |
2178
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
2293 |
nx := newPos1 max:margin. |
2171 | 2294 |
ny := newPos2. |
2295 |
nw := newSize1. |
|
2296 |
nh := newSize2 max:2. |
|
2178
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
2297 |
nx + nw >= (width - margin) ifTrue:[ |
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
2298 |
nx := (width - 1 - margin - nw) max:margin. |
2171 | 2299 |
]. |
2300 |
(ny+nh) >= height ifTrue:[ |
|
2301 |
ny := ((height - nh) // 2) max:0. |
|
2302 |
]. |
|
2177
f554919e10ab
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2176
diff
changeset
|
2303 |
nr := nx + nw - 1. |
f554919e10ab
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2176
diff
changeset
|
2304 |
nr >= (width - margin) ifTrue:[ |
f554919e10ab
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2176
diff
changeset
|
2305 |
nx <= margin ifTrue:[ |
f554919e10ab
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2176
diff
changeset
|
2306 |
thumbFrame := nil. |
f554919e10ab
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2176
diff
changeset
|
2307 |
^ self |
f554919e10ab
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2176
diff
changeset
|
2308 |
] |
f554919e10ab
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2176
diff
changeset
|
2309 |
]. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2310 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2311 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2312 |
" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2313 |
do not create new Rectangle if its the same anyway |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2314 |
" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2315 |
thumbFrame notNil ifTrue:[ |
2171 | 2316 |
(ny == thumbFrame top) ifTrue:[ |
2317 |
(nx == thumbFrame left) ifTrue:[ |
|
2318 |
(nh == thumbFrame height) ifTrue:[ |
|
2319 |
(nw == thumbFrame width) ifTrue:[ ^ self] |
|
2320 |
] |
|
2321 |
] |
|
2322 |
] |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2323 |
]. |
2177
f554919e10ab
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2176
diff
changeset
|
2324 |
|
2178
ba7c746da7c9
invalidation when size changes and thumbHeight becomes >= 100
Claus Gittinger <cg@exept.de>
parents:
2177
diff
changeset
|
2325 |
thumbFrame := Rectangle left:nx top:ny width:nw height:nh. |
1518
6d8e1461f119
removed unused: thumbUsable;
Claus Gittinger <cg@exept.de>
parents:
1514
diff
changeset
|
2326 |
|
6d8e1461f119
removed unused: thumbUsable;
Claus Gittinger <cg@exept.de>
parents:
1514
diff
changeset
|
2327 |
"Modified: / 12.5.1998 / 20:58:51 / cg" |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2328 |
! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2329 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2330 |
percentFromAbs:absValue |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2331 |
"given a number of pixels, compute percentage" |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2332 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2333 |
|fullSize val t| |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2334 |
|
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2335 |
(orientation == #vertical) ifTrue:[ |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2336 |
fullSize := height |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2337 |
] ifFalse:[ |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2338 |
fullSize := width |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2339 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2340 |
|
1283 | 2341 |
absValue < 0 ifTrue:[^ rangeStart]. |
2342 |
absValue > fullSize ifTrue:[^ rangeEnd]. |
|
2343 |
||
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2344 |
t := fullSize - thumbFrameSizeDifference - (margin * 2). |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2345 |
t = 0 ifTrue:[ |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2346 |
"/ in rare cases, this happens ... |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2347 |
val := 0 |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2348 |
] ifFalse:[ |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2349 |
val := absValue / t * (rangeEnd - rangeStart). |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2350 |
]. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2351 |
val := val + rangeStart. |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2352 |
|
1424
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
2353 |
rangeStart < rangeEnd ifTrue:[ |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2354 |
val < rangeStart ifTrue:[^ rangeStart]. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2355 |
val > rangeEnd ifTrue:[^ rangeEnd]. |
1424
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
2356 |
] ifFalse:[ |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2357 |
val > rangeStart ifTrue:[^ rangeStart]. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2358 |
val < rangeEnd ifTrue:[^ rangeEnd]. |
1424
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
2359 |
]. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2360 |
^ val |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2361 |
|
1424
e90680159109
handle rangeStart > rangeEnd;
Claus Gittinger <cg@exept.de>
parents:
1420
diff
changeset
|
2362 |
"Modified: / 21.1.1998 / 19:31:15 / cg" |
1652 | 2363 |
! |
2364 |
||
1799
7d3daeab6afe
fixed shift-scroll-motion (scrollOffset)
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
2365 |
startMove |
7d3daeab6afe
fixed shift-scroll-motion (scrollOffset)
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
2366 |
originBeforeMove := self thumbOrigin. |
7d3daeab6afe
fixed shift-scroll-motion (scrollOffset)
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
2367 |
|
7d3daeab6afe
fixed shift-scroll-motion (scrollOffset)
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
2368 |
(ghostColor notNil |
7d3daeab6afe
fixed shift-scroll-motion (scrollOffset)
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
2369 |
or:[ghostFrameColor notNil |
7d3daeab6afe
fixed shift-scroll-motion (scrollOffset)
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
2370 |
or:[ghostLevel ~~ 0]]) ifTrue:[ |
2010 | 2371 |
thumbFrame isNil ifTrue:[ |
2372 |
self computeThumbFrame. |
|
2373 |
]. |
|
2374 |
frameBeforeMove := thumbFrame insetBy:1@1 |
|
1799
7d3daeab6afe
fixed shift-scroll-motion (scrollOffset)
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
2375 |
]. |
7d3daeab6afe
fixed shift-scroll-motion (scrollOffset)
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
2376 |
|
7d3daeab6afe
fixed shift-scroll-motion (scrollOffset)
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
2377 |
! |
7d3daeab6afe
fixed shift-scroll-motion (scrollOffset)
Claus Gittinger <cg@exept.de>
parents:
1794
diff
changeset
|
2378 |
|
1652 | 2379 |
updateBackground |
2380 |
"make my background grey, whenever either readOnly or disable" |
|
2381 |
||
1731 | 2382 |
|bg| |
2383 |
||
2032
9807d0681551
bugfix (DefaultBackground is nil in iris style) for updateBackground
ah
parents:
2010
diff
changeset
|
2384 |
enabled ifTrue:[ |
9807d0681551
bugfix (DefaultBackground is nil in iris style) for updateBackground
ah
parents:
2010
diff
changeset
|
2385 |
bg := DefaultViewBackground. |
9807d0681551
bugfix (DefaultBackground is nil in iris style) for updateBackground
ah
parents:
2010
diff
changeset
|
2386 |
]. |
9807d0681551
bugfix (DefaultBackground is nil in iris style) for updateBackground
ah
parents:
2010
diff
changeset
|
2387 |
bg isNil ifTrue:[ |
9807d0681551
bugfix (DefaultBackground is nil in iris style) for updateBackground
ah
parents:
2010
diff
changeset
|
2388 |
bg := View defaultViewBackgroundColor. |
1652 | 2389 |
]. |
1731 | 2390 |
|
2391 |
bg ~= viewBackground ifTrue:[ |
|
2032
9807d0681551
bugfix (DefaultBackground is nil in iris style) for updateBackground
ah
parents:
2010
diff
changeset
|
2392 |
self backgroundColor:bg. |
9807d0681551
bugfix (DefaultBackground is nil in iris style) for updateBackground
ah
parents:
2010
diff
changeset
|
2393 |
self invalidate |
1731 | 2394 |
] |
2032
9807d0681551
bugfix (DefaultBackground is nil in iris style) for updateBackground
ah
parents:
2010
diff
changeset
|
2395 |
|
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2396 |
! ! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2397 |
|
2742 | 2398 |
!Scroller methodsFor:'private-scrollbar & scrollview interface'! |
454 | 2399 |
|
2400 |
setThumbFor:aView |
|
2401 |
"get contents and size info from aView and adjust thumb" |
|
2402 |
||
1962 | 2403 |
|percentSize percentOrigin contentsSize contentsPosition viewsSize t| |
454 | 2404 |
|
1432 | 2405 |
scrolling ifTrue:[self invalidate]. |
2406 |
||
454 | 2407 |
" |
2408 |
get the content's size |
|
2409 |
" |
|
2410 |
aView isNil ifTrue:[ |
|
2010 | 2411 |
contentsSize := 0 |
454 | 2412 |
] ifFalse:[ |
2010 | 2413 |
orientation == #vertical ifTrue:[ |
2414 |
contentsSize := aView heightOfContents. |
|
2415 |
(t := aView transformation) notNil ifTrue:[ |
|
2416 |
contentsSize := t applyScaleY:contentsSize. |
|
2417 |
]. |
|
2418 |
] ifFalse:[ |
|
2419 |
contentsSize := aView widthOfContents. |
|
2420 |
(t := aView transformation) notNil ifTrue:[ |
|
2421 |
contentsSize := t applyScaleX:contentsSize. |
|
2422 |
]. |
|
2423 |
] |
|
454 | 2424 |
]. |
2425 |
||
2426 |
(contentsSize = 0) ifTrue:[ |
|
2010 | 2427 |
percentSize := 100. |
2428 |
percentOrigin := 100 |
|
454 | 2429 |
] ifFalse:[ |
2010 | 2430 |
(orientation == #vertical) ifTrue:[ |
2431 |
viewsSize := aView innerHeight. |
|
2432 |
contentsPosition := aView yOriginOfContents. |
|
2433 |
] ifFalse:[ |
|
2434 |
viewsSize := aView innerWidth. |
|
2435 |
contentsPosition := aView xOriginOfContents |
|
2436 |
]. |
|
2437 |
||
2438 |
percentSize := viewsSize * 100.0 / contentsSize. |
|
2439 |
percentOrigin := contentsPosition * 100.0 / contentsSize. |
|
2440 |
percentOrigin + percentSize > 100.0 ifTrue:[ |
|
2441 |
"actually showing stuff below contents of view" |
|
454 | 2442 |
" |
2010 | 2443 |
contentsSize := contentsPosition + aView innerHeight. |
2444 |
percentSize := viewsSize * 100.0 / contentsSize. |
|
2445 |
percentOrigin := contentsPosition * 100.0 / contentsSize |
|
454 | 2446 |
" |
2010 | 2447 |
] |
454 | 2448 |
]. |
2449 |
(percentSize = thumbHeight) ifTrue:[ |
|
2010 | 2450 |
self thumbOrigin:percentOrigin |
454 | 2451 |
] ifFalse:[ |
2010 | 2452 |
(percentOrigin = thumbOrigin) ifTrue:[ |
2453 |
self thumbHeight:percentSize |
|
2454 |
] ifFalse:[ |
|
2455 |
self thumbOrigin:percentOrigin thumbHeight:percentSize |
|
2456 |
] |
|
454 | 2457 |
] |
2458 |
! |
|
2459 |
||
2460 |
setThumbHeightFor:aView |
|
2461 |
"get contents and size info from aView and adjust thumb height" |
|
2462 |
||
2463 |
|percent total viewsSize| |
|
2464 |
||
1432 | 2465 |
scrolling ifTrue:[self invalidate]. |
2466 |
||
454 | 2467 |
(orientation == #vertical) ifTrue:[ |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2468 |
total := aView heightOfContents. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2469 |
aView transformation notNil ifTrue:[ |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2470 |
total := aView transformation applyScaleY:total. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2471 |
]. |
454 | 2472 |
] ifFalse:[ |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2473 |
total := aView widthOfContents. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2474 |
aView transformation notNil ifTrue:[ |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2475 |
total := aView transformation applyScaleX:total. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2476 |
]. |
454 | 2477 |
]. |
2478 |
(total = 0) ifTrue:[ |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2479 |
percent := 100 |
454 | 2480 |
] ifFalse:[ |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2481 |
viewsSize := (orientation == #vertical) ifTrue:[aView innerHeight] |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2482 |
ifFalse:[aView innerWidth]. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2483 |
percent := viewsSize * 100.0 / total |
454 | 2484 |
]. |
2485 |
self thumbHeight:percent |
|
2486 |
! |
|
2487 |
||
2488 |
setThumbOriginFor:aView |
|
2489 |
"get contents and size info from aView and adjust thumb origin" |
|
2490 |
||
2491 |
|percent total contentsPosition| |
|
2492 |
||
1432 | 2493 |
scrolling ifTrue:[self invalidate]. |
2494 |
||
454 | 2495 |
(orientation == #vertical) ifTrue:[ |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2496 |
total := aView heightOfContents. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2497 |
aView transformation notNil ifTrue:[ |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2498 |
total := aView transformation applyScaleY:total. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2499 |
]. |
454 | 2500 |
] ifFalse:[ |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2501 |
total := aView widthOfContents. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2502 |
aView transformation notNil ifTrue:[ |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2503 |
total := aView transformation applyScaleX:total. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2504 |
]. |
454 | 2505 |
]. |
2506 |
(total = 0) ifTrue:[ |
|
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2507 |
percent := 100 |
454 | 2508 |
] ifFalse:[ |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2509 |
contentsPosition := (orientation == #vertical) ifTrue:[aView yOriginOfContents] |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2510 |
ifFalse:[aView xOriginOfContents]. |
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2511 |
percent := contentsPosition * 100.0 / total |
454 | 2512 |
]. |
2513 |
self thumbOrigin:percent |
|
2514 |
! ! |
|
2515 |
||
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2516 |
!Scroller methodsFor:'queries'! |
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2517 |
|
2358 | 2518 |
isScrolling |
2519 |
"true, if thumb is being moved (by user)" |
|
2520 |
||
2521 |
^ scrolling |
|
2522 |
! |
|
2523 |
||
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2524 |
preferredExtent |
572 | 2525 |
"return my preferredExtent" |
2526 |
||
538
b747ea31b972
use common code for H/V scrollers
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
2527 |
|defExt w h| |
b747ea31b972
use common code for H/V scrollers
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
2528 |
|
797 | 2529 |
"/ If I have an explicit preferredExtent .. |
2530 |
||
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
709
diff
changeset
|
2531 |
preferredExtent notNil ifTrue:[ |
2010 | 2532 |
^ preferredExtent |
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
709
diff
changeset
|
2533 |
]. |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
709
diff
changeset
|
2534 |
|
538
b747ea31b972
use common code for H/V scrollers
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
2535 |
defExt := self class defaultExtent. |
452
f255470106c4
oops - last checkin was bogus
Claus Gittinger <cg@exept.de>
parents:
448
diff
changeset
|
2536 |
|
538
b747ea31b972
use common code for H/V scrollers
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
2537 |
orientation == #vertical ifTrue:[ |
2010 | 2538 |
h := defExt y. |
2539 |
(w := DefaultVScrollerWidth) isNil ifTrue:[ |
|
2540 |
w := (device horizontalPixelPerMillimeter asFloat * 5) rounded |
|
2541 |
] |
|
538
b747ea31b972
use common code for H/V scrollers
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
2542 |
] ifFalse:[ |
2010 | 2543 |
w := defExt x. |
2544 |
(h := DefaultHScrollerHeight) isNil ifTrue:[ |
|
2545 |
h := (device verticalPixelPerMillimeter asFloat * 5) rounded |
|
2546 |
] |
|
538
b747ea31b972
use common code for H/V scrollers
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
2547 |
]. |
b747ea31b972
use common code for H/V scrollers
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
2548 |
|
786
8b301af1cdcc
remember and do not recompute the preferredExtent;
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
2549 |
preferredExtent := w @ h. |
8b301af1cdcc
remember and do not recompute the preferredExtent;
Claus Gittinger <cg@exept.de>
parents:
767
diff
changeset
|
2550 |
^ preferredExtent. |
538
b747ea31b972
use common code for H/V scrollers
Claus Gittinger <cg@exept.de>
parents:
507
diff
changeset
|
2551 |
|
1886 | 2552 |
"Modified: / 28.4.1999 / 18:28:19 / cg" |
1122 | 2553 |
! |
2554 |
||
1518
6d8e1461f119
removed unused: thumbUsable;
Claus Gittinger <cg@exept.de>
parents:
1514
diff
changeset
|
2555 |
thumbVisible |
1122 | 2556 |
"return true, if the thumb is usable i.e. its visible & movable. |
1518
6d8e1461f119
removed unused: thumbUsable;
Claus Gittinger <cg@exept.de>
parents:
1514
diff
changeset
|
2557 |
Can be used by the scrollBar to decide if it should hide the scroller." |
6d8e1461f119
removed unused: thumbUsable;
Claus Gittinger <cg@exept.de>
parents:
1514
diff
changeset
|
2558 |
|
6d8e1461f119
removed unused: thumbUsable;
Claus Gittinger <cg@exept.de>
parents:
1514
diff
changeset
|
2559 |
|m2| |
1122 | 2560 |
|
2561 |
(thumbHeight >= 100) ifTrue:[^ false]. |
|
2562 |
self computeThumbFrame. |
|
2563 |
thumbFrame isNil ifTrue:[^ false]. |
|
2564 |
||
1518
6d8e1461f119
removed unused: thumbUsable;
Claus Gittinger <cg@exept.de>
parents:
1514
diff
changeset
|
2565 |
m2 := margin * 2. |
1122 | 2566 |
orientation == #vertical ifTrue:[ |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2567 |
thumbFrame height >= (height - m2) ifTrue:[^ false]. |
1122 | 2568 |
] ifFalse:[ |
1657
4ae7bf80d51a
use #onDevice: instead of #on:
Claus Gittinger <cg@exept.de>
parents:
1652
diff
changeset
|
2569 |
thumbFrame width >= (width - m2) ifTrue:[^ false]. |
1122 | 2570 |
]. |
2571 |
^ true |
|
2572 |
||
1518
6d8e1461f119
removed unused: thumbUsable;
Claus Gittinger <cg@exept.de>
parents:
1514
diff
changeset
|
2573 |
"Created: / 7.3.1997 / 21:10:23 / cg" |
6d8e1461f119
removed unused: thumbUsable;
Claus Gittinger <cg@exept.de>
parents:
1514
diff
changeset
|
2574 |
"Modified: / 12.5.1998 / 20:21:00 / cg" |
2383 | 2575 |
! |
2576 |
||
2577 |
verticalScrollStep |
|
2384 | 2578 |
"mouse wheel: scroll by keyboardStep or a quarter of a page |
2383 | 2579 |
Note: this is used for horizontal scrollers, too" |
2580 |
||
2384 | 2581 |
^ (keyboardStep ? (thumbHeight / 4)) max:1 |
446 | 2582 |
! ! |
2583 |
||
897 | 2584 |
!Scroller class methodsFor:'documentation'! |
105 | 2585 |
|
205 | 2586 |
version |
3017 | 2587 |
^ '$Header: /cvs/stx/stx/libwidg/Scroller.st,v 1.167 2004-09-13 15:04:12 ca Exp $' |
105 | 2588 |
! ! |