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

NAME

6       wxEvtHandler - The Event handler.
7

DESCRIPTION

9       The Event handler.
10
11       To  get  events from wxwidgets objects you subscribe to them by calling
12       connect/[2-3]. Events are sent as messages, if no callback was supplied
13       These messages will be #wx{} where EventRecord is a record that depends
14       on the event type. The records are defined in: wx/include/wx.hrl.
15
16       If a callback was supplied to connect, the callback will be invoked (in
17       another  process)  to handle the event. The callback should be of arity
18       2. fun(EventRecord::wx(), EventObject::wxObject()).
19
20       Beware that the callback will be in executed in new process each time.
21
22        The orginal documentation.
23

DATA TYPES

25         event() = wxActivate() | wxAuiManager() | wxAuiNotebook() |  wxCalen‐
26         dar()   |  wxChildFocus()  |  wxClipboardText()  |  wxClose()  |  wx‐
27         ColourPicker() | wxCommand() | wxContextMenu() |  wxDate()  |  wxDis‐
28         playChanged() | wxDropFiles() | wxErase() | wxFileDirPicker() | wxFo‐
29         cus() | wxFontPicker() | wxGrid() | wxHelp() |  wxHtmlLink()  |  wxI‐
30         conize()  |  wxIdle()  |  wxInitDialog()  |  wxJoystick() | wxKey() |
31         wxList()  |  wxMaximize()  |  wxMenu()  |  wxMouse()  |   wxMouseCap‐
32         tureChanged() | wxMouseCaptureLost() | wxMove() | wxNavigationKey() |
33         wxNotebook() | wxPaint() | wxPaletteChanged() | wxQueryNewPalette() |
34         wxSash()  |  wxScroll()  | wxScrollWin() | wxSetCursor() | wxShow() |
35         wxSize() | wxSpin() | wxSplitter() |  wxStyledText()  |  wxSysColour‐
36         Changed()  | wxTaskBarIcon() | wxTree() | wxUpdateUI() | wxWindowCre‐
37         ate() | wxWindowDestroy():
38
39
40         wx()   =   #wx{id=integer(),   obj=wx:wx_object(),   userData=term(),
41         event=event()}:
42
43
44         wxActivate()  =  #wxActivate{type=wxActivateEventType(), active=bool‐
45         ean()}:
46
47
48         wxActivateEventType() = activate | activate_app | hibernate:
49
50
51         wxAuiManager()  =  #wxAuiManager{type=wxAuiManagerEventType(),   man‐
52         ager=wxAuiManager:wxAuiManager(), pane=wxAuiPaneInfo:wxAuiPaneInfo(),
53         button=integer(),    veto_flag=boolean(),     canveto_flag=boolean(),
54         dc=wxDC:wxDC()}:
55
56
57         wxAuiManagerEventType()   =   aui_pane_button   |   aui_pane_close  |
58         aui_pane_maximize | aui_pane_restore | aui_pane_activated |  aui_ren‐
59         der | aui_find_manager:
60
61
62         wxAuiNotebook()    =    #wxAuiNotebook{type=wxAuiNotebookEventType(),
63         old_selection=integer(), selection=integer(),  drag_source=wxAuiNote‐
64         book:wxAuiNotebook()}:
65
66
67         wxAuiNotebookEventType()   =  command_auinotebook_page_close  |  com‐
68         mand_auinotebook_page_changed |  command_auinotebook_page_changing  |
69         command_auinotebook_button  |  command_auinotebook_begin_drag  | com‐
70         mand_auinotebook_end_drag |  command_auinotebook_drag_motion  |  com‐
71         mand_auinotebook_allow_dnd  |  command_auinotebook_tab_middle_down  |
72         command_auinotebook_tab_middle_up         |          command_auinote‐
73         book_tab_right_down   |   command_auinotebook_tab_right_up   |   com‐
74         mand_auinotebook_page_closed | command_auinotebook_drag_done  |  com‐
75         mand_auinotebook_bg_dclick:
76
77
78         wxCalendar()         =        #wxCalendar{type=wxCalendarEventType(),
79         wday=wx:wx_enum(), date=wx:wx_datetime()}:
80
81
82         wxCalendarEventType() = calendar_sel_changed | calendar_day_changed |
83         calendar_month_changed   |   calendar_year_changed   |  calendar_dou‐
84         bleclicked | calendar_weekday_clicked:
85
86
87         wxChildFocus() = #wxChildFocus{type=wxChildFocusEventType()}:
88
89
90         wxChildFocusEventType() = child_focus:
91
92
93         wxClipboardText()    =    #wxClipboardText{type=wxClipboardTextEvent‐
94         Type()}:
95
96
97         wxClipboardTextEventType()  =  command_text_copy | command_text_cut |
98         command_text_paste:
99
100
101         wxClose() = #wxClose{type=wxCloseEventType()}:
102
103
104         wxCloseEventType() = close_window | end_session | query_end_session:
105
106
107         wxColourPicker()  =   #wxColourPicker{type=wxColourPickerEventType(),
108         colour=wx:wx_colour()}:
109
110
111         wxColourPickerEventType() = command_colourpicker_changed:
112
113
114         wxCommand()  =  #wxCommand{type=wxCommandEventType(),  cmdString=uni‐
115         code:chardata(), commandInt=integer(), extraLong=integer()}:
116
117
118         wxCommandEventType()  =   command_button_clicked   |   command_check‐
119         box_clicked  |  command_choice_selected  | command_listbox_selected |
120         command_listbox_doubleclicked   |   command_text_updated    |    com‐
121         mand_text_enter  |  command_menu_selected  | command_slider_updated |
122         command_radiobox_selected  |  command_radiobutton_selected   |   com‐
123         mand_scrollbar_updated   |   command_vlbox_selected   |  command_com‐
124         bobox_selected | command_tool_rclicked |  command_tool_enter  |  com‐
125         mand_checklistbox_toggled   |   command_togglebutton_clicked  |  com‐
126         mand_left_click | command_left_dclick |  command_right_click  |  com‐
127         mand_set_focus | command_kill_focus | command_enter:
128
129
130         wxContextMenu()    =    #wxContextMenu{type=wxContextMenuEventType(),
131         pos={X::integer(), Y::integer()}}:
132
133
134         wxContextMenuEventType() = context_menu:
135
136
137         wxDate() = #wxDate{type=wxDateEventType(), date=wx:wx_datetime()}:
138
139
140         wxDateEventType() = date_changed:
141
142
143         wxDisplayChanged()  =   #wxDisplayChanged{type=wxDisplayChangedEvent‐
144         Type()}:
145
146
147         wxDisplayChangedEventType() = display_changed:
148
149
150         wxDropFiles() = #wxDropFiles{type=wxDropFilesEventType(), noFiles=in‐
151         teger(),   pos={X::integer(),   Y::integer()},   files=[unicode:char‐
152         data()]}:
153
154
155         wxDropFilesEventType() = drop_files:
156
157
158         wxErase() = #wxErase{type=wxEraseEventType(), dc=wxDC:wxDC()}:
159
160
161         wxEraseEventType() = erase_background:
162
163
164         wxEventType() = wxActivateEventType() | wxAuiManagerEventType() | wx‐
165         AuiNotebookEventType() | wxCalendarEventType()  |  wxChildFocusEvent‐
166         Type()   |  wxClipboardTextEventType()  |  wxCloseEventType()  |  wx‐
167         ColourPickerEventType() | wxCommandEventType() |  wxContextMenuEvent‐
168         Type()  |  wxDateEventType()  | wxDisplayChangedEventType() | wxDrop‐
169         FilesEventType() | wxEraseEventType() | wxFileDirPickerEventType()  |
170         wxFocusEventType()  |  wxFontPickerEventType()  | wxGridEventType() |
171         wxHelpEventType() | wxHtmlLinkEventType()  |  wxIconizeEventType()  |
172         wxIdleEventType() | wxInitDialogEventType() | wxJoystickEventType() |
173         wxKeyEventType() | wxListEventType() |  wxMaximizeEventType()  |  wx‐
174         MenuEventType()   |  wxMouseCaptureChangedEventType()  |  wxMouseCap‐
175         tureLostEventType() | wxMouseEventType() | wxMoveEventType() | wxNav‐
176         igationKeyEventType()  | wxNotebookEventType() | wxPaintEventType() |
177         wxPaletteChangedEventType() |  wxQueryNewPaletteEventType()  |  wxSa‐
178         shEventType()   |   wxScrollEventType()  |  wxScrollWinEventType()  |
179         wxSetCursorEventType()  |  wxShowEventType()  |  wxSizeEventType()  |
180         wxSpinEventType() | wxSplitterEventType() | wxStyledTextEventType() |
181         wxSysColourChangedEventType()  |   wxTaskBarIconEventType()   |   wx‐
182         TreeEventType() | wxUpdateUIEventType() | wxWindowCreateEventType() |
183         wxWindowDestroyEventType():
184
185
186         wxEvtHandler() = wx:wx_object():
187
188
189         wxFileDirPicker() = #wxFileDirPicker{type=wxFileDirPickerEventType(),
190         path=unicode:chardata()}:
191
192
193         wxFileDirPickerEventType()   =   command_filepicker_changed   |  com‐
194         mand_dirpicker_changed:
195
196
197         wxFocus()  =  #wxFocus{type=wxFocusEventType(),   win=wxWindow:wxWin‐
198         dow()}:
199
200
201         wxFocusEventType() = set_focus | kill_focus:
202
203
204         wxFontPicker() = #wxFontPicker{type=wxFontPickerEventType(), font=wx‐
205         Font:wxFont()}:
206
207
208         wxFontPickerEventType() = command_fontpicker_changed:
209
210
211         wxGrid() = #wxGrid{type=wxGridEventType(),  row=integer(),  col=inte‐
212         ger(),  x=integer(),  y=integer(), selecting=boolean(), control=bool‐
213         ean(), meta=boolean(), shift=boolean(), alt=boolean()}:
214
215
216         wxGridEventType() = grid_cell_left_click  |  grid_cell_right_click  |
217         grid_cell_left_dclick    |    grid_cell_right_dclick    |    grid_la‐
218         bel_left_click | grid_label_right_click  |  grid_label_left_dclick  |
219         grid_label_right_dclick    |    grid_row_size   |   grid_col_size   |
220         grid_range_select | grid_cell_change | grid_select_cell  |  grid_edi‐
221         tor_shown  | grid_editor_hidden | grid_editor_created | grid_cell_be‐
222         gin_drag:
223
224
225         wxHelp() = #wxHelp{type=wxHelpEventType()}:
226
227
228         wxHelpEventType() = help | detailed_help:
229
230
231         wxHtmlLink()    =    #wxHtmlLink{type=wxHtmlLinkEventType(),    link‐
232         Info=wx:wx_wxHtmlLinkInfo()}:
233
234
235         wxHtmlLinkEventType() = command_html_link_clicked:
236
237
238         wxIconize()  =  #wxIconize{type=wxIconizeEventType(),  iconized=bool‐
239         ean()}:
240
241
242         wxIconizeEventType() = iconize:
243
244
245         wxIdle() = #wxIdle{type=wxIdleEventType()}:
246
247
248         wxIdleEventType() = idle:
249
250
251         wxInitDialog() = #wxInitDialog{type=wxInitDialogEventType()}:
252
253
254         wxInitDialogEventType() = init_dialog:
255
256
257         wxJoystick() = #wxJoystick{type=wxJoystickEventType(),  pos={X::inte‐
258         ger(),  Y::integer()},  zPosition=integer(),  buttonChange=integer(),
259         buttonState=integer(), joyStick=integer()}:
260
261
262         wxJoystickEventType() = joy_button_down | joy_button_up | joy_move  |
263         joy_zmove:
264
265
266         wxKey()  =  #wxKey{type=wxKeyEventType(),  x=integer(),  y=integer(),
267         keyCode=integer(), controlDown=boolean(),  shiftDown=boolean(),  alt‐
268         Down=boolean(), metaDown=boolean(), scanCode=boolean(), uniChar=inte‐
269         ger(), rawCode=integer(), rawFlags=integer()}:
270
271
272         wxKeyEventType() = char | char_hook | key_down | key_up:
273
274
275         wxList() =  #wxList{type=wxListEventType(),  code=integer(),  oldIte‐
276         mIndex=integer(),    itemIndex=integer(),    col=integer(),    point‐
277         Drag={X::integer(), Y::integer()}}:
278
279
280         wxListEventType()  =   command_list_begin_drag   |   command_list_be‐
281         gin_rdrag   |  command_list_begin_label_edit  |  command_list_end_la‐
282         bel_edit | command_list_delete_item | command_list_delete_all_items |
283         command_list_key_down     |     command_list_insert_item    |    com‐
284         mand_list_col_click    |    command_list_col_right_click    |    com‐
285         mand_list_col_begin_drag    |    command_list_col_dragging   |   com‐
286         mand_list_col_end_drag   |    command_list_item_selected    |    com‐
287         mand_list_item_deselected   |  command_list_item_right_click  |  com‐
288         mand_list_item_middle_click  |  command_list_item_activated  |   com‐
289         mand_list_item_focused | command_list_cache_hint:
290
291
292         wxMaximize() = #wxMaximize{type=wxMaximizeEventType()}:
293
294
295         wxMaximizeEventType() = maximize:
296
297
298         wxMenu() = #wxMenu{type=wxMenuEventType(), menuId=integer(), menu=wx‐
299         Menu:wxMenu()}:
300
301
302         wxMenuEventType() = menu_open | menu_close | menu_highlight:
303
304
305         wxMouse() =  #wxMouse{type=wxMouseEventType(),  x=integer(),  y=inte‐
306         ger(), leftDown=boolean(), middleDown=boolean(), rightDown=boolean(),
307         controlDown=boolean(), shiftDown=boolean(), altDown=boolean(), metaD‐
308         own=boolean(),  wheelRotation=integer(), wheelDelta=integer(), lines‐
309         PerAction=integer()}:
310
311
312         wxMouseCaptureChanged()   =   #wxMouseCaptureChanged{type=wxMouseCap‐
313         tureChangedEventType()}:
314
315
316         wxMouseCaptureChangedEventType() = mouse_capture_changed:
317
318
319         wxMouseCaptureLost()      =      #wxMouseCaptureLost{type=wxMouseCap‐
320         tureLostEventType()}:
321
322
323         wxMouseCaptureLostEventType() = mouse_capture_lost:
324
325
326         wxMouseEventType() = left_down | left_up | middle_down | middle_up  |
327         right_down  |  right_up  |  motion  |  enter_window  | leave_window |
328         left_dclick | middle_dclick | right_dclick | mousewheel:
329
330
331         wxMove() = #wxMove{type=wxMoveEventType(), pos={X::integer(),  Y::in‐
332         teger()},  rect={X::integer(),  Y::integer(),  W::integer(), H::inte‐
333         ger()}}:
334
335
336         wxMoveEventType() = move:
337
338
339         wxNavigationKey() = #wxNavigationKey{type=wxNavigationKeyEventType(),
340         flags=integer(), focus=wxWindow:wxWindow()}:
341
342
343         wxNavigationKeyEventType() = navigation_key:
344
345
346         wxNotebook()   =  #wxNotebook{type=wxNotebookEventType(),  nSel=inte‐
347         ger(), nOldSel=integer()}:
348
349
350         wxNotebookEventType() = command_notebook_page_changed | command_note‐
351         book_page_changing:
352
353
354         wxPaint() = #wxPaint{type=wxPaintEventType()}:
355
356
357         wxPaintEventType() = paint:
358
359
360         wxPaletteChanged()   =  #wxPaletteChanged{type=wxPaletteChangedEvent‐
361         Type()}:
362
363
364         wxPaletteChangedEventType() = palette_changed:
365
366
367         wxQueryNewPalette() = #wxQueryNewPalette{type=wxQueryNewPaletteEvent‐
368         Type()}:
369
370
371         wxQueryNewPaletteEventType() = query_new_palette:
372
373
374         wxSash()  =  #wxSash{type=wxSashEventType(),  edge=wx:wx_enum(), dra‐
375         gRect={X::integer(),   Y::integer(),   W::integer(),   H::integer()},
376         dragStatus=wx:wx_enum()}:
377
378
379         wxSashEventType() = sash_dragged:
380
381
382         wxScroll()   =  #wxScroll{type=wxScrollEventType(),  commandInt=inte‐
383         ger(), extraLong=integer()}:
384
385
386         wxScrollEventType() = scroll_top | scroll_bottom  |  scroll_lineup  |
387         scroll_linedown | scroll_pageup | scroll_pagedown | scroll_thumbtrack
388         | scroll_thumbrelease | scroll_changed:
389
390
391         wxScrollWin()   =   #wxScrollWin{type=wxScrollWinEventType(),    com‐
392         mandInt=integer(), extraLong=integer()}:
393
394
395         wxScrollWinEventType()  =  scrollwin_top | scrollwin_bottom | scroll‐
396         win_lineup | scrollwin_linedown | scrollwin_pageup |  scrollwin_page‐
397         down | scrollwin_thumbtrack | scrollwin_thumbrelease:
398
399
400         wxSetCursor()   =  #wxSetCursor{type=wxSetCursorEventType(),  x=inte‐
401         ger(), y=integer(), cursor=wxCursor:wxCursor()}:
402
403
404         wxSetCursorEventType() = set_cursor:
405
406
407         wxShow() = #wxShow{type=wxShowEventType(), show=boolean()}:
408
409
410         wxShowEventType() = show:
411
412
413         wxSize() = #wxSize{type=wxSizeEventType(), size={W::integer(), H::in‐
414         teger()},  rect={X::integer(),  Y::integer(),  W::integer(), H::inte‐
415         ger()}}:
416
417
418         wxSizeEventType() = size:
419
420
421         wxSpin() = #wxSpin{type=wxSpinEventType(), commandInt=integer()}:
422
423
424         wxSpinEventType() = command_spinctrl_updated | spin_up | spin_down  |
425         spin:
426
427
428         wxSplitter() = #wxSplitter{type=wxSplitterEventType()}:
429
430
431         wxSplitterEventType()   =  command_splitter_sash_pos_changed  |  com‐
432         mand_splitter_sash_pos_changing  |  command_splitter_doubleclicked  |
433         command_splitter_unsplit:
434
435
436         wxStyledText()  =  #wxStyledText{type=wxStyledTextEventType(),  posi‐
437         tion=integer(),  key=integer(),  modifiers=integer(),   modification‐
438         Type=integer(),   text=unicode:chardata(),   length=integer(),  line‐
439         sAdded=integer(), line=integer(), foldLevelNow=integer(),  foldLevel‐
440         Prev=integer(),   margin=integer(),  message=integer(),  wParam=inte‐
441         ger(),  lParam=integer(),  listType=integer(),  x=integer(),  y=inte‐
442         ger(),  dragText=unicode:chardata(), dragAllowMove=boolean(), dragRe‐
443         sult=wx:wx_enum()}:
444
445
446         wxStyledTextEventType()   =   stc_change    |    stc_styleneeded    |
447         stc_charadded | stc_savepointreached | stc_savepointleft | stc_romod‐
448         ifyattempt | stc_key | stc_doubleclick | stc_updateui |  stc_modified
449         |  stc_macrorecord  | stc_marginclick | stc_needshown | stc_painted |
450         stc_userlistselection   |   stc_uridropped   |    stc_dwellstart    |
451         stc_dwellend   |  stc_start_drag  |  stc_drag_over  |  stc_do_drop  |
452         stc_zoom | stc_hotspot_click | stc_hotspot_dclick | stc_calltip_click
453         | stc_autocomp_selection:
454
455
456         wxSysColourChanged()  = #wxSysColourChanged{type=wxSysColourChangedE‐
457         ventType()}:
458
459
460         wxSysColourChangedEventType() = sys_colour_changed:
461
462
463         wxTaskBarIcon() = #wxTaskBarIcon{type=wxTaskBarIconEventType()}:
464
465
466         wxTaskBarIconEventType()  =  taskbar_move   |   taskbar_left_down   |
467         taskbar_left_up    |    taskbar_right_down   |   taskbar_right_up   |
468         taskbar_left_dclick | taskbar_right_dclick:
469
470
471         wxTree()  =  #wxTree{type=wxTreeEventType(),   item=integer(),   ite‐
472         mOld=integer(), pointDrag={X::integer(), Y::integer()}}:
473
474
475         wxTreeEventType()   =   command_tree_begin_drag   |  command_tree_be‐
476         gin_rdrag  |  command_tree_begin_label_edit  |   command_tree_end_la‐
477         bel_edit  |  command_tree_delete_item  | command_tree_get_info | com‐
478         mand_tree_set_info    |     command_tree_item_expanded     |     com‐
479         mand_tree_item_expanding   |   command_tree_item_collapsed   |   com‐
480         mand_tree_item_collapsing   |   command_tree_sel_changed    |    com‐
481         mand_tree_sel_changing     |     command_tree_key_down     |     com‐
482         mand_tree_item_activated  |  command_tree_item_right_click   |   com‐
483         mand_tree_item_middle_click    |    command_tree_end_drag    |   com‐
484         mand_tree_state_image_click  |  command_tree_item_gettooltip  |  com‐
485         mand_tree_item_menu:
486
487
488         wxUpdateUI() = #wxUpdateUI{type=wxUpdateUIEventType()}:
489
490
491         wxUpdateUIEventType() = update_ui:
492
493
494         wxWindowCreate() = #wxWindowCreate{type=wxWindowCreateEventType()}:
495
496
497         wxWindowCreateEventType() = create:
498
499
500         wxWindowDestroy()    =    #wxWindowDestroy{type=wxWindowDestroyEvent‐
501         Type()}:
502
503
504         wxWindowDestroyEventType() = destroy:
505
506

EXPORTS

508       connect(This::wxEvtHandler(), EventType::wxEventType()) -> ok
509
510              Equivalent to connect(This, EventType, [])
511
512       connect(This::wxEvtHandler(),  EventType::wxEventType(),  Options::[Op‐
513       tion]) -> ok
514
515              Types:
516
517                 Option = {id, integer()} | {lastId, integer()} | {skip, bool‐
518                 ean()} |  callback  |  {callback,  function()}  |  {userData,
519                 term()}
520
521              This  function  subscribes  the  to  events of EventType, in the
522              range id, lastId. The events will be received as messages if  no
523              callback is supplied.
524
525              Options:  {id, integer()}, The identifier (or first of the iden‐
526              tifier range) to be associated with this event handler.  Default
527              ?wxID_ANY {lastId, integer()}, The second part of the identifier
528              range. If used 'id' must  be  set  as  the  starting  identifier
529              range. Default ?wxID_ANY {skip, boolean()}, If skip is true fur‐
530              ther event_handlers will be called. This  is  not  used  if  the
531              'callback' option is used. Default false. {callback, function()}
532              Use a callback  fun(EventRecord::wx(),  EventObject::wxObject())
533              to  process  the event. Default not specfied i.e. a message will
534              be delivered to the process calling  this  function.  {userData,
535              term()}  An  erlang  term  that will be sent with the event. De‐
536              fault: [].
537
538       disconnect(This::wxEvtHandler()) -> boolean()
539
540              Equivalent to disconnect(This, null, []) Can also  have  an  op‐
541              tional callback Fun() as an additional last argument.
542
543       disconnect(This::wxEvtHandler(), EventType::wxEventType()) -> boolean()
544
545              Equivalent to disconnect(This, EventType, [])
546
547       disconnect(This::wxEvtHandler(),  EventType::wxEventType(),  Opts::[Op‐
548       tion]) -> boolean()
549
550              Types:
551
552                 Option = {id, integer()} | {lastId, integer()}  |  {callback,
553                 function()}
554
555              See   external  documentation  This  function  unsubscribes  the
556              process or callback fun from the event handler. EventType may be
557              the  atom 'null' to match any eventtype. Notice that the options
558              skip and userdata is not used to match the eventhandler.
559

AUTHORS

561       <>
562
563
564
565                                  wx 1.9.3.1                   wxEvtHandler(3)
Impressum