summaryrefslogtreecommitdiff
path: root/src/core/stdmsg
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-03-22 17:54:29 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-03-22 17:54:29 +0300
commitf59a84dc9b6e843da1024f108cba16aa9544b10c (patch)
treeaacb5df6ff7fcf6f9a66fcdd8a6529f6b56aae0e /src/core/stdmsg
parent75876f6d7a4b4597e95a72315aa82dc3a8ffc57d (diff)
- more SRMM buttons went to mir_app;
- history button handler also moved to mir_app;
Diffstat (limited to 'src/core/stdmsg')
-rw-r--r--src/core/stdmsg/src/chat_window.cpp25
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp4
-rw-r--r--src/core/stdmsg/src/msgs.cpp2
-rw-r--r--src/core/stdmsg/src/resource.h3
-rw-r--r--src/core/stdmsg/src/stdafx.h2
5 files changed, 3 insertions, 33 deletions
diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp
index 00d2d4ad99..c2b527e629 100644
--- a/src/core/stdmsg/src/chat_window.cpp
+++ b/src/core/stdmsg/src/chat_window.cpp
@@ -208,7 +208,6 @@ LRESULT CALLBACK CChatRoomDlg::MessageSubclassProc(HWND hwnd, UINT msg, WPARAM w
SendMessage(hwndDlg, GC_SWITCHTAB, 0, (int)wParam - (int)VK_NUMPAD1);
if (wParam == VK_TAB && !isCtrl && !isShift) { // tab-autocomplete
- wchar_t *pszText = nullptr;
LRESULT lResult = (LRESULT)SendMessage(hwnd, EM_GETSEL, 0, 0);
SendMessage(hwnd, WM_SETREDRAW, FALSE, 0);
@@ -221,14 +220,14 @@ LRESULT CALLBACK CChatRoomDlg::MessageSubclassProc(HWND hwnd, UINT msg, WPARAM w
gtl.codepage = CP_ACP;
int iLen = SendMessage(hwnd, EM_GETTEXTLENGTHEX, (WPARAM)&gtl, 0);
if (iLen > 0) {
- pszText = (wchar_t *)mir_alloc(sizeof(wchar_t)*(iLen + 100));
+ wchar_t *pszText = (wchar_t *)mir_alloc(sizeof(wchar_t)*(iLen + 100));
GETTEXTEX gt = {};
gt.cb = iLen + 99;
gt.flags = GT_DEFAULT;
gt.codepage = 1200;
-
SendMessage(hwnd, EM_GETTEXTEX, (WPARAM)&gt, (LPARAM)pszText);
+
while (start > 0 && pszText[start - 1] != ' ' && pszText[start - 1] != 13 && pszText[start - 1] != VK_TAB)
start--;
while (end < iLen && pszText[end] != ' ' && pszText[end] != 13 && pszText[end - 1] != VK_TAB)
@@ -282,11 +281,6 @@ LRESULT CALLBACK CChatRoomDlg::MessageSubclassProc(HWND hwnd, UINT msg, WPARAM w
return TRUE;
}
- if (wParam == 0x48 && isCtrl && !isAlt) { // ctrl-h (history)
- pDlg->onClick_History(&pDlg->m_btnHistory);
- return TRUE;
- }
-
if (wParam == 0x4f && isCtrl && !isAlt) { // ctrl-o (options)
pDlg->onClick_Options(&pDlg->m_btnChannelMgr);
return TRUE;
@@ -695,10 +689,6 @@ CChatRoomDlg::CChatRoomDlg(SESSION_INFO *si) :
m_log(this, IDC_LOG),
m_btnOk(this, IDOK),
-
- m_btnHistory(this, IDC_HISTORY),
- m_btnNickList(this, IDC_SHOWNICKLIST),
- m_btnChannelMgr(this, IDC_CHANMGR),
m_splitterX(this, IDC_SPLITTERX),
m_splitterY(this, IDC_SPLITTERY)
@@ -712,7 +702,6 @@ CChatRoomDlg::CChatRoomDlg(SESSION_INFO *si) :
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_btnChannelMgr.OnClick = Callback(this, &CChatRoomDlg::onClick_Options);
m_btnNickList.OnClick = Callback(this, &CChatRoomDlg::onClick_NickList);
@@ -812,16 +801,6 @@ void CChatRoomDlg::onClick_Filter(CCtrlButton *pButton)
RedrawLog();
}
-void CChatRoomDlg::onClick_History(CCtrlButton *pButton)
-{
- if (!pButton->Enabled())
- return;
-
- MODULEINFO *pInfo = pci->MM_FindModule(m_si->pszModule);
- if (pInfo)
- ShellExecute(m_hwnd, nullptr, pci->GetChatLogsFilename(m_si, 0), nullptr, nullptr, SW_SHOW);
-}
-
void CChatRoomDlg::onClick_NickList(CCtrlButton *pButton)
{
if (!pButton->Enabled() || m_si->iType == GCW_SERVER)
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index ec6b384b59..1b3896ee31 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -1320,10 +1320,6 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
}
break;
- case IDC_HISTORY:
- CallService(MS_HISTORY_SHOWCONTACTHISTORY, m_hContact, 0);
- break;
-
case IDC_DETAILS:
CallService(MS_USERINFO_SHOWDIALOG, m_hContact, 0);
break;
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp
index e81d16e3a9..906b0270a4 100644
--- a/src/core/stdmsg/src/msgs.cpp
+++ b/src/core/stdmsg/src/msgs.cpp
@@ -307,7 +307,7 @@ int RegisterToolbarIcons(WPARAM, LPARAM)
Srmm_AddButton(&bbd);
bbd.bbbFlags |= BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON;
- bbd.dwButtonID = IDC_HISTORY;
+ bbd.dwButtonID = IDC_SRMM_HISTORY;
bbd.dwDefPos = 40;
bbd.hIcon = Skin_GetIconHandle(SKINICON_OTHER_HISTORY);
bbd.pwszText = LPGENW("&History");
diff --git a/src/core/stdmsg/src/resource.h b/src/core/stdmsg/src/resource.h
index d07e2b302a..bd06f80531 100644
--- a/src/core/stdmsg/src/resource.h
+++ b/src/core/stdmsg/src/resource.h
@@ -70,11 +70,8 @@
#define IDC_AUTOMIN 1005
#define IDC_DONOTSTEALFOCUS 1006
#define IDC_SPLITTERY 1008
-#define IDC_CHANMGR 1014
-#define IDC_SHOWNICKLIST 1016
#define IDC_CHECKBOXES 1018
#define IDC_NICKLISTBKG 1021
-#define IDC_HISTORY 1022
#define IDC_NICKROW 1024
#define IDC_LOGLIMIT 1024
#define IDC_NICKROW2 1025
diff --git a/src/core/stdmsg/src/stdafx.h b/src/core/stdmsg/src/stdafx.h
index c665cbb2b8..750bbefcf5 100644
--- a/src/core/stdmsg/src/stdafx.h
+++ b/src/core/stdmsg/src/stdafx.h
@@ -218,7 +218,6 @@ class CChatRoomDlg : public CSrmmBaseDialog
CCtrlEdit m_message, m_log;
CCtrlListBox m_nickList;
CCtrlButton m_btnOk;
- CCtrlButton m_btnChannelMgr, m_btnNickList, m_btnHistory;
CSplitter m_splitterX, m_splitterY;
HWND getCaptionWindow() const
@@ -253,7 +252,6 @@ public:
void onClick_Ok(CCtrlButton*);
void onClick_Filter(CCtrlButton*);
- void onClick_History(CCtrlButton*);
void onClick_Options(CCtrlButton*);
void onClick_NickList(CCtrlButton*);