[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NS port horizontal scroll-bars
From: |
YAMAMOTO Mitsuharu |
Subject: |
Re: NS port horizontal scroll-bars |
Date: |
Tue, 26 Apr 2016 20:27:35 +0900 |
User-agent: |
Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) |
>>>>> On Tue, 26 Apr 2016 10:51:57 +0100, Alan Third <address@hidden> said:
> It's actually the other end of the process that I'm struggling
> with. I write pixel values for dragging the scroll-bar into an
> emacs_event struct (location of mouse in scroll-bar and total length
> of scroll-bar), and when that data pops back out in scroll-bar.el it
> doesn't seem to be any use to the standard scroll-bar functions.
Ah, that reminds me of something. You can see how the Mac port
handles that (in the `work' branch based on Emacs 25.0.93 pretest).
https://bitbucket.org/mituharu/emacs-mac/src/472fe59bac472a9076cbb6e86e0ea92908f7b78d/src/macappkit.m?at=work&fileviewer=file-view-default#macappkit.m-6002
6690 if (bar->horizontal && whole > 0)
6691 {
6692 /* The default horizontal scroll bar drag handler assumes
6693 previously-set `whole' value to be preserved and doesn't
6694 want overscrolling. */
6695 int position = lround (whole * minEdge / maximum);
6696
6697 if (position > whole - portion)
6698 position = whole - portion;
6699 XSETINT (inputEvent.x, position);
6700 XSETINT (inputEvent.y, whole);
6701 }
6702 else
6703 {
6704 XSETINT (inputEvent.x, minEdge);
6705 XSETINT (inputEvent.y, maximum);
6706 }
6707 }
> The vertical scroll-bars in the NS port have their own functions
> defined in ns-win.el, rather than using the functions in
> scroll-bar.el. I think this is, at least in part, to enable clicking
> directional arrows in older versions of OS X (and GNUSTEP), but it's
> doing something different with dragging too.
The Mac port (and its predecessors) has been using the standard
toolkit scroll bar handler in scroll-bar.el as it is, and there has
been no problem even in the old OS X versions having the directional
arrows.
YAMAMOTO Mitsuharu
address@hidden