aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm2004-01-06 23:21:00 +0000
committerKim F. Storm2004-01-06 23:21:00 +0000
commit0898832984d3d3d7762ea032581daed58b1583fa (patch)
treefc3ed95fa5e8a4c51a3660bf9d3bbb1a351fb3a5
parent4385264a7d76a470557075c8bc283079c9e28ab6 (diff)
downloademacs-0898832984d3d3d7762ea032581daed58b1583fa.tar.gz
emacs-0898832984d3d3d7762ea032581daed58b1583fa.zip
(Click Events): Describe new image and
width/height elements of click events. (Accessing Events): Add posn-string, posn-image, and posn-object-width-height. Change posn-object to return either image or string object.
-rw-r--r--lispref/commands.texi44
1 files changed, 34 insertions, 10 deletions
diff --git a/lispref/commands.texi b/lispref/commands.texi
index a8350b88d82..90ac28f845e 100644
--- a/lispref/commands.texi
+++ b/lispref/commands.texi
@@ -1156,7 +1156,8 @@ the marginal areas, @var{position} has this form:
1156 1156
1157@example 1157@example
1158(@var{window} @var{pos-or-area} (@var{x} . @var{y}) @var{timestamp} 1158(@var{window} @var{pos-or-area} (@var{x} . @var{y}) @var{timestamp}
1159 @var{object} @var{text-pos} (@var{col} . @var{row}) (@var{dx} . @var{dy})) 1159 @var{object} @var{text-pos} (@var{col} . @var{row})
1160 @var{image} (@var{dx} . @var{dy}) (@var{width} . @var{height}))
1160@end example 1161@end example
1161 1162
1162@table @asis 1163@table @asis
@@ -1181,10 +1182,9 @@ This is the time at which the event occurred, in milliseconds.
1181 1182
1182@item @var{object} 1183@item @var{object}
1183This is the object on which the click occurred. It is either 1184This is the object on which the click occurred. It is either
1184@code{nil} if there is no string property or image at the position 1185@code{nil} if there is no string property, or it has the form
1185clicked on, or it has the form (@var{string} . @var{string-pos}) when 1186(@var{string} . @var{string-pos}) when there is a string-type text
1186there is a string-type text property at the click position, or it is 1187property at the click position.
1187an image object as returned by @code{find-image} if click was in an image.
1188 1188
1189@item @var{string} 1189@item @var{string}
1190This is the string on which the click occurred, including any 1190This is the string on which the click occurred, including any
@@ -1205,6 +1205,11 @@ These are the actual coordinates of the glyph under the @var{x},
1205@var{y} position, possibly padded with default character width 1205@var{y} position, possibly padded with default character width
1206glyphs if @var{x} is beyond the last glyph on the line. 1206glyphs if @var{x} is beyond the last glyph on the line.
1207 1207
1208@item @var{image}
1209This is the image object on which the click occurred. It is either
1210@code{nil} if there is no image at the position clicked on, or it is
1211an image object as returned by @code{find-image} if click was in an image.
1212
1208@item @var{dx}, @var{dy} 1213@item @var{dx}, @var{dy}
1209These are the pixel-denominated coordinates of the click, relative to 1214These are the pixel-denominated coordinates of the click, relative to
1210the top left corner of @var{object}, which is @code{(0 . 0)}. If 1215the top left corner of @var{object}, which is @code{(0 . 0)}. If
@@ -1669,7 +1674,8 @@ mouse-button event, as a list of this form:
1669 1674
1670@example 1675@example
1671(@var{window} @var{pos-or-area} (@var{x} . @var{y}) @var{timestamp} 1676(@var{window} @var{pos-or-area} (@var{x} . @var{y}) @var{timestamp}
1672 @var{object} @var{text-pos} (@var{col} . @var{row}) (@var{dx} . @var{dy})) 1677 @var{object} @var{text-pos} (@var{col} . @var{row})
1678 @var{image} (@var{dx} . @var{dy}) (@var{width} . @var{height}))
1673@end example 1679@end example
1674 1680
1675@defun event-start event 1681@defun event-start event
@@ -1730,15 +1736,33 @@ in the window, and the actual character number in that row. Return
1730case, @code{posn-col-row} can be used to get approximate values. 1736case, @code{posn-col-row} can be used to get approximate values.
1731@end defun 1737@end defun
1732 1738
1739@defun posn-string position
1740Return the string object in @var{position}, either @code{nil}, or a
1741cons cell @code{(@var{string} . @var{string-pos})}.
1742@end defun
1743
1744@defun posn-image position
1745Return the image object in @var{position}, either @code{nil}, or an
1746image @code{(image ...)}.
1747@end defun
1748
1733@defun posn-object position 1749@defun posn-object position
1734Return the object in @var{position}, either @code{nil}, a cons 1750Return the image or string object in @var{position}, either
1735cell @code{(@var{string} . @var{string-pos})}, or an image 1751@code{nil}, an image @code{(image ...)}, or a cons cell
1736@code{(image ...)}. 1752@code{(@var{string} . @var{string-pos})}.
1737@end defun 1753@end defun
1738 1754
1739@defun posn-object-x-y position 1755@defun posn-object-x-y position
1740Return the pixel-based x and y coordinates relative to the upper left 1756Return the pixel-based x and y coordinates relative to the upper left
1741corner of the object in @var{position}, as a cons cell @code{(@var{dx} . @var{dy})}. 1757corner of the object in @var{position} as a cons cell @code{(@var{dx}
1758. @var{dy})}. If the @var{position} is a buffer position, return the
1759relative position in the character at that position.
1760@end defun
1761
1762@defun posn-object-width-height position
1763Return the pixel width and height of the object in @var{position} as a
1764cons cell @code{(@var{width} . @var{height})}. If the @var{position}
1765is a buffer position, return the size of the character at that position.
1742@end defun 1766@end defun
1743 1767
1744@cindex mouse event, timestamp 1768@cindex mouse event, timestamp