X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1484b5cc701329c54bbe70f2a155119fd86945c7..1e24d8f783d9f5d8429f3d8ccdab6fa767db69c5:/contrib/samples/ogl/ogledit/ogledit.cpp?ds=sidebyside diff --git a/contrib/samples/ogl/ogledit/ogledit.cpp b/contrib/samples/ogl/ogledit/ogledit.cpp index 13e3770ee9..c0c668408f 100644 --- a/contrib/samples/ogl/ogledit/ogledit.cpp +++ b/contrib/samples/ogl/ogledit/ogledit.cpp @@ -6,7 +6,7 @@ // Created: 12/07/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -72,7 +72,6 @@ bool MyApp::OnInit(void) //// Make a menubar wxMenu *file_menu = new wxMenu; - wxMenu *edit_menu = NULL; file_menu->Append(wxID_NEW, _T("&New...")); file_menu->Append(wxID_OPEN, _T("&Open...")); @@ -85,7 +84,7 @@ bool MyApp::OnInit(void) file_menu->Append(wxID_PRINT_SETUP, _T("Print &Setup...")); file_menu->Append(wxID_PREVIEW, _T("Print Pre&view")); - edit_menu = new wxMenu; + wxMenu *edit_menu = new wxMenu; edit_menu->Append(wxID_UNDO, _T("&Undo")); edit_menu->Append(wxID_REDO, _T("&Redo")); edit_menu->AppendSeparator(); @@ -119,12 +118,14 @@ bool MyApp::OnInit(void) //// Associate the menu bar with the frame frame->SetMenuBar(menu_bar); +#if wxUSE_STATUSBAR frame->CreateStatusBar(1); +#endif // wxUSE_STATUSBAR frame->Centre(wxBOTH); - frame->Show(TRUE); + frame->Show(true); - return TRUE; + return true; } int MyApp::OnExit(void) @@ -148,14 +149,14 @@ END_EVENT_TABLE() MyFrame::MyFrame(wxDocManager *manager, wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size, long type): - wxDocParentFrame(manager, frame, -1, title, pos, size, type) + wxDocParentFrame(manager, frame, wxID_ANY, title, pos, size, type) { canvas = NULL; palette = NULL; editMenu = NULL; } -void MyFrame::OnSize(wxSizeEvent& WXUNUSED(event)) +void MyFrame::OnSize(wxSizeEvent& event) { if (canvas && palette) { @@ -173,6 +174,7 @@ void MyFrame::OnSize(wxSizeEvent& WXUNUSED(event)) palette->SetSize(paletteX, paletteY, paletteW, paletteH); canvas->SetSize(canvasX, canvasY, canvasW, canvasH); } + event.Skip(); } void MyFrame::OnCloseWindow(wxCloseEvent& event) @@ -197,7 +199,7 @@ MyCanvas *MyFrame::CreateCanvas(wxView *view, wxFrame *parent) parent->GetClientSize(&width, &height); // Non-retained canvas - MyCanvas *canvas = new MyCanvas(view, parent, -1, wxPoint(0, 0), wxSize(width, height), 0); + MyCanvas *canvas = new MyCanvas(view, parent, wxID_ANY, wxPoint(0, 0), wxSize(width, height), 0); canvas->SetCursor(wxCursor(wxCURSOR_HAND)); // Give it scrollbars