]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/internat/internat.cpp
Correct the wxButton::Setlabel nonsense
[wxWidgets.git] / samples / internat / internat.cpp
index ef1bb025764e2e1ba3b6aaa77005c68579433287..ddb70fe5a7a80da7cf667ba20b88f1df7709f662 100644 (file)
 #include "wx/file.h"
 #include "wx/log.h"
 
+#ifdef __WXGTK__
+#include "mondrian.xpm"
+#endif
+
 // Define a new application type
 class MyApp: public wxApp
 {
 public:
-  MyApp();
-
   virtual bool OnInit();
 
 protected:
@@ -77,9 +79,12 @@ END_EVENT_TABLE()
 IMPLEMENT_APP(MyApp)
 
 
-MyApp::MyApp() : m_locale("french", "fr", "C")
+// `Main program' equivalent, creating windows and returning main app frame
+bool MyApp::OnInit(void)
 {
-  // catalogs we'll be using:
+  // Initialize the catalogs we'll be using
+  m_locale.Init("french", "fr", "C");
+
   /* not needed any more, done in wxLocale ctor
   m_locale.AddCatalog("wxstd");      // 1) for library messages
   */
@@ -89,20 +94,14 @@ MyApp::MyApp() : m_locale("french", "fr", "C")
      or comment out this line then */
   m_locale.AddCatalog("fileutils");  // 3) and another just for testing
   
-}
-
-// `Main program' equivalent, creating windows and returning main app frame
-bool MyApp::OnInit(void)
-{
   // Create the main frame window
   MyFrame *frame = new MyFrame(NULL, _("Minimal wxWindows App"), 50, 50, 150, 40);
 
   // Give it an icon
 #ifdef __WXMSW__
   frame->SetIcon(wxIcon("mondrian"));
-#endif
-#ifdef __X__
-  frame->SetIcon(wxIcon("aiai.xbm"));
+#else
+  frame->SetIcon(wxIcon(mondrian_xpm));
 #endif
 
   // Make a menubar
@@ -133,18 +132,18 @@ MyFrame::MyFrame(wxFrame *frame, const char *title, int x, int y, int w, int h)
 {
 }
 
-void MyFrame::OnQuit(wxCommandEvent& event)
+void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) )
 {
   Close(TRUE);
 }
 
-void MyFrame::OnAbout(wxCommandEvent& event)
+void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
 {
   wxMessageDialog(this, _("I18n sample\n© Vadim Zeitlin & Julian Smart"),
                   _("About Internat"), wxOK | wxICON_INFORMATION).ShowModal();
 }
 
-void MyFrame::OnPlay(wxCommandEvent& event)
+void MyFrame::OnPlay(wxCommandEvent& WXUNUSED(event))
 {
   wxString str = wxGetTextFromUser(_("Enter your number:"),
                                    _("Try to guess my number!"),
@@ -172,4 +171,4 @@ void MyFrame::OnOpen(wxCommandEvent&)
   // open a bogus file -- the error message should be also translated if you've
   // got wxstd.mo somewhere in the search path
   wxFile file("NOTEXIST.ING");
-}
\ No newline at end of file
+}