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()  |
27         wxColourPicker() | 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(),
151         noFiles=integer(),  pos={X::integer(),   Y::integer()},   files=[uni‐
152         code:chardata()]}:
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() |
165         wxAuiNotebookEventType() | wxCalendarEventType() | wxChildFocusEvent‐
166         Type()    |   wxClipboardTextEventType()   |   wxCloseEventType()   |
167         wxColourPickerEventType()    |    wxCommandEventType()    |    wxCon‐
168         textMenuEventType() | wxDateEventType() | wxDisplayChangedEventType()
169         | wxDropFilesEventType() | wxEraseEventType() | wxFileDirPickerEvent‐
170         Type()  | wxFocusEventType() | wxFontPickerEventType() | wxGridEvent‐
171         Type() | wxHelpEventType() | wxHtmlLinkEventType() |  wxIconizeEvent‐
172         Type()  |  wxIdleEventType()  | wxInitDialogEventType() | wxJoystick‐
173         EventType() | wxKeyEventType() | wxListEventType() | wxMaximizeEvent‐
174         Type()   |  wxMenuEventType()  |  wxMouseCaptureChangedEventType()  |
175         wxMouseCaptureLostEventType()  |  wxMouseEventType()  |  wxMoveEvent‐
176         Type()   |   wxNavigationKeyEventType()   |  wxNotebookEventType()  |
177         wxPaintEventType() | wxPaletteChangedEventType()  |  wxQueryNewPalet‐
178         teEventType()  |  wxSashEventType() | wxScrollEventType() | wxScroll‐
179         WinEventType()  |  wxSetCursorEventType()   |   wxShowEventType()   |
180         wxSizeEventType()   |  wxSpinEventType()  |  wxSplitterEventType()  |
181         wxStyledTextEventType() | wxSysColourChangedEventType() | wxTaskBarI‐
182         conEventType()  |  wxTreeEventType() | wxUpdateUIEventType() | wxWin‐
183         dowCreateEventType() | 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(),
205         font=wxFont: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        |
218         grid_label_left_click        |        grid_label_right_click        |
219         grid_label_left_dclick  |  grid_label_right_dclick  | grid_row_size |
220         grid_col_size    |    grid_range_select    |    grid_cell_change    |
221         grid_select_cell | grid_editor_shown | grid_editor_hidden | grid_edi‐
222         tor_created | grid_cell_begin_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      |      com‐
281         mand_list_begin_rdrag    |   command_list_begin_label_edit   |   com‐
282         mand_list_end_label_edit   |    command_list_delete_item    |    com‐
283         mand_list_delete_all_items    |    command_list_key_down    |    com‐
284         mand_list_insert_item     |     command_list_col_click     |     com‐
285         mand_list_col_right_click   |   command_list_col_begin_drag   |  com‐
286         mand_list_col_dragging    |    command_list_col_end_drag    |    com‐
287         mand_list_item_selected   |   command_list_item_deselected   |   com‐
288         mand_list_item_right_click |  command_list_item_middle_click  |  com‐
289         mand_list_item_activated    |    command_list_item_focused   |   com‐
290         mand_list_cache_hint:
291
292
293         wxMaximize() = #wxMaximize{type=wxMaximizeEventType()}:
294
295
296         wxMaximizeEventType() = maximize:
297
298
299         wxMenu()    =    #wxMenu{type=wxMenuEventType(),    menuId=integer(),
300         menu=wxMenu:wxMenu()}:
301
302
303         wxMenuEventType() = menu_open | menu_close | menu_highlight:
304
305
306         wxMouse()  =  #wxMouse{type=wxMouseEventType(),  x=integer(), y=inte‐
307         ger(), leftDown=boolean(), middleDown=boolean(), rightDown=boolean(),
308         controlDown=boolean(), shiftDown=boolean(), altDown=boolean(), metaD‐
309         own=boolean(), wheelRotation=integer(), wheelDelta=integer(),  lines‐
310         PerAction=integer()}:
311
312
313         wxMouseCaptureChanged()   =   #wxMouseCaptureChanged{type=wxMouseCap‐
314         tureChangedEventType()}:
315
316
317         wxMouseCaptureChangedEventType() = mouse_capture_changed:
318
319
320         wxMouseCaptureLost()      =      #wxMouseCaptureLost{type=wxMouseCap‐
321         tureLostEventType()}:
322
323
324         wxMouseCaptureLostEventType() = mouse_capture_lost:
325
326
327         wxMouseEventType()  = left_down | left_up | middle_down | middle_up |
328         right_down | right_up  |  motion  |  enter_window  |  leave_window  |
329         left_dclick | middle_dclick | right_dclick | mousewheel:
330
331
332         wxMove()    =    #wxMove{type=wxMoveEventType(),   pos={X::integer(),
333         Y::integer()},   rect={X::integer(),   Y::integer(),    W::integer(),
334         H::integer()}}:
335
336
337         wxMoveEventType() = move:
338
339
340         wxNavigationKey() = #wxNavigationKey{type=wxNavigationKeyEventType(),
341         flags=integer(), focus=wxWindow:wxWindow()}:
342
343
344         wxNavigationKeyEventType() = navigation_key:
345
346
347         wxNotebook()  =  #wxNotebook{type=wxNotebookEventType(),   nSel=inte‐
348         ger(), nOldSel=integer()}:
349
350
351         wxNotebookEventType() = command_notebook_page_changed | command_note‐
352         book_page_changing:
353
354
355         wxPaint() = #wxPaint{type=wxPaintEventType()}:
356
357
358         wxPaintEventType() = paint:
359
360
361         wxPaletteChanged()  =   #wxPaletteChanged{type=wxPaletteChangedEvent‐
362         Type()}:
363
364
365         wxPaletteChangedEventType() = palette_changed:
366
367
368         wxQueryNewPalette() = #wxQueryNewPalette{type=wxQueryNewPaletteEvent‐
369         Type()}:
370
371
372         wxQueryNewPaletteEventType() = query_new_palette:
373
374
375         wxSash() =  #wxSash{type=wxSashEventType(),  edge=wx:wx_enum(),  dra‐
376         gRect={X::integer(),   Y::integer(),   W::integer(),   H::integer()},
377         dragStatus=wx:wx_enum()}:
378
379
380         wxSashEventType() = sash_dragged:
381
382
383         wxScroll()  =  #wxScroll{type=wxScrollEventType(),   commandInt=inte‐
384         ger(), extraLong=integer()}:
385
386
387         wxScrollEventType()  =  scroll_top  | scroll_bottom | scroll_lineup |
388         scroll_linedown | scroll_pageup | scroll_pagedown | scroll_thumbtrack
389         | scroll_thumbrelease | scroll_changed:
390
391
392         wxScrollWin()    =   #wxScrollWin{type=wxScrollWinEventType(),   com‐
393         mandInt=integer(), extraLong=integer()}:
394
395
396         wxScrollWinEventType() = scrollwin_top | scrollwin_bottom  |  scroll‐
397         win_lineup  | scrollwin_linedown | scrollwin_pageup | scrollwin_page‐
398         down | scrollwin_thumbtrack | scrollwin_thumbrelease:
399
400
401         wxSetCursor()  =  #wxSetCursor{type=wxSetCursorEventType(),   x=inte‐
402         ger(), y=integer(), cursor=wxCursor:wxCursor()}:
403
404
405         wxSetCursorEventType() = set_cursor:
406
407
408         wxShow() = #wxShow{type=wxShowEventType(), show=boolean()}:
409
410
411         wxShowEventType() = show:
412
413
414         wxSize()    =   #wxSize{type=wxSizeEventType(),   size={W::integer(),
415         H::integer()},   rect={X::integer(),   Y::integer(),    W::integer(),
416         H::integer()}}:
417
418
419         wxSizeEventType() = size:
420
421
422         wxSpin() = #wxSpin{type=wxSpinEventType(), commandInt=integer()}:
423
424
425         wxSpinEventType()  = command_spinctrl_updated | spin_up | spin_down |
426         spin:
427
428
429         wxSplitter() = #wxSplitter{type=wxSplitterEventType()}:
430
431
432         wxSplitterEventType()  =  command_splitter_sash_pos_changed  |   com‐
433         mand_splitter_sash_pos_changing  |  command_splitter_doubleclicked  |
434         command_splitter_unsplit:
435
436
437         wxStyledText()  =  #wxStyledText{type=wxStyledTextEventType(),  posi‐
438         tion=integer(),   key=integer(),  modifiers=integer(),  modification‐
439         Type=integer(),  text=unicode:chardata(),   length=integer(),   line‐
440         sAdded=integer(),  line=integer(), foldLevelNow=integer(), foldLevel‐
441         Prev=integer(),  margin=integer(),  message=integer(),   wParam=inte‐
442         ger(),  lParam=integer(),  listType=integer(),  x=integer(),  y=inte‐
443         ger(), dragText=unicode:chardata(), dragAllowMove=boolean(),  dragRe‐
444         sult=wx:wx_enum()}:
445
446
447         wxStyledTextEventType()    =    stc_change    |   stc_styleneeded   |
448         stc_charadded | stc_savepointreached | stc_savepointleft | stc_romod‐
449         ifyattempt  | stc_key | stc_doubleclick | stc_updateui | stc_modified
450         | stc_macrorecord | stc_marginclick | stc_needshown |  stc_painted  |
451         stc_userlistselection    |    stc_uridropped   |   stc_dwellstart   |
452         stc_dwellend  |  stc_start_drag  |  stc_drag_over  |  stc_do_drop   |
453         stc_zoom | stc_hotspot_click | stc_hotspot_dclick | stc_calltip_click
454         | stc_autocomp_selection:
455
456
457         wxSysColourChanged() =  #wxSysColourChanged{type=wxSysColourChangedE‐
458         ventType()}:
459
460
461         wxSysColourChangedEventType() = sys_colour_changed:
462
463
464         wxTaskBarIcon() = #wxTaskBarIcon{type=wxTaskBarIconEventType()}:
465
466
467         wxTaskBarIconEventType()   =   taskbar_move   |  taskbar_left_down  |
468         taskbar_left_up   |   taskbar_right_down   |    taskbar_right_up    |
469         taskbar_left_dclick | taskbar_right_dclick:
470
471
472         wxTree()   =   #wxTree{type=wxTreeEventType(),  item=integer(),  ite‐
473         mOld=integer(), pointDrag={X::integer(), Y::integer()}}:
474
475
476         wxTreeEventType()     =      command_tree_begin_drag      |      com‐
477         mand_tree_begin_rdrag    |   command_tree_begin_label_edit   |   com‐
478         mand_tree_end_label_edit   |    command_tree_delete_item    |    com‐
479         mand_tree_get_info      |      command_tree_set_info      |      com‐
480         mand_tree_item_expanded   |   command_tree_item_expanding   |    com‐
481         mand_tree_item_collapsed   |   command_tree_item_collapsing   |  com‐
482         mand_tree_sel_changed    |    command_tree_sel_changing    |     com‐
483         mand_tree_key_down     |     command_tree_item_activated    |    com‐
484         mand_tree_item_right_click |  command_tree_item_middle_click  |  com‐
485         mand_tree_end_drag    |    command_tree_state_image_click    |   com‐
486         mand_tree_item_gettooltip | command_tree_item_menu:
487
488
489         wxUpdateUI() = #wxUpdateUI{type=wxUpdateUIEventType()}:
490
491
492         wxUpdateUIEventType() = update_ui:
493
494
495         wxWindowCreate() = #wxWindowCreate{type=wxWindowCreateEventType()}:
496
497
498         wxWindowCreateEventType() = create:
499
500
501         wxWindowDestroy()    =    #wxWindowDestroy{type=wxWindowDestroyEvent‐
502         Type()}:
503
504
505         wxWindowDestroyEventType() = destroy:
506
507

EXPORTS

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

AUTHORS

562       <>
563
564
565
566                                   wx 1.8.9                    wxEvtHandler(3)
Impressum