/*
 * CiderPress
 * Copyright (C) 2007 by faddenSoft, LLC.  All Rights Reserved.
 * See the file LICENSE for distribution terms.
 */
/*
 * My edit class.
 */
#ifndef __MYEDIT__
#define __MYEDIT__

/*
 * Replace the edit box in a dialog with this code by calling MyEdit's
 * ReplaceDlgCtrl(this, ID) from the dialog's OnInitDialog.  This class will
 * take over support for that control.
 */
class MyEdit : public CEdit {
public:
	MyEdit(void) {
		fCapsOnly = fHexOnly = fNoWhiteSpace = false;
	}
	virtual ~MyEdit(void) {
		Detach();	// it's not really our window
	}

	/* don't allow creation of a window */
	int Create(LPCTSTR, LPCTSTR, DWORD, const RECT&, CWnd*, UINT, CCreateContext*) {
		ASSERT(false);
		return FALSE;
	}
	int Create(LPCTSTR, DWORD, const RECT&, CWnd*, UINT) {
		ASSERT(false);
		return FALSE;
	}

	enum {
		kCapsOnly = 0x01,
		kHexOnly = 0x02,
		kNoWhiteSpace = 0x04,
	};

	virtual void SetProperties(int props);
	virtual BOOL ReplaceDlgCtrl(CDialog* pDialog, int editID);

private:
	virtual BOOL PreTranslateMessage(MSG* pMsg);

	bool		fCapsOnly;
	bool		fHexOnly;
	bool		fNoWhiteSpace;

	//DECLARE_MESSAGE_MAP()
};

#endif /*__MYEDIT__*/