]> git.saurik.com Git - wxWidgets.git/blobdiff - demos/bombs/bombs1.cpp
removed src/gtk/eggtrayicon.h
[wxWidgets.git] / demos / bombs / bombs1.cpp
index cb1a9cc99560c16ee1aa3dfa41c3e96813dc2738..aa4bb3ced3c782e8dbf244642d8c6e534636ed7b 100644 (file)
@@ -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
 }
 
@@ -340,6 +345,10 @@ void BombsCanvas::OnChar(wxKeyEvent& event)
     if ((prevGridFocusX != m_game->m_gridFocusX)
         || (prevGridFocusY != m_game->m_gridFocusY))
     {
+        // cause focused field to be visible after first key hit after launching new game
+        if( m_game->m_gridFocusX < 0 ) m_game->m_gridFocusX = 0;
+        if( m_game->m_gridFocusY < 0 ) m_game->m_gridFocusY = 0;
+
         // refresh previous field and focused field
         RefreshField(prevGridFocusX, prevGridFocusY,
             prevGridFocusX, prevGridFocusY);