X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/70d26c3f4ffb24d50457d405c9595fd23f9e5b7c..90aaa86507f004720d761a737478a99c19689078:/demos/forty/playerdg.cpp?ds=inline diff --git a/demos/forty/playerdg.cpp b/demos/forty/playerdg.cpp index fa3ea03d04..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,13 +116,17 @@ 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(); } PlayerSelectionDialog::~PlayerSelectionDialog()