From 615afbd839b22a7a170c477481ef67e5603b9709 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 15 May 2021 23:01:52 +0300 Subject: SetDraw(bool bEnable) - a wrapper for WM_SETREDRAW command --- src/core/stdmsg/src/chat_window.cpp | 8 ++++---- src/core/stdmsg/src/msgdialog.cpp | 4 ++-- src/core/stdmsg/src/msglog.cpp | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/core') diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp index 05a5ddb24d..222087d178 100644 --- a/src/core/stdmsg/src/chat_window.cpp +++ b/src/core/stdmsg/src/chat_window.cpp @@ -145,7 +145,7 @@ void CLogWindow::LogEvents(LOGINFO *lin, bool bRedraw) CHARRANGE oldsel, sel; m_rtf.SendMsg(EM_EXGETSEL, 0, (LPARAM)&oldsel); if (oldsel.cpMax != oldsel.cpMin) - m_rtf.SendMsg(WM_SETREDRAW, FALSE, 0); + m_rtf.SetDraw(false); //set the insertion point at the bottom sel.cpMin = sel.cpMax = m_rtf.GetRichTextLength(); @@ -164,7 +164,7 @@ void CLogWindow::LogEvents(LOGINFO *lin, bool bRedraw) g_chatApi.logPixelSY = GetDeviceCaps(hdc, LOGPIXELSY); g_chatApi.logPixelSX = GetDeviceCaps(hdc, LOGPIXELSX); ReleaseDC(nullptr, hdc); - m_rtf.SendMsg(WM_SETREDRAW, FALSE, 0); + m_rtf.SetDraw(false); bFlag = true; } @@ -200,7 +200,7 @@ void CLogWindow::LogEvents(LOGINFO *lin, bool bRedraw) // do we need to restore the selection if (oldsel.cpMax != oldsel.cpMin) { m_rtf.SendMsg(EM_EXSETSEL, 0, (LPARAM)&oldsel); - m_rtf.SendMsg(WM_SETREDRAW, TRUE, 0); + m_rtf.SetDraw(true); InvalidateRect(m_rtf.GetHwnd(), nullptr, TRUE); } @@ -208,7 +208,7 @@ void CLogWindow::LogEvents(LOGINFO *lin, bool bRedraw) if (bFlag) { sel.cpMin = sel.cpMax = m_rtf.GetRichTextLength(); m_rtf.SendMsg(EM_EXSETSEL, 0, (LPARAM)&sel); - m_rtf.SendMsg(WM_SETREDRAW, TRUE, 0); + m_rtf.SetDraw(true); InvalidateRect(m_rtf.GetHwnd(), nullptr, TRUE); } } diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 74433f6cde..a115908a84 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -1250,7 +1250,7 @@ void CMsgDialog::TabAutoComplete() { LRESULT lResult = (LRESULT)m_message.SendMsg(EM_GETSEL, 0, 0); - m_message.SendMsg(WM_SETREDRAW, FALSE, 0); + m_message.SetDraw(false); m_iTabStart = LOWORD(lResult); int end = HIWORD(lResult); m_message.SendMsg(EM_SETSEL, end, end); @@ -1296,7 +1296,7 @@ void CMsgDialog::TabAutoComplete() mir_free(pszSelName); } - m_message.SendMsg(WM_SETREDRAW, TRUE, 0); + m_message.SetDraw(true); RedrawWindow(m_message.GetHwnd(), nullptr, nullptr, RDW_INVALIDATE); } diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index 61630fa198..3161dff215 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -465,7 +465,7 @@ void CLogWindow::LogEvents(MEVENT hDbEventFirst, int count, bool bAppend) BOOL bottomScroll = TRUE; POINT scrollPos; - m_rtf.SendMsg(WM_SETREDRAW, FALSE, 0); + m_rtf.SetDraw(false); m_rtf.SendMsg(EM_EXGETSEL, 0, (LPARAM)&oldSel); LogStreamData streamData = {}; @@ -542,7 +542,7 @@ void CLogWindow::LogEvents(MEVENT hDbEventFirst, int count, bool bAppend) CallService(MS_SMILEYADD_REPLACESMILEYS, 0, (LPARAM)&smre); } - m_rtf.SendMsg(WM_SETREDRAW, TRUE, 0); + m_rtf.SetDraw(true); if (bottomScroll) { ScrollToBottom(); RedrawWindow(m_rtf.GetHwnd(), nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW); -- cgit v1.2.3