X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b29903d4854625650ae678c0515acc76facba1ee..6ba5438dda164146bf36ca729f8328332fae36b7:/samples/listbox/lboxtest.cpp diff --git a/samples/listbox/lboxtest.cpp b/samples/listbox/lboxtest.cpp index 170ac91014..8f92c1920a 100644 --- a/samples/listbox/lboxtest.cpp +++ b/samples/listbox/lboxtest.cpp @@ -20,11 +20,6 @@ // declarations // ============================================================================ -#ifdef __GNUG__ - #pragma implementation "lboxtest.cpp" - #pragma interface "lboxtest.cpp" -#endif - // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- @@ -526,6 +521,7 @@ void LboxTestFrame::Reset() void LboxTestFrame::CreateLbox() { + wxWindow *parent = m_lbox->GetParent(); int flags = 0; switch ( m_radioSelMode->GetSelection() ) { @@ -545,19 +541,16 @@ void LboxTestFrame::CreateLbox() flags |= wxLB_SORT; wxArrayString items; - if ( m_lbox ) + int count = m_lbox->GetCount(); + for ( int n = 0; n < count; n++ ) { - int count = m_lbox->GetCount(); - for ( int n = 0; n < count; n++ ) - { - items.Add(m_lbox->GetString(n)); - } - - m_sizerLbox->Detach(m_lbox); - delete m_lbox; + items.Add(m_lbox->GetString(n)); } - m_lbox = new wxListBox(this, wxID_ANY, + m_sizerLbox->Detach(m_lbox); + delete m_lbox; + + m_lbox = new wxListBox(parent, LboxTest_Listbox, wxDefaultPosition, wxDefaultSize, 0, NULL, flags);