diff options
| author | Kim F. Storm | 2004-01-06 23:21:00 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2004-01-06 23:21:00 +0000 |
| commit | 0898832984d3d3d7762ea032581daed58b1583fa (patch) | |
| tree | fc3ed95fa5e8a4c51a3660bf9d3bbb1a351fb3a5 | |
| parent | 4385264a7d76a470557075c8bc283079c9e28ab6 (diff) | |
| download | emacs-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.texi | 44 |
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} |
| 1183 | This is the object on which the click occurred. It is either | 1184 | This 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 |
| 1185 | clicked 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 |
| 1186 | there is a string-type text property at the click position, or it is | 1187 | property at the click position. |
| 1187 | an image object as returned by @code{find-image} if click was in an image. | ||
| 1188 | 1188 | ||
| 1189 | @item @var{string} | 1189 | @item @var{string} |
| 1190 | This is the string on which the click occurred, including any | 1190 | This 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 |
| 1206 | glyphs if @var{x} is beyond the last glyph on the line. | 1206 | glyphs if @var{x} is beyond the last glyph on the line. |
| 1207 | 1207 | ||
| 1208 | @item @var{image} | ||
| 1209 | This 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 | ||
| 1211 | an 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} |
| 1209 | These are the pixel-denominated coordinates of the click, relative to | 1214 | These are the pixel-denominated coordinates of the click, relative to |
| 1210 | the top left corner of @var{object}, which is @code{(0 . 0)}. If | 1215 | the 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 | |||
| 1730 | case, @code{posn-col-row} can be used to get approximate values. | 1736 | case, @code{posn-col-row} can be used to get approximate values. |
| 1731 | @end defun | 1737 | @end defun |
| 1732 | 1738 | ||
| 1739 | @defun posn-string position | ||
| 1740 | Return the string object in @var{position}, either @code{nil}, or a | ||
| 1741 | cons cell @code{(@var{string} . @var{string-pos})}. | ||
| 1742 | @end defun | ||
| 1743 | |||
| 1744 | @defun posn-image position | ||
| 1745 | Return the image object in @var{position}, either @code{nil}, or an | ||
| 1746 | image @code{(image ...)}. | ||
| 1747 | @end defun | ||
| 1748 | |||
| 1733 | @defun posn-object position | 1749 | @defun posn-object position |
| 1734 | Return the object in @var{position}, either @code{nil}, a cons | 1750 | Return the image or string object in @var{position}, either |
| 1735 | cell @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 |
| 1740 | Return the pixel-based x and y coordinates relative to the upper left | 1756 | Return the pixel-based x and y coordinates relative to the upper left |
| 1741 | corner of the object in @var{position}, as a cons cell @code{(@var{dx} . @var{dy})}. | 1757 | corner 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 | ||
| 1759 | relative position in the character at that position. | ||
| 1760 | @end defun | ||
| 1761 | |||
| 1762 | @defun posn-object-width-height position | ||
| 1763 | Return the pixel width and height of the object in @var{position} as a | ||
| 1764 | cons cell @code{(@var{width} . @var{height})}. If the @var{position} | ||
| 1765 | is 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 |