ciderpress/util/MyEdit.h
Andy McFadden c78017b1d2 More source code shuffling
Moved comments and return types, switched to uint types, added
"override" keyword.
2014-11-25 14:34:14 -08:00

56 lines
1.3 KiB
C++

/*
* CiderPress
* Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved.
* See the file LICENSE for distribution terms.
*/
/*
* My edit class.
*/
#ifndef UTIL_MYEDIT_H
#define UTIL_MYEDIT_H
/*
* 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) override;
bool fCapsOnly;
bool fHexOnly;
bool fNoWhiteSpace;
//DECLARE_MESSAGE_MAP()
};
#endif /*UTIL_MYEDIT_H*/