Click here to Skip to main content
15,897,032 members
Articles / Desktop Programming / MFC

Windows 2000 Style Wizards

Rate me:
Please Sign up or sign in to vote.
4.88/5 (19 votes)
23 May 2000 303.2K   4.1K   76  
Create Windows 2000 style Wizards with white backgrounds
#if !defined(AFX_NEWWIZDIALOG_H__915D4C89_2E27_11D4_9FA9_0030DB0011C6__INCLUDED_)
#define AFX_NEWWIZDIALOG_H__915D4C89_2E27_11D4_9FA9_0030DB0011C6__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// NewWizDialog.h : header file
//

class CNewWizPage;

/////////////////////////////////////////////////////////////////////////////
// CNewWizDialog dialog

class CNewWizDialog : public CDialog
{
// Construction
public:
	CNewWizDialog (LPCTSTR lpszTemplate, CWnd* pParent = NULL);
  CNewWizDialog (UINT nIDTemplate, CWnd* pParent = NULL);
  virtual ~CNewWizDialog ();


// Attributes
public:


protected:
	CObList m_PageList; // this list of CNewWizPage objects
  UINT m_nPlaceholderID; // control ID for the palceholder


// Operations
public:
	void AddPage(CNewWizPage* pPage, UINT nID);

  void SetActivePageByResource(UINT nResourceID);
  BOOL SetFirstPage();
  void SetNextPage();

	void EnableFinish(BOOL bEnable);
	void EnableBack(BOOL bEnable);
	void EnableNext(BOOL bEnable);
	int GetActiveIndex() const;
	int GetPageIndex(CNewWizPage* pPage) const;
	int GetPageCount();
	CNewWizPage* GetPage(int nPage) const;
	BOOL SetActivePage(int nPage);
	BOOL SetActivePage(CNewWizPage* pPage);
	void SetTitle(LPCTSTR lpszText);
	void SetTitle(UINT nIDText);
	void SetFinishText(LPCTSTR lpszText);
	void SetFinishText(UINT nIDText);

protected:
  BOOL ActivatePage(CNewWizPage* pPage);
  BOOL DeactivatePage();
	void SetPlaceholderID(int nPlaceholderID);
	CNewWizPage* GetPageByResourceID(UINT nResourceID);


private:
  void Init();
  BOOL DestroyPage(CNewWizPage* pPage);
  CNewWizPage* GetFirstPage();
  CNewWizPage* GetLastPage();
  CNewWizPage* GetActivePage() const;
  CNewWizPage* GetNextPage();


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CNewWizDialog)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual BOOL OnInitDialog();
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CNewWizDialog)
	afx_msg void OnDestroy();
	afx_msg void OnWizardFinish();
	afx_msg void OnWizardBack(); 
	afx_msg void OnWizardNext(); 
	afx_msg void OnCancel(); 
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_NEWWIZDIALOG_H__915D4C89_2E27_11D4_9FA9_0030DB0011C6__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
President Starpoint Software Inc.
United States United States
Bob Pittenger is founder and President of Starpoint Software Inc. He holds a B.A. degree from Miami University, M.S. and Ph.D. degrees from Purdue University, and an MBA from Xavier University. He has been programming since 1993, starting with Windows application development in C++/MFC and moving to C# and .NET around 2005 and is a .NET Microsoft Certified Professional Developer.

Bob is the author of two books:
Billionaire: How the Ultra-Rich Built Their Fortunes Through Good and Evil and What You Can Learn from Them
and
Wealthonomics: The Most Important Economic and Financial Concepts that Can Make You Rich Fast.
Visit http://www.billionairebook.net for more information.

Comments and Discussions