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