diff options
author | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
---|---|---|
committer | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
commit | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Plugins/General/gen_ml/skinnedbutton.h | |
parent | 537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff) | |
download | winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz |
Initial community commit
Diffstat (limited to 'Src/Plugins/General/gen_ml/skinnedbutton.h')
-rw-r--r-- | Src/Plugins/General/gen_ml/skinnedbutton.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/Src/Plugins/General/gen_ml/skinnedbutton.h b/Src/Plugins/General/gen_ml/skinnedbutton.h new file mode 100644 index 00000000..6d82bbfa --- /dev/null +++ b/Src/Plugins/General/gen_ml/skinnedbutton.h @@ -0,0 +1,71 @@ +#ifndef NULLOSFT_MEDIALIBRARY_SKINNED_BUTTON_HEADER +#define NULLOSFT_MEDIALIBRARY_SKINNED_BUTTON_HEADER + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +#include "./skinnedwnd.h" + +#define BUTTON_TEXT_MAX 512 + +typedef struct _BUTTONPAINTSTRUCT +{ + HDC hdc; + RECT rcClient; + RECT rcPaint; + UINT buttonState; + UINT windowStyle; + UINT skinnedStyle; + HBITMAP hImage; + INT imageIndex; + UINT textFormat; + HFONT hFont; + COLORREF rgbText; + COLORREF rgbTextBk; + INT cchText; + wchar_t szText[BUTTON_TEXT_MAX]; +} BUTTONPAINTSTRUCT; + +class SkinnedButton : public SkinnedWnd +{ +protected: + SkinnedButton(void); + virtual ~SkinnedButton(void); + +protected: + virtual BOOL Attach(HWND hwndButton); + virtual LRESULT WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam); // treat this as dialog proc + virtual void OnPaint(void); + virtual void OnPrintClient(HDC hdc, UINT options); + + virtual void OnSkinChanged(BOOL bNotifyChildren, BOOL bRedraw); + virtual BOOL OnMediaLibraryIPC(INT msg, INT_PTR param, LRESULT *pResult); + virtual void OnLButtonDown(UINT flags, POINTS pts); + virtual void OnLButtonUp(UINT flags, POINTS pts); + virtual void OnMouseMove(UINT flags, POINTS pts); + virtual LRESULT GetIdealSize(LPCWSTR pszText); + +protected: + void Emulate_LeftButtonDown(UINT flags, POINTS pts, BOOL forwardMessage); + void Emulate_LeftButtonUp(UINT flags, POINTS pts, BOOL forwardMessage); + +public: + static COLORREF GetButtonBkColor(BOOL bPressed, BOOL *pbUnified); + static void PrePaint(HWND hwnd, BUTTONPAINTSTRUCT *pbps, UINT skinStyle, UINT uiStat); + static void DrawButton(BUTTONPAINTSTRUCT *pbps); + static void DrawPushButton(BUTTONPAINTSTRUCT *pbps); + static void DrawGroupBox(BUTTONPAINTSTRUCT *pbps); + static void DrawCheckBox(BUTTONPAINTSTRUCT *pbps); + static void DrawRadioButton(BUTTONPAINTSTRUCT *pbps); + static BOOL RegisterImageFilter(HANDLE filterMananger); + +protected: + MLBUTTONIMAGELIST imagelist; + +private: + friend BOOL SkinWindowEx(HWND hwndToSkin, INT type, UINT style); + +}; + +#endif // NULLOSFT_MEDIALIBRARY_SKINNED_BUTTON_HEADER
\ No newline at end of file |