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())
|
while (lookup->GetNext())
|
||||||
pLookUpSelectList->Append(lookup->lookupCol);
|
pLookUpSelectList->Append(lookup->lookupCol);
|
||||||
|
|
||||||
// Highlight the first list item
|
|
||||||
pLookUpSelectList->SetSelection(0);
|
|
||||||
|
|
||||||
// Make the OK activate by pressing Enter
|
// Make the OK activate by pressing Enter
|
||||||
if (pLookUpSelectList->GetCount())
|
if (pLookUpSelectList->GetCount())
|
||||||
|
{
|
||||||
|
pLookUpSelectList->SetSelection(0);
|
||||||
pLookUpOkBtn->SetDefault();
|
pLookUpOkBtn->SetDefault();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pLookUpCancelBtn->SetDefault();
|
pLookUpCancelBtn->SetDefault();
|
||||||
@@ -380,12 +380,12 @@ ClookUpDlg::ClookUpDlg(wxWindow *parent, wxChar *windowTitle, wxChar *tableName,
|
|||||||
pLookUpSelectList->Append(s);
|
pLookUpSelectList->Append(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Highlight the first list item
|
|
||||||
pLookUpSelectList->SetSelection(0);
|
|
||||||
|
|
||||||
// Make the OK activate by pressing Enter
|
// Make the OK activate by pressing Enter
|
||||||
if (pLookUpSelectList->GetCount())
|
if (pLookUpSelectList->GetCount())
|
||||||
|
{
|
||||||
|
pLookUpSelectList->SetSelection(0);
|
||||||
pLookUpOkBtn->SetDefault();
|
pLookUpOkBtn->SetDefault();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pLookUpCancelBtn->SetDefault();
|
pLookUpCancelBtn->SetDefault();
|
||||||
|
Reference in New Issue
Block a user