summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/modern_toolbar.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-07-09 17:53:15 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-07-09 17:53:15 +0000
commitcee90240b1301ad373e98fe874a924fcdbb83447 (patch)
tree2a289365c84efbfd0c27eca4663294b04737d2f1 /plugins/Clist_modern/modern_toolbar.cpp
parent132e74c3f3f5a31558b6b50be7be70e7bc283804 (diff)
- fix for button states errors in Clist Modern;
- fix for message handling duplicates; - fix for naming toolbar icons; - removed duplicate icon entry in dbeditor++ git-svn-id: http://svn.miranda-ng.org/main/trunk@884 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/modern_toolbar.cpp')
-rw-r--r--plugins/Clist_modern/modern_toolbar.cpp34
1 files changed, 31 insertions, 3 deletions
diff --git a/plugins/Clist_modern/modern_toolbar.cpp b/plugins/Clist_modern/modern_toolbar.cpp
index bd604e0464..5a5b0395f2 100644
--- a/plugins/Clist_modern/modern_toolbar.cpp
+++ b/plugins/Clist_modern/modern_toolbar.cpp
@@ -65,12 +65,15 @@ static int Modern_InitButtons(WPARAM, LPARAM)
char buf[255];
mir_snprintf(buf,SIZEOF(buf),"%s%s%s", TTB_OPTDIR, BTNS[i].pszButtonID, "_dn");
- tbb.hIconHandleUp = RegisterIcolibIconHandle( buf, "ToolBar", BTNS[i].pszButtonName , _T("icons\\toolbar_icons.dll"),-BTNS[i].icoDefIdx, g_hInst, BTNS[i].defResource );
+ tbb.hIconHandleUp = RegisterIcolibIconHandle( buf, "Toolbar", BTNS[i].pszTooltipUp, _T("icons\\toolbar_icons.dll"),-BTNS[i].icoDefIdx, g_hInst, BTNS[i].defResource );
if (BTNS[i].pszTooltipDn) {
+ tbb.dwFlags |= TTBBF_ASPUSHBUTTON;
+
mir_snprintf(buf,SIZEOF(buf),"%s%s%s", TTB_OPTDIR, BTNS[i].pszButtonID, "_up");
- tbb.hIconHandleUp = RegisterIcolibIconHandle( buf, "ToolBar", BTNS[i].pszTooltipDn , _T("icons\\toolbar_icons.dll"),-(BTNS[i].icoDefIdx+1), g_hInst, BTNS[i].defResource2 );
+ tbb.hIconHandleDn = RegisterIcolibIconHandle( buf, "Toolbar", BTNS[i].pszTooltipDn, _T("icons\\toolbar_icons.dll"),-(BTNS[i].icoDefIdx+1), g_hInst, BTNS[i].defResource2 );
}
+ else tbb.hIconHandleDn = NULL;
}
else tbb.dwFlags |= TTBBF_ISSEPARATOR;
@@ -114,6 +117,26 @@ static tbdat = { 0 };
COLORREF sttGetColor(char * module, char * color, COLORREF defColor);
+static int ehhToolBarSettingsChanged(WPARAM wParam, LPARAM lParam)
+{
+ DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
+ if ((HANDLE)wParam != NULL)
+ return 0;
+
+ if (!mir_strcmp(cws->szModule,"CList")) {
+ if (!mir_strcmp(cws->szSetting,"HideOffline"))
+ CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)BTNS[3].hButton, cws->value.bVal ? TTBST_PUSHED : TTBST_RELEASED);
+ else if (!mir_strcmp(cws->szSetting,"UseGroups"))
+ CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)BTNS[6].hButton, cws->value.bVal ? TTBST_PUSHED : TTBST_RELEASED);
+ }
+ else if (!mir_strcmp(cws->szModule,"Skin")) {
+ if (!mir_strcmp(cws->szSetting,"UseSound"))
+ CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)BTNS[7].hButton, cws->value.bVal ? TTBST_PUSHED : TTBST_RELEASED);
+ }
+
+ return 0;
+}
+
static int ehhToolBarBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam)
{
if ( tbdat.mtb_hBmpBackground) {
@@ -240,8 +263,12 @@ static LRESULT CALLBACK toolbarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
Offset.y = childRect.top - MyRect.top;
SendMessage(mtbi->hWindow, BUTTONDRAWINPARENT, (WPARAM)hDC, (LPARAM)&Offset);
}
- return 1;
}
+ pMTBInfo->lResult = 0;
+ return 1;
+
+ case WM_DESTROY:
+ xpt_FreeThemeForWindow(hwnd);
}
return 0;
@@ -267,6 +294,7 @@ void CustomizeToolbar(HWND hwnd)
static int Toolbar_ModulesLoaded(WPARAM, LPARAM)
{
CallService(MS_BACKGROUNDCONFIG_REGISTER, (WPARAM)"ToolBar Background/ToolBar",0);
+ HookEvent(ME_DB_CONTACT_SETTINGCHANGED, ehhToolBarSettingsChanged);
HookEvent(ME_BACKGROUNDCONFIG_CHANGED, ehhToolBarBackgroundSettingsChanged);
HookEvent(ME_TTB_INITBUTTONS, Modern_InitButtons);
return 0;