summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TabSRMM/src')
-rw-r--r--plugins/TabSRMM/src/chat/chat_resource.h1
-rw-r--r--plugins/TabSRMM/src/chat/main.cpp4
-rw-r--r--plugins/TabSRMM/src/chat/window.cpp206
-rw-r--r--plugins/TabSRMM/src/container.cpp10
-rw-r--r--plugins/TabSRMM/src/generic_msghandlers.cpp14
-rw-r--r--plugins/TabSRMM/src/infopanel.cpp28
-rw-r--r--plugins/TabSRMM/src/infopanel.h25
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp74
-rw-r--r--plugins/TabSRMM/src/msgdlgutils.cpp28
-rw-r--r--plugins/TabSRMM/src/msgs.cpp15
-rw-r--r--plugins/TabSRMM/src/msgs.h13
-rw-r--r--plugins/TabSRMM/src/sendqueue.cpp6
-rw-r--r--plugins/TabSRMM/src/stdafx.h3
13 files changed, 216 insertions, 211 deletions
diff --git a/plugins/TabSRMM/src/chat/chat_resource.h b/plugins/TabSRMM/src/chat/chat_resource.h
index 7dcdb22d61..564aa61fe7 100644
--- a/plugins/TabSRMM/src/chat/chat_resource.h
+++ b/plugins/TabSRMM/src/chat/chat_resource.h
@@ -21,7 +21,6 @@
#define IDC_NICKROW2 1023
#define IDC_NICKROW 1024
#define IDC_LOGLIMIT 1024
-#define IDC_CHAT_CLOSE 1025
#define IDC_CHAT_SPIN2 1029
#define IDC_CHAT_SPIN3 1030
#define IDC_CHAT_SPIN4 1031
diff --git a/plugins/TabSRMM/src/chat/main.cpp b/plugins/TabSRMM/src/chat/main.cpp
index ae1d259b6d..76c6efdb13 100644
--- a/plugins/TabSRMM/src/chat/main.cpp
+++ b/plugins/TabSRMM/src/chat/main.cpp
@@ -55,8 +55,8 @@ static void OnReplaceSession(SESSION_INFO *si)
static void OnSetTopic(SESSION_INFO *si)
{
- if (si->hWnd && si->dat->m_pPanel)
- si->dat->m_pPanel->Invalidate(true);
+ if (si->hWnd)
+ si->dat->m_pPanel.Invalidate(true);
}
static void OnNewUser(SESSION_INFO *si, USERINFO*)
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp
index cdefb49389..41db67446b 100644
--- a/plugins/TabSRMM/src/chat/window.cpp
+++ b/plugins/TabSRMM/src/chat/window.cpp
@@ -176,7 +176,7 @@ void CChatRoomDlg::UpdateWindowState(UINT msg)
SendDlgItemMessage(m_hwnd, IDC_MESSAGE, EM_REQUESTRESIZE, 0, 0);
}
- m_pPanel->dismissConfig();
+ m_pPanel.dismissConfig();
m_dwUnread = 0;
if (m_pWnd) {
m_pWnd->activateTab();
@@ -254,8 +254,8 @@ int CChatRoomDlg::Resizer(UTILRESIZECONTROL *urc)
bool bToolbar = !(m_pContainer->dwFlags & CNT_HIDETOOLBAR);
bool bBottomToolbar = m_pContainer->dwFlags & CNT_BOTTOMTOOLBAR ? 1 : 0;
bool bNick = si->iType != GCW_SERVER && si->bNicklistEnabled;
- bool bInfoPanel = m_pPanel->isActive();
- int panelHeight = m_pPanel->getHeight() + 1;
+ bool bInfoPanel = m_pPanel.isActive();
+ int panelHeight = m_pPanel.getHeight() + 1;
RECT rcTabs;
GetClientRect(m_hwnd, &rcTabs);
@@ -267,12 +267,12 @@ int CChatRoomDlg::Resizer(UTILRESIZECONTROL *urc)
Utils::showDlgControl(m_hwnd, IDC_LIST, si->bNicklistEnabled ? SW_SHOW : SW_HIDE);
Utils::showDlgControl(m_hwnd, IDC_SPLITTERX, si->bNicklistEnabled ? SW_SHOW : SW_HIDE);
- Utils::enableDlgControl(m_hwnd, IDC_SHOWNICKLIST, true);
+ m_btnNickList.Enable(true);
m_btnFilter.Enable(true);
if (si->iType == GCW_CHATROOM) {
- MODULEINFO* tmp = pci->MM_FindModule(si->pszModule);
+ MODULEINFO *tmp = pci->MM_FindModule(si->pszModule);
if (tmp)
- Utils::enableDlgControl(m_hwnd, IDC_CHANMGR, tmp->bChanMgr);
+ m_btnChannelMgr.Enable(tmp->bChanMgr);
}
}
else {
@@ -281,9 +281,9 @@ int CChatRoomDlg::Resizer(UTILRESIZECONTROL *urc)
}
if (si->iType == GCW_SERVER) {
- Utils::enableDlgControl(m_hwnd, IDC_SHOWNICKLIST, false);
+ m_btnNickList.Enable(false);
m_btnFilter.Enable(false);
- Utils::enableDlgControl(m_hwnd, IDC_CHANMGR, false);
+ m_btnChannelMgr.Enable(false);
}
switch (urc->wId) {
@@ -754,7 +754,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
}
if (wParam == VK_F4 && isCtrl && !isAlt) { // ctrl-F4 (close tab)
- SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_CHAT_CLOSE, BN_CLICKED), 0);
+ SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(IDC_CLOSE, BN_CLICKED), 0);
return 0;
}
@@ -1518,16 +1518,18 @@ static void __cdecl phase2(void * lParam)
CChatRoomDlg::CChatRoomDlg(TNewWindowData *pData)
: CTabBaseDlg(pData, IDD_CHANNEL),
m_btnOk(this, IDOK),
+ m_list(this, IDC_LIST),
m_btnBold(this, IDC_BOLD),
m_btnColor(this, IDC_COLOR),
m_btnFilter(this, IDC_FILTER),
m_btnItalic(this, IDC_ITALICS),
m_btnHistory(this, IDC_HISTORY),
m_btnBkColor(this, IDC_BKGCOLOR),
- m_btnUnderline(this, IDC_UNDERLINE)
+ m_btnChannelMgr(this, IDC_CHANMGR),
+ m_btnUnderline(this, IDC_UNDERLINE),
+ m_btnNickList(this, IDC_SHOWNICKLIST)
{
m_bType = SESSIONTYPE_CHAT;
- m_pPanel = new CInfoPanel(this);
si = newData->si;
m_hContact = si->hContact;
@@ -1536,10 +1538,16 @@ CChatRoomDlg::CChatRoomDlg(TNewWindowData *pData)
m_btnOk.OnClick = Callback(this, &CChatRoomDlg::OnClick_OK);
m_btnFilter.OnClick = Callback(this, &CChatRoomDlg::OnClick_Filter);
m_btnHistory.OnClick = Callback(this, &CChatRoomDlg::OnClick_History);
+ m_btnNickList.OnClick = Callback(this, &CChatRoomDlg::OnClick_ShowNickList);
+ m_btnChannelMgr.OnClick = Callback(this, &CChatRoomDlg::OnClick_ChanMgr);
+
m_btnColor.OnClick = Callback(this, &CChatRoomDlg::OnClick_Color);
m_btnBkColor.OnClick = Callback(this, &CChatRoomDlg::OnClick_BkColor);
m_btnBold.OnClick = m_btnItalic.OnClick = m_btnUnderline.OnClick = Callback(this, &CChatRoomDlg::OnClick_BIU);
+
m_message.OnChange = Callback(this, &CChatRoomDlg::OnChange_Message);
+
+ m_list.OnDblClick = Callback(this, &CChatRoomDlg::OnDblClick_List);
}
CThumbBase* CChatRoomDlg::CreateThumb(CProxyWindow *pProxy) const
@@ -1600,8 +1608,8 @@ void CChatRoomDlg::OnInitDialog()
SetTimer(m_hwnd, TIMERID_TYPE, 1000, NULL);
}
- m_pPanel->getVisibility();
- m_pPanel->Configure();
+ m_pPanel.getVisibility();
+ m_pPanel.Configure();
M.AddWindow(m_hwnd, m_hContact);
BroadCastContainer(m_pContainer, DM_REFRESHTABINDEX, 0, 0);
@@ -1617,7 +1625,7 @@ void CChatRoomDlg::OnInitDialog()
m_message.SendMsg(EM_SETEVENTMASK, 0, ENM_REQUESTRESIZE | ENM_MOUSEEVENTS | ENM_SCROLL | ENM_KEYEVENTS | ENM_CHANGE);
m_message.SendMsg(EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(3, 3));
- m_pPanel->loadHeight();
+ m_pPanel.loadHeight();
if (PluginConfig.g_hMenuTrayUnread != 0 && m_hContact != 0 && m_szProto != NULL)
UpdateTrayMenu(0, m_wStatus, m_szProto, m_wszStatus, m_hContact, FALSE);
@@ -1642,7 +1650,7 @@ void CChatRoomDlg::OnInitDialog()
mir_subclassWindow(GetDlgItem(m_hwnd, IDC_SPLITTERX), SplitterSubclassProc);
mir_subclassWindow(GetDlgItem(m_hwnd, IDC_SPLITTERY), SplitterSubclassProc);
- mir_subclassWindow(GetDlgItem(m_hwnd, IDC_LIST), NicklistSubclassProc);
+ mir_subclassWindow(m_list.GetHwnd(), NicklistSubclassProc);
mir_subclassWindow(m_log.GetHwnd(), LogSubclassProc);
mir_subclassWindow(m_btnFilter.GetHwnd(), ButtonSubclassProc);
mir_subclassWindow(m_btnColor.GetHwnd(), ButtonSubclassProc);
@@ -1722,8 +1730,6 @@ void CChatRoomDlg::OnDestroy()
memset((void*)&m_pContainer->mOld, -1000, sizeof(MARGINS));
PostMessage(m_pContainer->hwnd, WM_SIZE, 0, 1);
- delete m_pPanel;
-
if (m_pContainer->dwFlags & CNT_SIDEBAR)
m_pContainer->SideBar->removeSession(this);
mir_free(m_enteredText);
@@ -1816,6 +1822,27 @@ void CChatRoomDlg::OnClick_History(CCtrlButton *pButton)
ShellExecute(m_hwnd, NULL, pci->GetChatLogsFilename(si, 0), NULL, NULL, SW_SHOW);
}
+void CChatRoomDlg::OnClick_ShowNickList(CCtrlButton *pButton)
+{
+ if (!pButton->Enabled())
+ return;
+ if (si->iType == GCW_SERVER)
+ return;
+
+ si->bNicklistEnabled = !si->bNicklistEnabled;
+
+ SendMessage(m_hwnd, WM_SIZE, 0, 0);
+ if (CSkin::m_skinEnabled)
+ InvalidateRect(m_hwnd, NULL, TRUE);
+ PostMessage(m_hwnd, GC_SCROLLTOBOTTOM, 0, 0);
+}
+
+void CChatRoomDlg::OnClick_ChanMgr(CCtrlButton *pButton)
+{
+ if (pButton->Enabled())
+ pci->DoEventHookAsync(m_hwnd, si->ptszID, si->pszModule, GC_USER_CHANMGR, NULL, NULL, 0);
+}
+
void CChatRoomDlg::OnClick_BIU(CCtrlButton *pButton)
{
if (!pButton->Enabled())
@@ -1913,6 +1940,33 @@ void CChatRoomDlg::OnChange_Message(CCtrlEdit*)
}
}
+void CChatRoomDlg::OnDblClick_List(CCtrlListBox*)
+{
+ TVHITTESTINFO hti;
+ hti.pt.x = (short)LOWORD(GetMessagePos());
+ hti.pt.y = (short)HIWORD(GetMessagePos());
+ ScreenToClient(m_list.GetHwnd(), &hti.pt);
+
+ int item = LOWORD(m_list.SendMsg(LB_ITEMFROMPOINT, 0, MAKELPARAM(hti.pt.x, hti.pt.y)));
+ USERINFO *ui = pci->UM_FindUserFromIndex(si->pUsers, item);
+ if (ui == nullptr)
+ return;
+
+ bool bShift = (GetKeyState(VK_SHIFT) & 0x8000) != 0;
+ if (g_Settings.bDoubleClick4Privat ? bShift : !bShift) {
+ int selStart = LOWORD(m_message.SendMsg(EM_GETSEL, 0, 0));
+ CMStringW tszName(ui->pszNick);
+ if (selStart == 0)
+ tszName.AppendChar(':');
+ tszName.AppendChar(' ');
+
+ m_message.SendMsg(EM_REPLACESEL, FALSE, (LPARAM)tszName.GetString());
+ PostMessage(m_hwnd, WM_MOUSEACTIVATE, 0, 0);
+ SetFocus(m_message.GetHwnd());
+ }
+ else pci->DoEventHookAsync(m_hwnd, si->ptszID, si->pszModule, GC_USER_PRIVMESS, ui, NULL, 0);
+}
+
INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (si == NULL && (uMsg == WM_ACTIVATE || uMsg == WM_SETFOCUS))
@@ -1948,15 +2002,15 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
m_btnColor.Enable(pInfo->bColor);
m_btnBkColor.Enable(pInfo->bBkgColor);
if (si->iType == GCW_CHATROOM)
- Utils::enableDlgControl(m_hwnd, IDC_CHANMGR, pInfo->bChanMgr);
+ m_btnChannelMgr.Enable(pInfo->bChanMgr);
}
m_log.SendMsg(EM_SETBKGNDCOLOR, 0, M.GetDword(FONTMODULE, SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR));
DM_InitRichEdit();
m_btnOk.SendMsg(BUTTONSETASNORMAL, TRUE, 0);
- SendDlgItemMessage(m_hwnd, IDC_LIST, LB_SETITEMHEIGHT, 0, (LPARAM)g_Settings.iNickListFontHeight);
- InvalidateRect(GetDlgItem(m_hwnd, IDC_LIST), NULL, TRUE);
+ m_list.SetItemHeight(0, g_Settings.iNickListFontHeight);
+ InvalidateRect(m_list.GetHwnd(), NULL, TRUE);
m_btnFilter.SendMsg(BUTTONSETOVERLAYICON, (LPARAM)(si->bFilterEnabled ? PluginConfig.g_iconOverlayEnabled : PluginConfig.g_iconOverlayDisabled), 0);
SendMessage(m_hwnd, WM_SIZE, 0, 0);
@@ -2046,7 +2100,7 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
x += GetTextPixelSize(mi->ptszModDispName, (HFONT)SendMessage(m_pContainer->hwndStatus, WM_GETFONT, 0, 0), TRUE);
x += GetSystemMetrics(SM_CXSMICON);
- if (m_pPanel->isActive()) {
+ if (m_pPanel.isActive()) {
time_t now = time(0);
DWORD diff = (now - mi->idleTimeStamp) / 60;
@@ -2073,7 +2127,7 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
}
SendMessage(m_pContainer->hwndStatus, SB_SETTEXT, 0, (LPARAM)szFinalStatusBarText);
UpdateStatusBar();
- m_pPanel->Invalidate();
+ m_pPanel.Invalidate();
if (m_pWnd)
m_pWnd->Invalidate();
return TRUE;
@@ -2088,7 +2142,7 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
PostMessage(m_hwnd, GC_SCROLLTOBOTTOM, 0, 0);
if (!IsIconic(m_hwnd)) {
- int panelHeight = m_pPanel->getHeight() + 1;
+ int panelHeight = m_pPanel.getHeight() + 1;
GetClientRect(m_hwnd, &rc);
int cx = rc.right;
@@ -2188,7 +2242,7 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
MEASUREITEMSTRUCT *mis = (MEASUREITEMSTRUCT *)lParam;
if (mis->CtlType == ODT_MENU) {
- if (m_pPanel->isHovered()) {
+ if (m_pPanel.isHovered()) {
mis->itemHeight = 0;
mis->itemWidth = 6;
return TRUE;
@@ -2203,7 +2257,7 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *)lParam;
if (dis->CtlType == ODT_MENU) {
- if (m_pPanel->isHovered()) {
+ if (m_pPanel.isHovered()) {
DrawMenuItem(dis, (HICON)dis->itemData, 0);
return TRUE;
}
@@ -2310,9 +2364,9 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
case GC_UPDATENICKLIST:
{
- int i = SendDlgItemMessage(m_hwnd, IDC_LIST, LB_GETTOPINDEX, 0, 0);
- SendDlgItemMessage(m_hwnd, IDC_LIST, LB_SETCOUNT, si->nUsersInNicklist, 0);
- SendDlgItemMessage(m_hwnd, IDC_LIST, LB_SETTOPINDEX, i, 0);
+ int i = m_list.SendMsg(LB_GETTOPINDEX, 0, 0);
+ m_list.SendMsg(LB_SETCOUNT, si->nUsersInNicklist, 0);
+ m_list.SendMsg(LB_SETTOPINDEX, i, 0);
SendMessage(m_hwnd, GC_UPDATETITLE, 0, 0);
}
break;
@@ -2393,7 +2447,7 @@ LABEL_SHOWWINDOW:
}
else if ((HWND)lParam == GetDlgItem(m_hwnd, IDC_SPLITTERY) || lParam == -1) {
GetClientRect(m_hwnd, &rc);
- rc.top += (m_pPanel->isActive() ? m_pPanel->getHeight() + 40 : 30);
+ rc.top += (m_pPanel.isActive() ? m_pPanel.getHeight() + 40 : 30);
pt.x = 0, pt.y = wParam;
ScreenToClient(m_hwnd, &pt);
@@ -2411,7 +2465,7 @@ LABEL_SHOWWINDOW:
ScreenToClient(m_hwnd, &pt);
GetClientRect(m_log.GetHwnd(), &rc);
if ((pt.y + 2 >= MIN_PANELHEIGHT + 2) && (pt.y + 2 < 100) && (pt.y + 2 < rc.bottom - 30))
- m_pPanel->setHeight(pt.y + 2);
+ m_pPanel.setHeight(pt.y + 2);
RedrawWindow(m_hwnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);
if (M.isAero())
InvalidateRect(m_hwndParent, NULL, FALSE);
@@ -2512,7 +2566,7 @@ LABEL_SHOWWINDOW:
if (msg == WM_MOUSEMOVE) {
GetCursorPos(&pt);
DM_DismissTip(pt);
- m_pPanel->trackMouse(pt);
+ m_pPanel.trackMouse(pt);
break;
}
if (msg == WM_KEYDOWN) {
@@ -2540,14 +2594,14 @@ LABEL_SHOWWINDOW:
switch (mim_hotkey_check) {
case TABSRMM_HK_CHANNELMGR:
- SendMessage(m_hwnd, WM_COMMAND, MAKEWPARAM(IDC_CHANMGR, BN_CLICKED), 0);
+ OnClick_ChanMgr(&m_btnChannelMgr);
return _dlgReturn(m_hwnd, 1);
case TABSRMM_HK_FILTERTOGGLE:
- SendMessage(m_hwnd, WM_COMMAND, MAKEWPARAM(IDC_FILTER, BN_CLICKED), 0);
+ OnClick_Filter(&m_btnFilter);
InvalidateRect(m_btnFilter.GetHwnd(), NULL, TRUE);
return _dlgReturn(m_hwnd, 1);
case TABSRMM_HK_LISTTOGGLE:
- SendMessage(m_hwnd, WM_COMMAND, MAKEWPARAM(IDC_SHOWNICKLIST, BN_CLICKED), 0);
+ OnClick_ShowNickList(&m_btnNickList);
return _dlgReturn(m_hwnd, 1);
case TABSRMM_HK_MUC_SHOWSERVER:
if (si->iType != GCW_SERVER)
@@ -2767,7 +2821,7 @@ LABEL_SHOWWINDOW:
case WM_LBUTTONDOWN:
GetCursorPos(&tmp);
- if (!m_pPanel->isHovered()) {
+ if (!m_pPanel.isHovered()) {
cur.x = (SHORT)tmp.x;
cur.y = (SHORT)tmp.y;
SendMessage(m_pContainer->hwnd, WM_NCLBUTTONDOWN, HTCAPTION, *((LPARAM*)(&cur)));
@@ -2776,8 +2830,8 @@ LABEL_SHOWWINDOW:
case WM_LBUTTONUP:
GetCursorPos(&tmp);
- if (m_pPanel->isHovered())
- m_pPanel->handleClick(tmp);
+ if (m_pPanel.isHovered())
+ m_pPanel.handleClick(tmp);
else {
cur.x = (SHORT)tmp.x;
cur.y = (SHORT)tmp.y;
@@ -2788,7 +2842,7 @@ LABEL_SHOWWINDOW:
case WM_MOUSEMOVE:
GetCursorPos(&pt);
DM_DismissTip(pt);
- m_pPanel->trackMouse(pt);
+ m_pPanel.trackMouse(pt);
break;
case WM_APPCOMMAND:
@@ -2808,37 +2862,6 @@ LABEL_SHOWWINDOW:
}
switch (LOWORD(wParam)) {
- case IDC_LIST:
- if (HIWORD(wParam) == LBN_DBLCLK) {
- TVHITTESTINFO hti;
- hti.pt.x = (short)LOWORD(GetMessagePos());
- hti.pt.y = (short)HIWORD(GetMessagePos());
- ScreenToClient(GetDlgItem(m_hwnd, IDC_LIST), &hti.pt);
-
- int item = LOWORD(SendDlgItemMessage(m_hwnd, IDC_LIST, LB_ITEMFROMPOINT, 0, MAKELPARAM(hti.pt.x, hti.pt.y)));
- USERINFO *ui = pci->UM_FindUserFromIndex(si->pUsers, item);
- if (ui) {
- if (g_Settings.bDoubleClick4Privat ? GetKeyState(VK_SHIFT) & 0x8000 : !(GetKeyState(VK_SHIFT) & 0x8000)) {
- LRESULT lResult = (LRESULT)m_message.SendMsg(EM_GETSEL, 0, 0);
- int start = LOWORD(lResult);
- CMStringW tszName;
- if (start == 0)
- tszName.Format(L"%s: ", ui->pszNick);
- else
- tszName.Format(L"%s ", ui->pszNick);
-
- m_message.SendMsg(EM_REPLACESEL, FALSE, (LPARAM)tszName.GetString());
- PostMessage(m_hwnd, WM_MOUSEACTIVATE, 0, 0);
- SetFocus(m_message.GetHwnd());
- }
- else pci->DoEventHookAsync(m_hwnd, si->ptszID, si->pszModule, GC_USER_PRIVMESS, ui, NULL, 0);
- }
- return TRUE;
- }
- if (HIWORD(wParam) == LBN_KILLFOCUS)
- RedrawWindow(GetDlgItem(m_hwnd, IDC_LIST), NULL, NULL, RDW_INVALIDATE);
- break;
-
case IDC_TOGGLESIDEBAR:
SendMessage(m_pContainer->hwnd, WM_COMMAND, IDC_TOGGLESIDEBAR, 0);
break;
@@ -2847,30 +2870,10 @@ LABEL_SHOWWINDOW:
ShowWindow(m_pContainer->hwnd, SW_MINIMIZE);
return FALSE;
- case IDC_SHOWNICKLIST:
- if (!IsWindowEnabled(GetDlgItem(m_hwnd, IDC_SHOWNICKLIST)))
- break;
- if (si->iType == GCW_SERVER)
- break;
-
- si->bNicklistEnabled = !si->bNicklistEnabled;
-
- SendMessage(m_hwnd, WM_SIZE, 0, 0);
- if (CSkin::m_skinEnabled)
- InvalidateRect(m_hwnd, NULL, TRUE);
- PostMessage(m_hwnd, GC_SCROLLTOBOTTOM, 0, 0);
- break;
-
- case IDC_CHAT_CLOSE:
+ case IDC_CLOSE:
SendMessage(m_hwnd, WM_CLOSE, 0, 1);
break;
- case IDC_CHANMGR:
- if (!IsWindowEnabled(GetDlgItem(m_hwnd, IDC_CHANMGR)))
- break;
- pci->DoEventHookAsync(m_hwnd, si->ptszID, si->pszModule, GC_USER_CHANMGR, NULL, NULL, 0);
- break;
-
case IDC_SELFTYPING:
// Typing support for GCW_PRIVMESS sessions
if (si->iType == GCW_PRIVMESS) {
@@ -2892,9 +2895,6 @@ LABEL_SHOWWINDOW:
SetFocus(m_message.GetHwnd());
break;
- case WM_MOVE:
- break;
-
case WM_ERASEBKGND:
RECT rcClient, rcWindow;
{
@@ -2941,15 +2941,15 @@ LABEL_SHOWWINDOW:
if (M.isAero()) {
LONG temp = rcClient.bottom;
- rcClient.bottom = m_pPanel->isActive() ? m_pPanel->getHeight() + 5 : 5;
+ rcClient.bottom = m_pPanel.isActive() ? m_pPanel.getHeight() + 5 : 5;
FillRect(hdcMem, &rcClient, (HBRUSH)GetStockObject(BLACK_BRUSH));
rcClient.bottom = temp;
}
}
GetClientRect(m_hwnd, &rc);
- m_pPanel->renderBG(hdcMem, rc, &SkinItems[ID_EXTBKINFOPANELBG], M.isAero());
- m_pPanel->renderContent(hdcMem);
+ m_pPanel.renderBG(hdcMem, rc, &SkinItems[ID_EXTBKINFOPANELBG], M.isAero());
+ m_pPanel.renderContent(hdcMem);
if (!CSkin::m_skinEnabled)
RenderToolbarBG(hdcMem, rcClient);
@@ -2980,22 +2980,18 @@ LABEL_SHOWWINDOW:
case WM_RBUTTONUP:
GetCursorPos(&pt);
- if (!m_pPanel->invokeConfigDialog(pt)) {
+ if (!m_pPanel.invokeConfigDialog(pt)) {
HMENU subMenu = GetSubMenu(PluginConfig.g_hMenuContext, 0);
MsgWindowUpdateMenu(subMenu, MENU_TABCONTEXT);
int iSelection = TrackPopupMenu(subMenu, TPM_RETURNCMD, pt.x, pt.y, 0, m_hwnd, NULL);
if (iSelection >= IDM_CONTAINERMENU) {
- DBVARIANT dbv = { 0 };
char szIndex[10];
- mir_snprintf(szIndex, "%d", iSelection - IDM_CONTAINERMENU);
- if (iSelection - IDM_CONTAINERMENU >= 0) {
- if (!db_get_ws(NULL, "TAB_ContainersW", szIndex, &dbv)) {
- SendMessage(m_hwnd, DM_CONTAINERSELECTED, 0, (LPARAM)dbv.ptszVal);
- db_free(&dbv);
- }
- }
+ _itoa_s(iSelection - IDM_CONTAINERMENU, szIndex, 10);
+ ptrW wszContainer(db_get_wsa(NULL, "TAB_ContainersW", szIndex));
+ if (wszContainer != nullptr)
+ SendMessage(m_hwnd, DM_CONTAINERSELECTED, 0, wszContainer);
break;
}
MsgWindowMenuHandler(iSelection, MENU_TABCONTEXT);
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp
index 2fb8fdc715..603123f58f 100644
--- a/plugins/TabSRMM/src/container.cpp
+++ b/plugins/TabSRMM/src/container.cpp
@@ -61,13 +61,13 @@ void TSAPI SetAeroMargins(TContainerData *pContainer)
RECT rcWnd;
if (dat->m_bType == SESSIONTYPE_IM) {
- if (dat->m_pPanel->isActive())
+ if (dat->m_pPanel.isActive())
GetWindowRect(GetDlgItem(dat->GetHwnd(), IDC_LOG), &rcWnd);
else
GetWindowRect(dat->GetHwnd(), &rcWnd);
}
else {
- if (dat->m_pPanel->isActive())
+ if (dat->m_pPanel.isActive())
GetWindowRect(GetDlgItem(dat->GetHwnd(), IDC_LOG), &rcWnd);
else
GetWindowRect(dat->GetHwnd(), &rcWnd);
@@ -1077,8 +1077,8 @@ panel_found:
POINT pt;
GetWindowRect(pContainer->hwndActive, &rc);
pt.x = rc.left + 10;
- pt.y = rc.top + dat->m_pPanel->getHeight() - 10;
- dat->m_pPanel->invokeConfigDialog(pt);
+ pt.y = rc.top + dat->m_pPanel.getHeight() - 10;
+ dat->m_pPanel.invokeConfigDialog(pt);
}
return 0;
@@ -1240,7 +1240,7 @@ panel_found:
dat = (CTabBaseDlg*)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
if (dat && dat->m_bType == SESSIONTYPE_IM) {
if (dat->m_idle && pContainer->hwndActive && IsWindow(pContainer->hwndActive))
- dat->m_pPanel->Invalidate(TRUE);
+ dat->m_pPanel.Invalidate(TRUE);
}
else if (dat)
SendMessage(dat->GetHwnd(), GC_UPDATESTATUSBAR, 0, 0);
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp
index e94586b5a8..a079cb67f2 100644
--- a/plugins/TabSRMM/src/generic_msghandlers.cpp
+++ b/plugins/TabSRMM/src/generic_msghandlers.cpp
@@ -142,8 +142,8 @@ bool CTabBaseDlg::DM_GenericHotkeysCheck(MSG *message)
break;
case TABSRMM_HK_TOGGLEINFOPANEL:
- m_pPanel->setActive(!m_pPanel->isActive());
- m_pPanel->showHide();
+ m_pPanel.setActive(!m_pPanel.isActive());
+ m_pPanel.showHide();
return true;
case TABSRMM_HK_TOGGLETOOLBAR:
@@ -768,7 +768,7 @@ void CTabBaseDlg::DM_LoadLocale()
void CTabBaseDlg::DM_RecalcPictureSize()
{
- HBITMAP hbm = ((m_pPanel->isActive()) && m_pContainer->avatarMode != 3) ? m_hOwnPic : (m_ace ? m_ace->hbmPic : PluginConfig.g_hbmUnknown);
+ HBITMAP hbm = ((m_pPanel.isActive()) && m_pContainer->avatarMode != 3) ? m_hOwnPic : (m_ace ? m_ace->hbmPic : PluginConfig.g_hbmUnknown);
if (hbm) {
BITMAP bminfo;
GetObject(hbm, sizeof(bminfo), &bminfo);
@@ -887,7 +887,7 @@ LRESULT CTabBaseDlg::DM_MouseWheelHandler(WPARAM wParam, LPARAM lParam)
}
}
if (m_bType == SESSIONTYPE_CHAT) { // scroll nick list by just hovering it
- RECT rcNicklist;
+ RECT rcNicklist;
GetWindowRect(GetDlgItem(m_hwnd, IDC_LIST), &rcNicklist);
if (PtInRect(&rcNicklist, pt)) {
SendDlgItemMessage(m_hwnd, IDC_LIST, WM_MOUSEWHEEL, wParam, lParam);
@@ -1033,7 +1033,7 @@ void CSrmmWindow::DM_OptionsApplied(WPARAM, LPARAM lParam)
m_bShowUIElements = (m_pContainer->dwFlags & CNT_HIDETOOLBAR) == 0;
m_dwFlagsEx = M.GetByte(m_hContact, "splitoverride", 0) ? MWF_SHOW_SPLITTEROVERRIDE : 0;
- m_pPanel->getVisibility();
+ m_pPanel.getVisibility();
// small inner margins (padding) for the text areas
m_log.SendMsg(EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(0, 0));
@@ -1382,7 +1382,7 @@ void CTabBaseDlg::DM_HandleAutoSizeRequest(REQRESIZE* rr)
RECT rc;
GetClientRect(m_hwnd, &rc);
LONG cy = rc.bottom - rc.top;
- LONG panelHeight = (m_pPanel->isActive() ? m_pPanel->getHeight() : 0);
+ LONG panelHeight = (m_pPanel.isActive() ? m_pPanel.getHeight() : 0);
if (iNewHeight > (cy - panelHeight) / 2)
iNewHeight = (cy - panelHeight) / 2;
@@ -1491,7 +1491,7 @@ void CTabBaseDlg::DM_UpdateTitle(WPARAM, LPARAM lParam)
AddContactToFavorites(m_hContact, m_cache->getNick(), szActProto, m_wszStatus, m_wStatus,
Skin_LoadProtoIcon(m_cache->getProto(), m_cache->getStatus()), 0, PluginConfig.g_hMenuRecent);
- m_pPanel->Invalidate();
+ m_pPanel.Invalidate();
if (m_pWnd)
m_pWnd->Invalidate();
}
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp
index f1e4a2d977..a07f688019 100644
--- a/plugins/TabSRMM/src/infopanel.cpp
+++ b/plugins/TabSRMM/src/infopanel.cpp
@@ -40,6 +40,30 @@ wchar_t *xStatusDescr[] =
TInfoPanelConfig CInfoPanel::m_ipConfig = { 0 };
+/////////////////////////////////////////////////////////////////////////////////////////
+
+CInfoPanel::CInfoPanel(CTabBaseDlg *dat)
+{
+ if (dat) {
+ m_dat = dat;
+ m_isChat = dat->m_bType == SESSIONTYPE_CHAT ? true : false;
+ }
+ m_defaultHeight = PluginConfig.m_panelHeight;
+ m_defaultMUCHeight = PluginConfig.m_MUCpanelHeight;
+ m_hwndConfig = 0;
+ m_hoverFlags = 0;
+ m_tip = 0;
+}
+
+CInfoPanel::~CInfoPanel()
+{
+ if (m_hwndConfig)
+ ::DestroyWindow(m_hwndConfig);
+ saveHeight(true);
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
void CInfoPanel::setActive(const int newActive)
{
m_active = newActive ? true : false;
@@ -944,7 +968,7 @@ LRESULT CALLBACK CInfoPanel::avatarParentSubclass(HWND hwnd, UINT msg, WPARAM wP
GetClientRect(hwnd, &rcItem);
rc = rcItem;
- if (!IsWindowEnabled(hwnd) || !dat->m_pPanel->isActive() || !dat->m_bShowInfoAvatar)
+ if (!IsWindowEnabled(hwnd) || !dat->m_pPanel.isActive() || !dat->m_bShowInfoAvatar)
return TRUE;
HDC dcWin = (HDC)wParam;
@@ -978,7 +1002,7 @@ LRESULT CALLBACK CInfoPanel::avatarParentSubclass(HWND hwnd, UINT msg, WPARAM wP
else {
rc.bottom += 2;
rc.left -= 3; rc.right += 3;
- dat->m_pPanel->renderBG(dcWin, rc, &SkinItems[ID_EXTBKINFOPANELBG], M.isAero(), false);
+ dat->m_pPanel.renderBG(dcWin, rc, &SkinItems[ID_EXTBKINFOPANELBG], M.isAero(), false);
}
if (CSkin::m_bAvatarBorderType == 1) {
diff --git a/plugins/TabSRMM/src/infopanel.h b/plugins/TabSRMM/src/infopanel.h
index 73c235d902..f554fa0bc5 100644
--- a/plugins/TabSRMM/src/infopanel.h
+++ b/plugins/TabSRMM/src/infopanel.h
@@ -29,6 +29,10 @@
#ifndef __INFOPANEL_H
#define __INFOPANEL_H
+class CInfoPanel;
+class CTabBaseDlg;
+struct CSkinItem;
+
/*
* configuration data for the info panel (fonts, colors)
* this is global for all panels
@@ -125,25 +129,8 @@ public:
HTNIRVANA = 0
};
- CInfoPanel(CTabBaseDlg *dat)
- {
- if (dat) {
- m_dat = dat;
- m_isChat = dat->m_bType == SESSIONTYPE_CHAT ? true : false;
- }
- m_defaultHeight = PluginConfig.m_panelHeight;
- m_defaultMUCHeight = PluginConfig.m_MUCpanelHeight;
- m_hwndConfig = 0;
- m_hoverFlags = 0;
- m_tip = 0;
- }
-
- ~CInfoPanel()
- {
- if (m_hwndConfig)
- ::DestroyWindow(m_hwndConfig);
- saveHeight(true);
- }
+ CInfoPanel(CTabBaseDlg *dat);
+ ~CInfoPanel();
__forceinline const LONG getHeight() const { return m_height; }
__forceinline bool isActive() const { return m_active; }
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 0cba6bffc3..c853b3fb55 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -32,8 +32,6 @@
bool IsStringValidLink(wchar_t* pszText);
-const wchar_t *pszIDCSAVE_close = 0, *pszIDCSAVE_save = 0;
-
static const UINT sendControls[] = { IDC_MESSAGE, IDC_LOG };
static const UINT formatControls[] = { IDC_FONTBOLD, IDC_FONTITALIC, IDC_FONTUNDERLINE, IDC_FONTSTRIKEOUT };
static const UINT addControls[] = { IDC_ADD, IDC_CANCELADD };
@@ -272,7 +270,7 @@ void CSrmmWindow::MsgWindowUpdateState(UINT msg)
if (m_pWnd)
m_pWnd->activateTab();
- m_pPanel->dismissConfig();
+ m_pPanel.dismissConfig();
m_dwUnread = 0;
if (m_pContainer->hwndSaved == m_hwnd)
return;
@@ -325,7 +323,7 @@ void CSrmmWindow::MsgWindowUpdateState(UINT msg)
if (m_pContainer->hwndActive == m_hwnd)
DeletePopupsForContact(m_hContact, PU_REMOVE_ON_FOCUS);
- m_pPanel->Invalidate();
+ m_pPanel.Invalidate();
if (m_dwFlags & MWF_DEFERREDSCROLL && m_hwndIEView == 0 && m_hwndHPP == 0) {
m_dwFlags &= ~MWF_DEFERREDSCROLL;
@@ -428,7 +426,7 @@ void TSAPI SetDialogToType(HWND hwndDlg)
Utils::enableDlgControl(hwndDlg, IDC_CONTACTPIC, false);
- dat->m_pPanel->Configure();
+ dat->m_pPanel.Configure();
}
static LRESULT CALLBACK MessageLogSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -940,7 +938,6 @@ CSrmmWindow::CSrmmWindow(TNewWindowData *pNewData)
m_dwFlags = MWF_INITMODE;
m_bType = SESSIONTYPE_IM;
- m_pPanel = new CInfoPanel(this);
}
void CSrmmWindow::ClearLog()
@@ -983,9 +980,6 @@ void CSrmmWindow::OnInitDialog()
DM_ThemeChanged();
- pszIDCSAVE_close = TranslateT("Close session");
- pszIDCSAVE_save = TranslateT("Save and close session");
-
m_hContact = newData->hContact;
m_cache = CContactCache::getContactCache(m_hContact);
m_cache->updateNick();
@@ -1052,14 +1046,14 @@ void CSrmmWindow::OnInitDialog()
LoadLocalFlags();
DM_InitTip();
- m_pPanel->getVisibility();
+ m_pPanel.getVisibility();
m_dwFlagsEx |= M.GetByte(m_hContact, "splitoverride", 0) ? MWF_SHOW_SPLITTEROVERRIDE : 0;
m_bIsAutosizingInput = IsAutoSplitEnabled();
m_iInputAreaHeight = -1;
SetMessageLog();
if (m_hContact)
- m_pPanel->loadHeight();
+ m_pPanel.loadHeight();
m_bShowAvatar = GetAvatarVisibility();
@@ -1099,7 +1093,7 @@ void CSrmmWindow::OnInitDialog()
SetDlgItemText(m_hwnd, IDC_LOGFROZENTEXT, m_bNotOnList ? TranslateT("Contact not on list. You may add it...") :
TranslateT("Auto scrolling is disabled (press F12 to enable it)"));
- SendDlgItemMessage(m_hwnd, IDC_SAVE, BUTTONADDTOOLTIP, (WPARAM)pszIDCSAVE_close, BATF_UNICODE);
+ SendDlgItemMessage(m_hwnd, IDC_SAVE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Close session"), BATF_UNICODE);
SendDlgItemMessage(m_hwnd, IDC_PROTOCOL, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Click for contact menu\nClick dropdown for window settings"), BATF_UNICODE);
SetDlgItemText(m_hwnd, IDC_RETRY, TranslateT("Retry"));
@@ -1259,8 +1253,6 @@ void CSrmmWindow::OnDestroy()
if (db_get_b(m_hContact, "CList", "NotOnList", 0))
db_delete_contact(m_hContact);
- delete m_pPanel;
-
if (m_hwndContactPic)
DestroyWindow(m_hwndContactPic);
@@ -1392,9 +1384,9 @@ void CSrmmWindow::ReplayQueue()
int CSrmmWindow::Resizer(UTILRESIZECONTROL *urc)
{
- int panelHeight = m_pPanel->getHeight() + 1;
+ int panelHeight = m_pPanel.getHeight() + 1;
- bool bInfoPanel = m_pPanel->isActive();
+ bool bInfoPanel = m_pPanel.isActive();
bool bErrorState = (m_dwFlags & MWF_ERRORSTATE) != 0;
bool bShowToolbar = (m_pContainer->dwFlags & CNT_HIDETOOLBAR) == 0;
bool bBottomToolbar = (m_pContainer->dwFlags & CNT_BOTTOMTOOLBAR) != 0;
@@ -1633,7 +1625,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
if (M.isAero()) {
LONG temp = rcClient.bottom;
- rcClient.bottom = m_pPanel->isActive() ? m_pPanel->getHeight() + 5 : 5;
+ rcClient.bottom = m_pPanel.isActive() ? m_pPanel.getHeight() + 5 : 5;
FillRect(hdcMem, &rcClient, (HBRUSH)GetStockObject(BLACK_BRUSH));
rcClient.bottom = temp;
}
@@ -1641,14 +1633,14 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
// draw the (new) infopanel background. Use the gradient from the statusitem.
GetClientRect(m_hwnd, &rc);
- m_pPanel->renderBG(hdcMem, rc, &SkinItems[ID_EXTBKINFOPANELBG], bAero);
+ m_pPanel.renderBG(hdcMem, rc, &SkinItems[ID_EXTBKINFOPANELBG], bAero);
// draw aero related stuff
if (!CSkin::m_skinEnabled)
RenderToolbarBG(hdcMem, rcClient);
// render info panel fields
- m_pPanel->renderContent(hdcMem);
+ m_pPanel.renderContent(hdcMem);
if (hpb)
CSkin::FinalizeBufferedPaint(hpb, &rcClient);
@@ -1689,7 +1681,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
LoadSplitter();
}
- HBITMAP hbm = ((m_pPanel->isActive()) && m_pContainer->avatarMode != 3) ? m_hOwnPic : (m_ace ? m_ace->hbmPic : PluginConfig.g_hbmUnknown);
+ HBITMAP hbm = ((m_pPanel.isActive()) && m_pContainer->avatarMode != 3) ? m_hOwnPic : (m_ace ? m_ace->hbmPic : PluginConfig.g_hbmUnknown);
if (hbm != 0) {
BITMAP bminfo;
GetObject(hbm, sizeof(bminfo), &bminfo);
@@ -1703,9 +1695,9 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
BB_SetButtonsPos();
// size info panel fields
- if (m_pPanel->isActive()) {
+ if (m_pPanel.isActive()) {
LONG cx = rc.right;
- LONG panelHeight = m_pPanel->getHeight();
+ LONG panelHeight = m_pPanel.getHeight();
hbm = (m_pContainer->avatarMode == 3) ? m_hOwnPic : (m_ace ? m_ace->hbmPic : PluginConfig.g_hbmUnknown);
double dHeight = 0, dWidth = 0;
@@ -1721,7 +1713,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
if (m_bShowInfoAvatar) {
SetWindowPos(m_hwndPanelPicParent, HWND_TOP, rc.left - 2, rc.top, rc.right - rc.left, rc.bottom - rc.top + 1, 0);
- ShowWindow(m_hwndPanelPicParent, (m_iPanelAvatarX == 0) || !m_pPanel->isActive() ? SW_HIDE : SW_SHOW);
+ ShowWindow(m_hwndPanelPicParent, (m_iPanelAvatarX == 0) || !m_pPanel.isActive() ? SW_HIDE : SW_SHOW);
}
else {
ShowWindow(m_hwndPanelPicParent, SW_HIDE);
@@ -1746,7 +1738,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
rc.top = rc.bottom - m_ipFieldHeight;
m_rcUIN = rc;
- m_pPanel->Invalidate();
+ m_pPanel.Invalidate();
}
if (GetDlgItem(m_hwnd, IDC_CLIST) != 0) {
@@ -1757,8 +1749,8 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
rc.right = rcClient.right;
rc.left = rcClient.right - m_multiSplitterX;
rc.bottom = rcLog.bottom;
- if (m_pPanel->isActive())
- rc.top += (m_pPanel->getHeight() + 1);
+ if (m_pPanel.isActive())
+ rc.top += (m_pPanel.getHeight() + 1);
MoveWindow(GetDlgItem(m_hwnd, IDC_CLIST), rc.left, rc.top, rc.right - rc.left, rcLog.bottom - rcLog.top, FALSE);
}
@@ -2133,7 +2125,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_MOUSEMOVE:
GetCursorPos(&pt);
DM_DismissTip(pt);
- m_pPanel->trackMouse(pt);
+ m_pPanel.trackMouse(pt);
HCURSOR hCur = GetCursor();
if (hCur == LoadCursor(NULL, IDC_SIZENS) || hCur == LoadCursor(NULL, IDC_SIZEWE) || hCur == LoadCursor(NULL, IDC_SIZENESW) || hCur == LoadCursor(NULL, IDC_SIZENWSE))
@@ -2222,7 +2214,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
return 0;
case DM_UPDATESTATUSMSG:
- m_pPanel->Invalidate();
+ m_pPanel.Invalidate();
return 0;
case DM_OWNNICKCHANGED:
@@ -2265,7 +2257,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
}
else if ((HWND)lParam == GetDlgItem(m_hwnd, IDC_SPLITTER)) {
GetClientRect(m_hwnd, &rc);
- rc.top += (m_pPanel->isActive() ? m_pPanel->getHeight() + 40 : 30);
+ rc.top += (m_pPanel.isActive() ? m_pPanel.getHeight() + 40 : 30);
pt.x = 0;
pt.y = wParam;
ScreenToClient(m_hwnd, &pt);
@@ -2304,7 +2296,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
POINT pnt = { 0, (int)wParam };
ScreenToClient(m_hwnd, &pnt);
if ((pnt.y + 2 >= MIN_PANELHEIGHT + 2) && (pnt.y + 2 < 100) && (pnt.y + 2 < rc.bottom - 30))
- m_pPanel->setHeight(pnt.y + 2, true);
+ m_pPanel.setHeight(pnt.y + 2, true);
RedrawWindow(m_hwnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);
if (M.isAero())
@@ -2382,7 +2374,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
KillTimer(m_hwnd, wParam);
GetCursorPos(&pt);
- if (wParam == TIMERID_AWAYMSG && m_pPanel->hitTest(pt) != CInfoPanel::HTNIRVANA)
+ if (wParam == TIMERID_AWAYMSG && m_pPanel.hitTest(pt) != CInfoPanel::HTNIRVANA)
SendMessage(m_hwnd, DM_ACTIVATETOOLTIP, 0, 0);
else
m_dwFlagsEx &= ~MWF_SHOW_AWAYMSGTIMER;
@@ -2478,14 +2470,14 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
GetCursorPos(&tmp);
cur.x = (SHORT)tmp.x;
cur.y = (SHORT)tmp.y;
- if (!m_pPanel->isHovered())
+ if (!m_pPanel.isHovered())
SendMessage(m_pContainer->hwnd, WM_NCLBUTTONDOWN, HTCAPTION, *((LPARAM*)(&cur)));
break;
case WM_LBUTTONUP:
GetCursorPos(&tmp);
- if (m_pPanel->isHovered())
- m_pPanel->handleClick(tmp);
+ if (m_pPanel.isHovered())
+ m_pPanel.handleClick(tmp);
else {
cur.x = (SHORT)tmp.x;
cur.y = (SHORT)tmp.y;
@@ -2502,7 +2494,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
rcPanelNick.left = rcPanelNick.right - 30;
GetCursorPos(&pt);
- if (m_pPanel->invokeConfigDialog(pt))
+ if (m_pPanel.invokeConfigDialog(pt))
break;
if (PtInRect(&rcPicture, pt))
@@ -2541,13 +2533,13 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_MOUSEMOVE:
GetCursorPos(&pt);
DM_DismissTip(pt);
- m_pPanel->trackMouse(pt);
+ m_pPanel.trackMouse(pt);
break;
case WM_MEASUREITEM:
{
LPMEASUREITEMSTRUCT lpmi = (LPMEASUREITEMSTRUCT)lParam;
- if (m_pPanel->isHovered()) {
+ if (m_pPanel.isHovered()) {
lpmi->itemHeight = 0;
lpmi->itemWidth = 6;
return TRUE;
@@ -2877,13 +2869,13 @@ quote_from_last:
case DM_CLIENTCHANGED:
GetClientIcon();
- if (m_hClientIcon && m_pPanel->isActive())
+ if (m_hClientIcon && m_pPanel.isActive())
InvalidateRect(m_hwnd, NULL, TRUE);
return 0;
case DM_UPDATEUIN:
- if (m_pPanel->isActive())
- m_pPanel->Invalidate();
+ if (m_pPanel.isActive())
+ m_pPanel.Invalidate();
if (m_pContainer->dwFlags & CNT_UINSTATUSBAR)
UpdateStatusBar();
return 0;
@@ -3063,7 +3055,7 @@ quote_from_last:
return 0;
case DM_CHECKINFOTIP:
- m_pPanel->hideTip(reinterpret_cast<HWND>(lParam));
+ m_pPanel.hideTip(reinterpret_cast<HWND>(lParam));
return 0;
}
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp
index 9fad359f45..65898944fe 100644
--- a/plugins/TabSRMM/src/msgdlgutils.cpp
+++ b/plugins/TabSRMM/src/msgdlgutils.cpp
@@ -249,7 +249,7 @@ void CTabBaseDlg::CalcDynamicAvatarSize(BITMAP *bminfo)
int CTabBaseDlg::MsgWindowUpdateMenu(HMENU submenu, int menuID)
{
- bool bInfoPanel = m_pPanel->isActive();
+ bool bInfoPanel = m_pPanel.isActive();
if (menuID == MENU_TABCONTEXT) {
EnableMenuItem(submenu, ID_TABMENU_LEAVECHATROOM, (m_bType == SESSIONTYPE_CHAT && ProtoServiceExists(m_szProto, PS_LEAVECHAT)) ? MF_ENABLED : MF_DISABLED);
@@ -358,7 +358,7 @@ int CTabBaseDlg::MsgWindowMenuHandler(int selection, int menuId)
break;
case ID_PICMENU_SAVETHISPICTUREAS:
- if (m_pPanel->isActive())
+ if (m_pPanel.isActive())
SaveAvatarToFile(this, m_hOwnPic, 1);
else if (m_ace)
SaveAvatarToFile(this, m_ace->hbmPic, 0);
@@ -373,7 +373,7 @@ int CTabBaseDlg::MsgWindowMenuHandler(int selection, int menuId)
if (menuId == MENU_PANELPICMENU)
CallService(MS_AV_CONTACTOPTIONS, m_hContact, 0);
else if (menuId == MENU_PICMENU) {
- if (m_pPanel->isActive()) {
+ if (m_pPanel.isActive()) {
if (ServiceExists(MS_AV_SETMYAVATARW) && CallService(MS_AV_CANSETMYAVATAR, (WPARAM)(m_cache->getActiveProto()), 0))
CallService(MS_AV_SETMYAVATARW, (WPARAM)(m_cache->getActiveProto()), 0);
}
@@ -513,7 +513,7 @@ void TSAPI ProcessAvatarChange(HWND hwnd, LPARAM lParam)
dat->GetAvatarVisibility();
dat->ShowPicture(true);
- if (dat->m_pPanel->isActive())
+ if (dat->m_pPanel.isActive())
SendMessage(hwndDlg, WM_SIZE, 0, 0);
}
}
@@ -531,7 +531,7 @@ bool CTabBaseDlg::GetAvatarVisibility()
// infopanel visible, consider own avatar display
m_bShowAvatar = false;
- if (m_pPanel->isActive() && bAvatarMode != 3) {
+ if (m_pPanel.isActive() && bAvatarMode != 3) {
if (!bOwnAvatarMode) {
m_bShowAvatar = (m_hOwnPic && m_hOwnPic != PluginConfig.g_hbmUnknown);
if (!m_hwndContactPic)
@@ -681,7 +681,7 @@ void CTabBaseDlg::AdjustBottomAvatarDisplay()
{
GetAvatarVisibility();
- bool bInfoPanel = m_pPanel->isActive();
+ bool bInfoPanel = m_pPanel.isActive();
HBITMAP hbm = (bInfoPanel && m_pContainer->avatarMode != 3) ? m_hOwnPic : (m_ace ? m_ace->hbmPic : PluginConfig.g_hbmUnknown);
if (hbm) {
if (m_dynaSplitter == 0 || m_splitterY == 0)
@@ -700,11 +700,11 @@ void CTabBaseDlg::AdjustBottomAvatarDisplay()
void CTabBaseDlg::ShowPicture(bool showNewPic)
{
- if (!m_pPanel->isActive())
+ if (!m_pPanel.isActive())
m_pic.cy = m_pic.cx = DPISCALEY_S(60);
if (showNewPic) {
- if (m_pPanel->isActive() && m_pContainer->avatarMode != 3) {
+ if (m_pPanel.isActive() && m_pContainer->avatarMode != 3) {
if (!m_hwndPanelPic) {
InvalidateRect(m_hwnd, NULL, TRUE);
UpdateWindow(m_hwnd);
@@ -1306,11 +1306,11 @@ void CTabBaseDlg::LoadContactAvatar()
AdjustBottomAvatarDisplay();
CalcDynamicAvatarSize(&bm);
- if (!m_pPanel->isActive() || m_pContainer->avatarMode == 3) {
+ if (!m_pPanel.isActive() || m_pContainer->avatarMode == 3) {
m_iRealAvatarHeight = 0;
PostMessage(m_hwnd, WM_SIZE, 0, 0);
}
- else if (m_pPanel->isActive())
+ else if (m_pPanel.isActive())
GetAvatarVisibility();
}
@@ -1326,7 +1326,7 @@ void CTabBaseDlg::LoadOwnAvatar()
else
m_hOwnPic = PluginConfig.g_hbmUnknown;
- if (m_pPanel->isActive() && m_pContainer->avatarMode != 3) {
+ if (m_pPanel.isActive() && m_pContainer->avatarMode != 3) {
BITMAP bm;
m_iRealAvatarHeight = 0;
@@ -1407,7 +1407,7 @@ int CTabBaseDlg::MsgWindowDrawHandler(WPARAM, LPARAM lParam)
}
HBITMAP hbmAvatar = m_ace ? m_ace->hbmPic : PluginConfig.g_hbmUnknown;
- if ((dis->hwndItem == GetDlgItem(m_hwnd, IDC_CONTACTPIC) && m_bShowAvatar) || (dis->hwndItem == m_hwnd && m_pPanel->isActive())) {
+ if ((dis->hwndItem == GetDlgItem(m_hwnd, IDC_CONTACTPIC) && m_bShowAvatar) || (dis->hwndItem == m_hwnd && m_pPanel.isActive())) {
if (hbmAvatar == NULL)
return TRUE;
@@ -1542,7 +1542,7 @@ int CTabBaseDlg::MsgWindowDrawHandler(WPARAM, LPARAM lParam)
return TRUE;
}
- if (dis->CtlType == ODT_MENU && m_pPanel->isHovered()) {
+ if (dis->CtlType == ODT_MENU && m_pPanel.isHovered()) {
DrawMenuItem(dis, (HICON)dis->itemData, 0);
return TRUE;
}
@@ -1712,7 +1712,7 @@ void CTabBaseDlg::KbdState(bool &isShift, bool &isControl, bool &isAlt)
void CTabBaseDlg::DetermineMinHeight()
{
RECT rc;
- LONG height = (m_pPanel->isActive() ? m_pPanel->getHeight() + 2 : 0);
+ LONG height = (m_pPanel.isActive() ? m_pPanel.getHeight() + 2 : 0);
if (!(m_pContainer->dwFlags & CNT_HIDETOOLBAR))
height += DPISCALEY_S(24); // toolbar
GetClientRect(m_message.GetHwnd(), &rc);
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp
index a546c7a84e..ade80f5d73 100644
--- a/plugins/TabSRMM/src/msgs.cpp
+++ b/plugins/TabSRMM/src/msgs.cpp
@@ -122,6 +122,7 @@ CTabBaseDlg::CTabBaseDlg(TNewWindowData *pData, int iResource)
m_log(this, IDC_LOG),
m_message(this, IDC_MESSAGE),
newData(pData),
+ m_pPanel(this),
m_pContainer(pData->pContainer)
{
@@ -138,23 +139,23 @@ INT_PTR CTabBaseDlg::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
switch (msg) {
case DM_SETINFOPANEL: // broadcasted when global info panel setting changes
if (wParam == 0 && lParam == 0) {
- m_pPanel->getVisibility();
- m_pPanel->loadHeight();
- m_pPanel->showHide();
+ m_pPanel.getVisibility();
+ m_pPanel.loadHeight();
+ m_pPanel.showHide();
}
else {
CTabBaseDlg *srcDat = (CTabBaseDlg*)wParam;
if (lParam == 0)
- m_pPanel->loadHeight();
+ m_pPanel.loadHeight();
else {
- if (srcDat && lParam && this != srcDat && !m_pPanel->isPrivateHeight()) {
+ if (srcDat && lParam && this != srcDat && !m_pPanel.isPrivateHeight()) {
if (srcDat->m_bType != m_bType && M.GetByte("syncAllPanels", 0) == 0)
return 0;
if (m_pContainer->settings->fPrivate && srcDat->m_pContainer != m_pContainer)
return 0;
- m_pPanel->setHeight((LONG)lParam);
+ m_pPanel.setHeight((LONG)lParam);
}
}
SendMessage(m_hwnd, WM_SIZE, 0, 0);
@@ -223,7 +224,7 @@ INT_PTR CTabBaseDlg::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
// wParam == id of the "anchor" element, defaults to the panel status field (for away msg retrieval)
// lParam == new text to show
if (!IsIconic(m_pContainer->hwnd) && m_pContainer->hwndActive == m_hwnd)
- m_pPanel->showTip(wParam, lParam);
+ m_pPanel.showTip(wParam, lParam);
return 0;
case DM_STATUSBARCHANGED:
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h
index 830f2b5469..a8603e4d0e 100644
--- a/plugins/TabSRMM/src/msgs.h
+++ b/plugins/TabSRMM/src/msgs.h
@@ -358,7 +358,7 @@ public:
bool m_fEditNotesActive;
bool m_bActualHistory;
- CInfoPanel *m_pPanel;
+ CInfoPanel m_pPanel;
CContactCache *m_cache;
AVATARCACHEENTRY *m_ace, *m_ownAce;
CProxyWindow *m_pWnd; // proxy window object (win7+, for taskbar support).
@@ -480,8 +480,9 @@ class CChatRoomDlg : public CTabBaseDlg
{
HWND m_hwndFilter;
bool m_bWasDeleted;
- CCtrlButton m_btnFilter, m_btnHistory, m_btnOk;
+ CCtrlButton m_btnFilter, m_btnHistory, m_btnChannelMgr, m_btnNickList, m_btnOk;
CCtrlButton m_btnBold, m_btnItalic, m_btnUnderline, m_btnColor, m_btnBkColor;
+ CCtrlListBox m_list;
virtual CThumbBase* CreateThumb(CProxyWindow *pProxy) const override;
virtual void ClearLog() override;
@@ -496,14 +497,20 @@ public:
virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
+ void OnClick_OK(CCtrlButton*);
void OnClick_Filter(CCtrlButton*);
void OnClick_History(CCtrlButton*);
+ void OnClick_ChanMgr(CCtrlButton*);
+ void OnClick_ShowNickList(CCtrlButton*);
+
void OnClick_BIU(CCtrlButton*);
- void OnClick_OK(CCtrlButton*);
void OnClick_Color(CCtrlButton*);
void OnClick_BkColor(CCtrlButton*);
+
void OnChange_Message(CCtrlEdit*);
+ void OnDblClick_List(CCtrlListBox*);
+
void StreamInEvents(LOGINFO* lin, SESSION_INFO *si, bool bRedraw);
void UpdateWindowState(UINT msg);
};
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp
index b88e1e9d9a..fa6f1116e1 100644
--- a/plugins/TabSRMM/src/sendqueue.cpp
+++ b/plugins/TabSRMM/src/sendqueue.cpp
@@ -446,13 +446,13 @@ void SendQueue::UpdateSaveAndSendButton(CTabBaseDlg *dat)
if (len) { // looks complex but avoids flickering on the button while typing.
if (!(dat->m_dwFlags & MWF_SAVEBTN_SAV)) {
SendDlgItemMessage(hwndDlg, IDC_SAVE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)PluginConfig.g_buttonBarIcons[ICON_BUTTON_SAVE]);
- SendDlgItemMessage(hwndDlg, IDC_SAVE, BUTTONADDTOOLTIP, (WPARAM)pszIDCSAVE_save, BATF_UNICODE);
+ SendDlgItemMessage(hwndDlg, IDC_SAVE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Save and close session"), BATF_UNICODE);
dat->m_dwFlags |= MWF_SAVEBTN_SAV;
}
}
else {
SendDlgItemMessage(hwndDlg, IDC_SAVE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)PluginConfig.g_buttonBarIcons[ICON_BUTTON_CANCEL]);
- SendDlgItemMessage(hwndDlg, IDC_SAVE, BUTTONADDTOOLTIP, (WPARAM)pszIDCSAVE_close, BATF_UNICODE);
+ SendDlgItemMessage(hwndDlg, IDC_SAVE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Close session"), BATF_UNICODE);
dat->m_dwFlags &= ~MWF_SAVEBTN_SAV;
}
dat->m_textLen = len;
@@ -659,7 +659,7 @@ int SendQueue::doSendLater(int iJobIndex, CTabBaseDlg *dat, MCONTACT hContact, b
if (dat->m_pContainer->hwndActive == dat->GetHwnd())
dat->UpdateReadChars();
SendDlgItemMessage(dat->GetHwnd(), IDC_SAVE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)PluginConfig.g_buttonBarIcons[ICON_BUTTON_CANCEL]);
- SendDlgItemMessage(dat->GetHwnd(), IDC_SAVE, BUTTONADDTOOLTIP, (WPARAM)pszIDCSAVE_close, BATF_UNICODE);
+ SendDlgItemMessage(dat->GetHwnd(), IDC_SAVE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Close session"), BATF_UNICODE);
dat->m_dwFlags &= ~MWF_SAVEBTN_SAV;
if (!fAvail)
diff --git a/plugins/TabSRMM/src/stdafx.h b/plugins/TabSRMM/src/stdafx.h
index 2c0a0972a3..6708510ca7 100644
--- a/plugins/TabSRMM/src/stdafx.h
+++ b/plugins/TabSRMM/src/stdafx.h
@@ -115,6 +115,7 @@ typedef struct _DWM_THUMBNAIL_PROPERTIES
#include "resource.h"
#include "version.h"
#include "buttonbar.h"
+#include "infopanel.h"
#include "msgs.h"
#include "msgdlgutils.h"
#include "typingnotify.h"
@@ -129,7 +130,6 @@ typedef struct _DWM_THUMBNAIL_PROPERTIES
#include "sendqueue.h"
#include "taskbar.h"
#include "controls.h"
-#include "infopanel.h"
#include "sidebar.h"
#include "utils.h"
#include "sendlater.h"
@@ -231,7 +231,6 @@ extern LOGFONTA logfonts[MSGDLGFONTCOUNT + 2];
extern COLORREF fontcolors[MSGDLGFONTCOUNT + 2];
extern HINSTANCE hinstance;
extern BOOL g_bIMGtagButton;
-extern const wchar_t *pszIDCSAVE_save, *pszIDCSAVE_close;
extern char *TemplateNames[];
extern HANDLE hUserPrefsWindowList;
extern TCpTable cpTable[];