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
This commit is contained in:
Vadim Zeitlin 2010-06-12 21:26:41 +00:00
parent c70da1a243
commit 427861bde0

View File

@ -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
}