将CWizard::AddDialog()函数改名为CWizard::AddPage()函数
现举例如下:
#include <Symbol.h>
#include <MyFrame.h>
int far Page1(CObject* pCurObj)
{
//Create a Dialog On the Center of Desktop
CDialog* pDialog = new CDialog;//分配实例
pDialog->CreateWindow(0, 0, 321, 240, "第一页:1");//建立窗口
pDialog->Center();//窗口对中
//Create Close's Button Control
CCloseButton* pCloseButton = new CCloseButton(pDialog);//分配和建立关闭按钮
//Create a Button Control
CButton* pButton1 = new CButton(pDialog);
pButton1->CreateObject(10, 199, 93, 24, "上一步(\x3P\x3)");
pButton1->SetShortcutKey(VK_ALT_P);
pButton1->SetFc(ClickNoButton);
//Create a Button Control
CButton* pButton2 = new CButton(pDialog);
pButton2->CreateObject(111, 199, 93, 24, "下一步(\x3N\x3)");
pButton2->SetShortcutKey(VK_ALT_N);
pButton2->SetFc(ClickYesButton);
//Create a Button Control
CButton* pButton3 = new CButton(pDialog);
pButton3->CreateObject(211, 199, 93, 24, "退出(\x3\C\x3)");
pButton3->SetShortcutKey(VK_ALT_C);
pButton3->SetFc(ClickCancelButton);
//Create Radio Control
CRadio* pRadio1 = new CRadio(pDialog);
pRadio1->CreateObject(28, 59, 57, 24, "男姓");
pRadio1->SetStatic(TRUE);
pRadio1->SetRadio(TRUE);
pRadio1->SetID(RADIOBASE + 1 - 1);
//Create Radio Control
CRadio* pRadio2 = new CRadio(pDialog);
pRadio2->CreateObject(100, 61, 57, 24, "女性");
pRadio2->SetID(RADIOBASE + 2 - 1);
//Create Radio Control
CRadio* pRadio3 = new CRadio(pDialog);
pRadio3->CreateObject(171, 61, 57, 24, "保密");
pRadio3->SetID(RADIOBASE + 3 - 1);
//Create Radio Control
CRadio* pRadio4 = new CRadio(pDialog);
pRadio4->CreateObject(28, 148, 57, 24, "大专");
pRadio4->SetStatic(TRUE);
pRadio4->SetRadio(TRUE);
pRadio4->SetID(RADIOBASE + 4 - 1);
//Create Radio Control
CRadio* pRadio5 = new CRadio(pDialog);
pRadio5->CreateObject(100, 148, 57, 24, "本科");
pRadio5->SetID(RADIOBASE + 5 - 1);
//Create Radio Control
CRadio* pRadio6 = new CRadio(pDialog);
pRadio6->CreateObject(169, 148, 57, 24, "硕士");
pRadio6->SetID(RADIOBASE + 6 - 1);
//Create Radio Control
CRadio* pRadio7 = new CRadio(pDialog);
pRadio7->CreateObject(229, 147, 57, 24, "博士");
pRadio7->SetID(RADIOBASE + 7 - 1);
//Create Group Control
CStatic* pGroup1 = new CStatic(pDialog);
pGroup1->CreateObject(10, 29, 285, 67, "性别");
//Create Group Control
CStatic* pGroup2 = new CStatic(pDialog);
pGroup2->CreateObject(10, 118, 285, 66, "学位");
//Show Window
pDialog->ShowWindow();//显示窗口
//go into Message Loop
int nResult = pDialog->DoModal();//进入窗口消息循环
//Destroy Window
delete pDialog;//删除对话框
return (nResult);
}
int far Page2(CObject* pCurObj)
{
//Create a Dialog On the Center of Desktop
CDialog* pDialog = new CDialog;//分配实例
pDialog->CreateWindow(0, 0, 321, 240, "第二页:2");//建立窗口
pDialog->Center();//窗口对中
//Create Close's Button Control
CCloseButton* pCloseButton = new CCloseButton(pDialog);//分配和建立关闭按钮
//Create a Button Control
CButton* pButton1 = new CButton(pDialog);
pButton1->CreateObject(10, 199, 93, 24, "上一步(\x3P\x3)");
pButton1->SetShortcutKey(VK_ALT_P);
pButton1->SetFc(ClickNoButton);
//Create a Button Control
CButton* pButton2 = new CButton(pDialog);
pButton2->CreateObject(111, 199, 93, 24, "下一步(\x3N\x3)");
pButton2->SetShortcutKey(VK_ALT_N);
pButton2->SetFc(ClickYesButton);
//Create a Button Control
CButton* pButton3 = new CButton(pDialog);
pButton3->CreateObject(211, 199, 93, 24, "退出(\x3\C\x3)");
pButton3->SetShortcutKey(VK_ALT_C);
pButton3->SetFc(ClickCancelButton);
//Create Radio Control
CRadio* pRadio1 = new CRadio(pDialog);
pRadio1->CreateObject(28, 64, 57, 24, "北京");
pRadio1->SetStatic(TRUE);
pRadio1->SetRadio(TRUE);
pRadio1->SetID(RADIOBASE + 1 - 1);
//Create Radio Control
CRadio* pRadio2 = new CRadio(pDialog);
pRadio2->CreateObject(100, 65, 57, 24, "上海");
pRadio2->SetID(RADIOBASE + 2 - 1);
//Create Radio Control
CRadio* pRadio3 = new CRadio(pDialog);
pRadio3->CreateObject(171, 65, 57, 24, "广州");
pRadio3->SetID(RADIOBASE + 3 - 1);
//Create Combo Control
CComboBox* pComboBox1 = new CComboBox(pDialog);
pComboBox1->CreateCombo(124, 122, 169, 24, NULL);
pComboBox1->SetID(COMBOBASE + 1 - 1);
//Create Group Control
CStatic* pGroup1 = new CStatic(pDialog);
pGroup1->CreateObject(10, 34, 285, 67, "籍贯");
//Create a Label Control
CLabel* pLabel1 = new CLabel(pDialog);
pLabel1->CreateObject(13, 125, 67, 12, "选择年份(N)");
//Show Window
pDialog->ShowWindow();//显示窗口
//go into Message Loop
int nResult = pDialog->DoModal();//进入窗口消息循环
//Destroy Window
delete pDialog;//删除对话框
return (nResult);
}
int far Page3(CObject* pCurObj)
{
//Create a Dialog On the Center of Desktop
CDialog* pDialog = new CDialog;//分配实例
pDialog->CreateWindow(0, 0, 321, 240, "第三页:3");//建立窗口
pDialog->Center();//窗口对中
//Create Close's Button Control
CCloseButton* pCloseButton = new CCloseButton(pDialog);//分配和建立关闭按钮
//Create a Button Control
CButton* pButton1 = new CButton(pDialog);
pButton1->CreateObject(10, 199, 93, 24, "上一步(\x3P\x3)");
pButton1->SetShortcutKey(VK_ALT_P);
pButton1->SetFc(ClickNoButton);
//Create a Button Control
CButton* pButton2 = new CButton(pDialog);
pButton2->CreateObject(111, 199, 93, 24, "下一步(\x3N\x3)");
pButton2->SetShortcutKey(VK_ALT_N);
pButton2->SetFc(ClickYesButton);
//Create a Button Control
CButton* pButton3 = new CButton(pDialog);
pButton3->CreateObject(211, 199, 93, 24, "退出(\x3\C\x3)");
pButton3->SetShortcutKey(VK_ALT_C);
pButton3->SetFc(ClickCancelButton);
//Create Slider Control
CSliderCtrl* pSliderCtrl1 = new CSliderCtrl(pDialog);
pSliderCtrl1->CreateObject(37, 153, 241, 24, NULL);
pSliderCtrl1->SetID(SLIDERBASE + 1 - 1);
pSliderCtrl1->SetHorz(TRUE);
//Create Slider Control
CSliderCtrl* pSliderCtrl2 = new CSliderCtrl(pDialog);
pSliderCtrl2->CreateObject(138, 38, 30, 111, NULL);
pSliderCtrl2->SetID(SLIDERBASE + 2 - 1);
pSliderCtrl2->SetHorz(FALSE);
//Show Window
pDialog->ShowWindow();//显示窗口
//go into Message Loop
int nResult = pDialog->DoModal();//进入窗口消息循环
//Destroy Window
delete pDialog;//删除对话框
return(nResult);
}
void DemoWizard()
{
CWizard *pWizard = new CWizard;
pWizard->AddPage (Page1);
pWizard->AddPage (Page2);
pWizard->AddPage (Page3);
pWizard->DoWizard();
DELETE(pWizard);
}