ToolBarXP.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #if !defined(AFX_ToolBarXP_H__F739196A_2383_11D5_99BD_5254AB339987__INCLUDED_)
  2. #define AFX_ToolBarXP_H__F739196A_2383_11D5_99BD_5254AB339987__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. // ToolBarXP.h : header file
  7. //
  8. struct TOOLBAR_DATA
  9. {
  10. WORD wVersion;
  11. WORD wWidth;
  12. WORD wHeight;
  13. WORD wItemCount;
  14. WORD* items()
  15. { return (WORD*)(this+1); }
  16. };
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CToolBarXP window
  19. class CToolBarXP : public CToolBarCtrl
  20. {
  21. // Construction
  22. public:
  23. CToolBarXP();
  24. // Attributes
  25. private:
  26. COLORREF m_clrBack;
  27. COLORREF m_clrHot;
  28. COLORREF m_clrSelected;
  29. COLORREF m_clrChecked;
  30. COLORREF m_clrLine;
  31. BOOL m_bDrawLine; //Draw a line rect around the button when hot or selected
  32. protected:
  33. void PreDrawItem(CDC *pDC, const RECT &rect, UINT uState);
  34. // Operations
  35. public:
  36. void SetBackColor(COLORREF clr) { m_clrBack = clr; }
  37. void SetHotColor(COLORREF clr) { m_clrHot = clr; }
  38. void SetSelectedColor(COLORREF clr) { m_clrSelected = clr; }
  39. void SetCheckedColor(COLORREF clr) { m_clrChecked = clr; }
  40. void SetLineColor(COLORREF clr) {m_clrLine = clr; }
  41. void EnableDrawLine(BOOL b) { m_bDrawLine = b; };
  42. //Load a toolbar resource
  43. BOOL LoadToolBar(UINT nID);
  44. // Overrides
  45. // ClassWizard generated virtual function overrides
  46. //{{AFX_VIRTUAL(CToolBarXP)
  47. //}}AFX_VIRTUAL
  48. // Implementation
  49. public:
  50. virtual ~CToolBarXP();
  51. // Generated message map functions
  52. protected:
  53. //{{AFX_MSG(CToolBarXP)
  54. //}}AFX_MSG
  55. afx_msg void OnCustomDraw( NMHDR * pNotifyStruct, LRESULT* result );
  56. DECLARE_MESSAGE_MAP()
  57. };
  58. /////////////////////////////////////////////////////////////////////////////
  59. //{{AFX_INSERT_LOCATION}}
  60. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  61. #endif // !defined(AFX_ToolBarXP_H__F739196A_2383_11D5_99BD_5254AB339987__INCLUDED_)