From 6d10b27399e46e952ded3d5a8bc4645ccffb2c34 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 9 Jul 2012 09:02:16 +0000 Subject: - customizeable TopToolbar - restored Clist Modern toolbar painter git-svn-id: http://svn.miranda-ng.org/main/trunk@876 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/ExternalAPI/m_toptoolbar.h | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'plugins/ExternalAPI') diff --git a/plugins/ExternalAPI/m_toptoolbar.h b/plugins/ExternalAPI/m_toptoolbar.h index 5ef3a20352..ed79f8818e 100644 --- a/plugins/ExternalAPI/m_toptoolbar.h +++ b/plugins/ExternalAPI/m_toptoolbar.h @@ -134,10 +134,56 @@ returns: always returns 0. #define TTB_WINDOW_HANDLE ((HANDLE)-1) +// this procedure is executed on each button on toolbar +// and on a toolbar itself with hTTButton == TTB_WINDOW_HANDLE +// hTTButton = button handle +// hwndBtn = button window handle +// userInfo = lParam passed into TopToolbar_SetCustomProc + typedef void (__cdecl *pfnCustomProc)(HANDLE hTTButton, HWND hwndBtn, LPARAM userInfo); __forceinline void TopToolbar_SetCustomProc(pfnCustomProc pFunc, LPARAM lParam) { CallService("TopToolBar/SetCustomProc", (WPARAM)pFunc, lParam); } +/////////////////////////////////////////////////////////////////////////////// +// Toolbar internal structures + +typedef void (__cdecl *pfnTTBPainterFunc)(struct TTBCtrl*, HDC); + +struct TTBCtrlButton +{ + HWND hWindow; +}; + +struct TTBCtrl +{ + HWND hWnd; + HANDLE hFrame; + int nButtonWidth; + int nButtonHeight; + int nButtonSpace; + BOOL bFlatButtons; + + SortedList* pButtonList; + + LRESULT lResult; // custom window proc result + WNDPROC fnWindowProc; // custom window proc + pfnTTBPainterFunc fnPainter; // custom button painter +}; + +struct TTBCtrlCustomize +{ + size_t cbLen; // total length of the internal data structure + WNDPROC fnWindowProc; // subclassed windows procedure for the custom button + pfnTTBPainterFunc fnPainter; // custom button painter +}; + +// Sets the custom painting procedure for a toolbar +// wParam = not used +// lParam = TTBCtrlCustomize* +// Usage: SendMessage(hwndToolbar, TTB_SETCUSTOM, 0, (LPARAM)&CustomData); +// Only works on TopToolbars +#define TTB_SETCUSTOM (WM_USER+1) + #endif -- cgit v1.2.3