X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cb43b372fb1567caf7ccfa523aca10c676ceaec4..d7928388eb193d4fece79ccecf4b61bbb9344b3b:/samples/forty/scoredg.cpp diff --git a/samples/forty/scoredg.cpp b/samples/forty/scoredg.cpp index 58f8da8a1b..136fff7021 100644 --- a/samples/forty/scoredg.cpp +++ b/samples/forty/scoredg.cpp @@ -27,11 +27,16 @@ #include "wx/wx.h" #endif -#if defined(__WXMSW__) && !defined(GNUWIN32) +#if wxUSE_IOSTREAMH +#if defined(__WXMSW__) && !defined(__GNUWIN32__) && !defined(__MWERKS__) #include #else #include #endif +#else +#include +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); }