From: Vadim Zeitlin Date: Sat, 12 Jun 2010 21:26:41 +0000 (+0000) Subject: Fix scrolling to the bottom in wxTextCtrl::AppendText(). X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/427861bde09badef1a2950ad799e69fac6b4a48a Fix scrolling to the bottom in wxTextCtrl::AppendText(). The old code used EM_LINESCROLL which could scroll too far if the caret wasn't in the first line of the control. Instead of trying to compute the correct number of the lines to scroll, just use WM_VSCROLL with SB_BOTTOM parameter instead. Closes #12123. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64571 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index d9376ed756..c2417d2cc4 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -1193,9 +1193,7 @@ void wxTextCtrl::AppendText(const wxString& text) // don't do this if we're frozen, saves some time if ( !IsFrozen() && IsMultiLine() && GetRichVersion() > 1 ) { - // setting the caret to the end and showing it simply doesn't work for - // RichEdit 2.0 -- force it to still do what we want - ::SendMessage(GetHwnd(), EM_LINESCROLL, 0, GetNumberOfLines()); + ::SendMessage(GetHwnd(), WM_VSCROLL, SB_BOTTOM, NULL); } #endif // wxUSE_RICHEDIT }