diff options
| author | Richard M. Stallman | 1996-05-11 18:38:11 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-05-11 18:38:11 +0000 |
| commit | 2c28562d019163fd47f84685d817e0c7205601e5 (patch) | |
| tree | cacfb638d53d2d3ff5bcedb49ca6487ee75966fd /src | |
| parent | aeee66be3b17c883ee754ba733b7c7850b297b7c (diff) | |
| download | emacs-2c28562d019163fd47f84685d817e0c7205601e5.tar.gz emacs-2c28562d019163fd47f84685d817e0c7205601e5.zip | |
(x_scroll_bar_set_handle): Always use start in calling SetScrollPos.
(x_scroll_bar_handle_click): In line up/down cases, don't alter y.
Don't call x_scroll_bar_set_handle.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32term.c | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/src/w32term.c b/src/w32term.c index a067830a42a..bde3a04986b 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -1923,9 +1923,7 @@ x_scroll_bar_set_handle (bar, start, end, rebuild) | |||
| 1923 | XSETINT (bar->start, start); | 1923 | XSETINT (bar->start, start); |
| 1924 | XSETINT (bar->end, end); | 1924 | XSETINT (bar->end, end); |
| 1925 | 1925 | ||
| 1926 | /* If we are less than half of the page use start otherwise use end */ | 1926 | SetScrollPos (w, SB_CTL, start, TRUE); |
| 1927 | |||
| 1928 | SetScrollPos (w, SB_CTL, ((start >> 1) < bar->height)?start:end, TRUE); | ||
| 1929 | 1927 | ||
| 1930 | UNBLOCK_INPUT; | 1928 | UNBLOCK_INPUT; |
| 1931 | } | 1929 | } |
| @@ -2138,6 +2136,7 @@ win32_judge_scroll_bars (f) | |||
| 2138 | 2136 | ||
| 2139 | This may be called from a signal handler, so we have to ignore GC | 2137 | This may be called from a signal handler, so we have to ignore GC |
| 2140 | mark bits. */ | 2138 | mark bits. */ |
| 2139 | |||
| 2141 | static int | 2140 | static int |
| 2142 | x_scroll_bar_handle_click (bar, msg, emacs_event) | 2141 | x_scroll_bar_handle_click (bar, msg, emacs_event) |
| 2143 | struct scroll_bar *bar; | 2142 | struct scroll_bar *bar; |
| @@ -2162,43 +2161,39 @@ x_scroll_bar_handle_click (bar, msg, emacs_event) | |||
| 2162 | int y = GetScrollPos ((HWND) msg->msg.lParam, SB_CTL); | 2161 | int y = GetScrollPos ((HWND) msg->msg.lParam, SB_CTL); |
| 2163 | 2162 | ||
| 2164 | switch (LOWORD (msg->msg.wParam)) | 2163 | switch (LOWORD (msg->msg.wParam)) |
| 2165 | { | 2164 | { |
| 2166 | case SB_THUMBTRACK: | 2165 | case SB_THUMBTRACK: |
| 2167 | emacs_event->part = scroll_bar_handle; | 2166 | emacs_event->part = scroll_bar_handle; |
| 2168 | if (VERTICAL_SCROLL_BAR_TOP_RANGE (XINT (bar->height)) <= 0xffff) | 2167 | if (VERTICAL_SCROLL_BAR_TOP_RANGE (XINT (bar->height)) <= 0xffff) |
| 2169 | y = HIWORD (msg->msg.wParam); | 2168 | y = HIWORD (msg->msg.wParam); |
| 2170 | break; | 2169 | break; |
| 2171 | case SB_LINEDOWN: | 2170 | case SB_LINEDOWN: |
| 2172 | emacs_event->part = scroll_bar_down_arrow; | 2171 | emacs_event->part = scroll_bar_down_arrow; |
| 2173 | if (y < top_range) y++; | ||
| 2174 | break; | 2172 | break; |
| 2175 | case SB_LINEUP: | 2173 | case SB_LINEUP: |
| 2176 | emacs_event->part = scroll_bar_up_arrow; | 2174 | emacs_event->part = scroll_bar_up_arrow; |
| 2177 | if (y) y--; | ||
| 2178 | break; | 2175 | break; |
| 2179 | case SB_PAGEUP: | 2176 | case SB_PAGEUP: |
| 2180 | emacs_event->part = scroll_bar_above_handle; | 2177 | emacs_event->part = scroll_bar_above_handle; |
| 2181 | break; | 2178 | break; |
| 2182 | case SB_PAGEDOWN: | 2179 | case SB_PAGEDOWN: |
| 2183 | emacs_event->part = scroll_bar_below_handle; | 2180 | emacs_event->part = scroll_bar_below_handle; |
| 2184 | break; | 2181 | break; |
| 2185 | case SB_TOP: | 2182 | case SB_TOP: |
| 2186 | emacs_event->part = scroll_bar_handle; | 2183 | emacs_event->part = scroll_bar_handle; |
| 2187 | y = 0; | 2184 | y = 0; |
| 2188 | break; | 2185 | break; |
| 2189 | case SB_BOTTOM: | 2186 | case SB_BOTTOM: |
| 2190 | emacs_event->part = scroll_bar_handle; | 2187 | emacs_event->part = scroll_bar_handle; |
| 2191 | y = top_range; | 2188 | y = top_range; |
| 2192 | break; | 2189 | break; |
| 2193 | case SB_THUMBPOSITION: | 2190 | case SB_THUMBPOSITION: |
| 2194 | emacs_event->part = scroll_bar_handle; | 2191 | emacs_event->part = scroll_bar_handle; |
| 2195 | break; | 2192 | break; |
| 2196 | case SB_ENDSCROLL: | 2193 | case SB_ENDSCROLL: |
| 2197 | default: | 2194 | default: |
| 2198 | return FALSE; | 2195 | return FALSE; |
| 2199 | } | 2196 | } |
| 2200 | |||
| 2201 | x_scroll_bar_set_handle (bar, y , y, 0); | ||
| 2202 | 2197 | ||
| 2203 | XSETINT (emacs_event->x, y); | 2198 | XSETINT (emacs_event->x, y); |
| 2204 | XSETINT (emacs_event->y, top_range); | 2199 | XSETINT (emacs_event->y, top_range); |