www.pudn.com > wizardpropertysheet_src.zip > WizardPropertySheet.cpp
// WizardPropertySheet.cpp : implementation file // #include "stdafx.h" #include#include "ABBDOC.h" #include "WizardPropertySheet.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CWizardPropertySheet IMPLEMENT_DYNAMIC(CWizardPropertySheet, CPropertySheet) CWizardPropertySheet::CWizardPropertySheet(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage) :CPropertySheet(nIDCaption, pParentWnd, iSelectPage) { } CWizardPropertySheet::CWizardPropertySheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage) :CPropertySheet(pszCaption, pParentWnd, iSelectPage) { } CWizardPropertySheet::~CWizardPropertySheet() { } BEGIN_MESSAGE_MAP(CWizardPropertySheet, CPropertySheet) //{{AFX_MSG_MAP(CWizardPropertySheet) // NOTE - the ClassWizard will add and remove mapping macros here. //}}AFX_MSG_MAP ON_BN_CLICKED(ID_WIZBACK, OnWizBack) ON_BN_CLICKED(ID_WIZNEXT, OnWizNext) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CWizardPropertySheet message handlers BOOL CWizardPropertySheet::OnInitDialog() { // TODO: Add your specialized code here and/or call the base class BOOL ret=CPropertySheet::OnInitDialog(); SetWizardButtons(GetPageCount()>1?PSWIZB_NEXT:PSWIZB_FINISH); return ret; } void CWizardPropertySheet::OnWizBack() { int active=GetActiveIndex(); SetWizardButtons(active>1?(PSWIZB_NEXT|PSWIZB_BACK):PSWIZB_NEXT); Default(); } void CWizardPropertySheet::OnWizNext() { int active=GetActiveIndex(); int num=GetPageCount(); SetWizardButtons(active>=num-2?(PSWIZB_FINISH|PSWIZB_BACK):(PSWIZB_NEXT|PSWIZB_BACK)); Default(); }