]> git.saurik.com Git - wxWidgets.git/blobdiff - demos/forty/playerdg.cpp
Tcl regex lib
[wxWidgets.git] / demos / forty / playerdg.cpp
index 0f646e2e328c232e9ed56eaf74cc8e3d2734772e..674758143b9697be9130980cca731b6a39502adb 100644 (file)
@@ -52,7 +52,7 @@ PlayerSelectionDialog::PlayerSelectionDialog(
        // enable constraints
        SetAutoLayout (TRUE);
 
        // 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,
 
        wxListBox* list = new wxListBox(
                                                this, ID_LISTBOX,
@@ -116,12 +116,14 @@ PlayerSelectionDialog::PlayerSelectionDialog(
        list->SetConstraints(layout);
 
        wxString prevPlayer = m_scoreFile->GetPreviousPlayer();
        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);
        }
 
        {
                list->SetStringSelection(prevPlayer);
                m_textField->SetValue(prevPlayer);
        }
 
+    m_textField->SetFocus();
+
        Layout();
     
     CentreOnParent();
        Layout();
     
     CentreOnParent();