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 --- plugins/Clist_modern/src/modern_viewmodebar.cpp | 14 +++++++------- plugins/Ping/src/pingthread.cpp | 1 - plugins/QuickSearch/src/window_misc.cpp | 12 ++++++------ plugins/Scriver/src/msgdialog.cpp | 4 ++-- plugins/Scriver/src/msglog.cpp | 14 +++++++------- plugins/Scriver/src/msgutils.cpp | 4 ++-- plugins/TabSRMM/src/msgdialog.cpp | 4 ++-- plugins/TabSRMM/src/msglog.cpp | 12 ++++++------ 8 files changed, 32 insertions(+), 33 deletions(-) (limited to 'plugins') diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index b8f6c758d5..a9bcc83f1d 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -420,29 +420,29 @@ class CViewModeSetupDlg : public CDlgBase pageChange = 1; if (pageChange) - SendMessage(m_hwnd, WM_SETREDRAW, FALSE, 0); + SetDraw(false); switch (page) { case 0: for (auto &ctrlId : _page1Controls) - ShowWindow(GetDlgItem(m_hwnd, ctrlId), SW_SHOW); + ::ShowWindow(GetDlgItem(m_hwnd, ctrlId), SW_SHOW); for (auto &ctrlId : _page2Controls) - ShowWindow(GetDlgItem(m_hwnd, ctrlId), SW_HIDE); + ::ShowWindow(GetDlgItem(m_hwnd, ctrlId), SW_HIDE); break; case 1: for (auto &ctrlId : _page1Controls) - ShowWindow(GetDlgItem(m_hwnd, ctrlId), SW_HIDE); + ::ShowWindow(GetDlgItem(m_hwnd, ctrlId), SW_HIDE); for (auto &ctrlId : _page2Controls) - ShowWindow(GetDlgItem(m_hwnd, ctrlId), SW_SHOW); + ::ShowWindow(GetDlgItem(m_hwnd, ctrlId), SW_SHOW); break; } if (pageChange) { - SendMessage(m_hwnd, WM_SETREDRAW, TRUE, 0); - RedrawWindow(m_hwnd, nullptr, nullptr, RDW_ERASE | RDW_INVALIDATE); + SetDraw(true); + ::RedrawWindow(m_hwnd, nullptr, nullptr, RDW_ERASE | RDW_INVALIDATE); } } diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index 03847a4f3d..a57266e6f1 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -234,7 +234,6 @@ bool FrameIsFloating() int FillList(WPARAM, LPARAM) { - if (options.logging) CallService(MODULENAME "/Log", (WPARAM)L"ping address list reload", 0); diff --git a/plugins/QuickSearch/src/window_misc.cpp b/plugins/QuickSearch/src/window_misc.cpp index 8799d6770c..a52354b884 100644 --- a/plugins/QuickSearch/src/window_misc.cpp +++ b/plugins/QuickSearch/src/window_misc.cpp @@ -77,7 +77,7 @@ void QSMainDlg::AddContactToList(MCONTACT hContact, CRowItem *pRow) void QSMainDlg::AdvancedFilter() { - m_grid.SendMsg(WM_SETREDRAW, FALSE, 0); + m_grid.SetDraw(false); for (auto &it : m_rows) { bool bShow = (szFilterProto == nullptr) || !mir_strcmp(szFilterProto, it->szProto); @@ -96,7 +96,7 @@ void QSMainDlg::AdvancedFilter() } } - m_grid.SendMsg(WM_SETREDRAW, TRUE, 0); + m_grid.SetDraw(true); InvalidateRect(m_grid.GetHwnd(), 0, false); Sort(); @@ -152,7 +152,7 @@ void QSMainDlg::DeleteByList() if (IDOK != MessageBoxW(0, TranslateT("Do you really want to delete selected contacts"), TranslateT("Warning"), MB_OKCANCEL + MB_ICONWARNING)) return; - m_grid.SendMsg(WM_SETREDRAW, FALSE, 0); + m_grid.SetDraw(false); for (int i = m_grid.GetItemCount() - 1; i >= 0; i--) if (m_grid.GetItemState(i, LVIS_SELECTED)) { @@ -160,7 +160,7 @@ void QSMainDlg::DeleteByList() m_grid.DeleteItem(i); } - m_grid.SendMsg(WM_SETREDRAW, TRUE, 0); + m_grid.SetDraw(true); } void QSMainDlg::DeleteOneContact(MCONTACT hContact) @@ -260,14 +260,14 @@ void QSMainDlg::DrawSB() void QSMainDlg::FillGrid() { - m_grid.SendMsg(WM_SETREDRAW, FALSE, 0); + m_grid.SetDraw(false); MakePattern(); for (auto &it: m_rows) ProcessLine(it); - m_grid.SendMsg(WM_SETREDRAW, TRUE, 0); + m_grid.SetDraw(true); InvalidateRect(m_grid.GetHwnd(), 0, FALSE); Sort(); diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 2603cfec25..c8b0f89f2e 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -877,9 +877,9 @@ LRESULT CMsgDialog::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam) } if (wParam == VK_TAB && !isCtrl && !isShift) { // tab-autocomplete - m_message.SendMsg(WM_SETREDRAW, FALSE, 0); + m_message.SetDraw(false); TabAutoComplete(); - m_message.SendMsg(WM_SETREDRAW, TRUE, 0); + m_message.SetDraw(true); RedrawWindow(m_nickList.GetHwnd(), nullptr, nullptr, RDW_INVALIDATE); return 0; } diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index 8e2e2c40ac..062657a3ac 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -740,7 +740,7 @@ void CLogWindow::Attach() void CLogWindow::LogEvents(MEVENT hDbEventFirst, int count, bool bAppend) { CHARRANGE oldSel, sel; - m_rtf.SendMsg(WM_SETREDRAW, FALSE, 0); + m_rtf.SetDraw(false); m_rtf.SendMsg(EM_EXGETSEL, 0, (LPARAM)&oldSel); LogStreamData streamData = {}; @@ -779,7 +779,7 @@ void CLogWindow::LogEvents(MEVENT hDbEventFirst, int count, bool bAppend) m_rtf.SendMsg(EM_EXSETSEL, 0, (LPARAM)&sel); } else { - m_rtf.SendMsg(WM_SETREDRAW, FALSE, 0); + m_rtf.SetDraw(false); m_rtf.SetTextA(""); sel.cpMin = 0; sel.cpMax = m_rtf.GetRichTextLength(); @@ -819,7 +819,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); @@ -861,7 +861,7 @@ void CLogWindow::LogEvents(LOGINFO *lin, bool bRedraw) CHARRANGE oldsel, sel, newsel; 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(); @@ -878,7 +878,7 @@ void CLogWindow::LogEvents(LOGINFO *lin, bool bRedraw) // get the number of pixels per logical inch bool bFlag = false; if (bRedraw) { - m_rtf.SendMsg(WM_SETREDRAW, FALSE, 0); + m_rtf.SetDraw(false); bFlag = true; } @@ -913,7 +913,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); } @@ -921,7 +921,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/plugins/Scriver/src/msgutils.cpp b/plugins/Scriver/src/msgutils.cpp index 663f5bfde8..60c89a3801 100644 --- a/plugins/Scriver/src/msgutils.cpp +++ b/plugins/Scriver/src/msgutils.cpp @@ -431,7 +431,7 @@ void CMsgDialog::UpdateIcon() void CMsgDialog::UpdateNickList() { - m_nickList.SendMsg(WM_SETREDRAW, FALSE, 0); + m_nickList.SetDraw(false); m_nickList.ResetContent(); for (auto &ui : m_si->getUserList()) { char szIndicator = SM_GetStatusIndicator(m_si, ui); @@ -442,7 +442,7 @@ void CMsgDialog::UpdateNickList() } else m_nickList.AddString(ui->pszNick); } - m_nickList.SendMsg(WM_SETREDRAW, TRUE, 0); + m_nickList.SetDraw(true); InvalidateRect(m_nickList.GetHwnd(), nullptr, FALSE); UpdateWindow(m_nickList.GetHwnd()); UpdateTitle(); diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 9c5e2a4cc6..c872c9c44a 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -1842,9 +1842,9 @@ LRESULT CMsgDialog::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam) if (PluginConfig.m_bAllowTab) break; - m_message.SendMsg(WM_SETREDRAW, FALSE, 0); + m_message.SetDraw(false); bool fCompleted = TabAutoComplete(); - m_message.SendMsg(WM_SETREDRAW, TRUE, 0); + m_message.SetDraw(true); RedrawWindow(m_message.GetHwnd(), nullptr, nullptr, RDW_INVALIDATE); if (!fCompleted) { if ((GetSendButtonState() != PBS_DISABLED)) diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index 308729a68d..49d03fa2bd 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -1281,7 +1281,7 @@ void CLogWindow::LogEvents(MEVENT hDbEventFirst, int count, bool fAppend, DBEVEN } // begin to draw - m_rtf.SendMsg(WM_SETREDRAW, FALSE, 0); + m_rtf.SetDraw(false); m_rtf.SendMsg(EM_STREAMIN, fAppend ? SFF_SELECTION | SF_RTF : SFF_SELECTION | SF_RTF, (LPARAM)&stream); m_pDlg.m_hDbEventLast = streamData.hDbEventLast; @@ -1311,7 +1311,7 @@ void CLogWindow::LogEvents(MEVENT hDbEventFirst, int count, bool fAppend, DBEVEN m_rtf.SendMsg(EM_HIDESELECTION, FALSE, 0); - m_rtf.SendMsg(WM_SETREDRAW, TRUE, 0); + m_rtf.SetDraw(true); InvalidateRect(m_rtf.GetHwnd(), nullptr, FALSE); EnableWindow(GetDlgItem(m_pDlg.m_hwnd, IDC_QUOTE), m_pDlg.m_hDbEventLast != 0); mir_free(streamData.buffer); @@ -1347,7 +1347,7 @@ void CLogWindow::LogEvents(LOGINFO *lin, bool bRedraw) CHARRANGE oldsel, sel, newsel; 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(); @@ -1368,7 +1368,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; } @@ -1460,7 +1460,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); } @@ -1468,7 +1468,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); } } -- cgit v1.2.3