Mercurial > hg > xemacs-beta
comparison src/scrollbar-msw.c @ 707:a307f9a2021d
[xemacs-hg @ 2001-12-20 05:49:28 by andyp]
sync with 21-4-6-windows
author | andyp |
---|---|
date | Thu, 20 Dec 2001 05:49:48 +0000 |
parents | 685b588e92d8 |
children | 943eaba38521 |
comparison
equal
deleted
inserted
replaced
706:c9bf82d465b5 | 707:a307f9a2021d |
---|---|
328 mswindows_handle_mousewheel_event (Lisp_Object frame, int keys, int delta, | 328 mswindows_handle_mousewheel_event (Lisp_Object frame, int keys, int delta, |
329 POINTS where) | 329 POINTS where) |
330 { | 330 { |
331 int hasVertBar, hasHorzBar; /* Indicates presence of scroll bars */ | 331 int hasVertBar, hasHorzBar; /* Indicates presence of scroll bars */ |
332 unsigned wheelScrollLines = 0; /* Number of lines per wheel notch */ | 332 unsigned wheelScrollLines = 0; /* Number of lines per wheel notch */ |
333 Lisp_Object win; | 333 Lisp_Object win, corpore, sano; |
334 struct window_mirror *mirror; | 334 struct window_mirror *mirror; |
335 int mene, _mene, tekel, upharsin; | |
336 Charbpos mens, sana; | |
337 Charcount in; | |
338 struct window *needle_in_haystack = 0; | |
335 POINT donde_esta; | 339 POINT donde_esta; |
336 | 340 |
337 donde_esta.x = where.x; | 341 donde_esta.x = where.x; |
338 donde_esta.y = where.y; | 342 donde_esta.y = where.y; |
339 | 343 |
340 ScreenToClient (FRAME_MSWINDOWS_HANDLE (XFRAME (frame)), &donde_esta); | |
341 | |
342 /* Find the window to scroll */ | 344 /* Find the window to scroll */ |
343 { | 345 |
344 int mene, _mene, tekel, upharsin; | 346 /* The mouse event could actually occur outside of the emacs |
345 Charbpos mens, sana; | 347 frame. */ |
346 Charcount in; | 348 if (ScreenToClient (FRAME_MSWINDOWS_HANDLE (XFRAME (frame)), |
347 Lisp_Object corpore, sano; | 349 &donde_esta) != 0) |
348 struct window *needle_in_haystack; | 350 { |
349 | 351 /* stderr_out ("donde_esta: %d %d\n", donde_esta.x, donde_esta.y); */ |
350 pixel_to_glyph_translation (XFRAME (frame), donde_esta.x, donde_esta.y, | 352 pixel_to_glyph_translation (XFRAME (frame), donde_esta.x, donde_esta.y, |
351 &mene, &_mene, &tekel, &upharsin, | 353 &mene, &_mene, &tekel, &upharsin, |
352 &needle_in_haystack, | 354 &needle_in_haystack, |
353 &mens, &sana, &in, &corpore, &sano); | 355 &mens, &sana, &in, &corpore, &sano); |
354 | 356 |
355 if (needle_in_haystack) | 357 if (needle_in_haystack) |
356 { | 358 { |
357 XSETWINDOW (win, needle_in_haystack); | 359 XSETWINDOW (win, needle_in_haystack); |
358 } | 360 /* stderr_out ("found needle\n"); |
359 else | 361 debug_print (win); */ |
360 { | 362 } |
361 win = FRAME_SELECTED_WINDOW (XFRAME (frame)); | 363 } |
362 needle_in_haystack = XWINDOW (win); | 364 |
363 } | 365 if (!needle_in_haystack) |
364 | 366 { |
365 mirror = find_window_mirror (needle_in_haystack); | 367 win = FRAME_SELECTED_WINDOW (XFRAME (frame)); |
366 } | 368 needle_in_haystack = XWINDOW (win); |
369 } | |
370 | |
371 mirror = find_window_mirror (needle_in_haystack); | |
367 | 372 |
368 /* Check that there is something to scroll */ | 373 /* Check that there is something to scroll */ |
369 hasVertBar = can_scroll (mirror->scrollbar_vertical_instance); | 374 hasVertBar = can_scroll (mirror->scrollbar_vertical_instance); |
370 hasHorzBar = can_scroll (mirror->scrollbar_horizontal_instance); | 375 hasHorzBar = can_scroll (mirror->scrollbar_horizontal_instance); |
371 if (!hasVertBar && !hasHorzBar) | 376 if (!hasVertBar && !hasHorzBar) |