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
This commit is contained in:
Vadim Zeitlin
2000-04-17 00:01:16 +00:00
parent 59d3027c0c
commit 833a6790ad
2 changed files with 13 additions and 6 deletions

View File

@@ -917,8 +917,10 @@ void MyPanel::OnListBoxButtons( wxCommandEvent &event )
{ {
int idx; int idx;
idx = m_listbox->GetSelection(); idx = m_listbox->GetSelection();
if ( idx != wxNOT_FOUND )
m_listbox->Delete( idx ); m_listbox->Delete( idx );
idx = m_listboxSorted->GetSelection(); idx = m_listboxSorted->GetSelection();
if ( idx != wxNOT_FOUND )
m_listboxSorted->Delete( idx ); m_listboxSorted->Delete( idx );
break; break;
} }
@@ -1000,8 +1002,10 @@ void MyPanel::OnChoiceButtons( wxCommandEvent &event )
case ID_CHOICE_DELETE: case ID_CHOICE_DELETE:
{ {
int idx = m_choice->GetSelection(); int idx = m_choice->GetSelection();
if ( idx != wxNOT_FOUND )
m_choice->Delete( idx ); m_choice->Delete( idx );
idx = m_choiceSorted->GetSelection(); idx = m_choiceSorted->GetSelection();
if ( idx != wxNOT_FOUND )
m_choiceSorted->Delete( idx ); m_choiceSorted->Delete( idx );
break; break;
} }

View File

@@ -531,10 +531,13 @@ void MyTextCtrl::OnKeyDown(wxKeyEvent& event)
WriteText("\n"); WriteText("\n");
break; break;
default: case WXK_F6:
LogEvent( wxT("Key down"), event); SetValue("F6 was just pressed.");
break;
} }
LogEvent( wxT("Key down"), event);
event.Skip(); event.Skip();
} }