]> git.saurik.com Git - wxWidgets.git/blobdiff - demos/forty/playerdg.cpp
Added explicit Unicode conversion to wxDir - the
[wxWidgets.git] / demos / forty / playerdg.cpp
index fa3ea03d046635a980e8bb183a87e0f594a8fe4c..674758143b9697be9130980cca731b6a39502adb 100644 (file)
@@ -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()