Click here to Skip to main content
15,896,437 members
Articles / Desktop Programming / MFC

EZOptionsDlg - Netscape Preferences like dialog

Rate me:
Please Sign up or sign in to vote.
4.38/5 (4 votes)
16 Apr 2001 121K   3.1K   45  
A modified property sheet with the tree control replacing the tabs.
// EZPropertyPage.cpp : implementation file
//

#include "stdafx.h"
#include "EZPropertyPage.h"
#include "EZOptionsDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CEZPropertyPage property page

IMPLEMENT_DYNCREATE(CEZPropertyPage, CPropertyPage)

CEZPropertyPage::CEZPropertyPage(UINT nIDResource) : CPropertyPage(nIDResource)
{
	//{{AFX_DATA_INIT(CEZPropertyPage)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT

	m_nIDResource = nIDResource;
	
}

CEZPropertyPage::~CEZPropertyPage()
{
}

void CEZPropertyPage::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CEZPropertyPage)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CEZPropertyPage, CPropertyPage)
	//{{AFX_MSG_MAP(CEZPropertyPage)
		// NOTE: the ClassWizard will add message map macros here
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CEZPropertyPage message handlers

//////////////////
// CDialog class to get the size of a dialog.
// Assumes dialog is invisible (no WS_VISIBLE).
// From Sept 98 MSJ Paul DILascia 
class CTempDlg : public CDialog {
public:
	CRect m_rcDlg;
protected:
	virtual BOOL OnInitDialog();
};

////////////////
// Initialize dialog: save size, then quit.
// 
BOOL CTempDlg::OnInitDialog()
{
	GetWindowRect(&m_rcDlg);
	m_rcDlg -= m_rcDlg.TopLeft();
	EndDialog(0);
	return TRUE;
}


CSize CEZPropertyPage::GetDialogSize(UINT nIDTemplate,CWnd* pParentWnd)
{
	CTempDlg dlg;
	dlg.Create(nIDTemplate,pParentWnd);
	return dlg.m_rcDlg.Size();
}

CSize CEZPropertyPage::GetPageSize()
{
	return m_size;
}

BOOL CEZPropertyPage::Create(CWnd* pParentWnd) 
{
	// TODO: Add your specialized code here and/or call the base class
	m_size  = GetDialogSize(m_nIDResource,pParentWnd);
	return CPropertyPage::Create(m_nIDResource,pParentWnd);
}

BOOL CEZPropertyPage::IsButtonEnabled(int iButton)
{

	return ((CEZOptionsDlg*)GetParent())->IsButtonEnabled(iButton);
	
}

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
Web Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions