1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- #if !defined(AFX_HOVERBUTTON_H__1155737E_628E_11D2_81B5_0020AFC24C58__INCLUDED_)
- #define AFX_HOVERBUTTON_H__1155737E_628E_11D2_81B5_0020AFC24C58__INCLUDED_
- #if _MSC_VER >= 1000
- #pragma once
- #endif // _MSC_VER >= 1000
- // HoverButton.h : header file
- //
- /////////////////////////////////////////////////////////////////////////////
- // CHoverButton window
- enum BUTTON_STATE{ BUTTON_OFF, BUTTON_ON, BUTTON_OVER, BUTTON_GREYED};
- class CHoverButton : public CBitmapButton
- {
- // Construction
- public:
- // Constructor: default is to use buttons defined in our resources
- CHoverButton();
- // Attributes
- public:
- // The only way of accessing data from outside this class is to call these 2 functions
- BUTTON_STATE GetButtonState(void) { return(m_ButtonState);};
- BUTTON_STATE SetButtonState(BUTTON_STATE nState);
- void SetTabButton( bool bTabButton)
- {
- m_bTabButton = bTabButton;
- };
- bool GetTabButton( bool bTabButton )
- {
- return m_bTabButton;
- };
- private:
- bool m_bTabButton;
- bool m_bTabState;
- BOOL m_bMouseTracking;
- BUTTON_STATE m_ButtonState;
- CBitmap m_bmpButtonDown;
- CBitmap m_bmpButtonFocussed;
- CBitmap m_bmpButtonUp;
- CBitmap m_bmpButtonDisabled;
- HWND m_hWndOld;
- //此为了防止光标从右边的工具条直接移动到按钮上造成右边的工具条不隐藏
- //CLeftToolbar* m_pLeftToolbar;
- // Operations
- public:
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CHoverButton)
- public:
- virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
- //}}AFX_VIRTUAL
- public:
- // Called by OnMouseMove() when entering/leaving the button
- void OnMouseLeave(void);
- void OnMouseEnter(void);
- void SetTabState( bool bTabState );
- bool GetTabState();
- // Implementation
- public:
- virtual ~CHoverButton();
- BOOL LoadBitmaps(UINT nBitmapUp, UINT nBitmapDown, UINT nBitmapFocus, UINT nBitmapDisabled);
- BOOL LoadBitmaps(LPCSTR lpszBitmapUp, LPCSTR lpszBitmapDown, LPCSTR lpszBitmapFocus, LPCSTR lpszBitmapDisabled);
- // Generated message map functions
- protected:
- //{{AFX_MSG(CHoverButton)
- 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
- DECLARE_MESSAGE_MAP()
- };
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_HOVERBUTTON_H__1155737E_628E_11D2_81B5_0020AFC24C58__INCLUDED_)
|