summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-03-22 19:47:48 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-03-22 19:47:48 +0300
commit45eed63e9c7a99c9c88e6a98678c0098a06de27a (patch)
treeab46a406a0c4e85c0baa721e76ce005f41a2fee5 /plugins/TabSRMM
parent429859059db4093bf95dbe2695e205025dd7b3a7 (diff)
nick list moved to mir_app
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r--plugins/TabSRMM/res/chat.rc3
-rw-r--r--plugins/TabSRMM/src/buttonsbar.cpp2
-rw-r--r--plugins/TabSRMM/src/chat.h2
-rw-r--r--plugins/TabSRMM/src/chat_main.cpp2
-rw-r--r--plugins/TabSRMM/src/chat_resource.h1
-rw-r--r--plugins/TabSRMM/src/chat_window.cpp54
-rw-r--r--plugins/TabSRMM/src/generic_msghandlers.cpp6
-rw-r--r--plugins/TabSRMM/src/msgs.h3
8 files changed, 20 insertions, 53 deletions
diff --git a/plugins/TabSRMM/res/chat.rc b/plugins/TabSRMM/res/chat.rc
index 87e0f3685f..5f0631b371 100644
--- a/plugins/TabSRMM/res/chat.rc
+++ b/plugins/TabSRMM/res/chat.rc
@@ -2,6 +2,7 @@
//
#include "..\src\chat_resource.h"
#include "..\src\resource.h"
+#include "..\..\include\chat_resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
@@ -33,7 +34,7 @@ BEGIN
CONTROL "",IDC_SPLITTERY,"Static",SS_ENHMETAFILE,0,132,251,6
CONTROL "",IDC_MESSAGE,"RichEdit50W",WS_VSCROLL | WS_TABSTOP | 0x1144,0,128,127,12,WS_EX_STATICEDGE
CONTROL "",IDC_LOG,"RichEdit50W",WS_VSCROLL | 0x844,8,23,164,72,WS_EX_STATICEDGE
- LISTBOX IDC_LIST,182,23,69,73,LBS_MULTIPLESEL | LBS_OWNERDRAWFIXED | LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | LBS_NODATA | NOT WS_BORDER | WS_VSCROLL | WS_TABSTOP,WS_EX_STATICEDGE
+ LISTBOX IDC_SRMM_NICKLIST,182,23,69,73,LBS_MULTIPLESEL | LBS_OWNERDRAWFIXED | LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | LBS_NODATA | NOT WS_BORDER | WS_VSCROLL | WS_TABSTOP,WS_EX_STATICEDGE
CONTROL "",IDC_PANELSPLITTER,"Static",SS_ENHMETAFILE,0,32,252,1,WS_EX_TRANSPARENT
END
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp
index 5531463a5a..742accd73e 100644
--- a/plugins/TabSRMM/src/buttonsbar.cpp
+++ b/plugins/TabSRMM/src/buttonsbar.cpp
@@ -119,7 +119,7 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM)
Srmm_AddButton(&bbd);
bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID;
- bbd.dwButtonID = IDC_SRMM_NICKLIST;
+ bbd.dwButtonID = IDC_SRMM_SHOWNICKLIST;
bbd.dwDefPos = 22;
bbd.hIcon = PluginConfig.g_buttonBarIconHandles[19];
bbd.pwszTooltip = LPGENW("Toggle nick list");
diff --git a/plugins/TabSRMM/src/chat.h b/plugins/TabSRMM/src/chat.h
index 6e4df0f2b5..e9947ed8b3 100644
--- a/plugins/TabSRMM/src/chat.h
+++ b/plugins/TabSRMM/src/chat.h
@@ -72,7 +72,7 @@ struct TMUCSettings : public GlobalLogSettingsBase
COLORREF nickColors[8];
HBRUSH SelectionBGBrush;
bool bOpenInDefault, bBBCodeInPopups;
- bool bDoubleClick4Privat, bShowContactStatus, bContactStatusFirst;
+ bool bShowContactStatus, bContactStatusFirst;
bool bLogClassicIndicators, bAlternativeSorting, bAnnoyingHighlight, bCreateWindowOnHighlight;
bool bLogSymbols, bClassicIndicators, bClickableNicks, bColorizeNicks, bColorizeNicksInLog;
diff --git a/plugins/TabSRMM/src/chat_main.cpp b/plugins/TabSRMM/src/chat_main.cpp
index 3c0c487821..626c5aea5c 100644
--- a/plugins/TabSRMM/src/chat_main.cpp
+++ b/plugins/TabSRMM/src/chat_main.cpp
@@ -51,7 +51,7 @@ static void OnReplaceSession(SESSION_INFO *si)
if (si->hContact)
Chat_SetFilters(si);
if (si->pDlg)
- RedrawWindow(GetDlgItem(si->pDlg->GetHwnd(), IDC_LIST), nullptr, nullptr, RDW_INVALIDATE);
+ RedrawWindow(GetDlgItem(si->pDlg->GetHwnd(), IDC_SRMM_NICKLIST), nullptr, nullptr, RDW_INVALIDATE);
}
static void OnSetTopic(SESSION_INFO *si)
diff --git a/plugins/TabSRMM/src/chat_resource.h b/plugins/TabSRMM/src/chat_resource.h
index 2516ff30d4..1142bf12b6 100644
--- a/plugins/TabSRMM/src/chat_resource.h
+++ b/plugins/TabSRMM/src/chat_resource.h
@@ -37,7 +37,6 @@
#define IDC_LOGGING 1069
#define IDC_TEXTO2 1070
#define IDC_TEXTO3 1071
-#define IDC_LIST 1072
#define IDC_TEXTO4 1072
#define IDC_STATIC_ADD 1077
#define IDC_STATIC_ULIST 1078
diff --git a/plugins/TabSRMM/src/chat_window.cpp b/plugins/TabSRMM/src/chat_window.cpp
index c44124fda4..faa6d514f5 100644
--- a/plugins/TabSRMM/src/chat_window.cpp
+++ b/plugins/TabSRMM/src/chat_window.cpp
@@ -266,7 +266,7 @@ int CChatRoomDlg::Resizer(UTILRESIZECONTROL *urc)
Utils::showDlgControl(m_hwnd, IDC_SPLITTERY, SW_HIDE);
if (m_si->iType != GCW_SERVER) {
- Utils::showDlgControl(m_hwnd, IDC_LIST, m_bNicklistEnabled ? SW_SHOW : SW_HIDE);
+ Utils::showDlgControl(m_hwnd, IDC_SRMM_NICKLIST, m_bNicklistEnabled ? SW_SHOW : SW_HIDE);
Utils::showDlgControl(m_hwnd, IDC_SPLITTERX, m_bNicklistEnabled ? SW_SHOW : SW_HIDE);
m_btnNickList.Enable(true);
@@ -278,7 +278,7 @@ int CChatRoomDlg::Resizer(UTILRESIZECONTROL *urc)
}
}
else {
- Utils::showDlgControl(m_hwnd, IDC_LIST, SW_HIDE);
+ Utils::showDlgControl(m_hwnd, IDC_SRMM_NICKLIST, SW_HIDE);
Utils::showDlgControl(m_hwnd, IDC_SPLITTERX, SW_HIDE);
}
@@ -314,7 +314,7 @@ int CChatRoomDlg::Resizer(UTILRESIZECONTROL *urc)
}
return RD_ANCHORX_CUSTOM | RD_ANCHORY_CUSTOM;
- case IDC_LIST:
+ case IDC_SRMM_NICKLIST:
urc->rcItem.top = 0;
urc->rcItem.right = urc->dlgNewSize.cx;
urc->rcItem.left = urc->dlgNewSize.cx - iSplitterX + 2;
@@ -1378,8 +1378,7 @@ static void __cdecl phase2(void * lParam)
CChatRoomDlg::CChatRoomDlg(SESSION_INFO *si)
: CTabBaseDlg(IDD_CHANNEL, si),
- m_btnOk(this, IDOK),
- m_list(this, IDC_LIST)
+ m_btnOk(this, IDOK)
{
m_szProto = GetContactProto(m_hContact);
m_bFilterEnabled = db_get_b(m_hContact, CHAT_MODULE, "FilterEnabled", m_bFilterEnabled) != 0;
@@ -1390,8 +1389,6 @@ CChatRoomDlg::CChatRoomDlg(SESSION_INFO *si)
m_btnNickList.OnClick = Callback(this, &CChatRoomDlg::onClick_ShowNickList);
m_message.OnChange = Callback(this, &CChatRoomDlg::onChange_Message);
-
- m_list.OnDblClick = Callback(this, &CChatRoomDlg::onDblClick_List);
}
CThumbBase* CChatRoomDlg::tabCreateThumb(CProxyWindow *pProxy) const
@@ -1470,7 +1467,7 @@ void CChatRoomDlg::OnInitDialog()
mir_subclassWindow(GetDlgItem(m_hwnd, IDC_SPLITTERX), SplitterSubclassProc);
mir_subclassWindow(GetDlgItem(m_hwnd, IDC_SPLITTERY), SplitterSubclassProc);
- mir_subclassWindow(m_list.GetHwnd(), NicklistSubclassProc);
+ mir_subclassWindow(m_nickList.GetHwnd(), NicklistSubclassProc);
mir_subclassWindow(m_log.GetHwnd(), LogSubclassProc);
mir_subclassWindow(m_message.GetHwnd(), MessageSubclassProc);
@@ -1650,33 +1647,6 @@ 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(m_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 DoEventHook(GC_USER_PRIVMESS, ui, nullptr, 0);
-}
-
/////////////////////////////////////////////////////////////////////////////////////////
void CChatRoomDlg::AddLog()
@@ -1787,9 +1757,9 @@ void CChatRoomDlg::ShowFilterMenu()
void CChatRoomDlg::UpdateNickList()
{
- int i = m_list.SendMsg(LB_GETTOPINDEX, 0, 0);
- m_list.SendMsg(LB_SETCOUNT, m_si->nUsersInNicklist, 0);
- m_list.SendMsg(LB_SETTOPINDEX, i, 0);
+ int i = m_nickList.SendMsg(LB_GETTOPINDEX, 0, 0);
+ m_nickList.SendMsg(LB_SETCOUNT, m_si->nUsersInNicklist, 0);
+ m_nickList.SendMsg(LB_SETTOPINDEX, i, 0);
UpdateTitle();
m_hTabIcon = m_hTabStatusIcon;
}
@@ -1811,8 +1781,8 @@ void CChatRoomDlg::UpdateOptions()
DM_InitRichEdit();
m_btnOk.SendMsg(BUTTONSETASNORMAL, TRUE, 0);
- m_list.SetItemHeight(0, g_Settings.iNickListFontHeight);
- InvalidateRect(m_list.GetHwnd(), nullptr, TRUE);
+ m_nickList.SetItemHeight(0, g_Settings.iNickListFontHeight);
+ InvalidateRect(m_nickList.GetHwnd(), nullptr, TRUE);
m_btnFilter.SendMsg(BUTTONSETOVERLAYICON, (LPARAM)(m_bFilterEnabled ? PluginConfig.g_iconOverlayEnabled : PluginConfig.g_iconOverlayDisabled), 0);
SendMessage(m_hwnd, WM_SIZE, 0, 0);
@@ -2028,7 +1998,7 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
return Menu_DrawItem(lParam);
}
- if (dis->CtlID == IDC_LIST) {
+ if (dis->CtlID == IDC_SRMM_NICKLIST) {
int x_offset = 0;
int index = dis->itemID;
@@ -2550,7 +2520,7 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
HDC hdc = (HDC)wParam;
UINT item_ids[3] = { ID_EXTBKUSERLIST, ID_EXTBKHISTORY, ID_EXTBKINPUTAREA };
- UINT ctl_ids[3] = { IDC_LIST, IDC_LOG, IDC_MESSAGE };
+ UINT ctl_ids[3] = { IDC_SRMM_NICKLIST, IDC_LOG, IDC_MESSAGE };
HANDLE hbp = 0;
HDC hdcMem = 0;
HBITMAP hbm, hbmOld;
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp
index 7b1ebaedf1..091e13848b 100644
--- a/plugins/TabSRMM/src/generic_msghandlers.cpp
+++ b/plugins/TabSRMM/src/generic_msghandlers.cpp
@@ -880,9 +880,9 @@ LRESULT CTabBaseDlg::DM_MouseWheelHandler(WPARAM wParam, LPARAM lParam)
}
if (isChat()) { // scroll nick list by just hovering it
RECT rcNicklist;
- GetWindowRect(GetDlgItem(m_hwnd, IDC_LIST), &rcNicklist);
+ GetWindowRect(m_nickList.GetHwnd(), &rcNicklist);
if (PtInRect(&rcNicklist, pt)) {
- SendDlgItemMessage(m_hwnd, IDC_LIST, WM_MOUSEWHEEL, wParam, lParam);
+ m_nickList.SendMsg(WM_MOUSEWHEEL, wParam, lParam);
return 0;
}
}
@@ -943,7 +943,7 @@ void CTabBaseDlg::DM_ThemeChanged()
if (m_hTheme != 0 || (CSkin::m_skinEnabled && !item_log->IGNORED)) {
SetWindowLongPtr(m_log.GetHwnd(), GWL_EXSTYLE, GetWindowLongPtr(m_log.GetHwnd(), GWL_EXSTYLE) & ~WS_EX_STATICEDGE);
if (isChat())
- SetWindowLongPtr(GetDlgItem(m_hwnd, IDC_LIST), GWL_EXSTYLE, GetWindowLongPtr(GetDlgItem(m_hwnd, IDC_LIST), GWL_EXSTYLE) & ~(WS_EX_CLIENTEDGE | WS_EX_STATICEDGE));
+ SetWindowLongPtr(m_nickList.GetHwnd(), GWL_EXSTYLE, GetWindowLongPtr(m_nickList.GetHwnd(), GWL_EXSTYLE) & ~(WS_EX_CLIENTEDGE | WS_EX_STATICEDGE));
}
if (m_hTheme != 0 || (CSkin::m_skinEnabled && !item_msg->IGNORED))
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h
index 1bbefadf41..c2f7822141 100644
--- a/plugins/TabSRMM/src/msgs.h
+++ b/plugins/TabSRMM/src/msgs.h
@@ -484,7 +484,6 @@ class CChatRoomDlg : public CTabBaseDlg
{
HWND m_hwndFilter;
CCtrlButton m_btnOk;
- CCtrlListBox m_list;
static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
@@ -524,8 +523,6 @@ public:
void onChange_Message(CCtrlEdit*);
- void onDblClick_List(CCtrlListBox*);
-
void UpdateWindowState(UINT msg);
};