/ Published in: C++
OnRunWizard() function and simple wizard page class example.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
void AClass::OnRunWizard() { wxWizard *wizard = new wxWizard( this, -1, wxT("Title"), wxNullBitmap, wxDefaultPosition, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER); Page1 *page1 = new Page1( wizard ); Page2 *page2 = new Page2( wizard ); Page3 *page3 = new Page3( wizard ); Page4 *page4 = new Page4( wizard ); wxWizardPageSimple::Chain( page1, page2 ); wxWizardPageSimple::Chain( page2, page3 ); wxWizardPageSimple::Chain( page3, page4 ); wizard->GetPageAreaSizer()->Add( page1 ); if ( wizard->RunWizard(page1) ) { wxMessageBox( wxT("Wizard is over."), wxT("The End"), wxICON_INFORMATION | wxOK); } wizard->Destroy(); } class Page1 : public wxWizardPageSimple { enum { ID_DUMMY_VALUE_ //Dont Delete this DummyValue }; //End of Enum public: Page1 wxWizard *parent ); virtual bool TransferDataFromWindow(); private: }; bool Page1::TransferDataFromWindow() { if ( condition ) { wxMessageBox( wxT("Advice"), wxT("Error!"), wxICON_WARNING | wxOK, this ); return false; } return true; }