summaryrefslogtreecommitdiff
path: root/plugins/Scriver/src
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/Scriver/src
parent429859059db4093bf95dbe2695e205025dd7b3a7 (diff)
nick list moved to mir_app
Diffstat (limited to 'plugins/Scriver/src')
-rw-r--r--plugins/Scriver/src/chat_main.cpp2
-rw-r--r--plugins/Scriver/src/chat_window.cpp34
-rw-r--r--plugins/Scriver/src/msgs.cpp2
-rw-r--r--plugins/Scriver/src/msgs.h3
-rw-r--r--plugins/Scriver/src/resource.h1
5 files changed, 4 insertions, 38 deletions
diff --git a/plugins/Scriver/src/chat_main.cpp b/plugins/Scriver/src/chat_main.cpp
index f4b4755e56..5d0cb3b0e3 100644
--- a/plugins/Scriver/src/chat_main.cpp
+++ b/plugins/Scriver/src/chat_main.cpp
@@ -51,7 +51,7 @@ void LoadModuleIcons(MODULEINFO *mi)
static void OnReplaceSession(SESSION_INFO *si)
{
if (si->pDlg)
- RedrawWindow(GetDlgItem(si->pDlg->GetHwnd(), IDC_CHAT_LIST), nullptr, nullptr, RDW_INVALIDATE);
+ RedrawWindow(GetDlgItem(si->pDlg->GetHwnd(), IDC_SRMM_NICKLIST), nullptr, nullptr, RDW_INVALIDATE);
}
static void OnNewUser(SESSION_INFO *si, USERINFO*)
diff --git a/plugins/Scriver/src/chat_window.cpp b/plugins/Scriver/src/chat_window.cpp
index 6c43be27ca..12ff411673 100644
--- a/plugins/Scriver/src/chat_window.cpp
+++ b/plugins/Scriver/src/chat_window.cpp
@@ -176,7 +176,7 @@ LRESULT CALLBACK CChatRoomDlg::MessageSubclassProc(HWND hwnd, UINT msg, WPARAM w
else dat->lastEnterTime = 0;
if (wParam == VK_TAB && isShift && !isCtrl) { // SHIFT-TAB (go to nick list)
- SetFocus(GetDlgItem(GetParent(hwnd), IDC_CHAT_LIST));
+ SetFocus(pDlg->m_nickList.GetHwnd());
return TRUE;
}
@@ -747,7 +747,6 @@ CChatRoomDlg::CChatRoomDlg(SESSION_INFO *si)
m_log(this, IDC_LOG),
m_message(this, IDC_MESSAGE),
- m_nickList(this, IDC_CHAT_LIST),
m_splitterX(this, IDC_SPLITTERX),
m_splitterY(this, IDC_SPLITTERY),
@@ -761,8 +760,6 @@ CChatRoomDlg::CChatRoomDlg(SESSION_INFO *si)
m_btnFilter.OnClick = Callback(this, &CChatRoomDlg::onClick_Filter);
m_btnNickList.OnClick = Callback(this, &CChatRoomDlg::onClick_ShowList);
- m_nickList.OnDblClick = Callback(this, &CChatRoomDlg::onDblClick_List);
-
m_message.OnChange = Callback(this, &CChatRoomDlg::onChange_Message);
m_splitterX.OnChange = Callback(this, &CChatRoomDlg::OnSplitterX);
@@ -877,33 +874,6 @@ void CChatRoomDlg::OnSplitterY(CSplitter *pSplitter)
m_pParent->iSplitterY = rc.bottom - pSplitter->GetPos();
}
-void CChatRoomDlg::onDblClick_List(CCtrlListBox*)
-{
- TVHITTESTINFO hti;
- hti.pt.x = (short)LOWORD(GetMessagePos());
- hti.pt.y = (short)HIWORD(GetMessagePos());
- ScreenToClient(m_nickList.GetHwnd(), &hti.pt);
-
- int item = LOWORD(m_nickList.SendMsg(LB_ITEMFROMPOINT, 0, MAKELPARAM(hti.pt.x, hti.pt.y)));
- USERINFO *ui = pci->SM_GetUserFromIndex(m_si->ptszID, m_si->pszModule, item);
- if (ui) {
- if (GetKeyState(VK_SHIFT) & 0x8000) {
- LRESULT lResult = (LRESULT)m_message.SendMsg(EM_GETSEL, 0, 0);
- int start = LOWORD(lResult);
- size_t dwNameLenMax = (mir_wstrlen(ui->pszUID) + 4);
- wchar_t* pszName = (wchar_t*)alloca(sizeof(wchar_t) * dwNameLenMax);
- if (start == 0)
- mir_snwprintf(pszName, dwNameLenMax, L"%s: ", ui->pszUID);
- else
- mir_snwprintf(pszName, dwNameLenMax, L"%s ", ui->pszUID);
-
- m_message.SendMsg(EM_REPLACESEL, FALSE, (LPARAM)pszName);
- PostMessage(m_hwnd, WM_MOUSEACTIVATE, 0, 0);
- }
- else DoEventHook(GC_USER_PRIVMESS, ui, nullptr, 0);
- }
-}
-
void CChatRoomDlg::onClick_Ok(CCtrlButton *pButton)
{
if (!pButton->Enabled())
@@ -1244,7 +1214,7 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
if (dis->CtlType == ODT_MENU)
return Menu_DrawItem(lParam);
- if (dis->CtlID == IDC_CHAT_LIST) {
+ if (dis->CtlID == IDC_SRMM_NICKLIST) {
int index = dis->itemID;
USERINFO *ui = pci->SM_GetUserFromIndex(m_si->ptszID, m_si->pszModule, index);
if (ui) {
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp
index 3be8670a67..c2ef1ab5c5 100644
--- a/plugins/Scriver/src/msgs.cpp
+++ b/plugins/Scriver/src/msgs.cpp
@@ -527,7 +527,7 @@ int RegisterToolbarIcons(WPARAM, LPARAM)
bbd.pwszTooltip = LPGENW("Control this room (CTRL+O)");
Srmm_AddButton(&bbd);
- bbd.dwButtonID = IDC_SRMM_NICKLIST;
+ bbd.dwButtonID = IDC_SRMM_SHOWNICKLIST;
bbd.dwDefPos = 20;
bbd.hIcon = IcoLib_GetIconHandle("chat_nicklist");
bbd.pwszText = LPGENW("&Show/hide nick list");
diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h
index d742939075..a160e2c654 100644
--- a/plugins/Scriver/src/msgs.h
+++ b/plugins/Scriver/src/msgs.h
@@ -179,7 +179,6 @@ class CChatRoomDlg : public CScriverWindow
{
CCtrlEdit m_message, m_log;
CCtrlButton m_btnOk;
- CCtrlListBox m_nickList;
CSplitter m_splitterX, m_splitterY;
void MessageDialogResize(int w, int h);
@@ -215,8 +214,6 @@ public:
void onClick_Filter(CCtrlButton*);
void onClick_ShowList(CCtrlButton*);
- void onDblClick_List(CCtrlListBox*);
-
void OnSplitterX(CSplitter*);
void OnSplitterY(CSplitter*);
diff --git a/plugins/Scriver/src/resource.h b/plugins/Scriver/src/resource.h
index cd2b9afb0a..71f80fb75d 100644
--- a/plugins/Scriver/src/resource.h
+++ b/plugins/Scriver/src/resource.h
@@ -196,7 +196,6 @@
#define IDC_CHAT_TEXTO 5069
#define IDC_CHAT_LOGGING 5069
#define IDC_CHAT_COLORTEXT 5070
-#define IDC_CHAT_LIST 5072
#define IDC_CHAT_1 5075
#define IDC_CHAT_2 5076
#define IDC_CHAT_3 5077