1wxContextMenuEvent(3)      Erlang Module Definition      wxContextMenuEvent(3)
2
3
4

NAME

6       wxContextMenuEvent - Functions for wxContextMenuEvent class
7

DESCRIPTION

9       This  class  is used for context menu events, sent to give the applica‐
10       tion a chance to show a context (popup) menu for a wxWindow.
11
12       Note that if getPosition/1 returns wxDefaultPosition, this  means  that
13       the  event  originated  from  a  keyboard context button event, and you
14       should compute a suitable position yourself,  for  example  by  calling
15       wx_misc:getMousePosition/0.
16
17       Notice  that the exact sequence of mouse events is different across the
18       platforms. For example, under MSW the context menu event  is  generated
19       after  EVT_RIGHT_UP  event and only if it was not handled but under GTK
20       the context menu event is generated after EVT_RIGHT_DOWN event. This is
21       correct in the sense that it ensures that the context menu is shown ac‐
22       cording to the current platform UI conventions and also means that  you
23       must  not handle (or call wxEvent:skip/2 in your handler if you do have
24       one) neither right mouse down nor right mouse up event if you  plan  on
25       handling EVT_CONTEXT_MENU event.
26
27       See: wxCommandEvent, Overview events
28
29       This  class is derived (and can use functions) from: wxCommandEvent wx‐
30       Event
31
32       wxWidgets docs: wxContextMenuEvent
33

EVENTS

35       Use wxEvtHandler:connect/3 with wxContextMenuEventType to subscribe  to
36       events of this type.
37

DATA TYPES

39       wxContextMenuEvent() = wx:wx_object()
40
41       wxContextMenu() =
42           #wxContextMenu{type =
43                              wxContextMenuEvent:wxContextMenuEventType(),
44                          pos = {X :: integer(), Y :: integer()}}
45
46       wxContextMenuEventType() = context_menu
47

EXPORTS

49       getPosition(This) -> {X :: integer(), Y :: integer()}
50
51              Types:
52
53                 This = wxContextMenuEvent()
54
55              Returns  the  position  in  screen coordinates at which the menu
56              should be shown.
57
58              Use wxWindow:screenToClient/2 to convert to client coordinates.
59
60              You can also omit a position from wxWindow:popupMenu/4 in  order
61              to use the current mouse pointer position.
62
63              If  the  event  originated  from a keyboard event, the value re‐
64              turned from this function will be wxDefaultPosition.
65
66       setPosition(This, Point) -> ok
67
68              Types:
69
70                 This = wxContextMenuEvent()
71                 Point = {X :: integer(), Y :: integer()}
72
73              Sets the position at which the menu should be shown.
74
75
76
77wxWidgets team.                    wx 2.2.2              wxContextMenuEvent(3)
Impressum