1wxEvtHandler(3) Erlang Module Definition wxEvtHandler(3)
2
3
4
6 wxEvtHandler - Functions for wxEvtHandler class
7
9 A class that can handle events from the windowing system. wxWindow is
10 (and therefore all window classes are) derived from this class.
11
12 To get events from wxwidgets objects you subscribe to them by calling
13 connect/3.
14
15 If the callback option is not supplied events are sent as messages.
16
17 These messages will be #wx{} where EventRecord is a record that depends
18 on the wxEventType. The records are defined in: wx/include/wx.hrl.
19
20 If a callback was supplied to connect, the callback will be invoked (in
21 another process) to handle the event. The callback should be of arity
22 2.
23
24 fun Callback (EventRecord::wx(), EventObject::wxObject()).
25
26 Note: The callback will be in executed in new process each time.
27
28 See: Overview events
29
30 wxWidgets docs: wxEvtHandler
31
33 wxEvtHandler() = wx:wx_object()
34
35 wxEventType() =
36 wxActivateEvent:wxActivateEventType() |
37 wxAuiManagerEvent:wxAuiManagerEventType() |
38 wxAuiNotebookEvent:wxAuiNotebookEventType() |
39 wxBookCtrlEvent:wxBookCtrlEventType() |
40 wxCalendarEvent:wxCalendarEventType() |
41 wxChildFocusEvent:wxChildFocusEventType() |
42 wxClipboardTextEvent:wxClipboardTextEventType() |
43 wxCloseEvent:wxCloseEventType() |
44 wxColourPickerEvent:wxColourPickerEventType() |
45 wxCommandEvent:wxCommandEventType() |
46 wxContextMenuEvent:wxContextMenuEventType() |
47 wxDateEvent:wxDateEventType() |
48 wxDisplayChangedEvent:wxDisplayChangedEventType() |
49 wxDropFilesEvent:wxDropFilesEventType() |
50 wxEraseEvent:wxEraseEventType() |
51 wxFileDirPickerEvent:wxFileDirPickerEventType() |
52 wxFocusEvent:wxFocusEventType() |
53 wxFontPickerEvent:wxFontPickerEventType() |
54 wxGridEvent:wxGridEventType() |
55 wxHelpEvent:wxHelpEventType() |
56 wxHtmlLinkEvent:wxHtmlLinkEventType() |
57 wxIconizeEvent:wxIconizeEventType() |
58 wxIdleEvent:wxIdleEventType() |
59 wxInitDialogEvent:wxInitDialogEventType() |
60 wxJoystickEvent:wxJoystickEventType() |
61 wxKeyEvent:wxKeyEventType() |
62 wxListEvent:wxListEventType() |
63 wxMaximizeEvent:wxMaximizeEventType() |
64 wxMenuEvent:wxMenuEventType() |
65 wxMouseCaptureChangedEvent:wxMouseCaptureChangedEventType() |
66 wxMouseCaptureLostEvent:wxMouseCaptureLostEventType() |
67 wxMouseEvent:wxMouseEventType() |
68 wxMoveEvent:wxMoveEventType() |
69 wxNavigationKeyEvent:wxNavigationKeyEventType() |
70 wxPaintEvent:wxPaintEventType() |
71 wxPaletteChangedEvent:wxPaletteChangedEventType() |
72 wxQueryNewPaletteEvent:wxQueryNewPaletteEventType() |
73 wxSashEvent:wxSashEventType() |
74 wxScrollEvent:wxScrollEventType() |
75 wxScrollWinEvent:wxScrollWinEventType() |
76 wxSetCursorEvent:wxSetCursorEventType() |
77 wxShowEvent:wxShowEventType() |
78 wxSizeEvent:wxSizeEventType() |
79 wxSpinEvent:wxSpinEventType() |
80 wxSplitterEvent:wxSplitterEventType() |
81 wxStyledTextEvent:wxStyledTextEventType() |
82 wxSysColourChangedEvent:wxSysColourChangedEventType() |
83 wxTaskBarIconEvent:wxTaskBarIconEventType() |
84 wxTreeEvent:wxTreeEventType() |
85 wxUpdateUIEvent:wxUpdateUIEventType() |
86 wxWebViewEvent:wxWebViewEventType() |
87 wxWindowCreateEvent:wxWindowCreateEventType() |
88 wxWindowDestroyEvent:wxWindowDestroyEventType()
89
90 wx() =
91 #wx{id = integer(),
92 obj = wx:wx_object(),
93 userData = term(),
94 event = event()}
95
96 event() =
97 wxActivateEvent:wxActivate() |
98 wxAuiManagerEvent:wxAuiManager() |
99 wxAuiNotebookEvent:wxAuiNotebook() |
100 wxBookCtrlEvent:wxBookCtrl() |
101 wxCalendarEvent:wxCalendar() |
102 wxChildFocusEvent:wxChildFocus() |
103 wxClipboardTextEvent:wxClipboardText() |
104 wxCloseEvent:wxClose() |
105 wxColourPickerEvent:wxColourPicker() |
106 wxCommandEvent:wxCommand() |
107 wxContextMenuEvent:wxContextMenu() |
108 wxDateEvent:wxDate() |
109 wxDisplayChangedEvent:wxDisplayChanged() |
110 wxDropFilesEvent:wxDropFiles() |
111 wxEraseEvent:wxErase() |
112 wxFileDirPickerEvent:wxFileDirPicker() |
113 wxFocusEvent:wxFocus() |
114 wxFontPickerEvent:wxFontPicker() |
115 wxGridEvent:wxGrid() |
116 wxHelpEvent:wxHelp() |
117 wxHtmlLinkEvent:wxHtmlLink() |
118 wxIconizeEvent:wxIconize() |
119 wxIdleEvent:wxIdle() |
120 wxInitDialogEvent:wxInitDialog() |
121 wxJoystickEvent:wxJoystick() |
122 wxKeyEvent:wxKey() |
123 wxListEvent:wxList() |
124 wxMaximizeEvent:wxMaximize() |
125 wxMenuEvent:wxMenu() |
126 wxMouseCaptureChangedEvent:wxMouseCaptureChanged() |
127 wxMouseCaptureLostEvent:wxMouseCaptureLost() |
128 wxMouseEvent:wxMouse() |
129 wxMoveEvent:wxMove() |
130 wxNavigationKeyEvent:wxNavigationKey() |
131 wxPaintEvent:wxPaint() |
132 wxPaletteChangedEvent:wxPaletteChanged() |
133 wxQueryNewPaletteEvent:wxQueryNewPalette() |
134 wxSashEvent:wxSash() |
135 wxScrollEvent:wxScroll() |
136 wxScrollWinEvent:wxScrollWin() |
137 wxSetCursorEvent:wxSetCursor() |
138 wxShowEvent:wxShow() |
139 wxSizeEvent:wxSize() |
140 wxSpinEvent:wxSpin() |
141 wxSplitterEvent:wxSplitter() |
142 wxStyledTextEvent:wxStyledText() |
143 wxSysColourChangedEvent:wxSysColourChanged() |
144 wxTaskBarIconEvent:wxTaskBarIcon() |
145 wxTreeEvent:wxTree() |
146 wxUpdateUIEvent:wxUpdateUI() |
147 wxWebViewEvent:wxWebView() |
148 wxWindowCreateEvent:wxWindowCreate() |
149 wxWindowDestroyEvent:wxWindowDestroy()
150
152 connect(This :: wxEvtHandler(), EventType :: wxEventType()) -> ok
153
154 connect(This :: wxEvtHandler(),
155 EventType :: wxEventType(),
156 Options :: [Option]) ->
157 ok
158
159 Types:
160
161 Option =
162 {id, integer()} |
163 {lastId, integer()} |
164 {skip, boolean()} |
165 callback |
166 {callback, function()} |
167 {userData, term()}
168
169 This function subscribes to events.
170
171 Subscribes to events of type EventType, in the range id, lastId.
172
173 The events will be received as messages if no callback is sup‐
174 plied.
175
176 Options
177
178 id:{id, integer()} The identifier (or first of the identifier
179 range) to be associated with this event handler. Default is
180 ?wxID_ANY
181
182 lastid:{lastId,integer()} The second part of the identifier
183 range. If used 'id' must be set as the starting identifier
184 range. Default is ?wxID_ANY
185
186 skip:{skip,boolean()} If skip is true further event_handlers
187 will be called. This is not used if the 'callback' option is
188 used. Default is false.
189
190 callback:{callback,function()} Use a callbackfun(Even‐
191 tRecord::wx(),EventObject::wxObject()) to process the event.
192 Default not specified i.e. a message will be delivered to the
193 process calling this function.
194
195 userData:{userData,term()} An erlang term that will be sent
196 with the event. Default: [].
197
198 disconnect(This :: wxEvtHandler()) -> boolean()
199
200 disconnect(This :: wxEvtHandler(), EventType :: wxEventType()) ->
201 boolean()
202
203 disconnect(This :: wxEvtHandler(),
204 EventType :: wxEventType(),
205 Opts :: [Option]) ->
206 boolean()
207
208 Types:
209
210 Option =
211 {id, integer()} | {lastId, integer()} | {callback, func‐
212 tion()}
213
214 This function unsubscribes the process or callback fun from the
215 event handler.
216
217 EventType may be the atom 'null' to match any eventtype. Notice
218 that the options skip and userdata is not used to match the
219 eventhandler.
220
221
222
223wxWidgets team. wx 2.2.2 wxEvtHandler(3)