Visual Studio 2008 C++ Windows Xp SP3
I have created a wxWidgets form (using wxFormBuilder) and have buttons/menus/toolbars all generating events to call various methods (all this works perfectly). Each of these event methods is defined like this:
void cLoggingFrame::me_InsertCommentText(wxCommandEvent& event);
Now, what I want to be able to do is 're-use' some of these methods by calling them directly. I don't want to generate an event to be handled, I want the method to run when I call it. For example, I want to do something like this (this doesn't work)
me_InsertCommentText(NULL);
Now, I understand that I could have each event method just call another method (without parameters) that could be called from other locations, but in other languages I've been able to bypass the parameter requirement with NULL.
Is there any way to do this with wxWidgets without the need for an additional method?
Methods passed to Event-Handlers are just ordinary c++ methods, you have to pass correct parametes something like this will do the trick
just use the event variable that is already created by wxwidgets. The command line should be like this:
me_InsertCommentText(event);