toolbarButton.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef NULLSOFT_WINAMP_OMBROWSER_TOOLBAR_BUTTON_HEADER
  2. #define NULLSOFT_WINAMP_OMBROWSER_TOOLBAR_BUTTON_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include "./toolbarItem.h"
  7. class ToolbarButton : public ToolbarItem
  8. {
  9. public:
  10. typedef enum
  11. {
  12. stylePushbutton = 0x00000000,
  13. styleCommandLink = 0x00010000,
  14. } buttonStyles;
  15. protected:
  16. ToolbarButton(LPCSTR pszName, INT nCommand, UINT nStyle, INT nIcon, LPCWSTR pszText, LPCWSTR pszDescription);
  17. virtual ~ToolbarButton() {}
  18. public:
  19. static ToolbarItem* CALLBACK CreateInstance(ToolbarItem::Template *itemTemplate);
  20. public:
  21. BOOL AdjustRect(HWND hToolbar, RECT *proposedRect);
  22. BOOL Paint(HWND hToolbar, HDC hdc, const RECT *paintRect, UINT state);
  23. INT GetTip(LPTSTR pszBuffer, INT cchBufferMax);
  24. void MouseMove(HWND hToolbar, UINT mouseFlags, POINT pt);
  25. void MouseLeave(HWND hToolbar);
  26. void LButtonDown(HWND hToolbar, UINT mouseFlags, POINT pt);
  27. void LButtonUp(HWND hToolbar, UINT mouseFlags, POINT pt);
  28. void Click(HWND hToolbar, UINT mouseFlags, POINT pt);
  29. void UpdateSkin(HWND hToolbar);
  30. BOOL PtInItem(POINT pt);
  31. INT GetCommandId();
  32. BOOL FillMenuInfo(HWND hToolbar, MENUITEMINFO *pmii, LPWSTR pszBuffer, INT cchBufferMax);
  33. void SetFocus(HWND hToolbar, ToolbarItem *focusItem, BOOL fSet);
  34. BOOL KeyDown(HWND hToolbar, INT vKey, UINT flags);
  35. BOOL KeyUp(HWND hToolbar, INT vKey, UINT flags);
  36. protected:
  37. UINT commandId;
  38. INT offsetX;
  39. INT offsetY;
  40. COLORREF rgbText;
  41. COLORREF rgbHilite;
  42. };
  43. #endif //NULLSOFT_WINAMP_OMBROWSER_TOOLBAR_BUTTON_HEADER