etrade_edit_control.h
1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef __my_edit_control_h__
#define __my_edit_control_h__
class CEditBox : public CEdit
{
DECLARE_DYNAMIC( CEditBox )
public:
CEditBox();
~CEditBox();
private:
COLORREF m_clrBackground;
COLORREF m_clrFrame;
COLORREF m_clrText;
COLORREF m_clrDisabledBackground;
COLORREF m_clrDisabledBack;
COLORREF m_clrDisabledText;
CBrush m_brushBk;
public:
void SetBackgroundColor( COLORREF clr ) { m_clrBackground = clr; }
void SetFrameColor( COLORREF clr ) { m_clrFrame = clr; }
void SetTextColor( COLORREF clr ) { m_clrText = clr; }
void SetDisabledColor( COLORREF clrBack, COLORREF clrText ) {
m_clrDisabledBack = clrBack;
m_clrDisabledText = clrText;
}
COLORREF GetBackgroundColor() const { return m_clrBackground; }
COLORREF GetFrameColor() const { return m_clrFrame; }
COLORREF GetTextColor() const { return m_clrText; }
COLORREF GetDisabledColor( COLORREF& clrBack, COLORREF& clrText ) const {
clrBack = m_clrDisabledBack;
clrText = m_clrDisabledText;
}
protected:
afx_msg HBRUSH CtlColor( CDC *pDC, UINT nCtlColor );
afx_msg void OnNcPaint();
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnKillFocus(CWnd* pNewWnd);
private:
bool CheckCardNum(CString &num);
bool GetCardName(CString &num, CString &name);
public:
void SetEditRed(bool is_red);
bool is_edit_red_;
};
#endif // __my_edit_control_h__