Exemple #1
0
luNewProjWizard::luNewProjWizard(wxFrame* parent, bool useSizer) :
	 wxWizard(parent, ID_NEW_PROJ_WIZARD, _T("Create New Project Wizard"),
                   wxBitmap(wiz_xpm),wxDefaultPosition,
                   wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
	SetBitmapPlacement(wxWIZARD_VALIGN_CENTRE);

    SetLayoutAdaptationMode(wxDIALOG_ADAPTATION_MODE_ENABLED);

    m_page1 = new wxWizardPageSimple(this);

	new wxStaticText(m_page1, wxID_ANY,
		_T("Create New Project for LuaEditor"),
		wxPoint(5,5)
	);

	m_page2 = new luNewProjNamePage(this);
	m_page3 = new luNewProjTemplatePage(this);
	m_page4 = new luNewProjFinishPage(this);

	wxWizardPageSimple::Chain(m_page1, m_page2);
	wxWizardPageSimple::Chain(m_page2, m_page3);
	wxWizardPageSimple::Chain(m_page3, m_page4);


	if (useSizer)
		GetPageAreaSizer()->Add(m_page1);

}
MyWizard::MyWizard(wxFrame *frame, bool useSizer)
{
    SetExtraStyle(wxWIZARD_EX_HELPBUTTON);

    Create(frame,wxID_ANY,wxT("Absolutely Useless Wizard"),
                   wxBitmap(wiztest_xpm),wxDefaultPosition,
                   wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
    SetIcon(wxICON(sample));

    // Allow the bitmap to be expanded to fit the page height
    if (frame->GetMenuBar()->IsChecked(Wizard_ExpandBitmap))
        SetBitmapPlacement(wxWIZARD_VALIGN_CENTRE);

    // Enable scrolling adaptation
    if (frame->GetMenuBar()->IsChecked(Wizard_LargeWizard))
        SetLayoutAdaptationMode(wxDIALOG_ADAPTATION_MODE_ENABLED);

    // a wizard page may be either an object of predefined class
    m_page1 = new wxWizardPageSimple(this);

    /* wxStaticText *text = */ new wxStaticText(m_page1, wxID_ANY,
             wxT("This wizard doesn't help you\nto do anything at all.\n")
             wxT("\n")
             wxT("The next pages will present you\nwith more useless controls."),
             wxPoint(5,5)
        );

    // ... or a derived class
    wxRadioboxPage *page3 = new wxRadioboxPage(this);
    wxValidationPage *page4 = new wxValidationPage(this);

    // set the page order using a convenience function - could also use
    // SetNext/Prev directly as below, but Chain() is shorter, avoids the risk
    // of an error and can itself be chained, e.g. you could write
    // page3.Chain(page4).Chain(page5) and so on.
    page3->Chain(page4);

    // this page is not a wxWizardPageSimple, so we use SetNext/Prev to insert
    // it into the chain of pages
    wxCheckboxPage *page2 = new wxCheckboxPage(this, m_page1, page3);
    m_page1->SetNext(page2);
    page3->SetPrev(page2);

    if ( useSizer )
    {
        // allow the wizard to size itself around the pages
        GetPageAreaSizer()->Add(m_page1);
    }
}