X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c67daf87774c71ae9f73af9969008af220e52a11..d7dbc98ae97946a3d91e6653527fc72276d83712:/samples/layout/layout.cpp diff --git a/samples/layout/layout.cpp b/samples/layout/layout.cpp index 31229f5a88..23209958d2 100644 --- a/samples/layout/layout.cpp +++ b/samples/layout/layout.cpp @@ -20,8 +20,8 @@ #include "wx/wx.h" #endif -#if !USE_CONSTRAINTS -#error You must set USE_CONSTRAINTS to 1 in wx_setup.h! +#if !wxUSE_CONSTRAINTS +#error You must set wxUSE_CONSTRAINTS to 1 in setup.h! #endif #include @@ -171,8 +171,8 @@ END_EVENT_TABLE() void MyFrame::LoadFile(wxCommandEvent& WXUNUSED(event) ) { - char *s = wxFileSelector("Load text file", (const char *) NULL, (const char *) NULL, (const char *) NULL, "*.txt"); - if (s) + wxString s = wxFileSelector("Load text file", (const char *) NULL, (const char *) NULL, (const char *) NULL, "*.txt"); + if (s != "") { #ifdef __WXMSW__ frame->text_window->LoadFile(s); @@ -205,12 +205,12 @@ void MyFrame::OnSize(wxSizeEvent& WXUNUSED(event) ) void MyFrame::Draw(wxDC& dc, bool WXUNUSED(draw_bitmaps) ) { - dc.SetPen(wxGREEN_PEN); + dc.SetPen(* wxGREEN_PEN); dc.DrawLine(0, 0, 200, 200); dc.DrawLine(200, 0, 0, 200); - dc.SetBrush(wxCYAN_BRUSH); - dc.SetPen(wxRED_PEN); + dc.SetBrush(* wxCYAN_BRUSH); + dc.SetPen(* wxRED_PEN); dc.DrawRectangle(100, 100, 100, 50); dc.DrawRoundedRectangle(150, 150, 100, 50, 20); @@ -219,7 +219,7 @@ void MyFrame::Draw(wxDC& dc, bool WXUNUSED(draw_bitmaps) ) dc.DrawSpline(50, 200, 50, 100, 200, 10); dc.DrawLine(50, 230, 200, 230); - dc.SetPen(wxBLACK_PEN); + dc.SetPen(* wxBLACK_PEN); dc.DrawArc(50, 300, 100, 250, 100, 300 ); } @@ -244,14 +244,6 @@ void MyWindow::OnPaint(wxPaintEvent& WXUNUSED(event) ) frame->Draw(dc,TRUE); } -// Define the behaviour for the frame closing -// - must delete all frames except for the main one. -bool MyFrame::OnClose(void) -{ - Show(FALSE); - - return TRUE; -} SizerFrame::SizerFrame(wxFrame *frame, char *title, int x, int y, int w, int h): wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h)) @@ -346,10 +338,3 @@ void SizerFrame::OnSize(wxSizeEvent& event) panel->Layout(); } -bool SizerFrame::OnClose(void) -{ - Show(FALSE); - - return TRUE; -} -