Source code of Windows XP (NT5)
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.

120 lines
2.8 KiB

  1. #ifndef _MEDIAMENU_H_
  2. #define _MEDIAMENU_H_
  3. #include "cowsite.h"
  4. class CMediaBand;
  5. #define MEDIA_MRU_LIMIT 10
  6. class CMediaMRU
  7. {
  8. public:
  9. CMediaMRU();
  10. ~CMediaMRU();
  11. VOID Load(PTSTR pszKey);
  12. VOID Add(PTSTR pszData);
  13. BOOL Get(INT iWhich, PTSTR pszOut);
  14. VOID Delete(INT iWhich);
  15. private:
  16. HKEY _hkey;
  17. };
  18. class CMediaWidget
  19. {
  20. public:
  21. CMediaWidget(HWND, int cx, int cy);
  22. ~CMediaWidget();
  23. virtual LRESULT Draw(LPNMTBCUSTOMDRAW pnmc) = 0;
  24. virtual BOOL IsEnabled() = 0;
  25. virtual HRESULT TranslateAccelerator(LPMSG pMsg) = 0;
  26. //private:
  27. HWND _hwnd, _hwndParent;
  28. INT _cx, _cy;
  29. };
  30. enum
  31. {
  32. MWB_NORMAL = 0,
  33. MWB_DISABLED,
  34. MWB_HOT,
  35. MWB_PRESSED
  36. };
  37. class CMediaWidgetButton : public CMediaWidget
  38. {
  39. public:
  40. CMediaWidgetButton(HWND, int, int);
  41. ~CMediaWidgetButton();
  42. HRESULT SetImageList(INT iResource);
  43. HRESULT SetAlternateImageList(INT iResource);
  44. HRESULT SetImageSource(BOOL fImageSource);
  45. HRESULT SetMode(DWORD);
  46. virtual HRESULT Initialize(int idCommand, int idTooltip=0, int idTooltipAlt=0);
  47. LRESULT Draw(LPNMTBCUSTOMDRAW pnmc);
  48. BOOL IsEnabled();
  49. HRESULT TranslateAccelerator(LPMSG pMsg);
  50. //private:
  51. HIMAGELIST _himl, _himlAlt;
  52. INT _iTooltip, _iTooltipAlt, _iCommand;
  53. BOOL _fImageSource;
  54. DWORD _dwMode;
  55. };
  56. CMediaWidgetButton * CMediaWidgetButton_CreateInstance(HWND hwnd, int cx, int cy, int idCommand, int idImageList, int idAlt=0, int idTooltip=0, int idTooltipAlt=0);
  57. class CMediaWidgetToggle : public CMediaWidgetButton
  58. {
  59. public:
  60. CMediaWidgetToggle(HWND, int, int);
  61. LRESULT Draw(LPNMTBCUSTOMDRAW pnmc);
  62. VOID SetState(BOOL fState);
  63. BOOL IsEnabled() { return TRUE; };
  64. BOOL _fState;
  65. };
  66. class CMediaWidgetOptions : public CMediaWidgetButton
  67. {
  68. public:
  69. CMediaWidgetOptions(HWND, int, int);
  70. LRESULT Draw(LPNMTBCUSTOMDRAW pnmc);
  71. BOOL IsEnabled() { return TRUE; }
  72. HRESULT Initialize(int idCommand, int idTooltip=0, int idTooltipAlt=0);
  73. VOID SetDepth(BOOL fDepth) { _fDepth = fDepth; };
  74. BOOL _fDepth;
  75. };
  76. class CMediaWidgetVolume : public CMediaWidget
  77. {
  78. public:
  79. CMediaWidgetVolume() : CMediaWidget(NULL, 0, 0) {};
  80. LRESULT Draw(LPNMTBCUSTOMDRAW pnmc) { return CDRF_DODEFAULT; };
  81. BOOL IsEnabled() { return TRUE; };
  82. HRESULT TranslateAccelerator(LPMSG pMsg);
  83. HRESULT Initialize(HWND hwnd);
  84. };
  85. class CMediaWidgetSeek : public CMediaWidget
  86. {
  87. public:
  88. CMediaWidgetSeek() : CMediaWidget(NULL, 0, 0) { _fState = FALSE; };
  89. LRESULT Draw(LPNMTBCUSTOMDRAW pnmc) { return CDRF_DODEFAULT; };
  90. BOOL IsEnabled() { return _fState; };
  91. HRESULT TranslateAccelerator(LPMSG pMsg);
  92. HRESULT Initialize(HWND hwnd);
  93. VOID SetState(BOOL fState);
  94. BOOL _fState;
  95. };
  96. #define crMask RGB(255, 0, 255)
  97. #define COLOR_BKGND RGB(71, 80, 158)
  98. #define COLOR_BKGND2 RGB(92, 118, 186)
  99. #endif