⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 keyboarddlg.h

📁 wince下的触摸键盘(6×8)源代码
💻 H
字号:
// keyboardDlg.h : header file
//


#if !defined(AFX_KEYBOARDDLG_H__E22941AA_943A_4E2E_80BA_07F2809B0074__INCLUDED_)
#define AFX_KEYBOARDDLG_H__E22941AA_943A_4E2E_80BA_07F2809B0074__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#include "KeyDefine.h"
#include "AfxTempl.h"
/////////////////////////////////////////////////////////////////////////////
// CKeyboardDlg dialog

class CKeyboardDlg : public CDialog
{
// Construction
public:
	CKeyboardDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CKeyboardDlg)
	enum { IDD = IDD_KEYBOARD_DIALOG };
		// NOTE: the ClassWizard will add data members here
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CKeyboardDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

public:
	HWND gFocus;
	int cCurrentKeyState;
	int pKeyWidth;   
	int pKeyHeight;
	CTypedPtrList<CPtrList, KEYDEF*> cKeys;
	BOOL bActive;
	CFont  m_TextFont;
	CBrush m_BTBkColor[64];

private:
	void FreeBkBrushColor();
	void FillBkBrushColor();
	void DoGradientFill(CDC *pDC, CRect* rect);
	void DrawKeyboard();
	int	 DescribeKeyState();
	void SendKey(KEYDEF * key);
	void DrawKey(CDC * dc, KEYDEF * key);
	void CalcWidthHeight();
	void AddKey(char pNormal,char pShifted,	int pWidth);
	void ReleaseFocus();

// Implementation
protected:
	
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CKeyboardDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
	virtual void PostNcDestroy();
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);

public:
	SHORT VKeyScan(TCHAR ch);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnClose();
	afx_msg void OnDestroy();
	// 计算按键的矩形区域
	void CalKeyRect(void);
	afx_msg void OnSetFocus(CWnd* pOldWnd);
	afx_msg UINT OnNcHitTest(CPoint point);
	afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
	afx_msg BOOL OnNcActivate(BOOL bActive);
	afx_msg int OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message);
};

//{{AFX_INSERT_LOCATION}}
// Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_KEYBOARDDLG_H__E22941AA_943A_4E2E_80BA_07F2809B0074__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -