.TH wxContextMenuEvent 3erl "wx 2.2.2.1" "wxWidgets team." "Erlang Module Definition" .SH NAME wxContextMenuEvent \- Functions for wxContextMenuEvent class .SH DESCRIPTION .LP This class is used for context menu events, sent to give the application a chance to show a context (popup) menu for a \fIwxWindow\fR\&\&. .LP Note that if \fIgetPosition/1\fR\& returns wxDefaultPosition, this means that the event originated from a keyboard context button event, and you should compute a suitable position yourself, for example by calling \fIwx_misc:getMousePosition/0\fR\&\&. .LP Notice that the exact sequence of mouse events is different across the platforms\&. For example, under MSW the context menu event is generated after \fIEVT_RIGHT_UP\fR\& event and only if it was not handled but under GTK the context menu event is generated after \fIEVT_RIGHT_DOWN\fR\& event\&. This is correct in the sense that it ensures that the context menu is shown according to the current platform UI conventions and also means that you must not handle (or call \fIwxEvent:skip/2\fR\& in your handler if you do have one) neither right mouse down nor right mouse up event if you plan on handling \fIEVT_CONTEXT_MENU\fR\& event\&. .LP See: \fIwxCommandEvent\fR\&, Overview events .LP This class is derived (and can use functions) from: \fIwxCommandEvent\fR\& \fIwxEvent\fR\& .LP wxWidgets docs: wxContextMenuEvent .SH "EVENTS" .LP Use \fIwxEvtHandler:connect/3\fR\& with \fIwxContextMenuEventType\fR\& to subscribe to events of this type\&. .SH DATA TYPES .nf \fBwxContextMenuEvent()\fR\& = wx:wx_object() .br .fi .nf \fBwxContextMenu()\fR\& = .br #wxContextMenu{type = .br wxContextMenuEvent:wxContextMenuEventType(), .br pos = {X :: integer(), Y :: integer()}} .br .fi .nf \fBwxContextMenuEventType()\fR\& = context_menu .br .fi .SH EXPORTS .LP .nf .B getPosition(This) -> {X :: integer(), Y :: integer()} .br .fi .br .RS .LP Types: .RS 3 This = wxContextMenuEvent() .br .RE .RE .RS .LP Returns the position in screen coordinates at which the menu should be shown\&. .LP Use \fIwxWindow:screenToClient/2\fR\& to convert to client coordinates\&. .LP You can also omit a position from \fIwxWindow:popupMenu/4\fR\& in order to use the current mouse pointer position\&. .LP If the event originated from a keyboard event, the value returned from this function will be wxDefaultPosition\&. .RE .LP .nf .B setPosition(This, Point) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxContextMenuEvent() .br Point = {X :: integer(), Y :: integer()} .br .RE .RE .RS .LP Sets the position at which the menu should be shown\&. .RE