X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/72383a729f0b68e6527f9652d87fa98b20379724..7d88f0992a44be278c9ba743f997375b21a28fe3:/samples/widgets/textctrl.cpp diff --git a/samples/widgets/textctrl.cpp b/samples/widgets/textctrl.cpp index 9fc4ead7eb..e744691027 100644 --- a/samples/widgets/textctrl.cpp +++ b/samples/widgets/textctrl.cpp @@ -29,6 +29,7 @@ #include "wx/log.h" #include "wx/timer.h" + #include "wx/bitmap.h" #include "wx/button.h" #include "wx/checkbox.h" #include "wx/radiobox.h" @@ -199,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() @@ -542,7 +545,7 @@ void TextWidgetsPage::CreateText() { valueOld = m_text->GetValue(); - m_sizerText->Remove(m_text); + m_sizerText->Detach( m_text ); delete m_text; } else @@ -631,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); + } } } @@ -734,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 @@ -754,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(); }