diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-09 09:02:16 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-09 09:02:16 +0000 |
commit | 6d10b27399e46e952ded3d5a8bc4645ccffb2c34 (patch) | |
tree | fc245f64fc5b4da747fa85d588cc10ce525504c2 /plugins/ExternalAPI/m_toptoolbar.h | |
parent | 4ce494e510feaaabc64ac4630645874ddd95203d (diff) |
- customizeable TopToolbar
- restored Clist Modern toolbar painter
git-svn-id: http://svn.miranda-ng.org/main/trunk@876 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ExternalAPI/m_toptoolbar.h')
-rw-r--r-- | plugins/ExternalAPI/m_toptoolbar.h | 46 |
1 files changed, 46 insertions, 0 deletions
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
|