X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3bb70c4026e31feb396b60a02c2a36dd5f63c3f0..a85585d595c8409fa5e51a28e60fa49428440d5e:/samples/widgets/textctrl.cpp diff --git a/samples/widgets/textctrl.cpp b/samples/widgets/textctrl.cpp index 6c52e64825..e744691027 100644 --- a/samples/widgets/textctrl.cpp +++ b/samples/widgets/textctrl.cpp @@ -200,6 +200,8 @@ protected: m_selFrom, m_selTo; + wxString m_range10_20; + private: // any class wishing to process wxWindows events must use this macro DECLARE_EVENT_TABLE() @@ -632,7 +634,12 @@ void TextWidgetsPage::OnIdle(wxIdleEvent& WXUNUSED(event)) if ( m_textRange ) { - m_textRange->SetValue(m_text->GetRange(10, 20)); + wxString range = m_text->GetRange(10, 20); + if ( range != m_range10_20 ) + { + m_range10_20 = range; + m_textRange->SetValue(range); + } } } @@ -735,7 +742,7 @@ void TextWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& event) (m_chkWrapLines->GetValue() != DEFAULTS.wraplines) ); } -void TextWidgetsPage::OnText(wxCommandEvent& event) +void TextWidgetsPage::OnText(wxCommandEvent& WXUNUSED(event)) { // small hack to suppress the very first message: by then the logging is // not yet redirected and so initial setting of the text value results in @@ -755,7 +762,7 @@ void TextWidgetsPage::OnTextEnter(wxCommandEvent& event) wxLogMessage(_T("Text entered: '%s'"), event.GetString().c_str()); } -void TextWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& event) +void TextWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) { CreateText(); }