X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/23290a8c8fac977fba004f9a614142e0521d05db..8ddd9176a46065ab74d6ced1ed480e5affb4e1e2:/demos/bombs/bombs1.cpp diff --git a/demos/bombs/bombs1.cpp b/demos/bombs/bombs1.cpp index 9853fa7fff..e6daa25607 100644 --- a/demos/bombs/bombs1.cpp +++ b/demos/bombs/bombs1.cpp @@ -66,7 +66,7 @@ void BombsCanvas::DrawField(wxDC *dc, int xc1, int yc1, int xc2, int yc2) wxFont font= BOMBS_FONT; - dc->SetFont(font); + dc->SetFont(font); for(x=xc1; x<=xc2; x++) for(y=yc1; y<=yc2; y++) @@ -153,7 +153,7 @@ void BombsCanvas::DrawField(wxDC *dc, int xc1, int yc1, int xc2, int yc2) buf = wxT("0"); dc->SetTextForeground(wxGreen); break; - case 1: + case 1: buf = wxT("1"); dc->SetTextForeground(wxBlue); break; @@ -171,9 +171,14 @@ void BombsCanvas::DrawField(wxDC *dc, int xc1, int yc1, int xc2, int yc2) } dc->SetFont(wxNullFont); -#if wxUSE_LOG - wxLogStatus(wxT("%d bombs %d remaining cells"), + wxString msg; + msg.Printf(wxT("%d bombs %d remaining cells"), m_game->GetNumBombs(), m_game->GetNumRemainingCells() ); + +#if wxUSE_LOG && wxUSE_STATUSBAR + wxLogStatus(msg); +#else + this->GetParent()->SetTitle(msg); #endif } @@ -258,7 +263,7 @@ void BombsCanvas::OnMouseEvent(wxMouseEvent& event) if ( (event.RightDown() || (event.LeftDown() && event.ShiftDown())) && (m_game->IsHidden(x,y) || !m_game->GetNumRemainingCells() ) ) - { + { // store previous and current field int prevFocusX = m_game->m_gridFocusX; int prevFocusY = m_game->m_gridFocusY;