#ifndef _WizardPage_WizardPage_h
#define _WizardPage_WizardPage_h
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
#define LAYOUTFILE <WizardPage/WizardPage.lay>
#include <CtrlCore/lay.h>
class WizardPage : public WithWizardPageLayout<TopWindow> {
WithPage1Layout<ParentCtrl> Page1;
WithPage2Layout<ParentCtrl> Page2;
WithPage3Layout<ParentCtrl> Page3;
Array<ParentCtrl*> pageList;
int in_page;
void ClickNext();
public:
typedef WizardPage CLASSNAME;
WizardPage();
};
#endif
#include "WizardPage.h"
WizardPage::WizardPage()
{
CtrlLayout(*this, "Window title");
CtrlLayout(Page1);
pcPageBox.Add(Page1);
pageList.Add(&Page1);
CtrlLayout(Page2);
pcPageBox.Add(Page2);
pageList.Add(&Page2);
CtrlLayout(Page3);
pcPageBox.Add(Page3);
pageList.Add(&Page3);
Page1.Hide();
Page2.Hide();
Page3.Hide();
in_page=1;
pageList[in_page-1]->Show();
btnNext<<=THISBACK(ClickNext);
}
void WizardPage::ClickNext()
{
if(pageList.GetCount()>in_page)
{
pageList[in_page-1]->Hide();
++in_page;
pageList[in_page-1]->Show();
}
}
GUI_APP_MAIN
{
WizardPage().Run();
}
LAYOUT(WizardPageLayout, 424, 228)
ITEM(Button, btnNext, SetLabel(t_("Next")).LeftPosZ(316, 56).TopPosZ(200, 15))
ITEM(ParentCtrl, pcPageBox, LeftPosZ(32, 356).TopPosZ(36, 148))
END_LAYOUT
LAYOUT(Page1Layout, 400, 200)
ITEM(EditString, dv___0, LeftPosZ(132, 64).TopPosZ(40, 19))
ITEM(StaticText, dv___1, SetText(t_("This is page 1")).LeftPosZ(8, 160).TopPosZ(0, 19))
END_LAYOUT
LAYOUT(Page2Layout, 400, 200)
ITEM(Option, dv___0, SetLabel(t_("test")).LeftPosZ(32, 56).TopPosZ(48, 16))
ITEM(StaticText, dv___1, SetText(t_("This is page 2")).LeftPosZ(16, 160).TopPosZ(8, 19))
END_LAYOUT
LAYOUT(Page3Layout, 400, 200)
ITEM(StaticText, dv___0, SetText(t_("This is page 3")).LeftPosZ(16, 160).TopPosZ(44, 19))
ITEM(LabelBox, dv___1, LeftPosZ(56, 76).TopPosZ(64, 60))
END_LAYOUT
]]>