summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src/modplus.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2016-12-01 19:33:16 +0300
committerGeorge Hazan <ghazan@miranda.im>2016-12-01 19:33:35 +0300
commit06fc3d811d71a44b92d45e1263e5fb0099a7304e (patch)
treecbcdafbcddacab601a6d47321ec09aac5d5e5c0c /plugins/TabSRMM/src/modplus.cpp
parentbd408d296ccfa16dba379f3820a2007ff6963a6a (diff)
toolbar icons processing code moved to mir_app
Diffstat (limited to 'plugins/TabSRMM/src/modplus.cpp')
-rw-r--r--plugins/TabSRMM/src/modplus.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/plugins/TabSRMM/src/modplus.cpp b/plugins/TabSRMM/src/modplus.cpp
index d58e9a3062..3885fbe072 100644
--- a/plugins/TabSRMM/src/modplus.cpp
+++ b/plugins/TabSRMM/src/modplus.cpp
@@ -49,18 +49,14 @@ static wchar_t* getMenuEntry(int i)
static int RegisterCustomButton(WPARAM, LPARAM)
{
- if (!ServiceExists(MS_BB_ADDBUTTON))
- return 1;
-
- BBButton bbd = { 0 };
- bbd.cbSize = sizeof(BBButton);
+ BBButton bbd = {};
bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISPUSHBUTTON;
bbd.dwButtonID = 1;
bbd.dwDefPos = 200;
bbd.hIcon = PluginConfig.g_buttonBarIconHandles[3];
bbd.pszModuleName = "Tabmodplus";
bbd.pwszTooltip = LPGENW("Insert [img] tag / surround selected text with [img][/img]");
- return CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd);
+ return Srmm_AddButton(&bbd);
}
static int CustomButtonPressed(WPARAM wParam, LPARAM lParam)
@@ -69,10 +65,10 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam)
if (mir_strcmp(cbcd->pszModule, "Tabmodplus") || cbcd->dwButtonId != 1)
return 0;
- BBButton bbd = { sizeof(bbd) };
+ BBButton bbd = {};
bbd.dwButtonID = 1;
bbd.pszModuleName = "Tabmodplus";
- CallService(MS_BB_GETBUTTONSTATE, wParam, (LPARAM)&bbd);
+ Srmm_SetButtonState(wParam, &bbd);
wchar_t *pszText = L"";
CHARRANGE cr;
@@ -133,21 +129,21 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam)
bbd.pwszTooltip = 0;
bbd.hIcon = 0;
bbd.bbbFlags = BBSF_RELEASED;
- CallService(MS_BB_SETBUTTONSTATE, wParam, (LPARAM)&bbd);
+ Srmm_SetButtonState(wParam, &bbd);
break;
case 3:
pszFormatedText = L"[img]";
bbd.pwszTooltip = LPGENW("Insert [img] tag / surround selected text with [img][/img]");
- CallService(MS_BB_SETBUTTONSTATE, wParam, (LPARAM)&bbd);
+ Srmm_SetButtonState(wParam, &bbd);
break;
case 4:
pszFormatedText = L"[/img]";
bbd.pwszTooltip = LPGENW("Insert [img] tag / surround selected text with [img][/img]");
- CallService(MS_BB_SETBUTTONSTATE, wParam, (LPARAM)&bbd);
+ Srmm_SetButtonState(wParam, &bbd);
break;
}