TRACKLOOKBUTTON.H
上传用户:lvjun8202
上传日期:2013-04-30
资源大小:797k
文件大小:3k
- #if !defined(AFX_TRACKLOOKBUTTON_H__24F3B8E1_7579_11D1_BC08_0080C825700A__INCLUDED_)
- #define AFX_TRACKLOOKBUTTON_H__24F3B8E1_7579_11D1_BC08_0080C825700A__INCLUDED_
- #if _MSC_VER >= 1000
- #pragma once
- #endif // _MSC_VER >= 1000
- // TrackLookButton.h : header file
- //
- //DrawBitmap flags;
- #define DB_HCENTER 0x0001L
- #define DB_VCENTER 0x0002L
- /////////////////////////////////////////////////////////////////////////////
- // CTrackLookButton window
- class CTrackLookButton : public CButton
- {
- // Construction
- public:
- CTrackLookButton();
- // Attributes
- public:
- typedef enum TextAlign {AlignLeft=0,AlignRight,AlignBelow,AlignAbove};
- // Operations
- public:
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CTrackLookButton)
- public:
- virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
- //}}AFX_VIRTUAL
- virtual void OnMouseEnter(UINT nFlags,CPoint point);
- virtual void OnMouseLeave(UINT nFlags,CPoint point);
- // Implementation
- public:
- BOOL LoadBitmaps(LPCSTR lpszBitmap,LPCSTR lpszBitmapFocus=NULL,LPCSTR lpszBitmapDisabled=NULL,BOOL bFromFile = FALSE);
- void SetTextAlignment(TextAlign nTextAlign);
- TextAlign GetTextAlignment() const;
- BOOL LoadBitmaps(UINT nBitmap,UINT nBitmapFocus=0, UINT nBitmapDisabled=0);
- virtual ~CTrackLookButton();
- // Generated message map functions
- protected:
- BOOL m_bRaised;
- void DrawBitmap(CDC* pDC,CRect rc,UINT nFlags,CBitmap* pBitmap);
- CBitmap m_bitmap;
- CBitmap m_bitmapFocus;
- CBitmap m_bitmapDisabled;
- CBitmap m_bitmapRaised;
-
- HBITMAP m_hBitmap;
- HBITMAP m_hBitmapFocus;
- HBITMAP m_hBitmapDisabled;
- TextAlign m_TextAlign;
- BOOL m_bDisabled;
- BOOL m_bHasFocus;
- void Draw3DBorder(CDC* pDC,CRect rc,UINT nOptions);
-
- BOOL m_bLButtonDown;
- UINT m_nBorder;
- BOOL m_bMouseCaptured;
- //{{AFX_MSG(CTrackLookButton)
- afx_msg void OnMouseMove(UINT nFlags, CPoint point);
- afx_msg void OnKillFocus(CWnd* pNewWnd);
- afx_msg void OnSetFocus(CWnd* pOldWnd);
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
- afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnEnable(BOOL bEnable);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- /////////////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////////////
- // CTrackLookButtonEx window
- class CTrackLookButtonEx : public CTrackLookButton
- {
- // Construction
- public:
- CTrackLookButtonEx();
- // Attributes
- public:
- virtual void OnMouseEnter(UINT nFlags,CPoint point);
- virtual void OnMouseLeave(UINT nFlags,CPoint point);
- // Operations
- public:
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CTrackLookButtonEx)
- public:
- virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
- //}}AFX_VIRTUAL
- // Implementation
- public:
- virtual ~CTrackLookButtonEx();
- // Generated message map functions
- protected:
- //{{AFX_MSG(CTrackLookButtonEx)
- // NOTE - the ClassWizard will add and remove member functions here.
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_BUTTONEX_H__24F3B8E1_7579_11D1_BC08_0080C825700A__INCLUDED_)