]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/forty/canvas.cpp
Ops. wxUSE_XXX and wxUSE_STREAMS are separated again :-)
[wxWidgets.git] / samples / forty / canvas.cpp
index 7a5dfe401021914edda747c941195f6a7e639cc0..384d2bebbed510408edc32908a312b31b432c08e 100644 (file)
@@ -51,7 +51,6 @@ FortyCanvas::FortyCanvas(wxWindow* parent, int x, int y, int w, int h) :
        m_font = wxTheFontList->FindOrCreateFont(10, wxSWISS, wxNORMAL, wxNORMAL);
 #endif
        SetBackgroundColour(FortyApp::BackgroundColour());
        m_font = wxTheFontList->FindOrCreateFont(10, wxSWISS, wxNORMAL, wxNORMAL);
 #endif
        SetBackgroundColour(FortyApp::BackgroundColour());
-       AllowDoubleClick(true);
 
        m_handCursor = new wxCursor(wxCURSOR_HAND);
        m_arrowCursor = new wxCursor(wxCURSOR_ARROW);
 
        m_handCursor = new wxCursor(wxCURSOR_HAND);
        m_arrowCursor = new wxCursor(wxCURSOR_ARROW);
@@ -98,7 +97,7 @@ void FortyCanvas::OnDraw(wxDC& dc)
        // then ask the player for their name
        if (m_player.Length() == 0 && !m_playerDialog)
        {
        // then ask the player for their name
        if (m_player.Length() == 0 && !m_playerDialog)
        {
-               m_playerDialog = new PlayerSelectionDialog(this, m_scoreFile);
+               m_playerDialog = new PlayerSelectionDialog(this, m_scoreFile);
                m_playerDialog->ShowModal();
                m_player = m_playerDialog->GetPlayersName();
                if (m_player.Length() > 0)
                m_playerDialog->ShowModal();
                m_player = m_playerDialog->GetPlayersName();
                if (m_player.Length() > 0)
@@ -108,7 +107,7 @@ void FortyCanvas::OnDraw(wxDC& dc)
                        m_scoreFile->ReadPlayersScore(m_player, wins, games, score);
                        m_game->NewPlayer(wins, games, score);
                        m_game->DisplayScore(dc);
                        m_scoreFile->ReadPlayersScore(m_player, wins, games, score);
                        m_game->NewPlayer(wins, games, score);
                        m_game->DisplayScore(dc);
-                       delete m_playerDialog;
+                       m_playerDialog->Destroy();
                        m_playerDialog = 0;
                        Refresh();
                }
                        m_playerDialog = 0;
                        Refresh();
                }
@@ -123,13 +122,13 @@ void FortyCanvas::OnDraw(wxDC& dc)
 /*
 Called when the main frame is closed
 */
 /*
 Called when the main frame is closed
 */
-bool FortyCanvas::OnClose()
+bool FortyCanvas::OnCloseCanvas()
 {
        if (m_game->InPlay() &&
                wxMessageBox("Are you sure you want to\nabandon the current game?",
                        "Warning", wxYES_NO | wxICON_QUESTION) == wxNO)
        {
 {
        if (m_game->InPlay() &&
                wxMessageBox("Are you sure you want to\nabandon the current game?",
                        "Warning", wxYES_NO | wxICON_QUESTION) == wxNO)
        {
-               return FALSE;
+        return FALSE;
        }
        return TRUE;
 }
        }
        return TRUE;
 }