EventX ( )
Parameters
| None. |
Description
|
Returns the x value of the current event - usually a pointer or window position. Requires Extended language mode. What it holds depends on the event id: $201-$203, $205 mouse events: the pointer's x position, relative to the gadget that posted the event, in logical 96-DPI units $801 window move: the window's new x position $802 window size: the window's new width $2003 display change: the new physical display width $401 from a hotkey field: the modifier bits of the captured combination Other events leave it at 0. The classic use is a right-click context menu: on a $201 with EventData 2, pass EventX() and EventY() straight to ShowPopupMenu so the menu opens under the pointer. Note the coordinate space: event positions are logical units, the same ones gadget geometry uses. When you draw on a canvas, whose buffer is measured in physical pixels, poll CanvasMouseX and CanvasMouseY instead of using mouse-event positions. See it working in the selection and context menus sample, which opens a popup menu at the click position. See also: EventY, EventData, EventID, CanvasMouseX, ShowPopupMenu. |
Index