wxEvent.EventType

Is there any utility function which interprets the bits of an event's type into text?

Colin W.

This is a lovely snippet of code, but to my surprise, when I tried getting
the name for type EVT_MENU, I got EVT_TOOL_RANGE. A closer look revealed
that there are four entries with the same type:

    10010 EVT_MENU
    10010 EVT_MENU_RANGE
    10010 EVT_TOOL
    10010 EVT_TOOL_RANGE

After removing duplicate type entries, the original 231 entries was reduced
to 196, so there are 35 duplicates. I would appreciate an explanation for
this.

Thanks,

Roger House

···

--
View this message in context: http://wxpython-users.1045709.n5.nabble.com/wxEvent-EventType-tp2357268p5538579.html
Sent from the wxPython-users mailing list archive at Nabble.com.

Roger House wrote:

This is a lovely snippet of code, but to my surprise, when I tried getting
the name for type EVT_MENU, I got EVT_TOOL_RANGE. A closer look revealed
that there are four entries with the same type:

    10010 EVT_MENU
    10010 EVT_MENU_RANGE
    10010 EVT_TOOL
    10010 EVT_TOOL_RANGE

There is more to an event than its ID number. EVT_MENU_RANGE is a
shortcut that lets you bind EVT_MENU for a series of IDs. EVT_MENU is
bound with one parameter, EVT_MENU_RANGE is bound with two parameters (a
range of IDs), but it's the same event.

Windows treats tool bar hits and menu selections identically, so it's
not a surprise that they bind to the same ID.

···

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.