Click here to Skip to main content
15,897,519 members
Articles / Web Development / HTML

A Comprehensive CE Class Library to Replace ATL and MFC

Rate me:
Please Sign up or sign in to vote.
4.48/5 (14 votes)
4 Oct 2000CPOL 283.6K   999   70  
A collection of classes for CE that do not use ATL or MFC, plus an FTP client, database viewer, and sample application that solves beam deflection equations.
///////////////////////////////////////////////////////////////////////////////
//
///////////////////////////////////////////////////////////////////////////////

#ifndef __CeProperty_h__
#define __CeProperty_h__

#include "stdafx.h"
#include "cedialog.h"
#include <prsht.h>

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

class CePropertySheet: public CeDialog
{
private:
	PROPSHEETHEADER m_psh;
	static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam);

	friend class CePropertyPage;

public:
	CePropertySheet();
	virtual ~CePropertySheet();

	// undefined... ???
	BOOL Create(LPCTSTR lpszCaption, HWND hParent);

	int DoModal(LPCTSTR lpszCaption, HWND hParent);
	int DoWizard(LPCTSTR lpszCaption, HWND hParent);

	BOOL SetCurSel(int index);
	BOOL SetCurSel(CePropertyPage* pPage);

	BOOL AddPage(CePropertyPage* pPage);

	void RemovePage(CePropertyPage* pPage);
	void RemovePage(int index);

	BOOL SetChanged(CePropertyPage* pPage);
	void SetUnChanged(CePropertyPage* pPage);

	void CancelToClose();
	int QuerySiblings(WPARAM wParam, LPARAM lParam);

	BOOL Apply();

	void SetTitle(WORD wStyle, LPCTSTR lpszText);
	void SetWizButtons(DWORD dwFlags);

	BOOL PressButton(int iButton);
	BOOL SetCurSelByID(int id);
	void SetFinishText(LPCTSTR lpszText);
	HWND GetTabControl();
	HWND GetCurrentPageHwnd();

	void RestartWindows();
	void RebootSystem();

	BOOL IsDialogMessage(MSG* pMsg);


	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam, bool &bHandled);
};


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

class CePropertyPage: public CeDialog
{
private:
	PROPSHEETPAGE m_psp;
	static UINT CALLBACK PropSheetPageProc(HWND hwnd, UINT uMsg, LPPROPSHEETPAGE ppsp);
	static BOOL CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
	
	void CommonConstruct(LPCTSTR lpszTemplateName, LPCTSTR lpszCaption);

	friend class CePropertySheet;

public:
	CePropertyPage(UINT nIDTemplate, LPCTSTR lpszCaption): CeDialog(nIDTemplate)
		{ CommonConstruct(MAKEINTRESOURCE(nIDTemplate), lpszCaption); }

	CePropertyPage(LPCTSTR lpszTemplateName, LPCTSTR lpszCaption): CeDialog(lpszTemplateName)
		{ CommonConstruct(lpszTemplateName, lpszCaption); }

	CePropertyPage(UINT nIDTemplate, UINT nIDCaption = 0): CeDialog(nIDTemplate)
		{ CommonConstruct(MAKEINTRESOURCE(nIDTemplate), MAKEINTRESOURCE(nIDCaption)); }

	CePropertyPage(LPCTSTR lpszTemplateName, UINT nIDCaption = 0): CeDialog(lpszTemplateName)
		{ CommonConstruct(lpszTemplateName, MAKEINTRESOURCE(nIDCaption)); }

	virtual ~CePropertyPage();

	//CePropertySheet& GetSheet();
	//CePropertySheet& GetPropertySheet();

	BOOL OnCommand(WPARAM wParam, LPARAM lParam, bool& bHandled);
	LRESULT OnNotify(int nCtrlId, LPNMHDR pNMH, bool& bHandled);
	LRESULT OnMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled);

	virtual BOOL OnApply();
	virtual BOOL OnKillActive();
	virtual BOOL OnSetActive();
	virtual LRESULT OnQuerySiblings(WPARAM wParam, LPARAM lParam); 
	virtual BOOL OnQueryCancel();

	// Only called for wizard pages
	virtual void OnHelp();
	virtual void OnReset();
	virtual void OnBack();
	virtual void OnNext();
	virtual void OnFinish();

	virtual void OnCancel();
	virtual void OnOK();

};

#include "CeProperty.inl"

#endif //  __CeProperty_h__

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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
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