summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src/buttonsbar.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-08-12 18:03:10 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-08-12 18:03:10 +0000
commitd9013df6a880f0bd7459f952d654ff476e480a90 (patch)
treed6547c07cc04da79368c3a98003f365b83835c7a /plugins/TabSRMM/src/buttonsbar.cpp
parent58ff50e5bf8dbb6b28d54370423232dc0221cd53 (diff)
custom buttons in TabSRMM removed and based on the standard MButtonClass
git-svn-id: http://svn.miranda-ng.org/main/trunk@5661 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM/src/buttonsbar.cpp')
-rw-r--r--plugins/TabSRMM/src/buttonsbar.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp
index 0e878bcb93..afac6207cb 100644
--- a/plugins/TabSRMM/src/buttonsbar.cpp
+++ b/plugins/TabSRMM/src/buttonsbar.cpp
@@ -210,7 +210,7 @@ void CB_ChangeButton(HWND hwndDlg, TWindowData *dat, CustomButtonData* cbd)
if (cbd->hIcon)
SendMessage(hwndBtn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_GetIconByHandle(cbd->hIcon));
if (cbd->ptszTooltip)
- SendMessage(hwndBtn, BUTTONADDTOOLTIP, (WPARAM)TranslateTS(cbd->ptszTooltip), 0);
+ SendMessage(hwndBtn, BUTTONADDTOOLTIP, (WPARAM)TranslateTS(cbd->ptszTooltip), BATF_TCHAR);
SendMessage(hwndBtn, BUTTONSETCONTAINER, (LPARAM)dat->pContainer, 0);
}
}
@@ -384,12 +384,8 @@ static INT_PTR CB_SetButtonState(WPARAM wParam, LPARAM lParam)
hwndDlg = M.FindWindow((HANDLE)wParam);
if (hwndDlg && realbutton && bbdi->hIcon)
SendMessage(GetDlgItem(hwndDlg, tempCID), BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_GetIconByHandle(bbdi->hIcon));
- if (hwndDlg && realbutton && bbdi->pszTooltip) {
- if (bbdi->bbbFlags&BBBF_ANSITOOLTIP)
- SendMessage(GetDlgItem(hwndDlg, tempCID), BUTTONADDTOOLTIP, (WPARAM)mir_a2u(bbdi->pszTooltip), 0);
- else
- SendMessage(GetDlgItem(hwndDlg, tempCID), BUTTONADDTOOLTIP, (WPARAM)bbdi->ptszTooltip, 0);
- }
+ if (hwndDlg && realbutton && bbdi->pszTooltip)
+ SendMessage(GetDlgItem(hwndDlg, tempCID), BUTTONADDTOOLTIP, (WPARAM)bbdi->ptszTooltip, (bbdi->bbbFlags & BBBF_ANSITOOLTIP) ? 0 : BATF_TCHAR);
if (hwndDlg && realbutton && bbdi->bbbFlags) {
Utils::showDlgControl(hwndDlg, tempCID, (bbdi->bbbFlags&BBSF_HIDDEN) ? SW_HIDE : SW_SHOW);
Utils::enableDlgControl(hwndDlg, tempCID, (bbdi->bbbFlags&BBSF_DISABLED) ? 0 : 1);
@@ -561,15 +557,17 @@ void TSAPI BB_InitDlgButtons(TWindowData *dat)
rwidth += cbd->iButtonWidth + gap;
if (!cbd->bHidden && !cbd->bCanBeHidden)
dat->iButtonBarReallyNeeds += cbd->iButtonWidth + gap;
- if (!cbd->bDummy && !GetDlgItem(hdlg, cbd->dwButtonCID))
- hwndBtn = CreateWindowEx(0, _T("TSButtonClass"), _T(""), WS_CHILD | WS_VISIBLE | WS_TABSTOP, rect.right - rwidth + gap, splitterY, cbd->iButtonWidth, DPISCALEY_S(22), hdlg, (HMENU) cbd->dwButtonCID, g_hInst, NULL);
+ if (!cbd->bDummy && !GetDlgItem(hdlg, cbd->dwButtonCID)) {
+ hwndBtn = CreateWindowEx(0, _T("MButtonClass"), _T(""), WS_CHILD | WS_VISIBLE | WS_TABSTOP, rect.right - rwidth + gap, splitterY, cbd->iButtonWidth, DPISCALEY_S(22), hdlg, (HMENU) cbd->dwButtonCID, g_hInst, NULL);
+ CustomizeButton(hwndBtn);
+ }
if (!cbd->bDummy && hwndBtn) {
SendMessage(hwndBtn, BUTTONSETASFLATBTN, TRUE, 0);
SendMessage(hwndBtn, BUTTONSETASTHEMEDBTN, isThemed != 0, 0);
if (cbd->hIcon)
SendMessage(hwndBtn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_GetIconByHandle(cbd->hIcon));
if (cbd->ptszTooltip)
- SendMessage(hwndBtn, BUTTONADDTOOLTIP, (WPARAM)TranslateTS(cbd->ptszTooltip), 0);
+ SendMessage(hwndBtn, BUTTONADDTOOLTIP, (WPARAM)TranslateTS(cbd->ptszTooltip), BATF_TCHAR);
SendMessage(hwndBtn, BUTTONSETCONTAINER, (LPARAM)dat->pContainer, 0);
SendMessage(hwndBtn, BUTTONSETASTOOLBARBUTTON, TRUE, 0);
@@ -594,9 +592,11 @@ void TSAPI BB_InitDlgButtons(TWindowData *dat)
CustomButtonData* cbd = (CustomButtonData *)LButtonsList->items[i];
if (((dat->bType == SESSIONTYPE_IM && cbd->bIMButton)
|| (dat->bType == SESSIONTYPE_CHAT && cbd->bChatButton))) {
- if (!cbd->bDummy && !GetDlgItem(hdlg, cbd->dwButtonCID))
- hwndBtn = CreateWindowEx(0, _T("TSButtonClass"), _T(""), WS_CHILD | WS_VISIBLE | WS_TABSTOP, 2 + lwidth, splitterY,
+ if (!cbd->bDummy && !GetDlgItem(hdlg, cbd->dwButtonCID)) {
+ hwndBtn = CreateWindowEx(0, _T("MButtonClass"), _T(""), WS_CHILD | WS_VISIBLE | WS_TABSTOP, 2 + lwidth, splitterY,
cbd->iButtonWidth, DPISCALEY_S(22), hdlg, (HMENU) cbd->dwButtonCID, g_hInst, NULL);
+ CustomizeButton(hwndBtn);
+ }
if (!cbd->bHidden)
lwidth += cbd->iButtonWidth + gap;
if (!cbd->bHidden && !cbd->bCanBeHidden)
@@ -607,7 +607,7 @@ void TSAPI BB_InitDlgButtons(TWindowData *dat)
if (cbd->hIcon)
SendMessage(hwndBtn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_GetIconByHandle(cbd->hIcon));
if (cbd->ptszTooltip)
- SendMessage(hwndBtn, BUTTONADDTOOLTIP, (WPARAM)TranslateTS(cbd->ptszTooltip), 0);
+ SendMessage(hwndBtn, BUTTONADDTOOLTIP, (WPARAM)TranslateTS(cbd->ptszTooltip), BATF_TCHAR);
SendMessage(hwndBtn, BUTTONSETCONTAINER, (LPARAM)dat->pContainer, 0);
SendMessage(hwndBtn, BUTTONSETASTOOLBARBUTTON, TRUE, 0);