]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/forty/scoredg.cpp
clipboards tests
[wxWidgets.git] / samples / forty / scoredg.cpp
index 58f8da8a1b30dc31f305b7986e792731f9cca410..de7d7a6a09d1b496a6e23b1915e5ac5ac9c28c22 100644 (file)
 #include "wx/wx.h"
 #endif
 
-#if defined(__WXMSW__) && !defined(GNUWIN32)
+#if wxUSE_IOSTREAMH
+#if defined(__WXMSW__) && !defined(__GNUWIN32__)
 #include <strstrea.h>
 #else
 #include <strstream.h>
 #endif
+#else
+#include <strstream>
+using namespace std;
+#endif
 #include "scorefil.h"
 #include "scoredg.h"
 
@@ -91,7 +96,7 @@ ScoreCanvas::~ScoreCanvas()
 
 void ScoreCanvas::OnDraw(wxDC& dc)
 {
-       dc.SetFont(m_font);
+       dc.SetFont(m_font);
 
        const char* str = m_text;
        unsigned int tab = 0;
@@ -132,6 +137,9 @@ void ScoreCanvas::OnDraw(wxDC& dc)
        }
 }
 
+BEGIN_EVENT_TABLE(ScoreDialog, wxDialog)
+    EVT_CLOSE(ScoreDialog::OnCloseWindow)
+END_EVENT_TABLE()
 
 ScoreDialog::ScoreDialog(
                                                        wxWindow* parent,
@@ -178,10 +186,7 @@ void ScoreDialog::Display()
        Show(TRUE);
 }
 
-bool ScoreDialog::OnClose()
+void ScoreDialog::OnCloseWindow(wxCloseEvent& event)
 {
-       // hide the dialog
-       // NB don't return TRUE otherwise delete is called
-       Show(FALSE);
-       return FALSE;
+    EndModal(wxID_OK);
 }