From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
To: Alan Third <alan@idiocy.org>
Cc: martin rudalics <rudalics@gmx.at>,
Anders Lindgren <andlind@gmail.com>,
emacs-devel <emacs-devel@gnu.org>
Subject: Re: NS port horizontal scroll-bars
Date: Tue, 26 Apr 2016 20:27:35 +0900 [thread overview]
Message-ID: <wltwiofw48.wl%mituharu@math.s.chiba-u.ac.jp> (raw)
In-Reply-To: <CABGBtwmv1Z_djf8i2a0Qr0TS+=CFy0naoSDwBxSOGVbZ06xTMw@mail.gmail.com>
>>>>> On Tue, 26 Apr 2016 10:51:57 +0100, Alan Third <alan@idiocy.org> 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
mituharu@math.s.chiba-u.ac.jp
next prev parent reply other threads:[~2016-04-26 11:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-24 16:01 NS port horizontal scroll-bars Alan Third
2016-04-24 17:28 ` Anders Lindgren
2016-04-25 20:34 ` Alan Third
2016-04-26 5:39 ` Anders Lindgren
2016-04-26 6:35 ` martin rudalics
2016-04-26 9:51 ` Alan Third
2016-04-26 11:27 ` YAMAMOTO Mitsuharu [this message]
2016-04-26 17:07 ` Alan Third
-- strict thread matches above, loose matches on Subject: below --
2016-05-01 14:40 Angelo Graziosi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=wltwiofw48.wl%mituharu@math.s.chiba-u.ac.jp \
--to=mituharu@math.s.chiba-u.ac.jp \
--cc=alan@idiocy.org \
--cc=andlind@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=rudalics@gmx.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.