git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5295
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// tool bar
wxBitmap tbBitmaps[3];
// tool bar
wxBitmap tbBitmaps[3];
tbBitmaps[0] = wxBITMAP(reset);
tbBitmaps[1] = wxBITMAP(play);
tbBitmaps[2] = wxBITMAP(stop);
tbBitmaps[0] = wxBITMAP(reset);
tbBitmaps[1] = wxBITMAP(play);
tbBitmaps[2] = wxBITMAP(stop);
{
int w = m_life->GetWidth();
int h = m_life->GetHeight();
{
int w = m_life->GetWidth();
int h = m_life->GetHeight();
// stop if it was running
OnStop();
// stop if it was running
OnStop();
LifeNewGameDialog dialog(this, &w, &h);
LifeNewGameDialog dialog(this, &w, &h);
- result = dialog.ShowModal();
+ if (dialog.ShowModal() == wxID_OK)
{
// check dimensions
if (w >= LIFE_MIN && w <= LIFE_MAX &&
{
// check dimensions
if (w >= LIFE_MIN && w <= LIFE_MAX &&
// stop if it was running
OnStop();
// stop if it was running
OnStop();
LifeSamplesDialog dialog(this);
// new game?
LifeSamplesDialog dialog(this);
// new game?
dc.BeginDrawing();
// draw cells
dc.BeginDrawing();
// draw cells
- for (int j = 0; j < m_life->GetWidth(); j++)
- for (int i = 0; i < m_life->GetHeight(); i++)
+ for (int j = 0; j < m_life->GetHeight(); j++)
+ for (int i = 0; i < m_life->GetWidth(); i++)
if (force || m_life->HasChanged(i, j))
DrawCell(i, j, dc);
if (force || m_life->HasChanged(i, j))
DrawCell(i, j, dc);
- // prompts and text controls
- wxString strw, strh;
- strw.Printf(_("%u"), *m_w);
- strh.Printf(_("%u"), *m_h);
- m_spinctrlw = new wxSpinCtrl( this, -1, strw );
- m_spinctrlh = new wxSpinCtrl( this, -1, strh );
+ // 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 );
// component layout
wxBoxSizer *inputsizer1 = new wxBoxSizer( wxHORIZONTAL );