Well, since no one answers, I myself :)
So, how to do it - just create the appropriate event and send it for processing.
wxCommandEvent event; event.SetEventObject(this); event.SetEventType(wxEVT_COMMAND_BUTTON_CLICKED); event.SetId(id_CalcDs); GetEventHandler()->ProcessEvent(event);
The subtlety is (that I didn’t realize right away) that it’s not handling the event that triggers a button, say, but vice versa. Those. if I need to change, say, the state of the TOGGLE_BUTTON switch, then I need to not only handle the event, but first change its state — about
event.SetEventType(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED); event.SetId(id_ToggleButton); toggleButton->SetValue(!toggleButton->GetValue()); // Меняем состояние GetEventHandler()->ProcessEvent(event);
Well, the last thing is how to automate the call initiation ... In principle, it worked in CreateControls() main window, but it seemed to me somewhat "dumb", so I did - I don’t know how correct it was to initiate this process OnIdle() - something like this:
void MainWindow::OnIdle( wxIdleEvent& event) { static bool once = true; if (once) { once = false; AutoRun(); // Здесь вся обработка последовательности } }
Not very sure of absolute correctness, but it works.
Waiting for criticism :)