diff options
author | George Hazan <ghazan@miranda.im> | 2018-06-08 19:44:51 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-06-08 19:44:51 +0300 |
commit | 290518a76e3dbed5f3452f9e210c90246c8875d4 (patch) | |
tree | fd88db301fa85e98d9c3a3771676e1464f392b5b /plugins/Scriver | |
parent | f9e9f87fe527ef131e10518ed19b5cd071299c9b (diff) |
merge of recent SRMM-related fixes
Diffstat (limited to 'plugins/Scriver')
-rw-r--r-- | plugins/Scriver/src/msgdialog.cpp | 57 | ||||
-rw-r--r-- | plugins/Scriver/src/msglog.cpp | 2 | ||||
-rw-r--r-- | plugins/Scriver/src/msgs.h | 52 | ||||
-rw-r--r-- | plugins/Scriver/src/tabs.cpp | 2 | ||||
-rw-r--r-- | plugins/Scriver/src/version.h | 2 |
5 files changed, 56 insertions, 59 deletions
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 06ca2fe422..8ab31e05aa 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -660,6 +660,33 @@ void CSrmmWindow::NotifyTyping(int mode) CallService(MS_PROTO_SELFISTYPING, m_hContact, m_nTypeMode);
}
+void CSrmmWindow::ScrollToBottom()
+{
+ if (m_hwndIeview != nullptr) {
+ IEVIEWWINDOW ieWindow;
+ ieWindow.cbSize = sizeof(IEVIEWWINDOW);
+ ieWindow.iType = IEW_SCROLLBOTTOM;
+ ieWindow.hwnd = m_hwndIeview;
+ CallService(MS_IEVIEW_WINDOW, 0, (LPARAM)&ieWindow);
+ return;
+ }
+
+ if (GetWindowLongPtr(m_log.GetHwnd(), GWL_STYLE) & WS_VSCROLL) {
+ SCROLLINFO si = { sizeof(si) };
+ si.fMask = SIF_PAGE | SIF_RANGE | SIF_POS;
+ if (GetScrollInfo(m_log.GetHwnd(), SB_VERT, &si)) {
+ if (m_log.GetHwnd() != GetFocus()) {
+ si.fMask = SIF_POS;
+ si.nPos = si.nMax - si.nPage + 1;
+ SetScrollInfo(m_log.GetHwnd(), SB_VERT, &si, TRUE);
+
+ PostMessage(m_log.GetHwnd(), WM_VSCROLL, MAKEWPARAM(SB_BOTTOM, 0), 0);
+ }
+ }
+ RedrawWindow(m_log.GetHwnd(), nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW);
+ }
+}
+
void CSrmmWindow::SetDialogToType()
{
BOOL showToolbar = SendMessage(m_hwndParent, CM_GETTOOLBARSTATUS, 0, 0);
@@ -1378,36 +1405,6 @@ INT_PTR CSrmmWindow::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) InvalidateRect(m_log.GetHwnd(), nullptr, FALSE);
break;
- case DM_APPENDTOLOG: //takes wParam=hDbEvent
- StreamInEvents(wParam, 1, 1);
- break;
-
- case DM_SCROLLLOGTOBOTTOM:
- if (m_hwndIeview == nullptr) {
- if ((GetWindowLongPtr(m_log.GetHwnd(), GWL_STYLE) & WS_VSCROLL) == 0)
- break;
-
- SCROLLINFO si = { sizeof(si) };
- si.fMask = SIF_PAGE | SIF_RANGE | SIF_POS;
- if (GetScrollInfo(m_log.GetHwnd(), SB_VERT, &si)) {
- if (m_log.GetHwnd() != GetFocus()) {
- si.fMask = SIF_POS;
- si.nPos = si.nMax - si.nPage + 1;
- SetScrollInfo(m_log.GetHwnd(), SB_VERT, &si, TRUE);
- PostMessage(m_log.GetHwnd(), WM_VSCROLL, MAKEWPARAM(SB_BOTTOM, 0), 0);
- }
- }
- RedrawWindow(m_log.GetHwnd(), nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW);
- }
- else {
- IEVIEWWINDOW ieWindow;
- ieWindow.cbSize = sizeof(IEVIEWWINDOW);
- ieWindow.iType = IEW_SCROLLBOTTOM;
- ieWindow.hwnd = m_hwndIeview;
- CallService(MS_IEVIEW_WINDOW, 0, (LPARAM)&ieWindow);
- }
- break;
-
case HM_DBEVENTADDED:
if (wParam == m_hContact) {
MEVENT hDbEvent = lParam;
diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index f594b637c1..439a585112 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -836,7 +836,7 @@ void CSrmmWindow::StreamInEvents(MEVENT hDbEventFirst, int count, int fAppend) m_log.SendMsg(WM_SETREDRAW, TRUE, 0);
m_hDbEventLast = streamData.hDbEventLast;
- PostMessage(m_hwnd, DM_SCROLLLOGTOBOTTOM, 0, 0);
+ ScrollToBottom();
}
#define RTFPICTHEADERMAXSIZE 78
diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h index 5abab8fe59..8950709813 100644 --- a/plugins/Scriver/src/msgs.h +++ b/plugins/Scriver/src/msgs.h @@ -86,9 +86,9 @@ protected: int InputAreaShortcuts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
public:
- virtual void CloseTab() override;
- virtual void LoadSettings() override;
- virtual void SetStatusText(const wchar_t*, HICON) override;
+ void CloseTab() override;
+ void LoadSettings() override;
+ void SetStatusText(const wchar_t*, HICON) override;
bool IsActive() const
{
@@ -110,8 +110,8 @@ class CSrmmWindow : public CScriverWindow CCtrlButton m_btnOk, m_btnAdd, m_btnUserMenu, m_btnQuote, m_btnDetails;
CSplitter m_splitter;
- virtual LRESULT WndProc_Log(UINT msg, WPARAM wParam, LPARAM lParam);
- virtual LRESULT WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam);
+ LRESULT WndProc_Log(UINT msg, WPARAM wParam, LPARAM lParam);
+ LRESULT WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam);
bool m_bIncoming, m_bShowTyping;
@@ -162,13 +162,14 @@ public: public:
CSrmmWindow(MCONTACT hContact, bool bIncoming);
- virtual void OnInitDialog() override;
- virtual void OnDestroy() override;
+ void OnInitDialog() override;
+ void OnDestroy() override;
- virtual void UpdateStatusBar() override;
- virtual void UpdateTitle() override;
+ void ScrollToBottom() override;
+ void UpdateStatusBar() override;
+ void UpdateTitle() override;
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
+ INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
void onClick_Ok(CCtrlButton*);
void onClick_Add(CCtrlButton*);
@@ -192,9 +193,9 @@ class CChatRoomDlg : public CScriverWindow void MessageDialogResize(int w, int h);
void TabAutoComplete(void);
- virtual LRESULT WndProc_Log(UINT msg, WPARAM wParam, LPARAM lParam) override;
- virtual LRESULT WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam) override;
- virtual LRESULT WndProc_Nicklist(UINT msg, WPARAM wParam, LPARAM lParam) override;
+ LRESULT WndProc_Log(UINT msg, WPARAM wParam, LPARAM lParam) override;
+ LRESULT WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam) override;
+ LRESULT WndProc_Nicklist(UINT msg, WPARAM wParam, LPARAM lParam) override;
static INT_PTR CALLBACK FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
@@ -205,19 +206,19 @@ class CChatRoomDlg : public CScriverWindow public:
CChatRoomDlg(SESSION_INFO *si);
- virtual void OnInitDialog() override;
- virtual void OnDestroy() override;
+ void OnInitDialog() override;
+ void OnDestroy() override;
- virtual INT_PTR DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) override;
+ INT_PTR DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) override;
- virtual void RedrawLog() override;
- virtual void ScrollToBottom() override;
- virtual void ShowFilterMenu() override;
- virtual void StreamInEvents(LOGINFO* lin, bool bRedraw) override;
- virtual void UpdateNickList() override;
- virtual void UpdateOptions() override;
- virtual void UpdateStatusBar() override;
- virtual void UpdateTitle() override;
+ void RedrawLog() override;
+ void ScrollToBottom() override;
+ void ShowFilterMenu() override;
+ void StreamInEvents(LOGINFO* lin, bool bRedraw) override;
+ void UpdateNickList() override;
+ void UpdateOptions() override;
+ void UpdateStatusBar() override;
+ void UpdateTitle() override;
void onChange_Message(CCtrlEdit*);
@@ -237,7 +238,6 @@ public: #define DM_OPTIONSAPPLIED (WM_USER+14)
#define DM_APPENDTOLOG (WM_USER+17)
#define DM_ERRORDECIDED (WM_USER+18)
-#define DM_SCROLLLOGTOBOTTOM (WM_USER+19)
#define DM_TYPING (WM_USER+20)
#define DM_UPDATELASTMESSAGE (WM_USER+22)
#define DM_USERNAMETOCLIP (WM_USER+23)
@@ -282,7 +282,7 @@ class CErrorDlg : public CDlgBase CCtrlButton m_btnOk, m_btnCancel;
protected:
- virtual void OnInitDialog() override;
+ void OnInitDialog() override;
public:
CErrorDlg(const wchar_t *pwszDescr, HWND, MessageSendQueueItem*);
diff --git a/plugins/Scriver/src/tabs.cpp b/plugins/Scriver/src/tabs.cpp index 47208794a9..3f4dd2db88 100644 --- a/plugins/Scriver/src/tabs.cpp +++ b/plugins/Scriver/src/tabs.cpp @@ -197,7 +197,7 @@ static void ActivateChild(ParentWindowData *dat, HWND child) pDlg->UpdateTitle();
SendMessage(dat->hwndActive, WM_SIZE, 0, 0);
ShowWindow(dat->hwndActive, SW_SHOWNOACTIVATE);
- SendMessage(dat->hwndActive, DM_SCROLLLOGTOBOTTOM, 0, 0);
+ pDlg->ScrollToBottom();
if (prev != nullptr)
ShowWindow(prev, SW_HIDE);
}
diff --git a/plugins/Scriver/src/version.h b/plugins/Scriver/src/version.h index fc56d643d5..2da3d6bb5b 100644 --- a/plugins/Scriver/src/version.h +++ b/plugins/Scriver/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 3 #define __MINOR_VERSION 0 #define __RELEASE_NUM 1 -#define __BUILD_NUM 8 +#define __BUILD_NUM 9 #include <stdver.h> |