Click here to Skip to main content
15,885,366 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 278.6K   998   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 __OptDlg_h__
#define __OptDlg_h__

#include "FtpViewRes.h"

class CeOptionsDlg: public CeDialog
{
private:
	CeChildMgr m_mgr;

public:
	CeStaticGroup m_staticGeneral;
	CeStaticGroup m_staticColumns;

	bool m_bClose;
	bool m_bSysIcons;
	bool m_bIconbar;
	bool m_bROM;
	bool m_bHidden;

	bool m_bCol_Type;
	bool m_bCol_Date;
	bool m_bCol_Attrib;
	bool m_bCol_Size;

	CeOptionsDlg(): CeDialog(IDD_OPTDLG)
		{
			m_bClose = false;
			m_bSysIcons = false;
			m_bIconbar = false;
			m_bROM = true;
			m_bHidden = false;

			m_bCol_Type = true;
			m_bCol_Date = true;
			m_bCol_Attrib = true;
			m_bCol_Size = true;
		}

	virtual void OnSize(UINT nType, int cx, int cy, bool& bHandled)
		{
			m_mgr.OnSize(nType, cx, cy);
			CeDialog::OnSize(nType, cx, cy, bHandled);
		}

	virtual BOOL OnInitDialog()
		{
			BOOL bRet = CeDialog::OnInitDialog();

			// subclass the static controls
			m_staticGeneral.Subclass(IDC_STATIC_GENERAL, m_hWnd);
			m_staticColumns.Subclass(IDC_STATIC_COLUMNS, m_hWnd);

			// subclass check boxies for auto movement
			m_mgr.Manage(m_staticGeneral, AL_ADJUST_WIDTH);
			m_mgr.Manage(m_staticColumns, AL_ADJUST_WIDTH);

			// disable sysicons for version that don't support it
			OSVERSIONINFO os;
			os.dwOSVersionInfoSize = sizeof os;
			GetVersionEx(&os);
			DWORD dwVer = os.dwMajorVersion * 100 + os.dwMinorVersion;
			if (dwVer < 210)
			{
				m_bSysIcons = false;
				::EnableWindow(GetDlgItem(IDC_CHECK_SYSICONS), FALSE);
			}

			// set the checkbox values
			CheckDlgButton(IDC_CHECK_SYSICONS, m_bSysIcons ? BST_CHECKED: BST_UNCHECKED);
			CheckDlgButton(IDC_CHECK_CLOSE,  m_bClose ? BST_CHECKED: BST_UNCHECKED);
			CheckDlgButton(IDC_CHECK_ICONBAR,  m_bIconbar ? BST_CHECKED: BST_UNCHECKED);
			CheckDlgButton(IDC_CHECK_INROM,  m_bROM ? BST_CHECKED: BST_UNCHECKED);
			CheckDlgButton(IDC_CHECK_HIDDEN,  m_bHidden ? BST_CHECKED: BST_UNCHECKED);

			CheckDlgButton(IDC_CHECK_COL_TYPE, m_bCol_Type ? BST_CHECKED: BST_UNCHECKED);
			CheckDlgButton(IDC_CHECK_COL_DATE, m_bCol_Date ? BST_CHECKED: BST_UNCHECKED);
			CheckDlgButton(IDC_CHECK_COL_ATTRIB, m_bCol_Attrib ? BST_CHECKED: BST_UNCHECKED);
			CheckDlgButton(IDC_CHECK_COL_SIZE, m_bCol_Size ? BST_CHECKED: BST_UNCHECKED);

#ifdef _WIN32_WCE_POCKETPC
			// Create a Done button and size it.  
			SHINITDLGINFO shidi;
			shidi.dwMask = SHIDIM_FLAGS;
			shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIPDOWN | SHIDIF_SIZEDLGFULLSCREEN;
			shidi.hDlg = m_hWnd;

			SHInitDialog(&shidi);
#endif
			return bRet;
		}

	virtual void OnOK()
		{
			m_bClose	  = IsDlgButtonChecked(IDC_CHECK_CLOSE) == BST_CHECKED;
			m_bSysIcons	  = IsDlgButtonChecked(IDC_CHECK_SYSICONS) == BST_CHECKED;
			m_bIconbar	  = IsDlgButtonChecked(IDC_CHECK_ICONBAR) == BST_CHECKED;
			m_bROM		  = IsDlgButtonChecked(IDC_CHECK_INROM) == BST_CHECKED;
			m_bHidden     = IsDlgButtonChecked(IDC_CHECK_HIDDEN) == BST_CHECKED;

			m_bCol_Type   = IsDlgButtonChecked(IDC_CHECK_COL_TYPE) == BST_CHECKED;
			m_bCol_Date   = IsDlgButtonChecked(IDC_CHECK_COL_DATE) == BST_CHECKED;
			m_bCol_Attrib = IsDlgButtonChecked(IDC_CHECK_COL_ATTRIB) == BST_CHECKED;
			m_bCol_Size   = IsDlgButtonChecked(IDC_CHECK_COL_SIZE) == BST_CHECKED;

			CeDialog::OnOK();
		}
};

#endif // __OptDlg_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