Fixed assert warning if the listbox has no elements, we shouldn't try to set the selection to the first line
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27225 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -220,12 +220,12 @@ ClookUpDlg::ClookUpDlg(wxWindow *parent, wxChar *windowTitle, wxChar *tableName,
|
||||
while (lookup->GetNext())
|
||||
pLookUpSelectList->Append(lookup->lookupCol);
|
||||
|
||||
// Highlight the first list item
|
||||
pLookUpSelectList->SetSelection(0);
|
||||
|
||||
// Make the OK activate by pressing Enter
|
||||
if (pLookUpSelectList->GetCount())
|
||||
{
|
||||
pLookUpSelectList->SetSelection(0);
|
||||
pLookUpOkBtn->SetDefault();
|
||||
}
|
||||
else
|
||||
{
|
||||
pLookUpCancelBtn->SetDefault();
|
||||
@@ -380,12 +380,12 @@ ClookUpDlg::ClookUpDlg(wxWindow *parent, wxChar *windowTitle, wxChar *tableName,
|
||||
pLookUpSelectList->Append(s);
|
||||
}
|
||||
|
||||
// Highlight the first list item
|
||||
pLookUpSelectList->SetSelection(0);
|
||||
|
||||
// Make the OK activate by pressing Enter
|
||||
if (pLookUpSelectList->GetCount())
|
||||
{
|
||||
pLookUpSelectList->SetSelection(0);
|
||||
pLookUpOkBtn->SetDefault();
|
||||
}
|
||||
else
|
||||
{
|
||||
pLookUpCancelBtn->SetDefault();
|
||||
|
Reference in New Issue
Block a user