TRACKLOOKBUTTON.H
上传用户:lvjun8202
上传日期:2013-04-30
资源大小:797k
文件大小:3k
源码类别:

SNMP编程

开发平台:

C/C++

  1. #if !defined(AFX_TRACKLOOKBUTTON_H__24F3B8E1_7579_11D1_BC08_0080C825700A__INCLUDED_)
  2. #define AFX_TRACKLOOKBUTTON_H__24F3B8E1_7579_11D1_BC08_0080C825700A__INCLUDED_
  3. #if _MSC_VER >= 1000
  4. #pragma once
  5. #endif // _MSC_VER >= 1000
  6. // TrackLookButton.h : header file
  7. //
  8. //DrawBitmap flags;
  9. #define DB_HCENTER 0x0001L
  10. #define DB_VCENTER 0x0002L
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CTrackLookButton window
  13. class CTrackLookButton : public CButton
  14. {
  15. // Construction
  16. public:
  17. CTrackLookButton();
  18. // Attributes
  19. public:
  20. typedef enum TextAlign {AlignLeft=0,AlignRight,AlignBelow,AlignAbove};
  21. // Operations
  22. public:
  23. // Overrides
  24. // ClassWizard generated virtual function overrides
  25. //{{AFX_VIRTUAL(CTrackLookButton)
  26. public:
  27. virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
  28. //}}AFX_VIRTUAL
  29. virtual void OnMouseEnter(UINT nFlags,CPoint point);
  30. virtual void OnMouseLeave(UINT nFlags,CPoint point);
  31. // Implementation
  32. public:
  33. BOOL LoadBitmaps(LPCSTR lpszBitmap,LPCSTR lpszBitmapFocus=NULL,LPCSTR lpszBitmapDisabled=NULL,BOOL bFromFile = FALSE);
  34. void SetTextAlignment(TextAlign nTextAlign);
  35. TextAlign GetTextAlignment() const;
  36. BOOL LoadBitmaps(UINT nBitmap,UINT nBitmapFocus=0, UINT nBitmapDisabled=0);
  37. virtual ~CTrackLookButton();
  38. // Generated message map functions
  39. protected:
  40. BOOL m_bRaised;
  41. void DrawBitmap(CDC* pDC,CRect rc,UINT nFlags,CBitmap* pBitmap);
  42. CBitmap m_bitmap;
  43. CBitmap m_bitmapFocus;
  44. CBitmap m_bitmapDisabled;
  45. CBitmap m_bitmapRaised;
  46. HBITMAP m_hBitmap;
  47. HBITMAP m_hBitmapFocus;
  48. HBITMAP m_hBitmapDisabled;
  49. TextAlign m_TextAlign;
  50. BOOL m_bDisabled;
  51. BOOL m_bHasFocus;
  52. void Draw3DBorder(CDC* pDC,CRect rc,UINT nOptions);
  53. BOOL m_bLButtonDown;
  54. UINT m_nBorder;
  55. BOOL m_bMouseCaptured;
  56. //{{AFX_MSG(CTrackLookButton)
  57. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  58. afx_msg void OnKillFocus(CWnd* pNewWnd);
  59. afx_msg void OnSetFocus(CWnd* pOldWnd);
  60. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  61. afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  62. afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  63. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  64. afx_msg void OnEnable(BOOL bEnable);
  65. //}}AFX_MSG
  66. DECLARE_MESSAGE_MAP()
  67. };
  68. /////////////////////////////////////////////////////////////////////////////
  69. /////////////////////////////////////////////////////////////////////////////
  70. // CTrackLookButtonEx window
  71. class CTrackLookButtonEx : public CTrackLookButton
  72. {
  73. // Construction
  74. public:
  75. CTrackLookButtonEx();
  76. // Attributes
  77. public:
  78. virtual void OnMouseEnter(UINT nFlags,CPoint point);
  79. virtual void OnMouseLeave(UINT nFlags,CPoint point);
  80. // Operations
  81. public:
  82. // Overrides
  83. // ClassWizard generated virtual function overrides
  84. //{{AFX_VIRTUAL(CTrackLookButtonEx)
  85. public:
  86. virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
  87. //}}AFX_VIRTUAL
  88. // Implementation
  89. public:
  90. virtual ~CTrackLookButtonEx();
  91. // Generated message map functions
  92. protected:
  93. //{{AFX_MSG(CTrackLookButtonEx)
  94. // NOTE - the ClassWizard will add and remove member functions here.
  95. //}}AFX_MSG
  96. DECLARE_MESSAGE_MAP()
  97. };
  98. /////////////////////////////////////////////////////////////////////////////
  99. //{{AFX_INSERT_LOCATION}}
  100. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  101. #endif // !defined(AFX_BUTTONEX_H__24F3B8E1_7579_11D1_BC08_0080C825700A__INCLUDED_)