wxPoint(0, 250), wxSize(100, 50), wxTE_MULTILINE);
m_text->SetBackgroundColour(wxT("wheat"));
- if ( 0 )
- wxLog::AddTraceMask(_T("focus"));
m_logTargetOld = wxLog::SetActiveTarget(new wxLogTextCtrl(m_text));
m_notebook = new wxNotebook(this, ID_NOTEBOOK);
}
case ID_LISTBOX_SEL_NUM:
{
- m_listbox->SetSelection( 2 );
- m_listboxSorted->SetSelection( 2 );
+ if (m_listbox->GetCount() > 2)
+ m_listbox->SetSelection( 2 );
+ if (m_listboxSorted->GetCount() > 2)
+ m_listboxSorted->SetSelection( 2 );
m_lbSelectThis->WarpPointer( 40, 14 );
break;
}
case ID_LISTBOX_SEL_STR:
{
- m_listbox->SetStringSelection( _T("This") );
- m_listboxSorted->SetStringSelection( _T("This") );
+ if (m_listbox->FindString(_T("This")) > -1)
+ m_listbox->SetStringSelection( _T("This") );
+ if (m_listboxSorted->FindString(_T("This")) > -1)
+ m_listboxSorted->SetStringSelection( _T("This") );
m_lbSelectNum->WarpPointer( 40, 14 );
break;
}