Return to Snippet

Revision: 977
at August 24, 2006 18:19 by yuconner


Updated Code
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;
}

Revision: 976
at August 24, 2006 14:06 by yuconner


Initial Code
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 );

	wxWizardPageSimple::Chain( page1, page2 );
	wxWizardPageSimple::Chain( page2, page3 );

	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;
}

Initial URL


Initial Description
OnRunWizard() function and simple wizard page class example.

Initial Title
wxWidgets wizard structure

Initial Tags


Initial Language
C++