]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/samples/ogl/ogledit/ogledit.cpp
Avoid warnings from mgl headers if possible.
[wxWidgets.git] / contrib / samples / ogl / ogledit / ogledit.cpp
index b69f7dece33ea47d8b4847b2c4782c316c106cb5..aeaaf1af969ab9055a986adc922d6249e4d6c71d 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     12/07/98
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
 // Created:     12/07/98
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
-// Licence:    wxWindows licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #ifdef __GNUG__
 /////////////////////////////////////////////////////////////////////////////
 
 #ifdef __GNUG__
@@ -52,7 +52,7 @@ MyApp::MyApp(void)
 bool MyApp::OnInit(void)
 {
   wxOGLInitialize();
 bool MyApp::OnInit(void)
 {
   wxOGLInitialize();
-  
+
   //// Create a document manager
   myDocManager = new wxDocManager;
 
   //// Create a document manager
   myDocManager = new wxDocManager;
 
@@ -88,13 +88,13 @@ bool MyApp::OnInit(void)
   edit_menu->Append(wxID_UNDO, _T("&Undo"));
   edit_menu->Append(wxID_REDO, _T("&Redo"));
   edit_menu->AppendSeparator();
   edit_menu->Append(wxID_UNDO, _T("&Undo"));
   edit_menu->Append(wxID_REDO, _T("&Redo"));
   edit_menu->AppendSeparator();
-  edit_menu->Append(OGLEDIT_CUT, _T("&Cut"));
+  edit_menu->Append(wxID_CUT, _T("&Cut"));
   edit_menu->AppendSeparator();
   edit_menu->Append(OGLEDIT_CHANGE_BACKGROUND_COLOUR, _T("Change &background colour"));
   edit_menu->Append(OGLEDIT_EDIT_LABEL, _T("Edit &label"));
 
   frame->editMenu = edit_menu;
   edit_menu->AppendSeparator();
   edit_menu->Append(OGLEDIT_CHANGE_BACKGROUND_COLOUR, _T("Change &background colour"));
   edit_menu->Append(OGLEDIT_EDIT_LABEL, _T("Edit &label"));
 
   frame->editMenu = edit_menu;
-  
+
   file_menu->AppendSeparator();
   file_menu->Append(wxID_EXIT, _T("E&xit"));
 
   file_menu->AppendSeparator();
   file_menu->Append(wxID_EXIT, _T("E&xit"));
 
@@ -118,12 +118,14 @@ bool MyApp::OnInit(void)
   //// Associate the menu bar with the frame
   frame->SetMenuBar(menu_bar);
 
   //// Associate the menu bar with the frame
   frame->SetMenuBar(menu_bar);
 
+#if wxUSE_STATUSBAR
   frame->CreateStatusBar(1);
   frame->CreateStatusBar(1);
+#endif // wxUSE_STATUSBAR
 
   frame->Centre(wxBOTH);
 
   frame->Centre(wxBOTH);
-  frame->Show(TRUE);
+  frame->Show(true);
 
 
-  return TRUE;
+  return true;
 }
 
 int MyApp::OnExit(void)
 }
 
 int MyApp::OnExit(void)
@@ -147,7 +149,7 @@ END_EVENT_TABLE()
 
 MyFrame::MyFrame(wxDocManager *manager, wxFrame *frame, const wxString& title,
     const wxPoint& pos, const wxSize& size, long type):
 
 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;
 {
   canvas = NULL;
   palette = NULL;
@@ -168,7 +170,7 @@ void MyFrame::OnSize(wxSizeEvent& event)
     int canvasY = 0;
     int canvasW = cw - paletteW;
     int canvasH = ch;
     int canvasY = 0;
     int canvasW = cw - paletteW;
     int canvasH = ch;
-    
+
     palette->SetSize(paletteX, paletteY, paletteW, paletteH);
     canvas->SetSize(canvasX, canvasY, canvasW, canvasH);
   }
     palette->SetSize(paletteX, paletteY, paletteW, paletteH);
     canvas->SetSize(canvasX, canvasY, canvasW, canvasH);
   }
@@ -197,7 +199,7 @@ MyCanvas *MyFrame::CreateCanvas(wxView *view, wxFrame *parent)
   parent->GetClientSize(&width, &height);
 
   // Non-retained canvas
   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
   canvas->SetCursor(wxCursor(wxCURSOR_HAND));
 
   // Give it scrollbars