catching all control events with one handler?

Vadim Zeitlin vadim at wxwidgets.org
Mon Feb 11 05:47:18 PST 2008


On Mon, 11 Feb 2008 05:00:39 -0800 (PST) rory <rorywalsh at gmail.com> wrote:

r> Is it possible to catch and process all controls events with one event
r> handler? At the moment I have different events handlers for
r> scrollbars, comboboxs and checkboxes. I know I can check the type of
r> control that is sending the event but I'm having problems mixing
r> command events with scroll events. In my event table I have been using
r> EVT_MENU and EVT_COMMAND_SCROLL, how do I create an event handler that
r> handles all events?

 If you really need *all* events, you should override ProcessEvent()
virtual function. But you rarely want to process all of them so usually you
just use a few event table macros and forward them all to a single handler.

 Regards,
VZ

-- 
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/





More information about the wx-users mailing list