summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2016-12-01 20:51:42 +0300
committerGeorge Hazan <ghazan@miranda.im>2016-12-01 21:49:54 +0300
commitf9c7760f54c279327a977b0cb5ee028c8f0c0bfb (patch)
tree0a1cf4602a5eac89dc38606cc91981c2166a83e0 /plugins/TabSRMM/src
parent40203d30ad1a569cfea61442782393b200e9fbe3 (diff)
more fixes
Diffstat (limited to 'plugins/TabSRMM/src')
-rw-r--r--plugins/TabSRMM/src/buttonbar.h6
-rw-r--r--plugins/TabSRMM/src/buttonsbar.cpp41
-rw-r--r--plugins/TabSRMM/src/chat/window.cpp8
-rw-r--r--plugins/TabSRMM/src/containeroptions.cpp2
-rw-r--r--plugins/TabSRMM/src/globals.cpp1
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp8
-rw-r--r--plugins/TabSRMM/src/msgs.h2
7 files changed, 9 insertions, 59 deletions
diff --git a/plugins/TabSRMM/src/buttonbar.h b/plugins/TabSRMM/src/buttonbar.h
index 52201ebb12..b29538554e 100644
--- a/plugins/TabSRMM/src/buttonbar.h
+++ b/plugins/TabSRMM/src/buttonbar.h
@@ -1,20 +1,14 @@
#ifndef _BUTTONSBAR_H
#define _BUTTONSBAR_H
-#define MIN_CBUTTONID 4000
-#define MAX_CBUTTONID 5000
-
-struct CustomButtonData;
struct TWindowData;
-void CB_DeInitCustomButtons();
void CB_InitCustomButtons();
void BB_InitDlgButtons(TWindowData *dat);
void BB_RefreshTheme(const TWindowData *dat);
BOOL BB_SetButtonsPos(TWindowData *dat);
void BB_RedrawButtons(TWindowData *dat);
-void BB_CustomButtonClick(TWindowData *dat, DWORD idFrom, HWND hwndFrom, BOOL code);
void CB_DestroyAllButtons(HWND hwndDlg);
void CB_DestroyButton(HWND hwndDlg, TWindowData *dat, DWORD dwButtonCID, DWORD dwFlags);
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp
index c44e2cba44..7c39d01b8c 100644
--- a/plugins/TabSRMM/src/buttonsbar.cpp
+++ b/plugins/TabSRMM/src/buttonsbar.cpp
@@ -1,7 +1,5 @@
#include "stdafx.h"
-HANDLE hHookButtonPressedEvt;
-
/////////////////////////////////////////////////////////////////////////////////////////
// Global functions
@@ -396,38 +394,6 @@ BOOL BB_SetButtonsPos(TWindowData *dat)
return EndDeferWindowPos(hdwp);
}
-void BB_CustomButtonClick(TWindowData *dat, DWORD idFrom, HWND hwndFrom, BOOL code)
-{
- RECT rc;
- GetWindowRect(hwndFrom, &rc);
-
- bool bFromArrow = false;
-
- CustomButtonClickData cbcd = { 0 };
- cbcd.cbSize = sizeof(cbcd);
- cbcd.pt.x = rc.left;
- cbcd.pt.y = rc.bottom;
-
- CustomButtonData *cbd;
- for (int i = 0; cbd = Srmm_GetNthButton(i); i++) {
- if (cbd->m_dwButtonCID == idFrom) {
- cbcd.pszModule = cbd->m_pszModuleName;
- cbcd.dwButtonId = cbd->m_dwButtonOrigID;
- }
- else if (cbd->m_dwArrowCID == idFrom) {
- bFromArrow = true;
- cbcd.pszModule = cbd->m_pszModuleName;
- cbcd.dwButtonId = cbd->m_dwButtonOrigID;
- }
- }
-
- cbcd.hwndFrom = dat->hwnd;
- cbcd.hContact = dat->hContact;
- cbcd.flags = (code ? BBCF_RIGHTBUTTON : 0) | (GetKeyState(VK_SHIFT) & 0x8000 ? BBCF_SHIFTPRESSED : 0) | (GetKeyState(VK_CONTROL) & 0x8000 ? BBCF_CONTROLPRESSED : 0) | (bFromArrow ? BBCF_ARROWCLICKED : 0);
-
- NotifyEventHooks(hHookButtonPressedEvt, dat->hContact, (LPARAM)&cbcd);
-}
-
void CB_DestroyAllButtons(HWND hwndDlg)
{
CustomButtonData *cbd;
@@ -474,12 +440,5 @@ void CB_ChangeButton(HWND hwndDlg, TWindowData *dat, CustomButtonData *cbd)
void CB_InitCustomButtons()
{
- hHookButtonPressedEvt = CreateHookableEvent(ME_MSG_BUTTONPRESSED);
-
HookEvent(ME_MSG_TOOLBARLOADED, CB_InitDefaultButtons);
}
-
-void CB_DeInitCustomButtons()
-{
- DestroyHookableEvent(hHookButtonPressedEvt);
-}
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp
index 646a4398f1..423320a909 100644
--- a/plugins/TabSRMM/src/chat/window.cpp
+++ b/plugins/TabSRMM/src/chat/window.cpp
@@ -2074,7 +2074,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
{
DWORD idFrom = GetDlgCtrlID((HWND)wParam);
if (idFrom >= MIN_CBUTTONID && idFrom <= MAX_CBUTTONID)
- BB_CustomButtonClick(dat, idFrom, (HWND)wParam, 1);
+ Srmm_ClickToolbarIcon(dat->hContact, idFrom, (HWND)wParam, 1);
}
break;
@@ -2611,7 +2611,7 @@ LABEL_SHOWWINDOW:
case WM_COMMAND:
if (LOWORD(wParam) >= MIN_CBUTTONID && LOWORD(wParam) <= MAX_CBUTTONID){
- BB_CustomButtonClick(dat, LOWORD(wParam), GetDlgItem(hwndDlg, LOWORD(wParam)), 0);
+ Srmm_ClickToolbarIcon(dat->hContact, LOWORD(wParam), GetDlgItem(hwndDlg, LOWORD(wParam)), 0);
break;
}
@@ -3196,7 +3196,7 @@ LABEL_SHOWWINDOW:
UpdateStatusBar(dat);
break;
- case DM_BBNEEDUPDATE:
+ case WM_CBD_UPDATED:
if (lParam)
CB_ChangeButton(hwndDlg, dat, (CustomButtonData*)lParam);
else
@@ -3205,7 +3205,7 @@ LABEL_SHOWWINDOW:
BB_SetButtonsPos(dat);
return 0;
- case DM_CBDESTROY:
+ case WM_CBD_REMOVED:
if (lParam)
CB_DestroyButton(hwndDlg, dat, (DWORD)wParam, (DWORD)lParam);
else
diff --git a/plugins/TabSRMM/src/containeroptions.cpp b/plugins/TabSRMM/src/containeroptions.cpp
index c3adeb98e6..b8c57dd415 100644
--- a/plugins/TabSRMM/src/containeroptions.cpp
+++ b/plugins/TabSRMM/src/containeroptions.cpp
@@ -93,7 +93,7 @@ void TSAPI ApplyContainerSetting(TContainerData *pContainer, DWORD flags, UINT m
if (fForceResize)
SendMessage(pContainer->hwnd, WM_SIZE, 0, 1);
- BroadCastContainer(pContainer, DM_BBNEEDUPDATE, 0, 0);
+ BroadCastContainer(pContainer, WM_CBD_UPDATED, 0, 0);
}
#define NR_O_PAGES 10
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp
index fe655afa41..71b2a095c1 100644
--- a/plugins/TabSRMM/src/globals.cpp
+++ b/plugins/TabSRMM/src/globals.cpp
@@ -470,7 +470,6 @@ int CGlobals::PreshutdownSendRecv(WPARAM, LPARAM)
db_set_dw(hContact, SRMSGMOD_T, "messagecount", 0);
::SI_DeinitStatusIcons();
- ::CB_DeInitCustomButtons();
// the event API
DestroyHookableEvent(PluginConfig.m_event_MsgWin);
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 567673c5a5..cb92cdf4e0 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -2595,7 +2595,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
// custom button handling
if (LOWORD(wParam) >= MIN_CBUTTONID && LOWORD(wParam) <= MAX_CBUTTONID) {
- BB_CustomButtonClick(dat, LOWORD(wParam), GetDlgItem(hwndDlg, LOWORD(wParam)), 0);
+ Srmm_ClickToolbarIcon(dat->hContact, LOWORD(wParam), GetDlgItem(hwndDlg, LOWORD(wParam)), 0);
break;
}
@@ -2848,7 +2848,7 @@ quote_from_last:
{
DWORD idFrom = GetDlgCtrlID((HWND)wParam);
if (idFrom >= MIN_CBUTTONID && idFrom <= MAX_CBUTTONID) {
- BB_CustomButtonClick(dat, idFrom, (HWND)wParam, 1);
+ Srmm_ClickToolbarIcon(dat->hContact, idFrom, (HWND)wParam, 1);
break;
}
}
@@ -3004,7 +3004,7 @@ quote_from_last:
}
return 0;
- case DM_BBNEEDUPDATE:
+ case WM_CBD_UPDATED:
if (lParam)
CB_ChangeButton(hwndDlg, dat, (CustomButtonData*)lParam);
else
@@ -3013,7 +3013,7 @@ quote_from_last:
BB_SetButtonsPos(dat);
return 0;
- case DM_CBDESTROY:
+ case WM_CBD_REMOVED:
if (lParam)
CB_DestroyButton(hwndDlg, dat, (DWORD)wParam, (DWORD)lParam);
else
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h
index a765921139..38911e1741 100644
--- a/plugins/TabSRMM/src/msgs.h
+++ b/plugins/TabSRMM/src/msgs.h
@@ -573,8 +573,6 @@ struct TNewWindowData
#define DM_PLAYINCOMINGSOUND (TM_USER+92)
#define DM_SENDMESSAGECOMMANDW (TM_USER+93)
#define DM_REMOVEPOPUPS (TM_USER+94)
-#define DM_BBNEEDUPDATE (TM_USER+96)
-#define DM_CBDESTROY (TM_USER+97)
#define DM_LOGSTATUSCHANGE (TM_USER+98)
#define DM_SC_BUILDLIST (TM_USER+100)
#define DM_SC_INITDIALOG (TM_USER+101)