www.pudn.com > T9InPut.rar > T9.h, change:2011-06-13,size:3396b


#pragma once 
#include "HZK.h" 
 
// CT9 对话框 
enum InputType {Type_PY = 0,Type_ZM=1,Type_SZ = 2}; 
#define CLR_BK		RGB(150, 150, 150)	 
#define CLR_PY		RGB(100,200,0)			 
#define CLR_HZ		RGB(150,50,0)			 
#define CLR_KEY	RGB(50,50,250)			 
class CT9 : public CDialog 
{ 
	DECLARE_DYNAMIC(CT9) 
 
public: 
	CT9(CWnd* pParent = NULL);    
	virtual ~CT9(); 
 
// 对话框数据 
	enum { IDD = IDD_DIALOG_T9 }; 
public: 
	CZK *pZk; 
	UINT	m_nPYPage;						    
	UINT	m_nHZPage;							  
	InputType m_kType;					 
	CEdit *m_peditAcceptInput;			 
	TCHAR m_chLayout[3][5];			 
	CRect m_rcLayout[3][5];				 
	CRect m_rcPY[5];						 
	CRect m_rcHZ[8];						 
 
	int m_nSpace;						 
	int m_nPenWidth;					 
	BOOL m_bValidRectArray; 
 
	CPoint m_ptKeyboardIndex[2];		 
	CPoint m_ptPYIndex[2];				 
	CPoint m_ptHZIndex[2];				 
 
	int m_iKeyPress;					 
	int m_iPYNum;						 
	int m_iPYNumOld; 
 
	CString m_arrInputWord[6];			 
	CString m_arrSelectWord[20];	 
 
	CString m_sShowWord;				 
 
	CString m_sInputWord;				 
 
	int m_nRow;							 
	int m_nColumn;						 
	int m_nHZSelectColumn;				 
	int m_nPYSelectColumn;			 
 
	const TCHAR m_chEnter;			 
	const TCHAR m_chDel;				 
	const TCHAR m_chCancel;			 
	const TCHAR m_chSign;				 
	const TCHAR m_chType;				 
 
	COLORREF m_clrLo;//(::GetSysColor(COLOR_BTNSHADOW)), m_clrActiveHi(RGB(255, 255, 0)),  
	COLORREF m_clrActiveLo;//(RGB(0, 255, 255)) 
	COLORREF m_clrHi;//(::GetSysColor(COLOR_BTNSHADOW)), m_clrActiveHi(RGB(255, 255, 0)),  
	COLORREF m_clrActiveHi;//(RGB(0, 255, 255)) 
	CString m_strOrinalNumber;			 
	CFont m_font; 
 
 
public: 
	InputType GetInputType()			 
	{ 
		return m_kType; 
	} 
	void SetInputType(InputType kType)	 
	{ 
		m_kType=kType; 
	} 
	void SetAccpetInputEdit(CEdit *pEdit) 
	{ 
		VERIFY(pEdit != NULL && pEdit->GetSafeHwnd() != NULL); 
 
		m_peditAcceptInput = pEdit;	 
		m_peditAcceptInput->GetWindowText(m_strOrinalNumber); 
 
	} 
	void SetFont( LPCTSTR lpszFaceName, int nPointSize, BOOL bRedraw = TRUE); 
	void Frame3DRect(HDC hDC, COLORREF clrHi, COLORREF clrLo, CRect& rcFrame, int iFrameWid, BOOL bDrawLeft /*= TRUE*/, BOOL bDrawTop /*= TRUE*/, BOOL bDrawRight /*= TRUE*/, BOOL bDrawBottom /*= TRUE*/); 
	void Frame3D(HDC hDC, COLORREF clrHi, COLORREF clrLo, POINT& ptLeftTop, POINT& ptRightBottom, int iFrameWid, BOOL bDrawLeft, BOOL bDrawTop, BOOL bDrawRight, BOOL bDrawBottom); 
	void DrawKeyboard(CDC* pDC); 
	void FillRectLayoutArray(int cx, int cy); 
	void DrawSelectedKey(CDC* pDC); 
	void OnMouseDown( const CPoint point ); 
	void DrawPYRect(CDC *pDC); 
	void DrawHZRect(CDC*pDC); 
 
	void ClearPYSelectWord();		 
	void ClearShowWord();				 
	 
	void GetPYInputChar();				 
	void GetHZInputChar();				 
	void GetKeyBoardChar();			 
 
	void RefrshPYRect();					 
	void RefrshHZRect();					 
	void RefrshKeyBoardRect();		 
 
	void T9TypeOperate();			 
 
	void Del123All();					 
	void DelABC();						 
	void DelT9All();							 
	void DelInputWord();				 
 
	void ConfigT9(TCHAR input);	 
	void OperateFH();						 
	void Operate123(WCHAR input); 
	void OperateT9();							 
	void OperateABC();					 
 
protected: 
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 支持 
 
	DECLARE_MESSAGE_MAP() 
	 
public: 
	afx_msg void OnPaint(); 
	 
 
	afx_msg void OnSize(UINT nType, int cx, int cy); 
	 
 
	afx_msg BOOL OnEraseBkgnd(CDC* pDC); 
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point); 
	 
};