summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/modern_toolbar.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-07-09 13:47:44 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-07-09 13:47:44 +0000
commita6ad2609bad6a7c4b6f30c17973af9dcaba8c8af (patch)
tree48b23fcfd0b68409659e850e7bc5f5a6099f3413 /plugins/Clist_modern/modern_toolbar.cpp
parentcfc759efa580c2aea1b5e882e9811d7aeea9b593 (diff)
slightly changed design of custom MButtonCtrl window procedure. Clist Nicer works ok
git-svn-id: http://svn.miranda-ng.org/main/trunk@880 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/modern_toolbar.cpp')
-rw-r--r--plugins/Clist_modern/modern_toolbar.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/plugins/Clist_modern/modern_toolbar.cpp b/plugins/Clist_modern/modern_toolbar.cpp
index 606dc1122a..89de2e2609 100644
--- a/plugins/Clist_modern/modern_toolbar.cpp
+++ b/plugins/Clist_modern/modern_toolbar.cpp
@@ -35,6 +35,7 @@ struct
char *pszTooltipUp, *pszTooltipDn;
int icoDefIdx, defResource, defResource2;
BOOL bVisByDefault;
+ HANDLE hButton;
}
static BTNS[] =
{
@@ -74,8 +75,13 @@ static int Modern_InitButtons(WPARAM, LPARAM)
else tbb.dwFlags |= TTBBF_ISSEPARATOR;
tbb.dwFlags |= (BTNS[i].bVisByDefault ? TTBBF_VISIBLE :0 );
- TopToolbar_AddButton(&tbb);
+ BTNS[i].hButton = TopToolbar_AddButton(&tbb);
}
+
+ CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)BTNS[3].hButton, db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? TTBST_PUSHED : TTBST_RELEASED);
+ CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)BTNS[6].hButton, db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? TTBST_PUSHED : TTBST_RELEASED);
+ CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)BTNS[7].hButton, db_get_b(NULL, "Skin", "UseSound", SETTING_ENABLESOUNDS_DEFAULT) ? TTBST_PUSHED : TTBST_RELEASED);
+
return 1;
}
@@ -241,11 +247,18 @@ static LRESULT CALLBACK toolbarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
return 0;
}
+static int ToolBar_LayeredPaintProc(HWND hWnd, HDC hDC, RECT *rcPaint, HRGN rgn, DWORD dFlags, void * CallBackData)
+{
+ return SendMessage(hWnd, MTBM_LAYEREDPAINT,(WPARAM)hDC,0);
+}
+
void CustomizeToolbar(HWND hwnd)
{
TTBCtrlCustomize custData = { sizeof(ModernToolbarCtrl), toolbarWndProc, NULL };
SendMessage(hwnd, TTB_SETCUSTOM, 0, (LPARAM)&custData);
+ CallService(MS_SKINENG_REGISTERPAINTSUB,(WPARAM)hwnd,(LPARAM)ToolBar_LayeredPaintProc);
+
ModernToolbarCtrl* pMTBInfo = (ModernToolbarCtrl*)GetWindowLongPtr(hwnd, 0);
pMTBInfo->nLineCount = 1;
pMTBInfo->mtbXPTheme = xpt_AddThemeHandle(hwnd, L"TOOLBAR");