diff options
author | George Hazan <ghazan@miranda.im> | 2021-05-15 23:01:52 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-05-15 23:01:52 +0300 |
commit | 615afbd839b22a7a170c477481ef67e5603b9709 (patch) | |
tree | 60e94f6264420b630edf11b424cea2e8beb9370d /src | |
parent | d58ff2a433bb441aef9c8f87de14cf27594baaf9 (diff) |
SetDraw(bool bEnable) - a wrapper for WM_SETREDRAW command
Diffstat (limited to 'src')
-rw-r--r-- | src/core/stdmsg/src/chat_window.cpp | 8 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 4 | ||||
-rw-r--r-- | src/core/stdmsg/src/msglog.cpp | 4 | ||||
-rw-r--r-- | src/mir_app/src/menu_options.cpp | 4 | ||||
-rw-r--r-- | src/mir_app/src/options.cpp | 4 | ||||
-rw-r--r-- | src/mir_core/src/CCtrlBase.cpp | 5 | ||||
-rw-r--r-- | src/mir_core/src/CDlgBase.cpp | 5 | ||||
-rw-r--r-- | src/mir_core/src/mir_core.def | 2 | ||||
-rw-r--r-- | src/mir_core/src/mir_core64.def | 2 |
9 files changed, 26 insertions, 12 deletions
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);
diff --git a/src/mir_app/src/menu_options.cpp b/src/mir_app/src/menu_options.cpp index 3d12ade011..897902a3c4 100644 --- a/src/mir_app/src/menu_options.cpp +++ b/src/mir_app/src/menu_options.cpp @@ -252,12 +252,12 @@ class CGenMenuOptionsPage : public CDlgBase if (bReread) // no need to reread database on reset MO_RecursiveWalkMenu(pmo->m_items.first, Menu_LoadFromDatabase, szModule); - m_menuItems.SendMsg(WM_SETREDRAW, FALSE, 0); + m_menuItems.SetDraw(false); m_menuItems.DeleteAllItems(); BuildTreeInternal(szModule, bReread, pmo->m_items.first, nullptr); - m_menuItems.SendMsg(WM_SETREDRAW, TRUE, 0); + m_menuItems.SetDraw(true); m_warning.Show(!pmo->m_bUseUserDefinedItems); m_menuItems.Enable(pmo->m_bUseUserDefinedItems); diff --git a/src/mir_app/src/options.cpp b/src/mir_app/src/options.cpp index be2c96b67b..d4c566acf1 100644 --- a/src/mir_app/src/options.cpp +++ b/src/mir_app/src/options.cpp @@ -540,7 +540,7 @@ class COptionsDlg : public CDlgBase _tcslwr_locale(m_szFilterString); //all strings are stored as lowercase ... make sure filter string is lowercase too
- m_pageTree.SendMsg(WM_SETREDRAW, FALSE, 0);
+ m_pageTree.SetDraw(false);
HWND oldWnd = nullptr;
HWND oldTab = nullptr;
@@ -651,7 +651,7 @@ class COptionsDlg : public CDlgBase m_keywordFilter.SendMsg(CB_SETEDITSEL, 0, oldSel); //but don't select any of the text
- m_pageTree.SendMsg(WM_SETREDRAW, TRUE, 0);
+ m_pageTree.SetDraw(true);
m_pageTree.EnsureVisible(m_hCurrentPage);
}
diff --git a/src/mir_core/src/CCtrlBase.cpp b/src/mir_core/src/CCtrlBase.cpp index 800e8c693d..aa684707e0 100644 --- a/src/mir_core/src/CCtrlBase.cpp +++ b/src/mir_core/src/CCtrlBase.cpp @@ -116,6 +116,11 @@ void CCtrlBase::SetTextA(const char *text) ::SetWindowTextA(m_hwnd, text); } +void CCtrlBase::SetDraw(bool bEnable) +{ + ::SendMessage(m_hwnd, WM_SETREDRAW, bEnable, 0); +} + void CCtrlBase::SetInt(int value) { wchar_t buf[32] = { 0 }; diff --git a/src/mir_core/src/CDlgBase.cpp b/src/mir_core/src/CDlgBase.cpp index bc051554de..f9f5f47a06 100644 --- a/src/mir_core/src/CDlgBase.cpp +++ b/src/mir_core/src/CDlgBase.cpp @@ -137,6 +137,11 @@ void CDlgBase::SetCaption(const wchar_t *ptszCaption) SetWindowText(m_hwnd, ptszCaption); } +void CDlgBase::SetDraw(bool bEnable) +{ + ::SendMessage(m_hwnd, WM_SETREDRAW, bEnable, 0); +} + void CDlgBase::Show(int nCmdShow) { if (m_hwnd == nullptr) diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def index 3702d84864..b823bc88f8 100644 --- a/src/mir_core/src/mir_core.def +++ b/src/mir_core/src/mir_core.def @@ -1505,3 +1505,5 @@ TimeZone_GetSystemTime @1692 ?SelectData@CCtrlCombo@@QAEHJ@Z @1728 NONAME
?SetCurSel@CCtrlListView@@QAEXH@Z @1729 NONAME
?GetCurData@CCtrlCombo@@QBEJXZ @1730 NONAME
+?SetDraw@CCtrlBase@@QAEX_N@Z @1731 NONAME
+?SetDraw@CDlgBase@@QAEX_N@Z @1732 NONAME
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def index ae7037fbdd..e4515d39d6 100644 --- a/src/mir_core/src/mir_core64.def +++ b/src/mir_core/src/mir_core64.def @@ -1505,3 +1505,5 @@ TimeZone_GetSystemTime @1692 ?SelectData@CCtrlCombo@@QEAAH_J@Z @1728 NONAME
?SetCurSel@CCtrlListView@@QEAAXH@Z @1729 NONAME
?GetCurData@CCtrlCombo@@QEBA_JXZ @1730 NONAME
+?SetDraw@CCtrlBase@@QEAAX_N@Z @1731 NONAME
+?SetDraw@CDlgBase@@QEAAX_N@Z @1732 NONAME
|