]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/xrc/xrcdemo.cpp
don't try to remove -g flag from CFLAGS, it is not necessary and doesn't work correct...
[wxWidgets.git] / samples / xrc / xrcdemo.cpp
index 7faaa1cda66abcc9733deb16eff72fa670bb013a..ba5e147e43995ad4ab7b5e004d029a500a33c5e9 100644 (file)
@@ -39,7 +39,7 @@
 // resources
 // ----------------------------------------------------------------------------
 // the application icon
-#if defined(__WXGTK__) || defined(__WXMOTIF__)
+#if defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__)
     #include "rc/appicon.xpm"
 #endif
 
@@ -86,10 +86,10 @@ private:
 // handlers) which process them. It can be also done at run-time, but for the
 // simple menu events like this the static method is much simpler.
 BEGIN_EVENT_TABLE(MyFrame, wxFrame)
-    EVT_MENU(XMLID("menu_quit"),  MyFrame::OnQuit)
-    EVT_MENU(XMLID("menu_about"), MyFrame::OnAbout)
-    EVT_MENU(XMLID("menu_dlg1"), MyFrame::OnDlg1)
-    EVT_MENU(XMLID("menu_dlg2"), MyFrame::OnDlg2)
+    EVT_MENU(XRCID("menu_quit"),  MyFrame::OnQuit)
+    EVT_MENU(XRCID("menu_about"), MyFrame::OnAbout)
+    EVT_MENU(XRCID("menu_dlg1"), MyFrame::OnDlg1)
+    EVT_MENU(XRCID("menu_dlg2"), MyFrame::OnDlg2)
 END_EVENT_TABLE()
 
 // Create a new application object: this macro will allow wxWindows to create
@@ -111,8 +111,8 @@ IMPLEMENT_APP(MyApp)
 bool MyApp::OnInit()
 {
     wxImage::AddHandler(new wxGIFHandler);
-    wxTheXmlResource->InitAllHandlers();
-    wxTheXmlResource->Load("rc/resource.xrc");
+    wxXmlResource::Get()->InitAllHandlers();
+    wxXmlResource::Get()->Load("rc/resource.xrc");
 
     MyFrame *frame = new MyFrame("XML resources demo",
                                  wxPoint(50, 50), wxSize(450, 340));
@@ -130,8 +130,8 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
 {
     SetIcon(wxICON(appicon));
 
-    SetMenuBar(wxTheXmlResource->LoadMenuBar("mainmenu"));
-    SetToolBar(wxTheXmlResource->LoadToolBar(this, "toolbar"));
+    SetMenuBar(wxXmlResource::Get()->LoadMenuBar("mainmenu"));
+    SetToolBar(wxXmlResource::Get()->LoadToolBar(this, "toolbar"));
 }
 
 
@@ -155,7 +155,7 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
 void MyFrame::OnDlg1(wxCommandEvent& WXUNUSED(event))
 {
     wxDialog dlg;
-    wxTheXmlResource->LoadDialog(&dlg, this, "dlg1");
+    wxXmlResource::Get()->LoadDialog(&dlg, this, "dlg1");
     dlg.ShowModal();
 }
 
@@ -163,6 +163,6 @@ void MyFrame::OnDlg1(wxCommandEvent& WXUNUSED(event))
 void MyFrame::OnDlg2(wxCommandEvent& WXUNUSED(event))
 {
     wxDialog dlg;
-    wxTheXmlResource->LoadDialog(&dlg, this, "dlg2");
+    wxXmlResource::Get()->LoadDialog(&dlg, this, "dlg2");
     dlg.ShowModal();
 }