/*****************************************************************************
* Copyright (c) 1990-98 Digi International Inc., All Rights Reserved
* 
* This software contains proprietary and confidential information of Digi
* International Inc.  By accepting transfer of this copy, Recipient agrees
* to retain this software in confidence, to prevent disclosure to others,
* and to make no use of this software other than that for which it was
* delivered.  This is an unpublished copyrighted work of Digi International
* Inc.  Except as permitted by federal law, 17 USC 117, copying is strictly
* prohibited.
* 
* Restricted Rights Legend
*
* Use, duplication, or disclosure by the Government is subject to
* restrictions set forth in sub-paragraph (c)(1)(ii) of The Rights in
* Technical Data and Computer Software clause at DFARS 252.227-7031 or
* subparagraphs (c)(1) and (2) of the Commercial Computer Software -
* Restricted Rights at 48 CFR 52.227-19, as applicable.
*
* Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343
*
*****************************************************************************/


#if !defined(CONFIGWIZSHEET_H)
#define CONFIGWIZSHEET_H

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#include "Dib.h"

#if !NT5_BUILD && !_M_IA64
// NT5 and newer DDKs define these types.  They float (at compile time) from 32 to 64
// bit width depending on the size of pointers in the system being compiled for.
// Define it for NT4.
typedef ULONG        ULONG_PTR, *PULONG_PTR;
typedef LONG         LONG_PTR,  *PLONG_PTR;
typedef int          INT_PTR,   *PINT_PTR;
typedef unsigned int UINT_PTR,  *PUINT_PTR;
#endif

/////////////////////////////////////////////////////////////////////////////
// CConfigWizSheet

class FW_EXPORTED_CLASS CConfigWizSheet : public CPropertySheet
{
   friend class CConfigWizPage;

	DECLARE_DYNAMIC(CConfigWizSheet)

public:
// Construction/Destruction
	CConfigWizSheet(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
	CConfigWizSheet(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
	virtual ~CConfigWizSheet();

// Operations
	BOOL AddPage(CConfigWizPage* pPage, BOOL fSkipOnBack = FALSE, BOOL fPermanent = FALSE);
	BOOL InsertPage(CConfigWizPage* pPage, BOOL fSkipOnBack = FALSE, BOOL fPermanent = FALSE);
	BOOL RemovePage(CConfigWizPage* pPage);

   void SetTitleBase(CString const & strTitleBase) { m_strTitleBase = strTitleBase; }
   CString GetTitleBase(void) { return m_strTitleBase; }

   void SetSheetBitmap(CDib const * const pBmp, CPoint const & ptPlacement);
   void SetDefaultPageBitmap(CDib const * const pBmp, CPoint const & ptPlacement);

private:
// Attributes
	CPtrArray m_PagePtrs;
	CWordArray m_PageProperty;
	int m_nPageIndex;
	int m_nInsertIndex;

   CString m_strTitleBase;

	void Construct();

	void WizForward();
	void WizReverse();
	void CheckButtonState();

	BOOL FindPage(const CConfigWizPage* pPage) const;

   CPoint m_ptSheetBmpPlacement;
   CDib * m_pSheetBmp;

   CPoint m_ptDfltPageBmpPlacement;
   CDib * m_pDfltPageBmp;

   int DoRealizePalette(BOOL const fForeground);

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CConfigWizSheet)
	public:
	virtual INT_PTR DoModal();
	virtual BOOL OnInitDialog();
	//}}AFX_VIRTUAL

protected:
	// Generated message map functions
	//{{AFX_MSG(CConfigWizSheet)
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnDestroy();
	afx_msg void OnPaletteChanged(CWnd* pFocusWnd);
	afx_msg BOOL OnQueryNewPalette();
	afx_msg void OnSetFocus(CWnd* pOldWnd);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(CONFIGWIZSHEET_H)
