X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/82ea63e6e046652bc0799badd9d62f91c9918dbe..830efc9b0cb87eae22d4435af7858175017522ab:/demos/forty/playerdg.cpp?ds=sidebyside diff --git a/demos/forty/playerdg.cpp b/demos/forty/playerdg.cpp index 0f646e2e32..674758143b 100644 --- a/demos/forty/playerdg.cpp +++ b/demos/forty/playerdg.cpp @@ -52,7 +52,7 @@ PlayerSelectionDialog::PlayerSelectionDialog( // enable constraints SetAutoLayout (TRUE); - wxStaticText* msg = new wxStaticText(this, -1, "Please select a name from the list"); + wxStaticText* msg = new wxStaticText(this, -1, "Please select a name or type a new one:"); wxListBox* list = new wxListBox( this, ID_LISTBOX, @@ -116,12 +116,14 @@ PlayerSelectionDialog::PlayerSelectionDialog( list->SetConstraints(layout); wxString prevPlayer = m_scoreFile->GetPreviousPlayer(); - if (prevPlayer.Length() > 0) + if ((prevPlayer.Length() > 0) && (list->FindString(prevPlayer) != -1)) { list->SetStringSelection(prevPlayer); m_textField->SetValue(prevPlayer); } + m_textField->SetFocus(); + Layout(); CentreOnParent();