file with all events from a widget

I am looking for a way to autogenerate event handling template code for all events in my system. So I am looking for some means of automatically figuring out which events may be launched from a particular wx.Python class. Is there some file I can parse for that info?

Paul

···

--
Paul Sijben tel: +31334566488
Eemvalley Technology fax: +31334557523
the Netherlands http://eemvalley.com

Paul Sijben wrote:

I am looking for a way to autogenerate event handling template code for all events in my system. So I am looking for some means of automatically figuring out which events may be launched from a particular wx.Python class. Is there some file I can parse for that info?

Other than the docs (which certainly have some inaccuracy in this area) there isn't anything like that, although it would certainly be nice to have.

One of the wx SoC projects this year is to complete a widget metadata project that was started a few years ago. When this is complete it will probably be able to be used to discover applicable events (and other properties) at runtime. It just depends on how well that is able to be mapped into Python.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

OK thanks for the info. So I can generate a first stab from the docs and then be more complete after the SoC, that is fine. This is one of those projects that I can not afford to spend time on and at the same time can not afford to let lie....

Robin Dunn wrote:

···

Paul Sijben wrote:

I am looking for a way to autogenerate event handling template code for all events in my system. So I am looking for some means of automatically figuring out which events may be launched from a particular wx.Python class. Is there some file I can parse for that info?

Other than the docs (which certainly have some inaccuracy in this area) there isn't anything like that, although it would certainly be nice to have.

One of the wx SoC projects this year is to complete a widget metadata project that was started a few years ago. When this is complete it will probably be able to be used to discover applicable events (and other properties) at runtime. It just depends on how well that is able to be mapped into Python.

--
Paul Sijben tel: +31334566488
Eemvalley Technology fax: +31334557523
the Netherlands http://eemvalley.com

Here is a bit of help to get you started…

import wx, wx.wizard, wx.calendar

def reverse(dic):
result = {}
for key,val in dic.items():
if val in result:
raise Warning, “Duplicated (%s/%s/%s) found in reverse dictionary.” % (val,key,result[val])

    result[val] = key
return result

EventMapX = {
‘EVT_ACTIVATE’ : wx.wxEVT_ACTIVATE,
‘EVT_ACTIVATE_APP’ : wx.wxEVT_ACTIVATE_APP,
‘EVT_CALCULATE_LAYOUT’ : wx.wxEVT_CALCULATE_LAYOUT,
‘EVT_CALENDAR_DAY_CHANGED’ : wx.calendar.wxEVT_CALENDAR_DAY_CHANGED,
‘EVT_CALENDAR_DOUBLECLICKED’ : wx.calendar.wxEVT_CALENDAR_DOUBLECLICKED,
‘EVT_CALENDAR_MONTH_CHANGED’ : wx.calendar.wxEVT_CALENDAR_MONTH_CHANGED,
‘EVT_CALENDAR_SEL_CHANGED’ : wx.calendar.wxEVT_CALENDAR_SEL_CHANGED,
‘EVT_CALENDAR_WEEKDAY_CLICKED’ : wx.calendar.wxEVT_CALENDAR_WEEKDAY_CLICKED,
‘EVT_CALENDAR_YEAR_CHANGED’ : wx.calendar.wxEVT_CALENDAR_YEAR_CHANGED,
‘EVT_CHAR’ : wx.wxEVT_CHAR,
‘EVT_CHAR_HOOK’ : wx.wxEVT_CHAR_HOOK,
‘EVT_CHILD_FOCUS’ : wx.wxEVT_CHILD_FOCUS,
‘EVT_CLOSE_WINDOW’ : wx.wxEVT_CLOSE_WINDOW,
‘EVT_COMMAND_BUTTON_CLICKED’ : wx.wxEVT_COMMAND_BUTTON_CLICKED,
‘EVT_COMMAND_CHECKBOX_CLICKED’ : wx.wxEVT_COMMAND_CHECKBOX_CLICKED,
‘EVT_COMMAND_CHECKLISTBOX_TOGGLED’ : wx.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED,
‘EVT_COMMAND_CHOICE_SELECTED’ : wx.wxEVT_COMMAND_CHOICE_SELECTED,
‘EVT_COMMAND_COMBOBOX_SELECTED’ : wx.wxEVT_COMMAND_COMBOBOX_SELECTED,
‘EVT_COMMAND_ENTER’ : wx.wxEVT_COMMAND_ENTER,
‘EVT_COMMAND_FIND’ : wx.wxEVT_COMMAND_FIND

···

On 6/4/07, Paul Sijben sijben@eemvalley.com wrote:

OK thanks for the info. So I can generate a first stab from the docs and
then be more complete after the SoC, that is fine. This is one of those

projects that I can not afford to spend time on and at the same time can
not afford to let lie…

,
‘EVT_COMMAND_FIND_CLOSE’ : wx.wxEVT_COMMAND_FIND_CLOSE,
‘EVT_COMMAND_FIND_NEXT’ : wx.wxEVT_COMMAND_FIND_NEXT,
‘EVT_COMMAND_FIND_REPLACE’ : wx.wxEVT_COMMAND_FIND_REPLACE,
‘EVT_COMMAND_FIND_REPLACE_ALL’ : wx.wxEVT_COMMAND_FIND_REPLACE_ALL,
‘EVT_COMMAND_KILL_FOCUS’ : wx.wxEVT_COMMAND_KILL_FOCUS,
‘EVT_COMMAND_LEFT_CLICK’ : wx.wxEVT_COMMAND_LEFT_CLICK,
‘EVT_COMMAND_LEFT_DCLICK’ : wx.wxEVT_COMMAND_LEFT_DCLICK
,
‘EVT_COMMAND_LISTBOOK_PAGE_CHANGED’ : wx.wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED,
‘EVT_COMMAND_LISTBOOK_PAGE_CHANGING’ : wx.wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING,
‘EVT_COMMAND_LISTBOX_DOUBLECLICKED’ : wx.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED,
‘EVT_COMMAND_LISTBOX_SELECTED’ : wx.wxEVT_COMMAND_LISTBOX_SELECTED,
‘EVT_COMMAND_LIST_BEGIN_DRAG’ : wx.wxEVT_COMMAND_LIST_BEGIN_DRAG,
‘EVT_COMMAND_LIST_BEGIN_LABEL_EDIT’ : wx.wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT,
‘EVT_COMMAND_LIST_BEGIN_RDRAG’ : wx.wxEVT_COMMAND_LIST_BEGIN_RDRAG,
‘EVT_COMMAND_LIST_CACHE_HINT’ : wx.wxEVT_COMMAND_LIST_CACHE_HINT,
‘EVT_COMMAND_LIST_COL_BEGIN_DRAG’ : wx.wxEVT_COMMAND_LIST_COL_BEGIN_DRAG,
‘EVT_COMMAND_LIST_COL_CLICK’ : wx.wxEVT_COMMAND_LIST_COL_CLICK,
‘EVT_COMMAND_LIST_COL_DRAGGING’ : wx.wxEVT_COMMAND_LIST_COL_DRAGGING,
‘EVT_COMMAND_LIST_COL_END_DRAG’ : wx.wxEVT_COMMAND_LIST_COL_END_DRAG,
‘EVT_COMMAND_LIST_COL_RIGHT_CLICK’ : wx.wxEVT_COMMAND_LIST_COL_RIGHT_CLICK,
‘EVT_COMMAND_LIST_DELETE_ALL_ITEMS’ : wx.wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS,
‘EVT_COMMAND_LIST_DELETE_ITEM’ : wx.wxEVT_COMMAND_LIST_DELETE_ITEM,
‘EVT_COMMAND_LIST_END_LABEL_EDIT’ : wx.wxEVT_COMMAND_LIST_END_LABEL_EDIT,

‘EVT_COMMAND_LIST_GET_INFO’ : wx.wxEVT_COMMAND_LIST_GET_INFO

,
‘EVT_COMMAND_LIST_INSERT_ITEM’ : wx.wxEVT_COMMAND_LIST_INSERT_ITEM,
‘EVT_COMMAND_LIST_ITEM_ACTIVATED’ : wx.wxEVT_COMMAND_LIST_ITEM_ACTIVATED,
‘EVT_COMMAND_LIST_ITEM_DESELECTED’ : wx.wxEVT_COMMAND_LIST_ITEM_DESELECTED,
‘EVT_COMMAND_LIST_ITEM_FOCUSED’ : wx.wxEVT_COMMAND_LIST_ITEM_FOCUSED,
‘EVT_COMMAND_LIST_ITEM_MIDDLE_CLICK’ : wx.wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK,
‘EVT_COMMAND_LIST_ITEM_RIGHT_CLICK’ : wx.wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK,
‘EVT_COMMAND_LIST_ITEM_SELECTED’ : wx.wxEVT_COMMAND_LIST_ITEM_SELECTED,
‘EVT_COMMAND_LIST_KEY_DOWN’ : wx.wxEVT_COMMAND_LIST_KEY_DOWN,

‘EVT_COMMAND_LIST_SET_INFO’ : wx.wxEVT_COMMAND_LIST_SET_INFO,

'EVT_COMMAND_MENU_SELECTED' : wx.wxEVT_COMMAND_MENU_SELECTED,
'EVT_COMMAND_NOTEBOOK_PAGE_CHANGED' : wx.wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED,
'EVT_COMMAND_NOTEBOOK_PAGE_CHANGING' : wx.wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING,
'EVT_COMMAND_RADIOBOX_SELECTED' : wx.wxEVT_COMMAND_RADIOBOX_SELECTED,
'EVT_COMMAND_RADIOBUTTON_SELECTED' : wx.wxEVT_COMMAND_RADIOBUTTON_SELECTED,
'EVT_COMMAND_RIGHT_CLICK' : wx.wxEVT_COMMAND_RIGHT_CLICK,
'EVT_COMMAND_RIGHT_DCLICK' : wx.wxEVT_COMMAND_RIGHT_DCLICK

,
‘EVT_COMMAND_SCROLLBAR_UPDATED’ : wx.wxEVT_COMMAND_SCROLLBAR_UPDATED,
‘EVT_COMMAND_SET_FOCUS’ : wx.wxEVT_COMMAND_SET_FOCUS,
‘EVT_COMMAND_SLIDER_UPDATED’ : wx.wxEVT_COMMAND_SLIDER_UPDATED
,
‘EVT_COMMAND_SPINCTRL_UPDATED’ : wx.wxEVT_COMMAND_SPINCTRL_UPDATED,

‘EVT_COMMAND_TAB_SEL_CHANGED’ : wx.wxEVT_COMMAND_TAB_SEL_CHANGED,

‘EVT_COMMAND_TAB_SEL_CHANGING’ : wx.wxEVT_COMMAND_TAB_SEL_CHANGING

,
‘EVT_COMMAND_TEXT_COPY’ : wx.wxEVT_COMMAND_TEXT_COPY,
‘EVT_COMMAND_TEXT_CUT’ : wx.wxEVT_COMMAND_TEXT_CUT,
‘EVT_COMMAND_TEXT_ENTER’ : wx.wxEVT_COMMAND_TEXT_ENTER,
‘EVT_COMMAND_TEXT_MAXLEN’ : wx.wxEVT_COMMAND_TEXT_MAXLEN,
‘EVT_COMMAND_TEXT_PASTE’ : wx.wxEVT_COMMAND_TEXT_PASTE,
‘EVT_COMMAND_TEXT_UPDATED’ : wx.wxEVT_COMMAND_TEXT_UPDATED,
‘EVT_COMMAND_TEXT_URL’ : wx.wxEVT_COMMAND_TEXT_URL
,
‘EVT_COMMAND_TOGGLEBUTTON_CLICKED’ : wx.wxEVT_COMMAND_TOGGLEBUTTON_CLICKED,

‘EVT_COMMAND_TOOL_CLICKED’ : wx.wxEVT_COMMAND_TOOL_CLICKED,

'EVT_COMMAND_TOOL_ENTER' : wx.wxEVT_COMMAND_TOOL_ENTER

,
‘EVT_COMMAND_TOOL_RCLICKED’ : wx.wxEVT_COMMAND_TOOL_RCLICKED,
‘EVT_COMMAND_TREE_BEGIN_DRAG’ : wx.wxEVT_COMMAND_TREE_BEGIN_DRAG,
‘EVT_COMMAND_TREE_BEGIN_LABEL_EDIT’ : wx.wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT
,
‘EVT_COMMAND_TREE_BEGIN_RDRAG’ : wx.wxEVT_COMMAND_TREE_BEGIN_RDRAG,
‘EVT_COMMAND_TREE_DELETE_ITEM’ : wx.wxEVT_COMMAND_TREE_DELETE_ITEM,
‘EVT_COMMAND_TREE_END_DRAG’ : wx.wxEVT_COMMAND_TREE_END_DRAG
,
‘EVT_COMMAND_TREE_END_LABEL_EDIT’ : wx.wxEVT_COMMAND_TREE_END_LABEL_EDIT,
‘EVT_COMMAND_TREE_GET_INFO’ : wx.wxEVT_COMMAND_TREE_GET_INFO,
‘EVT_COMMAND_TREE_ITEM_ACTIVATED’ : wx.wxEVT_COMMAND_TREE_ITEM_ACTIVATED
,
‘EVT_COMMAND_TREE_ITEM_COLLAPSED’ : wx.wxEVT_COMMAND_TREE_ITEM_COLLAPSED,
‘EVT_COMMAND_TREE_ITEM_COLLAPSING’ : wx.wxEVT_COMMAND_TREE_ITEM_COLLAPSING,
‘EVT_COMMAND_TREE_ITEM_EXPANDED’ : wx.wxEVT_COMMAND_TREE_ITEM_EXPANDED,
‘EVT_COMMAND_TREE_ITEM_EXPANDING’ : wx.wxEVT_COMMAND_TREE_ITEM_EXPANDING,
‘EVT_COMMAND_TREE_ITEM_GETTOOLTIP’ : wx.wxEVT_COMMAND_TREE_ITEM_GETTOOLTIP,
‘EVT_COMMAND_TREE_ITEM_MENU’ : wx.wxEVT_COMMAND_TREE_ITEM_MENU,
‘EVT_COMMAND_TREE_ITEM_MIDDLE_CLICK’ : wx.wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK,
‘EVT_COMMAND_TREE_ITEM_RIGHT_CLICK’ : wx.wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK,
‘EVT_COMMAND_TREE_KEY_DOWN’ : wx.wxEVT_COMMAND_TREE_KEY_DOWN,
‘EVT_COMMAND_TREE_SEL_CHANGED’ : wx.wxEVT_COMMAND_TREE_SEL_CHANGED,
‘EVT_COMMAND_TREE_SEL_CHANGING’ : wx.wxEVT_COMMAND_TREE_SEL_CHANGING
,
‘EVT_COMMAND_TREE_SET_INFO’ : wx.wxEVT_COMMAND_TREE_SET_INFO,
‘EVT_COMMAND_TREE_STATE_IMAGE_CLICK’ : wx.wxEVT_COMMAND_TREE_STATE_IMAGE_CLICK,
‘EVT_COMMAND_VLBOX_SELECTED’ : wx.wxEVT_COMMAND_VLBOX_SELECTED
,
‘EVT_COMPARE_ITEM’ : wx.wxEVT_COMPARE_ITEM,
‘EVT_CONTEXT_MENU’ : wx.wxEVT_CONTEXT_MENU,
‘EVT_CREATE’ : wx.wxEVT_CREATE,
‘EVT_DESTROY’ : wx.wxEVT_DESTROY,
‘EVT_DISPLAY_CHANGED’ : wx.wxEVT_DISPLAY_CHANGED,
‘EVT_DRAW_ITEM’ : wx.wxEVT_DRAW_ITEM,
‘EVT_DROP_FILES’ : wx.wxEVT_DROP_FILES,
‘EVT_END_SESSION’ : wx.wxEVT_END_SESSION,
‘EVT_ENTER_WINDOW’ : wx.wxEVT_ENTER_WINDOW,
‘EVT_ERASE_BACKGROUND’ : wx.wxEVT_ERASE_BACKGROUND,
‘EVT_FIRST’ : wx.wxEVT_FIRST,
‘EVT_HIBERNATE’ : wx.wxEVT_HIBERNATE,
‘EVT_HOTKEY’ : wx.wxEVT_HOTKEY
,
‘EVT_ICONIZE’ : wx.wxEVT_ICONIZE,
‘EVT_IDLE’ : wx.wxEVT_IDLE,
‘EVT_INIT_DIALOG’ : wx.wxEVT_INIT_DIALOG,
‘EVT_KEY_DOWN’ : wx.wxEVT_KEY_DOWN,
‘EVT_KEY_UP’ : wx.wxEVT_KEY_UP,
‘EVT_KILL_FOCUS’ : wx.wxEVT_KILL_FOCUS,
‘EVT_LEAVE_WINDOW’ : wx.wxEVT_LEAVE_WINDOW,
‘EVT_LEFT_DCLICK’ : wx.wxEVT_LEFT_DCLICK,
‘EVT_LEFT_DOWN’ : wx.wxEVT_LEFT_DOWN,
‘EVT_LEFT_UP’ : wx.wxEVT_LEFT_UP,
‘EVT_MAXIMIZE’ : wx.wxEVT_MAXIMIZE,
‘EVT_MEASURE_ITEM’ : wx.wxEVT_MEASURE_ITEM,
‘EVT_MENU_CLOSE’ : wx.wxEVT_MENU_CLOSE
,
‘EVT_MENU_HIGHLIGHT’ : wx.wxEVT_MENU_HIGHLIGHT,
‘EVT_MENU_OPEN’ : wx.wxEVT_MENU_OPEN,
‘EVT_MIDDLE_DCLICK’ : wx.wxEVT_MIDDLE_DCLICK,
‘EVT_MIDDLE_DOWN’ : wx.wxEVT_MIDDLE_DOWN
,
‘EVT_MIDDLE_UP’ : wx.wxEVT_MIDDLE_UP,
‘EVT_MOTION’ : wx.wxEVT_MOTION,
‘EVT_MOUSEWHEEL’ : wx.wxEVT_MOUSEWHEEL,
‘EVT_MOUSE_CAPTURE_CHANGED’ : wx.wxEVT_MOUSE_CAPTURE_CHANGED
,
‘EVT_MOUSE_CAPTURE_LOST’ : wx.wxEVT_MOUSE_CAPTURE_LOST,
‘EVT_MOVE’ : wx.wxEVT_MOVE,
‘EVT_MOVING’ : wx.wxEVT_MOVING,
‘EVT_NAVIGATION_KEY’ : wx.wxEVT_NAVIGATION_KEY
,
‘EVT_NC_ENTER_WINDOW’ : wx.wxEVT_NC_ENTER_WINDOW,
‘EVT_NC_LEAVE_WINDOW’ : wx.wxEVT_NC_LEAVE_WINDOW,
‘EVT_NC_LEFT_DCLICK’ : wx.wxEVT_NC_LEFT_DCLICK,
‘EVT_NC_LEFT_DOWN’ : wx.wxEVT_NC_LEFT_DOWN,
‘EVT_NC_LEFT_UP’ : wx.wxEVT_NC_LEFT_UP,
‘EVT_NC_MIDDLE_DCLICK’ : wx.wxEVT_NC_MIDDLE_DCLICK,
‘EVT_NC_MIDDLE_DOWN’ : wx.wxEVT_NC_MIDDLE_DOWN,
‘EVT_NC_MIDDLE_UP’ : wx.wxEVT_NC_MIDDLE_UP,
‘EVT_NC_MOTION’ : wx.wxEVT_NC_MOTION,
‘EVT_NC_PAINT’ : wx.wxEVT_NC_PAINT,
‘EVT_NC_RIGHT_DCLICK’ : wx.wxEVT_NC_RIGHT_DCLICK,
‘EVT_NC_RIGHT_DOWN’ : wx.wxEVT_NC_RIGHT_DOWN,
‘EVT_NC_RIGHT_UP’ : wx.wxEVT_NC_RIGHT_UP,
‘EVT_NULL’ : wx.wxEVT_NULL,
‘EVT_PAINT’ : wx.wxEVT_PAINT,
‘EVT_PAINT_ICON’ : wx.wxEVT_PAINT_ICON
,
‘EVT_PALETTE_CHANGED’ : wx.wxEVT_PALETTE_CHANGED,
‘EVT_QUERY_END_SESSION’ : wx.wxEVT_QUERY_END_SESSION,
‘EVT_QUERY_NEW_PALETTE’ : wx.wxEVT_QUERY_NEW_PALETTE,
‘EVT_RIGHT_DCLICK’ : wx.wxEVT_RIGHT_DCLICK,
‘EVT_RIGHT_DOWN’ : wx.wxEVT_RIGHT_DOWN,
‘EVT_RIGHT_UP’ : wx.wxEVT_RIGHT_UP,
‘EVT_SCROLLWIN_BOTTOM’ : wx.wxEVT_SCROLLWIN_BOTTOM,
‘EVT_SCROLLWIN_LINEDOWN’ : wx.wxEVT_SCROLLWIN_LINEDOWN,
‘EVT_SCROLLWIN_LINEUP’ : wx.wxEVT_SCROLLWIN_LINEUP,
‘EVT_SCROLLWIN_PAGEDOWN’ : wx.wxEVT_SCROLLWIN_PAGEDOWN,
‘EVT_SCROLLWIN_PAGEUP’ : wx.wxEVT_SCROLLWIN_PAGEUP
,
‘EVT_SCROLLWIN_THUMBRELEASE’ : wx.wxEVT_SCROLLWIN_THUMBRELEASE,
‘EVT_SCROLLWIN_THUMBTRACK’ : wx.wxEVT_SCROLLWIN_THUMBTRACK,
‘EVT_SCROLLWIN_TOP’ : wx.wxEVT_SCROLLWIN_TOP,
‘EVT_SCROLL_BOTTOM’ : wx.wxEVT_SCROLL_BOTTOM,
‘EVT_SCROLL_CHANGED’ : wx.wxEVT_SCROLL_CHANGED,

‘EVT_SCROLL_ENDSCROLL’ : wx.wxEVT_SCROLL_ENDSCROLL,

'EVT_SCROLL_LINEDOWN' : wx.wxEVT_SCROLL_LINEDOWN,
'EVT_SCROLL_LINEUP' : wx.wxEVT_SCROLL_LINEUP,
'EVT_SCROLL_PAGEDOWN' : wx.wxEVT_SCROLL_PAGEDOWN,
'EVT_SCROLL_PAGEUP' : wx.wxEVT_SCROLL_PAGEUP,
'EVT_SCROLL_THUMBRELEASE' : wx.wxEVT_SCROLL_THUMBRELEASE,
'EVT_SCROLL_THUMBTRACK' : wx.wxEVT_SCROLL_THUMBTRACK,
'EVT_SCROLL_TOP' : wx.wxEVT_SCROLL_TOP,
'EVT_SETTING_CHANGED' : wx.wxEVT_SETTING_CHANGED,
'EVT_SET_CURSOR' : wx.wxEVT_SET_CURSOR,
'EVT_SET_FOCUS' : wx.wxEVT_SET_FOCUS,
'EVT_SHOW' : wx.wxEVT_SHOW,
'EVT_SIZE' : wx.wxEVT_SIZE,
'EVT_SIZING' : wx.wxEVT_SIZING,
'EVT_SYS_COLOUR_CHANGED' : wx.wxEVT_SYS_COLOUR_CHANGED,
'EVT_UPDATE_UI' : wx.wxEVT_UPDATE_UI,
'EVT_USER_FIRST' : wx.wxEVT_USER_FIRST,
}

EventMap = reverse(EventMapX)

def BindEvents(Window, EventHandler=None, Bind=True):
for Child in Window.GetChildren():
BindEvents(Child, EventHandler, Bind)
_BindEvents(Window, Window.ClassName, EventHandler, Bind)
_BindEvents(Window, ‘wxFocusEvent’, EventHandler, Bind)
_BindEvents(Window, ‘wxDropFilesEvent’, EventHandler, Bind)
_BindEvents(Window, ‘wxHelpEvent’, EventHandler, Bind)

_BindEvents(Window, ‘wxKeyEvent’, EventHandler, Bind)

_BindEvents(Window, ‘wxMouseEvent’, EventHandler, Bind)

ClassName = Window.ClassName
if ClassName == 'wxFrame':

    _BindEvents(Window, 'wxMoveEvent',     EventHandler, Bind)
    _BindEvents(Window, 'wxSizeEvent',     EventHandler, Bind)
    _BindEvents(Window, 'wxCloseEvent',    EventHandler, Bind)

    _BindEvents(Window, 'wxIconizeEvent',  EventHandler, Bind)
    _BindEvents(Window, 'wxMaximizeEvent', EventHandler, Bind)
  # _BindEvents(Window, 'wxIdleEvent',     EventHandler, Bind)

def _BindEvents(Window, ClassName, EventHandler, Bind):
if Bind:
BindFunc = Window.Bind
else:
BindFunc = Window.Unbind
EventHandler = None
if ClassName == ‘wxActivateEvent’:

    # Process a wxEVT_ACTIVATE event.
    BindFunc(wx.EVT_ACTIVATE, EventHandler)
    # Process a wxEVT_ACTIVATE_APP event.
    BindFunc(wx.EVT_ACTIVATE_APP, EventHandler)
   
elif ClassName == 'wxBitmapButton':

    BindFunc(wx.EVT_BUTTON, EventHandler)
   
elif ClassName == 'wxButton':
    BindFunc(wx.EVT_BUTTON, EventHandler)
   
elif ClassName == 'wxCalculateLayoutEvent':

    BindFunc(wx.EVT_CALCULATE_LAYOUT, EventHandler)

elif ClassName == ‘wxCalendarCtrl’:
# A day was double clicked in the calendar.
BindFunc(wx.EVT_CALENDAR, EventHandler)
# The selected date changed.
BindFunc(wx.EVT_CALENDAR_SEL_CHANGED
, EventHandler)
# The selected day changed.
BindFunc(wx.EVT_CALENDAR_DAY, EventHandler)
# The selected month changed.
BindFunc(wx.EVT_CALENDAR_MONTH, EventHandler)
# The selected year changed.

    BindFunc(wx.EVT_CALENDAR_YEAR, EventHandler)
    # User clicked on the week day header
    BindFunc(wx.EVT_CALENDAR_WEEKDAY_CLICKED, EventHandler)

elif ClassName == ‘wxCheckBox’:
BindFunc(wx.EVT_CHECKBOX, EventHandler)

elif ClassName == ‘wxCheckListBox’:
BindFunc(wx.EVT_CHECKLISTBOX, EventHandler)

elif ClassName == ‘wxChoice’:
BindFunc(wx.EVT_CHOICE, EventHandler)

elif ClassName == ‘wxCloseEvent’:
BindFunc(wx.EVT_CLOSE, EventHandler)
BindFunc(wx.EVT_QUERY_END_SESSION, EventHandler)
BindFunc(wx.EVT_END_SESSION, EventHandler)

elif ClassName == ‘wxComboBox’:
BindFunc(wx.EVT_COMBOBOX, EventHandler)
BindFunc(wx.EVT_TEXT, EventHandler)

elif ClassName == ‘wxCommandEvent’:
BindFunc(wx.EVT_COMMAND, EventHandler)
BindFunc(wx.EVT_COMMAND_RANGE, EventHandler)
BindFunc(wx.EVT_BUTTON, EventHandler)
BindFunc(
wx.EVT_CHECKBOX, EventHandler)
BindFunc(wx.EVT_CHOICE, EventHandler)
BindFunc(wx.EVT_LISTBOX, EventHandler)
BindFunc(wx.EVT_LISTBOX_DCLICK, EventHandler)
BindFunc(wx.EVT_TEXT
, EventHandler)
BindFunc(wx.EVT_TEXT_ENTER, EventHandler)
BindFunc(wx.EVT_TEXT_MAXLEN, EventHandler)
BindFunc(wx.EVT_MENU, EventHandler)
BindFunc(wx.EVT_MENU_RANGE, EventHandler)
BindFunc(wx.EVT_CONTEXT_MENU, EventHandler)
BindFunc(wx.EVT_SLIDER, EventHandler)
BindFunc(wx.EVT_RADIOBOX, EventHandler)
BindFunc(wx.EVT_RADIOBUTTON, EventHandler)
BindFunc(
wx.EVT_SCROLLBAR, EventHandler)
BindFunc(wx.EVT_COMBOBOX, EventHandler)
BindFunc(wx.EVT_TOOL, EventHandler)
BindFunc(wx.EVT_TOOL_RANGE, EventHandler)
BindFunc(wx.EVT_TOOL_RCLICKED
, EventHandler)
BindFunc(wx.EVT_TOOL_RCLICKED_RANGE, EventHandler)
BindFunc(wx.EVT_TOOL_ENTER, EventHandler)
BindFunc(wx.EVT_COMMAND_LEFT_CLICK, EventHandler)
BindFunc(wx.EVT_COMMAND_LEFT_DCLICK
, EventHandler)
BindFunc(wx.EVT_COMMAND_RIGHT_CLICK, EventHandler)
BindFunc(wx.EVT_COMMAND_SET_FOCUS, EventHandler)
BindFunc(wx.EVT_COMMAND_KILL_FOCUS, EventHandler)
BindFunc(
wx.EVT_COMMAND_ENTER, EventHandler)

elif ClassName == ‘wxDialUpManager’:
# A connection with the network was established.
BindFunc(wx.EVT_DIALUP_CONNECTED, EventHandler)
# The connection with the network was lost.

    BindFunc(wx.EVT_DIALUP_DISCONNECTED, EventHandler)

elif ClassName == ‘wxDropFilesEvent’:
# Process a wxEVT_DROP_FILES event.
BindFunc(wx.EVT_DROP_FILES, EventHandler)

elif ClassName == ‘wxEraseEvent’:
# Process a wxEVT_ERASE_BACKGROUND event.
BindFunc(wx.EVT_ERASE_BACKGROUND, EventHandler)

elif ClassName == ‘wxFindDialogEvent’:
# Find button was pressed in the dialog.
BindFunc(wx.EVT_FIND, EventHandler)
# Find next button was pressed in the dialog.
BindFunc(
wx.EVT_FIND_NEXT, EventHandler)
# Replace button was pressed in the dialog.
BindFunc(wx.EVT_FIND_REPLACE, EventHandler)
# Replace all button was pressed in the dialog.
BindFunc(
wx.EVT_FIND_REPLACE_ALL, EventHandler)
BindFunc(wx.EVT_FIND_CLOSE, EventHandler)

elif ClassName == ‘wxFocusEvent’:
# Process a wxEVT_SET_FOCUS event.
BindFunc(wx.EVT_SET_FOCUS, EventHandler)
# Process a wxEVT_KILL_FOCUS event.
BindFunc(wx.EVT_KILL_FOCUS
, EventHandler)

elif ClassName == ‘wxGridEditorCreatedEvent’:
# The editor for a cell was created. Processes a wxEVT_GRID_EDITOR_CREATED.
BindFunc(wx.EVT_GRID_EDITOR_CREATED, EventHandler)

elif ClassName == ‘wxGridEvent’:
# The user clicked a cell with the left mouse button. Processes a wxEVT_GRID_CELL_LEFT_CLICK.
BindFunc(wx.EVT_GRID_CELL_LEFT_CLICK, EventHandler)
# The user clicked a cell with the right mouse button. Processes a wxEVT_GRID_CELL_RIGHT_CLICK.
BindFunc(wx.EVT_GRID_CELL_RIGHT_CLICK, EventHandler)
# The user double-clicked a cell with the left mouse button. Processes a wxEVT_GRID_CELL_LEFT_DCLICK.

    BindFunc(wx.EVT_GRID_CELL_LEFT_DCLICK, EventHandler)
    # The user double-clicked a cell with the right mouse button. Processes a wxEVT_GRID_CELL_RIGHT_DCLICK.
    BindFunc(wx.EVT_GRID_CELL_RIGHT_DCLICK

, EventHandler)
# The user clicked a label with the left mouse button. Processes a wxEVT_GRID_LABEL_LEFT_CLICK.
BindFunc(wx.EVT_GRID_LABEL_LEFT_CLICK, EventHandler)
# The user clicked a label with the right mouse button. Processes a wxEVT_GRID_LABEL_RIGHT_CLICK.

    BindFunc(wx.EVT_GRID_LABEL_RIGHT_CLICK, EventHandler)
    # The user double-clicked a label with the left mouse button. Processes a wxEVT_GRID_LABEL_LEFT_DCLICK.
    BindFunc(wx.EVT_GRID_LABEL_LEFT_DCLICK

, EventHandler)
# The user double-clicked a label with the right mouse button. Processes a wxEVT_GRID_LABEL_RIGHT_DCLICK.
BindFunc(wx.EVT_GRID_LABEL_RIGHT_DCLICK, EventHandler)
# The user changed the data in a cell. Processes a wxEVT_GRID_CELL_CHANGE.

    BindFunc(wx.EVT_GRID_CELL_CHANGE, EventHandler)
    # The user moved to, and selected a cell. Processes a wxEVT_GRID_SELECT_CELL.
    BindFunc(wx.EVT_GRID_SELECT_CELL, EventHandler)
    # The editor for a cell was hidden. Processes a wxEVT_GRID_EDITOR_HIDDEN.

    BindFunc(wx.EVT_GRID_EDITOR_HIDDEN, EventHandler)
    # The editor for a cell was shown. Processes a wxEVT_GRID_EDITOR_SHOWN.
    BindFunc(wx.EVT_GRID_EDITOR_SHOWN, EventHandler)

elif ClassName == ‘wxGridRangeSelectEvent’:
# The user selected a group of contiguous cells. Processes a wxEVT_GRID_RANGE_SELECT.
BindFunc(wx.EVT_GRID_RANGE_SELECT, EventHandler)

elif ClassName == ‘wxGridSizeEvent’:
# The user resized a column by dragging it. Processes a wxEVT_GRID_COL_SIZE.
BindFunc(wx.EVT_GRID_COL_SIZE, EventHandler)
# The user resized a row by dragging it. Processes a wxEVT_GRID_ROW_SIZE.

    BindFunc(wx.EVT_GRID_ROW_SIZE, EventHandler)

elif ClassName == ‘wxHelpEvent’:
# Process a wxEVT_HELP event.
BindFunc(wx.EVT_HELP, EventHandler)
# Process a wxEVT_HELP event for a range of ids.
BindFunc(wx.EVT_HELP_RANGE
, EventHandler)

elif ClassName == ‘wxIconizeEvent’:
# Process a wxEVT_ICONIZE event.
BindFunc(wx.EVT_ICONIZE, EventHandler)

elif ClassName == ‘wxIdleEvent’:
# Process a wxEVT_IDLE event.
BindFunc(wx.EVT_IDLE, EventHandler)

elif ClassName == ‘wxInitDialogEvent’:
# Process a wxEVT_INIT_DIALOG event.
BindFunc(wx.EVT_INIT_DIALOG, EventHandler)

elif ClassName == ‘wxJoystickEvent’:
# Process a wxEVT_JOY_BUTTON_DOWN event.
BindFunc(wx.EVT_JOY_BUTTON_DOWN, EventHandler)
# Process a wxEVT_JOY_BUTTON_UP event.
BindFunc(
wx.EVT_JOY_BUTTON_UP, EventHandler)
# Process a wxEVT_JOY_MOVE event.
BindFunc(wx.EVT_JOY_MOVE, EventHandler)
# Process a wxEVT_JOY_ZMOVE event.
BindFunc(wx.EVT_JOY_ZMOVE, EventHandler)

elif ClassName == ‘wxKeyEvent’:
# Process a wxEVT_KEY_DOWN event (any key has been pressed).
BindFunc(wx.EVT_KEY_DOWN, EventHandler)
# Process a wxEVT_KEY_UP event (any key has been released).

    BindFunc(wx.EVT_KEY_UP, EventHandler)
    # Process a wxEVT_CHAR event.
    BindFunc(wx.EVT_CHAR, EventHandler)

elif ClassName == ‘wxLayoutAlgorithm’:
BindFunc(wx.EVT_QUERY_LAYOUT_INFO, EventHandler)
BindFunc(wx.EVT_CALCULATE_LAYOUT, EventHandler)

elif ClassName == ‘wxListBox’:
BindFunc(wx.EVT_LISTBOX, EventHandler)
BindFunc(wx.EVT_LISTBOX_DCLICK, EventHandler)

elif ClassName == ‘wxListCtrl’:
# Begin dragging with the left mouse button.
BindFunc(wx.EVT_LIST_BEGIN_DRAG, EventHandler)
# Begin dragging with the right mouse button.
BindFunc(wx.EVT_LIST_BEGIN_RDRAG, EventHandler)
BindFunc(wx.EVT_LIST_BEGIN_LABEL_EDIT, EventHandler)
BindFunc(wx.EVT_LIST_END_LABEL_EDIT, EventHandler)
# Delete an item.
BindFunc(
wx.EVT_LIST_DELETE_ITEM, EventHandler)
# Delete all items.
BindFunc(wx.EVT_LIST_DELETE_ALL_ITEMS, EventHandler)
# The item has been selected.
BindFunc(wx.EVT_LIST_ITEM_SELECTED
, EventHandler)
# The item has been deselected.
BindFunc(wx.EVT_LIST_ITEM_DESELECTED, EventHandler)
BindFunc(wx.EVT_LIST_ITEM_ACTIVATED, EventHandler)
# The currently focused item has changed.

    BindFunc(wx.EVT_LIST_ITEM_FOCUSED, EventHandler)
    # The middle mouse button has been clicked on an item.
    BindFunc(wx.EVT_LIST_ITEM_MIDDLE_CLICK, EventHandler)
    # The right mouse button has been clicked on an item.

    BindFunc(wx.EVT_LIST_ITEM_RIGHT_CLICK, EventHandler)
    # A key has been pressed.
    BindFunc(wx.EVT_LIST_KEY_DOWN, EventHandler)
    # An item has been inserted.
    BindFunc(wx.EVT_LIST_INSERT_ITEM

, EventHandler)
# has been left-clicked.
BindFunc(wx.EVT_LIST_COL_CLICK, EventHandler)
# has been right-clicked.
BindFunc(wx.EVT_LIST_COL_RIGHT_CLICK, EventHandler)
# The user started resizing a column - can be vetoed.

    BindFunc(wx.EVT_LIST_COL_BEGIN_DRAG, EventHandler)
    # The divider between columns is being dragged.
    BindFunc(wx.EVT_LIST_COL_DRAGGING, EventHandler)
    # A column has been resized by the user.

    BindFunc(wx.EVT_LIST_COL_END_DRAG, EventHandler)
    # Prepare cache for a virtual list control
    BindFunc(wx.EVT_LIST_CACHE_HINT, EventHandler)

elif ClassName == ‘wxListEvent’:
# Begin dragging with the left mouse button.
BindFunc(wx.EVT_LIST_BEGIN_DRAG, EventHandler)
# Begin dragging with the right mouse button.
BindFunc(wx.EVT_LIST_BEGIN_RDRAG, EventHandler)
BindFunc(wx.EVT_LIST_BEGIN_LABEL_EDIT, EventHandler)
BindFunc(wx.EVT_LIST_END_LABEL_EDIT, EventHandler)
# Delete an item.
BindFunc(
wx.EVT_LIST_DELETE_ITEM, EventHandler)
# Delete all items.
BindFunc(wx.EVT_LIST_DELETE_ALL_ITEMS, EventHandler)
# The item has been selected.
BindFunc(wx.EVT_LIST_ITEM_SELECTED
, EventHandler)
# The item has been deselected.
BindFunc(wx.EVT_LIST_ITEM_DESELECTED, EventHandler)
BindFunc(wx.EVT_LIST_ITEM_ACTIVATED, EventHandler)
# The currently focused item has changed.

    BindFunc(wx.EVT_LIST_ITEM_FOCUSED, EventHandler)
    # The middle mouse button has been clicked on an item.
    BindFunc(wx.EVT_LIST_ITEM_MIDDLE_CLICK, EventHandler)
    # The right mouse button has been clicked on an item.

    BindFunc(wx.EVT_LIST_ITEM_RIGHT_CLICK, EventHandler)
    # A key has been pressed.
    BindFunc(wx.EVT_LIST_KEY_DOWN, EventHandler)
    # An item has been inserted.
    BindFunc(wx.EVT_LIST_INSERT_ITEM

, EventHandler)
# has been left-clicked.
BindFunc(wx.EVT_LIST_COL_CLICK, EventHandler)
# has been right-clicked.
BindFunc(wx.EVT_LIST_COL_RIGHT_CLICK, EventHandler)
# The user started resizing a column - can be vetoed.

    BindFunc(wx.EVT_LIST_COL_BEGIN_DRAG, EventHandler)
    # The divider between columns is being dragged.
    BindFunc(wx.EVT_LIST_COL_DRAGGING, EventHandler)
    # A column has been resized by the user.

    BindFunc(wx.EVT_LIST_COL_END_DRAG, EventHandler)
    # Prepare cache for a virtual list control
    BindFunc(wx.EVT_LIST_CACHE_HINT, EventHandler)

elif ClassName == ‘wxMaximizeEvent’:
# Process a wxEVT_MAXIMIZE event.
BindFunc(wx.EVT_MAXIMIZE, EventHandler)

elif ClassName == ‘wxMenuEvent’:
BindFunc(wx.EVT_MENU_OPEN, EventHandler)
# A menu has been just closed.
BindFunc(wx.EVT_MENU_CLOSE, EventHandler)
BindFunc(wx.EVT_MENU_HIGHLIGHT
, EventHandler)
BindFunc(wx.EVT_MENU_HIGHLIGHT_ALL, EventHandler)

elif ClassName == ‘wxMouseCaptureChangedEvent’:
# Process a wxEVT_MOUSE_CAPTURE_CHANGED event.
BindFunc(wx.EVT_MOUSE_CAPTURE_CHANGED, EventHandler)

elif ClassName == ‘wxMouseEvent’:
# Process all mouse events.
BindFunc(wx.EVT_MOUSE_EVENTS, EventHandler)
## Process a wxEVT_LEFT_DOWN event.
#BindFunc(wx.EVT_LEFT_DOWN
, EventHandler)
## Process a wxEVT_LEFT_UP event.
#BindFunc(wx.EVT_LEFT_UP, EventHandler)
## Process a wxEVT_LEFT_DCLICK event.
#BindFunc(wx.EVT_LEFT_DCLICK, EventHandler)
## Process a wxEVT_MIDDLE_DOWN event.
#BindFunc(wx.EVT_MIDDLE_DOWN, EventHandler)
## Process a wxEVT_MIDDLE_UP event.
#BindFunc(wx.EVT_MIDDLE_UP, EventHandler)
## Process a wxEVT_MIDDLE_DCLICK event.

    #BindFunc(wx.EVT_MIDDLE_DCLICK, EventHandler)
    ## Process a wxEVT_RIGHT_DOWN event.
    #BindFunc(wx.EVT_RIGHT_DOWN, EventHandler)
    ## Process a wxEVT_RIGHT_UP event.
    #BindFunc(

wx.EVT_RIGHT_UP, EventHandler)
## Process a wxEVT_RIGHT_DCLICK event.
#BindFunc(wx.EVT_RIGHT_DCLICK, EventHandler)
## Process a wxEVT_MOTION event.
#BindFunc(wx.EVT_MOTION, EventHandler)
## Process a wxEVT_ENTER_WINDOW event.
#BindFunc(wx.EVT_ENTER_WINDOW, EventHandler)
## Process a wxEVT_LEAVE_WINDOW event.
#BindFunc(wx.EVT_LEAVE_WINDOW, EventHandler)
## Process a wxEVT_MOUSEWHEEL event.

    #BindFunc(wx.EVT_MOUSEWHEEL, EventHandler)

elif ClassName == ‘wxMoveEvent’:
BindFunc(wx.EVT_MOVE, EventHandler)

elif ClassName == ‘wxNotebookEvent’:
BindFunc(wx.EVT_NOTEBOOK_PAGE_CHANGED, EventHandler)
BindFunc(wx.EVT_NOTEBOOK_PAGE_CHANGING, EventHandler)

elif ClassName == ‘wxPaintEvent’:
# Process a wxEVT_PAINT event.
BindFunc(wx.EVT_PAINT, EventHandler)

elif ClassName == ‘wxProcessEvent’:
BindFunc(wx.EVT_END_PROCESS, EventHandler)

elif ClassName == ‘wxQueryLayoutInfoEvent’:
BindFunc(wx.EVT_QUERY_LAYOUT_INFO, EventHandler)

elif ClassName == ‘wxRadioBox’:
BindFunc(wx.EVT_RADIOBOX, EventHandler)

elif ClassName == ‘wxRadioButton’:
BindFunc(wx.EVT_RADIOBUTTON, EventHandler)

elif ClassName == ‘wxSashEvent’:
BindFunc(wx.EVT_SASH_DRAGGED, EventHandler)
BindFunc(wx.EVT_SASH_DRAGGED_RANGE, EventHandler)

elif ClassName == ‘wxSashWindow’:
BindFunc(wx.EVT_SASH_DRAGGED, EventHandler)
BindFunc(wx.EVT_SASH_DRAGGED_RANGE, EventHandler)

elif ClassName == ‘wxScrollEvent’:
# Process all scroll events.
BindFunc(wx.EVT_SCROLL, EventHandler)
# Process wxEVT_SCROLL_TOP scroll-to-top events (minium position).
BindFunc(wx.EVT_SCROLL_TOP, EventHandler)
# Process wxEVT_SCROLL_TOP scroll-to-bottom events (maximum position).
BindFunc(wx.EVT_SCROLL_BOTTOM, EventHandler)
# Process wxEVT_SCROLL_LINEUP line up events.

    BindFunc(wx.EVT_SCROLL_LINEUP, EventHandler)
    # Process wxEVT_SCROLL_LINEDOWN line down events.
    BindFunc(wx.EVT_SCROLL_LINEDOWN, EventHandler)
    # Process wxEVT_SCROLL_PAGEUP page up events.

    BindFunc(wx.EVT_SCROLL_PAGEUP, EventHandler)
    # Process wxEVT_SCROLL_PAGEDOWN page down events.
    BindFunc(wx.EVT_SCROLL_PAGEDOWN, EventHandler)
    BindFunc(wx.EVT_SCROLL_THUMBTRACK

, EventHandler)
# Process wxEVT_SCROLL_THUMBRELEASE thumb release events.
BindFunc(wx.EVT_SCROLL_THUMBRELEASE, EventHandler)
# Process wxEVT_SCROLL_ENDSCROLL end of scrolling events (MSW only).

    BindFunc(wx.EVT_SCROLL_ENDSCROLL, EventHandler)
    # Process all scroll events.
    BindFunc(wx.EVT_COMMAND_SCROLL, EventHandler)
    BindFunc(wx.EVT_COMMAND_SCROLL_TOP, EventHandler)
    BindFunc(wx.EVT_COMMAND_SCROLL_BOTTOM, EventHandler)
    # Process wxEVT_SCROLL_LINEUP line up events.
    BindFunc(wx.EVT_COMMAND_SCROLL_LINEUP, EventHandler)
    # Process wxEVT_SCROLL_LINEDOWN line down events.

    BindFunc(wx.EVT_COMMAND_SCROLL_LINEDOWN, EventHandler)
    # Process wxEVT_SCROLL_PAGEUP page up events.
    BindFunc(wx.EVT_COMMAND_SCROLL_PAGEUP, EventHandler)
    # Process wxEVT_SCROLL_PAGEDOWN page down events.

    BindFunc(wx.EVT_COMMAND_SCROLL_PAGEDOWN, EventHandler)
    BindFunc(wx.EVT_COMMAND_SCROLL_THUMBTRACK, EventHandler)
    # Process wxEVT_SCROLL_THUMBRELEASE thumb release events.
    BindFunc(

wx.EVT_COMMAND_SCROLL_THUMBRELEASE, EventHandler)
# Process wxEVT_SCROLL_ENDSCROLL end of scrolling events (MSW only).
BindFunc(wx.EVT_COMMAND_SCROLL_ENDSCROLL, EventHandler)

elif ClassName == ‘wxScrollWinEvent’:
# Process all scroll events.
BindFunc(wx.EVT_SCROLLWIN, EventHandler)
# Process wxEVT_SCROLLWIN_TOP scroll-to-top events.
BindFunc(
wx.EVT_SCROLLWIN_TOP, EventHandler)
# Process wxEVT_SCROLLWIN_TOP scroll-to-bottom events.
BindFunc(wx.EVT_SCROLLWIN_BOTTOM, EventHandler)
# Process wxEVT_SCROLLWIN_LINEUP line up events.

    BindFunc(wx.EVT_SCROLLWIN_LINEUP, EventHandler)
    # Process wxEVT_SCROLLWIN_LINEDOWN line down events.
    BindFunc(wx.EVT_SCROLLWIN_LINEDOWN, EventHandler)
    # Process wxEVT_SCROLLWIN_PAGEUP page up events.

    BindFunc(wx.EVT_SCROLLWIN_PAGEUP, EventHandler)
    # Process wxEVT_SCROLLWIN_PAGEDOWN page down events.
    BindFunc(wx.EVT_SCROLLWIN_PAGEDOWN, EventHandler)
    BindFunc(wx.EVT_SCROLLWIN_THUMBTRACK

, EventHandler)
# Process wxEVT_SCROLLWIN_THUMBRELEASE thumb release events.
BindFunc(wx.EVT_SCROLLWIN_THUMBRELEASE, EventHandler)

elif ClassName == ‘wxSizeEvent’:
# Process a wxEVT_SIZE event.
BindFunc(wx.EVT_SIZE, EventHandler)

elif ClassName == ‘wxSlider’:
# Process all scroll events.
BindFunc(wx.EVT_SCROLL, EventHandler)
# Process wxEVT_SCROLL_TOP scroll-to-top events (minium position).
BindFunc(
wx.EVT_SCROLL_TOP, EventHandler)
# Process wxEVT_SCROLL_TOP scroll-to-bottom events (maximum position).
BindFunc(wx.EVT_SCROLL_BOTTOM, EventHandler)
# Process wxEVT_SCROLL_LINEUP line up events.

    BindFunc(wx.EVT_SCROLL_LINEUP, EventHandler)
    # Process wxEVT_SCROLL_LINEDOWN line down events.
    BindFunc(wx.EVT_SCROLL_LINEDOWN, EventHandler)
    # Process wxEVT_SCROLL_PAGEUP page up events.

    BindFunc(wx.EVT_SCROLL_PAGEUP, EventHandler)
    # Process wxEVT_SCROLL_PAGEDOWN page down events.
    BindFunc(wx.EVT_SCROLL_PAGEDOWN, EventHandler)
    BindFunc(wx.EVT_SCROLL_THUMBTRACK

, EventHandler)
# Process wxEVT_SCROLL_THUMBRELEASE thumb release events.
BindFunc(wx.EVT_SCROLL_THUMBRELEASE, EventHandler)
# Process wxEVT_SCROLL_ENDSCROLL end of scrolling events (MSW only).

    BindFunc(wx.EVT_SCROLL_ENDSCROLL, EventHandler)
    # Process all scroll events.
    BindFunc(wx.EVT_COMMAND_SCROLL, EventHandler)
    BindFunc(wx.EVT_COMMAND_SCROLL_TOP, EventHandler)
    BindFunc(wx.EVT_COMMAND_SCROLL_BOTTOM, EventHandler)
    # Process wxEVT_SCROLL_LINEUP line up events.
    BindFunc(wx.EVT_COMMAND_SCROLL_LINEUP, EventHandler)
    # Process wxEVT_SCROLL_LINEDOWN line down events.

    BindFunc(wx.EVT_COMMAND_SCROLL_LINEDOWN, EventHandler)
    # Process wxEVT_SCROLL_PAGEUP page up events.
    BindFunc(wx.EVT_COMMAND_SCROLL_PAGEUP, EventHandler)
    # Process wxEVT_SCROLL_PAGEDOWN page down events.

    BindFunc(wx.EVT_COMMAND_SCROLL_PAGEDOWN, EventHandler)
    BindFunc(wx.EVT_COMMAND_SCROLL_THUMBTRACK, EventHandler)
    # Process wxEVT_SCROLL_THUMBRELEASE thumb release events.
    BindFunc(

wx.EVT_COMMAND_SCROLL_THUMBRELEASE, EventHandler)
# Process wxEVT_SCROLL_ENDSCROLL end of scrolling events (MSW only).
BindFunc(wx.EVT_COMMAND_SCROLL_ENDSCROLL, EventHandler)

elif ClassName == ‘wxSocketBase’:
# Process a wxEVT_SOCKET event.
BindFunc(wx.EVT_SOCKET, EventHandler)

elif ClassName == ‘wxSocketEvent’:
# Process a socket event, supplying the member function.
BindFunc(wx.EVT_SOCKET, EventHandler)

elif ClassName == ‘wxSpinCtrl’:
BindFunc(wx.EVT_SPINCTRL, EventHandler)

elif ClassName == ‘wxSpinEvent’:
# Generated whenever an arrow is pressed.
BindFunc(wx.EVT_SPIN, EventHandler)
# Generated when left/up arrow is pressed.
BindFunc(
wx.EVT_SPIN_UP, EventHandler)
# Generated when right/down arrow is pressed.
BindFunc(wx.EVT_SPIN_DOWN, EventHandler)

elif ClassName == ‘wxSplitterEvent’:
BindFunc(wx.EVT_SPLITTER_SASH_POS_CHANGING, EventHandler)
BindFunc(wx.EVT_SPLITTER_SASH_POS_CHANGED, EventHandler)
BindFunc(wx.EVT_SPLITTER_UNSPLIT
, EventHandler)
BindFunc(wx.EVT_SPLITTER_DCLICK, EventHandler)

elif ClassName == ‘wxSplitterWindow’:
BindFunc(wx.EVT_SPLITTER_SASH_POS_CHANGING, EventHandler)
BindFunc(wx.EVT_SPLITTER_SASH_POS_CHANGED, EventHandler)
BindFunc(wx.EVT_SPLITTER_UNSPLIT
, EventHandler)
BindFunc(wx.EVT_SPLITTER_DCLICK, EventHandler)

elif ClassName == ‘wxSysColourChangedEvent’:
# Process a wxEVT_SYS_COLOUR_CHANGED event.
BindFunc(wx.EVT_SYS_COLOUR_CHANGED, EventHandler)

elif ClassName == ‘wxTabEvent’:
BindFunc(wx.EVT_TAB_SEL_CHANGED, EventHandler)
BindFunc(wx.EVT_TAB_SEL_CHANGING, EventHandler)

elif ClassName == ‘wxTaskBarIcon’:
BindFunc(wx.EVT_TASKBAR_MOVE, EventHandler)
BindFunc(wx.EVT_TASKBAR_LEFT_DOWN, EventHandler)
BindFunc(wx.EVT_TASKBAR_LEFT_UP, EventHandler)
BindFunc(wx.EVT_TASKBAR_RIGHT_DOWN, EventHandler)
BindFunc(wx.EVT_TASKBAR_RIGHT_UP, EventHandler)
BindFunc(wx.EVT_TASKBAR_LEFT_DCLICK, EventHandler)
BindFunc(wx.EVT_TASKBAR_RIGHT_DCLICK
, EventHandler)

elif ClassName == ‘wxTextCtrl’:
BindFunc(wx.EVT_TEXT, EventHandler)
BindFunc(wx.EVT_TEXT_ENTER, EventHandler)
BindFunc(wx.EVT_TEXT_URL, EventHandler)
BindFunc(
wx.EVT_TEXT_MAXLEN, EventHandler)

elif ClassName == ‘wxToggleButton’:
# Handles button click event.
BindFunc(wx.EVT_TOGGLEBUTTON, EventHandler)

elif ClassName == ‘wxToolBar’:
BindFunc(wx.EVT_TOOL, EventHandler)
# The same as EVT_TOOL.
BindFunc(wx.EVT_MENU, EventHandler)
BindFunc(wx.EVT_TOOL_RANGE, EventHandler)
# The same as EVT_TOOL_RANGE.
BindFunc(wx.EVT_MENU_RANGE, EventHandler)
BindFunc(wx.EVT_TOOL_RCLICKED, EventHandler)
BindFunc(wx.EVT_TOOL_RCLICKED_RANGE, EventHandler)
BindFunc(
wx.EVT_TOOL_ENTER, EventHandler)

elif ClassName == ‘wxTreeCtrl’:
# Begin dragging with the left mouse button.
BindFunc(wx.EVT_TREE_BEGIN_DRAG, EventHandler)
# Begin dragging with the right mouse button.
BindFunc(wx.EVT_TREE_BEGIN_RDRAG, EventHandler)
BindFunc(wx.EVT_TREE_BEGIN_LABEL_EDIT, EventHandler)
BindFunc(wx.EVT_TREE_END_LABEL_EDIT, EventHandler)
# Delete an item.
BindFunc(
wx.EVT_TREE_DELETE_ITEM, EventHandler)
# Request information from the application.
BindFunc(wx.EVT_TREE_GET_INFO, EventHandler)
# Information is being supplied.
BindFunc(wx.EVT_TREE_SET_INFO
, EventHandler)
# The item has been activated, i.e. chosen by double clicking it with mouse or from keyboard
BindFunc(wx.EVT_TREE_ITEM_ACTIVATED, EventHandler)
# The item has been collapsed.

    BindFunc(wx.EVT_TREE_ITEM_COLLAPSED, EventHandler)
    BindFunc(wx.EVT_TREE_ITEM_COLLAPSING, EventHandler)
    # The item has been expanded.
    BindFunc(wx.EVT_TREE_ITEM_EXPANDED, EventHandler)
    BindFunc(wx.EVT_TREE_ITEM_EXPANDING, EventHandler)
    # Selection has changed.
    BindFunc(wx.EVT_TREE_SEL_CHANGED, EventHandler)
    BindFunc(wx.EVT_TREE_SEL_CHANGING, EventHandler)
    # A key has been pressed.
    BindFunc(wx.EVT_TREE_KEY_DOWN, EventHandler)
    BindFunc(wx.EVT_TREE_ITEM_GETTOOLTIP, EventHandler)

elif ClassName == ‘wxTreeEvent’:
# The user has started dragging an item with the
# left mouse button. The event handler must call
# wxTreeEvent::Allow() for the drag operation to continue.

    BindFunc(wx.EVT_TREE_BEGIN_DRAG, EventHandler)
    # The user has started dragging an item with the
    # right mouse button. The event handler must call
    # wxTreeEvent::Allow() for the drag operation to continue.

    BindFunc(wx.EVT_TREE_BEGIN_RDRAG, EventHandler)
    BindFunc(wx.EVT_TREE_BEGIN_LABEL_EDIT, EventHandler)
    # The user has released the mouse after dragging an item.
    BindFunc(wx.EVT_TREE_END_DRAG

, EventHandler)
BindFunc(wx.EVT_TREE_END_LABEL_EDIT, EventHandler)
# A tree item has been deleted.
BindFunc(wx.EVT_TREE_DELETE_ITEM, EventHandler)
BindFunc(wx.EVT_TREE_ITEM_ACTIVATED
, EventHandler)
# The item has been collapsed.
BindFunc(wx.EVT_TREE_ITEM_COLLAPSED, EventHandler)
BindFunc(wx.EVT_TREE_ITEM_COLLAPSING, EventHandler)
# The item has been expanded.

    BindFunc(wx.EVT_TREE_ITEM_EXPANDED, EventHandler)
    BindFunc(wx.EVT_TREE_ITEM_EXPANDING, EventHandler)
    # The user has clicked the item with the right mouse button.
    BindFunc(wx.EVT_TREE_ITEM_RIGHT_CLICK

, EventHandler)
# The user has clicked the item with the middle mouse button.
BindFunc(wx.EVT_TREE_ITEM_MIDDLE_CLICK, EventHandler)
# A key has been pressed.
BindFunc(wx.EVT_TREE_KEY_DOWN
, EventHandler)
# Selection has changed.
BindFunc(wx.EVT_TREE_SEL_CHANGED, EventHandler)
BindFunc(wx.EVT_TREE_SEL_CHANGING, EventHandler)
# A key has been pressed.
BindFunc(
wx.EVT_TREE_KEY_DOWN, EventHandler)
BindFunc(wx.EVT_TREE_ITEM_GETTOOLTIP, EventHandler)

elif ClassName == ‘wxUpdateUIEvent’:
# Process a wxEVT_UPDATE_UI event for the command with the given id.
BindFunc(wx.EVT_UPDATE_UI, EventHandler)
# Process a wxEVT_UPDATE_UI event for any command with id included in the given range.

    BindFunc(wx.EVT_UPDATE_UI_RANGE, EventHandler)

elif ClassName == ‘wxWizard’:
BindFunc(wx.EVT_WIZARD_PAGE_CHANGED, EventHandler)
BindFunc(wx.EVT_WIZARD_PAGE_CHANGING, EventHandler)
BindFunc(wx.EVT_WIZARD_CANCEL, EventHandler)
# The wizard help button was pressed.
BindFunc(wx.EVT_WIZARD_HELP, EventHandler)
# The wizard finished button was pressed.
BindFunc(wx.EVT_WIZARD_FINISHED, EventHandler)

elif ClassName == ‘wxWizardEvent’:
BindFunc(wx.EVT_WIZARD_PAGE_CHANGED, EventHandler)
BindFunc(wx.EVT_WIZARD_PAGE_CHANGING, EventHandler)
BindFunc(wx.EVT_WIZARD_CANCEL, EventHandler)
# The wizard help button was pressed.
BindFunc(wx.EVT_WIZARD_HELP, EventHandler)
# The wizard finished button was pressed.
BindFunc(wx.EVT_WIZARD_FINISHED, EventHandler)

if name==‘main’:
import pprint
pprint.pprint(EventMap)

Paul Perez wrote:

    OK thanks for the info. So I can generate a first stab from the docs and
    then be more complete after the SoC, that is fine. This is one of those
    projects that I can not afford to spend time on and at the same time can
    not afford to let lie....

import wx, wx.wizard, wx.calendar

def reverse(dic):
    result = {}
    for key,val in dic.items():
        if val in result:
            raise Warning, "Duplicated (%s/%s/%s) found in reverse dictionary." % (val,key,result[val])
        result[val] = key
    return result

EventMapX = {
    'EVT_ACTIVATE' : wx.wxEVT_ACTIVATE,

BTW, starting in 2.8 you can use the binder object's typeId property to get the value of the corresponding wxEventType. For example:

  >>>
  >>> import wx
  >>> wx.EVT_ACTIVATE.typeId
  10158
  >>> wx.wxEVT_ACTIVATE
  10158

···

On 6/4/07, *Paul Sijben* <sijben@eemvalley.com > <mailto:sijben@eemvalley.com>> wrote:

  >>>

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Paul,

thanks for the input! Unfortunately I needed it ordered by launching class.

Spent the (too hot) Friday afternoon making a script (attached) that tries to get the events from the source tree. It does its job quite bluntly but it seems to yield the desired result.

When running it as python getWxEvents.py /home/sijben/Desktop/wxPython-src-2.8.4.0/wxPython/src I got the second attached file. I hope it is to some use for somebody.

I noticed it it not completely correct (e.g. the events for a slider are wrong). But it will suffice for now for me.

Paul

Robin Dunn wrote:

getWxEvents.py (2.15 KB)

wxEventsByObjectType.py (9.31 KB)

···

Paul Perez wrote:

On 6/4/07, *Paul Sijben* <sijben@eemvalley.com >> <mailto:sijben@eemvalley.com>> wrote:

    OK thanks for the info. So I can generate a first stab from the docs and
    then be more complete after the SoC, that is fine. This is one of those
    projects that I can not afford to spend time on and at the same time can
    not afford to let lie....

import wx, wx.wizard, wx.calendar

def reverse(dic):
    result = {}
    for key,val in dic.items():
        if val in result:
            raise Warning, "Duplicated (%s/%s/%s) found in reverse dictionary." % (val,key,result[val])
        result[val] = key
    return result

EventMapX = {
    'EVT_ACTIVATE' : wx.wxEVT_ACTIVATE,

BTW, starting in 2.8 you can use the binder object's typeId property to get the value of the corresponding wxEventType. For example:

>>>
>>> import wx
>>> wx.EVT_ACTIVATE.typeId
10158
>>> wx.wxEVT_ACTIVATE
10158
>>>

--
Paul Sijben tel: +31334566488
Eemvalley Technology fax: +31334557523
the Netherlands http://eemvalley.com