From 833a6790ad1f047706abedefa893b01918d0c8e3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 17 Apr 2000 00:01:16 +0000 Subject: [PATCH] 1. corrected some asserts/crashes in controls 2. added test for SetValue() in text git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7186 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/controls/controls.cpp | 12 ++++++++---- samples/text/text.cpp | 7 +++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index 1958ab30e0..b7c33521d1 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -917,9 +917,11 @@ void MyPanel::OnListBoxButtons( wxCommandEvent &event ) { int idx; idx = m_listbox->GetSelection(); - m_listbox->Delete( idx ); + if ( idx != wxNOT_FOUND ) + m_listbox->Delete( idx ); idx = m_listboxSorted->GetSelection(); - m_listboxSorted->Delete( idx ); + if ( idx != wxNOT_FOUND ) + m_listboxSorted->Delete( idx ); break; } case ID_LISTBOX_FONT: @@ -1000,9 +1002,11 @@ void MyPanel::OnChoiceButtons( wxCommandEvent &event ) case ID_CHOICE_DELETE: { int idx = m_choice->GetSelection(); - m_choice->Delete( idx ); + if ( idx != wxNOT_FOUND ) + m_choice->Delete( idx ); idx = m_choiceSorted->GetSelection(); - m_choiceSorted->Delete( idx ); + if ( idx != wxNOT_FOUND ) + m_choiceSorted->Delete( idx ); break; } case ID_CHOICE_FONT: diff --git a/samples/text/text.cpp b/samples/text/text.cpp index e67de81a3b..353da6b737 100644 --- a/samples/text/text.cpp +++ b/samples/text/text.cpp @@ -531,10 +531,13 @@ void MyTextCtrl::OnKeyDown(wxKeyEvent& event) WriteText("\n"); break; - default: - LogEvent( wxT("Key down"), event); + case WXK_F6: + SetValue("F6 was just pressed."); + break; } + LogEvent( wxT("Key down"), event); + event.Skip(); }