Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

134 lines
4.2 KiB

  1. /*++
  2. Copyright (C) 1996-1999 Microsoft Corporation
  3. Module Name:
  4. toolbar.h
  5. Abstract:
  6. <abstract>
  7. --*/
  8. #include <windows.h>
  9. #ifdef _WIN32_IE
  10. #if _WIN32_IE < 0x0400
  11. #undef _WIN32_IE
  12. #define _WIN32_IE 0x0400 // for color scheme info
  13. #endif // < 0x0400
  14. #endif // defined
  15. #include <commctrl.h>
  16. #include <assert.h>
  17. #include "polyline.h"
  18. #include "smonctrl.h"
  19. #ifndef _TOOLBAR_H_
  20. #define _TOOLBAR_H_
  21. #include "resource.h"
  22. // button ID's
  23. // these must correspond to the individual button
  24. // locations in the toolbar bitmap
  25. enum sysmonTb {
  26. sysmonTbBlank = -1,
  27. sysmonTbNew = 0,
  28. sysmonTbClear,
  29. sysmonTbCurrentActivity,
  30. sysmonTbLogData,
  31. sysmonTbChartDisplay,
  32. sysmonTbHistogramDisplay,
  33. sysmonTbReportDisplay,
  34. sysmonTbAdd,
  35. sysmonTbDelete,
  36. sysmonTbHighlight,
  37. sysmonTbCopy,
  38. sysmonTbPaste,
  39. sysmonTbProperties,
  40. sysmonTbFreeze,
  41. sysmonTbUpdate,
  42. sysmonTbHelp,
  43. sysmonTbLastButton = sysmonTbHelp
  44. };
  45. // define Toolbar bitmap fields
  46. #define TBF_sysmonTbNew (DWORD)(0x00000001 << (DWORD)sysmonTbNew)
  47. #define TBF_sysmonTbCurrentActivity (DWORD)(0x00000001 << (DWORD)sysmonTbCurrentActivity)
  48. #define TBF_sysmonTbLogData (DWORD)(0x00000001 << (DWORD)sysmonTbLogData)
  49. #define TBF_sysmonTbChartDisplay (DWORD)(0x00000001 << (DWORD)sysmonTbChartDisplay)
  50. #define TBF_sysmonTbHistogramDisplay (DWORD)(0x00000001 << (DWORD)sysmonTbHistogramDisplay)
  51. #define TBF_sysmonTbReportDisplay (DWORD)(0x00000001 << (DWORD)sysmonTbReportDisplay)
  52. #define TBF_sysmonTbAdd (DWORD)(0x00000001 << (DWORD)sysmonTbAdd)
  53. #define TBF_sysmonTbDelete (DWORD)(0x00000001 << (DWORD)sysmonTbDelete)
  54. #define TBF_sysmonTbCopy (DWORD)(0x00000001 << (DWORD)sysmonTbCopy)
  55. #define TBF_sysmonTbPaste (DWORD)(0x00000001 << (DWORD)sysmonTbPaste)
  56. #define TBF_sysmonTbProperties (DWORD)(0x00000001 << (DWORD)sysmonTbProperties)
  57. #define TBF_sysmonTbFreeze (DWORD)(0x00000001 << (DWORD)sysmonTbFreeze)
  58. #define TBF_sysmonTbUpdate (DWORD)(0x00000001 << (DWORD)sysmonTbUpdate)
  59. #define TBF_sysmonTbHelp (DWORD)(0x00000001 << (DWORD)sysmonTbHelp)
  60. // define bitmap & button sizes
  61. #define SMTB_BM_X 16
  62. #define SMTB_BM_Y 15
  63. //#define SMTB_BT_X 20
  64. //#define SMTB_BT_Y 20
  65. // this constant defines the buttons that are defined by default
  66. // it can be edited as desired to alter the default appearance
  67. // of the bitmap.
  68. #define TBF_DefaultButtons (DWORD)(\
  69. TBF_sysmonTbNew | \
  70. TBF_sysmonTbCurrentActivity | \
  71. TBF_sysmonTbLogData | \
  72. TBF_sysmonTbChartDisplay | \
  73. TBF_sysmonTbHistogramDisplay | \
  74. TBF_sysmonTbReportDisplay | \
  75. TBF_sysmonTbAdd | \
  76. TBF_sysmonTbDelete | \
  77. TBF_sysmonTbCopy | \
  78. TBF_sysmonTbPaste | \
  79. TBF_sysmonTbProperties | \
  80. TBF_sysmonTbUpdate | \
  81. TBF_sysmonTbFreeze | \
  82. TBF_sysmonTbHelp )
  83. class CSysmonControl;
  84. class CSysmonToolbar {
  85. private:
  86. LONG GetToolbarCmdId (UINT nBtnId);
  87. void PostEnableButton ( UINT nBtnId, BOOL bState );
  88. HWND m_hToolbarWnd;
  89. RECT m_rectToolbar;
  90. CSysmonControl *m_pCtrl;
  91. DWORD m_dwToolbarFlags;
  92. TBBUTTON *m_pTbArray;
  93. DWORD m_dwBtnCnt;
  94. BOOL m_bVisible;
  95. public:
  96. CSysmonToolbar (void);
  97. ~CSysmonToolbar (void);
  98. BOOL Init (CSysmonControl *pCtrl, HWND hWnd);
  99. BOOL SizeComponents (LPRECT pRect);
  100. BOOL EnableButton (UINT nBtnId, BOOL bState);
  101. BOOL RemoveButton (UINT nBtnId);
  102. BOOL ShowToolbar (BOOL bVisible);
  103. BOOL SyncToolbar (void);
  104. BOOL SetBackgroundColor (COLORREF ocBackClr);
  105. LONG Height (void);
  106. BOOL GetRect (LPRECT pRect);
  107. LRESULT DoCmd (WPARAM wParam, LPARAM lParam);
  108. };
  109. typedef CSysmonToolbar *PSYSMONTOOLBAR;
  110. #endif //_TOOLBAR_H_