www.pudn.com > 智能内码识别,支持屏幕取词翻译的程序.zip > INBUTTON.H


// InButton.h : header file 
// 
//输入板上按钮类 
 
///////////////////////////////////////////////////////////////////////////// 
// CInButton window 
 
//按钮类 
class CInButton : public CBasicWin 
{ 
// Construction 
public: 
	//缺省初始函数 
	CInButton( void ) ; 
	//状态类初始函数 
	CInButton( CPoint pos , //位置 
					UINT	uUpBitmap , UINT uDownBitmap ) ; 
	//初始化动作按钮 
	CInButton( CPoint pos , 
						UINT	uUpBitmap , UINT uDownBitmap , 
						BOOL bFlag ) ; 
	//菜单1按钮初始函数 
	CInButton( CPoint pos , 			//位置 
						LPCSTR Str ,	//显示串	 
						UINT	uMenuID ) ;//在APPSTUDIO中创建的菜单 
	//菜单2按钮初始函数						 
	CInButton( CPoint pos , 		//位置 
						LPCSTR Str ,	//显示串 
						HMENU hmenu ) ;	//运行时创建的菜单										 
						 
 	const	CInButton&	operator=( const CInButton &button ) ;  
    private: 
    	//标志是何种按钮,0为状态,1为菜单1,2为菜单2,3为左翻页按钮 
    	//4为右翻页按钮 
    	BOOL	m_bButtonType ;	 
    	BOOL	m_bCaptureStatus ;	// 标记是否获得鼠标控制权 
	private: 
		CPoint	m_OPos ;		//按钮左上角的位置 
		int			m_nWidth ;		//按钮宽度 
		int			m_nHeight ;		//按钮高度 
	private: 
		BOOL	m_bStatus ;		//按钮状态,0表示按下,1表示没有按下. 
		 
		//用于菜单按钮 
		CString		m_OMenuString ;		//按钮上显示的串 
		UINT	m_uMenuID ;			//菜单ID,用于菜单1,即功能菜单 
		HMENU	m_hMenu ;		//用于菜单2 
		CMenu	m_OMenu ;		//菜单对象 
		 
		//用于状态按钮 
		UINT	m_uUpBitmapID ; 
		UINT	m_uDownBitmapID ; 
 
	private: 
		//改变菜单按钮的显示内容 
		void	ChangeMenuButton( int nMenu ) ; 
		//改变功能菜单上的内码 
		void	ChangeCodeMenu( int m ) ; 
	public: 
		//创建按钮窗口 
		BOOL	CreateInButton(	 
					LPCSTR lpszWindowName ,	//窗口名 
					CWnd	*pParentWnd ,				//父窗口 
					UINT	nID ) ;								//ID 
		BOOL	GetStatus( void ) ;	//得到按钮的当前状态 
		 
		//改变按钮的显示状态 
		void	ChangeButtonStatus( void ) ; 
 
// Implementation 
public: 
	virtual ~CInButton(); 
 
protected: 
	// Generated message map functions 
	//{{AFX_MSG(CInButton) 
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point); 
	afx_msg void OnPaint(); 
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point); 
	afx_msg void OnMouseMove(UINT nFlags, CPoint point); 
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); 
	afx_msg LRESULT OnMenuChar(UINT nChar, UINT nFlags, CMenu* pMenu); 
	afx_msg void OnMenuSelect(UINT nItemID, UINT nFlags, HMENU hSysMenu); 
	afx_msg void OnInputSetup(); 
	afx_msg void OnInputGb(); 
	afx_msg void OnInputBig5(); 
	afx_msg void OnInputHz(); 
	afx_msg void OnInputShiftjis(); 
	afx_msg void OnInputEucjis(); 
	afx_msg void OnInputKsc5601(); 
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point); 
	afx_msg void OnRButtonDblClk(UINT nFlags, CPoint point); 
	//}}AFX_MSG 
	DECLARE_MESSAGE_MAP() 
 
protected: 
	virtual BOOL OnCommand( WPARAM wParam, LPARAM lParam ); 
}; 
 
/////////////////////////////////////////////////////////////////////////////