[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r102533: Fix and document components
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r102533: Fix and document components of mouse event position. |
Date: |
Fri, 26 Nov 2010 20:15:09 +0200 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 102533
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Fri 2010-11-26 20:15:09 +0200
message:
Fix and document components of mouse event position.
src/keyboard.c (make_lispy_position): Put a meaningful value in yret
when the click is on the header or mode line.
doc/lispref/commands.texi (Click Events): Document the values of X, Y and
COL, ROW in the event's position, when the click is on the header or
mode line, on the fringes, or in the margins.
modified:
doc/lispref/ChangeLog
doc/lispref/commands.texi
src/ChangeLog
src/keyboard.c
=== modified file 'doc/lispref/ChangeLog'
--- a/doc/lispref/ChangeLog 2010-11-18 03:54:14 +0000
+++ b/doc/lispref/ChangeLog 2010-11-26 18:15:09 +0000
@@ -1,3 +1,9 @@
+2010-11-26 Eli Zaretskii <address@hidden>
+
+ * commands.texi (Click Events): Document the values of X, Y and
+ COL, ROW in the event's position, when the click is on the header
+ or mode line, on the fringes, or in the margins.
+
2010-11-17 Eli Zaretskii <address@hidden>
* customize.texi (Composite Types): Lower-case index entry.
=== modified file 'doc/lispref/commands.texi'
--- a/doc/lispref/commands.texi 2010-08-20 20:07:29 +0000
+++ b/doc/lispref/commands.texi 2010-11-26 18:15:09 +0000
@@ -1285,8 +1285,12 @@
@item @var{x}, @var{y}
These are the pixel coordinates of the click, relative to
the top left corner of @var{window}, which is @code{(0 . 0)}.
-For the mode or header line, @var{y} does not have meaningful data.
-For the vertical line, @var{x} does not have meaningful data.
+For a click on text, these are relative to the top left corner of
+the window's text area. For the mode or header line, they are
+relative to the top left window edge. For fringes, margins, and the
+vertical border, @var{x} does not have meaningful data. For fringes
+and margins, @var{y} is relative to the bottom edge of the header
+line.
@item @var{timestamp}
This is the time at which the event occurred, in milliseconds.
@@ -1316,7 +1320,12 @@
@item @var{col}, @var{row}
These are the actual coordinates of the glyph under the @var{x},
@var{y} position, possibly padded with default character width
-glyphs if @var{x} is beyond the last glyph on the line.
+glyphs if @var{x} is beyond the last glyph on the line. For clicks on
+the header or mode line, these are measured from the top left edge of
+the header or mode line. For clicks on the fringes and on the
+vertical border, these have no meaningful data. For clicks on the
+margins, @var{col} is measured from the left edge of the margin area
+and @var{row} is measured from the top of the margin area.
@item @var{image}
This is the image object on which the click occurred. It is either
@@ -1333,7 +1342,7 @@
These are the pixel width and height of @var{object} or, if this is
@code{nil}, those of the character glyph clicked on.
@end table
-
+
@sp 1
For mouse clicks on a scroll-bar, @var{position} has this form:
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2010-11-25 20:28:14 +0000
+++ b/src/ChangeLog 2010-11-26 18:15:09 +0000
@@ -1,3 +1,8 @@
+2010-11-26 Eli Zaretskii <address@hidden>
+
+ * keyboard.c (make_lispy_position): Put a meaningful value in yret
+ when the click is on the header or mode line.
+
2010-11-25 Eli Zaretskii <address@hidden>
* xdisp.c (set_cursor_from_row): Don't forget to consider the
=== modified file 'src/keyboard.c'
--- a/src/keyboard.c 2010-11-20 14:51:25 +0000
+++ b/src/keyboard.c 2010-11-26 18:15:09 +0000
@@ -5283,9 +5283,9 @@
xret = XINT (x) - window_box_left (w, TEXT_AREA);
yret = wy - WINDOW_HEADER_LINE_HEIGHT (w);
}
- /* For mode line and header line clicks, return X relative to
- the left window edge; ignore Y. Use mode_line_string to look
- for a string on the click position. */
+ /* For mode line and header line clicks, return X, Y relative to
+ the left window edge. Use mode_line_string to look for a
+ string on the click position. */
else if (part == ON_MODE_LINE || part == ON_HEADER_LINE)
{
Lisp_Object string;
@@ -5305,6 +5305,7 @@
? PT : XMARKER (w->pointm)->charpos;
xret = wx;
+ yret = wy;
}
/* For fringes and margins, Y is relative to the area's (and the
window's) top edge, while X is meaningless. */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r102533: Fix and document components of mouse event position.,
Eli Zaretskii <=