// 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,
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()