From 0d45559975329d03017c4f181908134bc69a7363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83t=C4=83lin=20R=C4=83ceanu?= Date: Mon, 31 Aug 2015 21:08:34 +0300 Subject: [PATCH] Append log messages to the end of the text in the toolbar sample This ensures that the messages always appear in the correct order, even if the user clicked somewhere in the middle of the control -- which would previously result in inserting the next message at the cursor position, not the end. --- samples/toolbar/toolbar.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/toolbar/toolbar.cpp b/samples/toolbar/toolbar.cpp index 6464a9fe41..e9a0d04514 100644 --- a/samples/toolbar/toolbar.cpp +++ b/samples/toolbar/toolbar.cpp @@ -813,9 +813,9 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& event) { if ( event.IsChecked() ) - m_textWindow->WriteText( wxT("Help button down now.\n") ); + m_textWindow->AppendText( wxT("Help button down now.\n") ); else - m_textWindow->WriteText( wxT("Help button up now.\n") ); + m_textWindow->AppendText( wxT("Help button up now.\n") ); (void)wxMessageBox(wxT("wxWidgets toolbar sample"), wxT("About wxToolBar")); } @@ -824,7 +824,7 @@ void MyFrame::OnToolLeftClick(wxCommandEvent& event) { wxString str; str.Printf( wxT("Clicked on tool %d\n"), event.GetId()); - m_textWindow->WriteText( str ); + m_textWindow->AppendText( str ); if (event.GetId() == wxID_COPY) { @@ -998,7 +998,7 @@ void MyFrame::OnToolDropdown(wxCommandEvent& event) { wxString str; str.Printf( wxT("Dropdown on tool %d\n"), event.GetId()); - m_textWindow->WriteText( str ); + m_textWindow->AppendText( str ); event.Skip(); }