-// --------------------------------------------------------------------------
-// LifeNewGameDialog
-// --------------------------------------------------------------------------
-
-LifeNewGameDialog::LifeNewGameDialog(wxWindow *parent, int *w, int *h)
- : wxDialog(parent, -1,
- _("New game"),
- wxDefaultPosition,
- wxDefaultSize,
- wxDEFAULT_DIALOG_STYLE | wxDIALOG_MODAL)
-{
- m_w = w;
- m_h = h;
-
- // spin ctrls
- m_spinctrlw = new wxSpinCtrl( this, -1 );
- m_spinctrlw->SetValue(*m_w);
- m_spinctrlw->SetRange(LIFE_MIN, LIFE_MAX);
-
- m_spinctrlh = new wxSpinCtrl( this, -1 );
- m_spinctrlh->SetValue(*m_h);
- m_spinctrlh->SetRange(LIFE_MIN, LIFE_MAX);
-
- // component layout
- wxBoxSizer *inputsizer1 = new wxBoxSizer( wxHORIZONTAL );
- inputsizer1->Add( new wxStaticText(this, -1, _("Width")), 1, wxCENTRE | wxLEFT, 20);
- inputsizer1->Add( m_spinctrlw, 2, wxCENTRE | wxLEFT | wxRIGHT, 20 );
-
- wxBoxSizer *inputsizer2 = new wxBoxSizer( wxHORIZONTAL );
- inputsizer2->Add( new wxStaticText(this, -1, _("Height")), 1, wxCENTRE | wxLEFT, 20);
- inputsizer2->Add( m_spinctrlh, 2, wxCENTRE | wxLEFT | wxRIGHT, 20 );
-
- wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
- topsizer->Add( CreateTextSizer(_("Enter board dimensions")), 0, wxALL, 10 );
- topsizer->Add( new wxStaticLine(this, -1), 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 10);
- topsizer->Add( inputsizer1, 1, wxGROW | wxLEFT | wxRIGHT, 5 );
- topsizer->Add( inputsizer2, 1, wxGROW | wxLEFT | wxRIGHT, 5 );
- topsizer->Add( new wxStaticLine(this, -1), 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 10);
- topsizer->Add( CreateButtonSizer(wxOK | wxCANCEL), 0, wxCENTRE | wxALL, 10);
-
- // activate
- SetSizer(topsizer);
- SetAutoLayout(TRUE);
- topsizer->SetSizeHints(this);
- topsizer->Fit(this);
- Centre(wxBOTH);
-}
-
-void LifeNewGameDialog::OnOK(wxCommandEvent& WXUNUSED(event))
-{
- *m_w = m_spinctrlw->GetValue();
- *m_h = m_spinctrlh->GetValue();
-
- EndModal(wxID_OK);
-}
-