Discussion:
concept question with form builder tools: adding custom event handlers
Lars Uffmann
2008-03-18 12:07:25 UTC
Permalink
Hi everyone,

I'm using wxFormBuilder - starting to get the hang of it - but now I
haven't modified my form for a while, and have introduced an event
handler of my own to the application (for use with threading and
wxPostEvent), that is not linked to any of the "Events" of the widgets /
controls. So I added the virtual event handler to the GUI-part of the
code (the wxFormBuilder-generated files), including connecting it to the
main frame in the constructor, and disconnecting in the destructor.

Upon my next use of wxFormBuilder, I'm bound to run into manual editing
there - so I was wondring what the better approach to adding custom
event handlers would be.

Skip the virtual event handler, and only add it to the derived class
that holds the real event handlers? Then include the connect and
disconnect in that class' constructor / destructor? Or what would you
suggest?

Any ideas welcome :)

Lars
Lars Uffmann
2008-03-18 12:17:47 UTC
Permalink
Never mind. I should have tested this before posting.

Yes, apparently it is the way to only declare the new event handler in
the derived class (the one that wxFormBuilder creates when you do
Tools->Generate Inherited Class), and connect/disconnect it to whatever
control you want it to be linked to in the respective
constructor/destructor.

Sorry & ignore ;)

Lars

Loading...