]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/internat/internat.cpp
supporting SetFont(wxNullFont), fixes #10980
[wxWidgets.git] / samples / internat / internat.cpp
index 1647630af4d4ba16df080c771572bc972d52cae8..cc00ea8e0351a03965c4257b5f199d983145b041 100644 (file)
@@ -76,6 +76,7 @@ public:
     void OnTest1(wxCommandEvent& event);
     void OnTest2(wxCommandEvent& event);
     void OnTest3(wxCommandEvent& event);
+    void OnTestMsgBox(wxCommandEvent& event);
 
     DECLARE_EVENT_TABLE()
 
@@ -93,7 +94,8 @@ enum
     INTERNAT_PLAY,
     INTERNAT_TEST_1,
     INTERNAT_TEST_2,
-    INTERNAT_TEST_3
+    INTERNAT_TEST_3,
+    INTERNAT_TEST_MSGBOX
 };
 
 // language data
@@ -163,6 +165,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
     EVT_MENU(INTERNAT_TEST_1, MyFrame::OnTest1)
     EVT_MENU(INTERNAT_TEST_2, MyFrame::OnTest2)
     EVT_MENU(INTERNAT_TEST_3, MyFrame::OnTest3)
+    EVT_MENU(INTERNAT_TEST_MSGBOX, MyFrame::OnTestMsgBox)
 END_EVENT_TABLE()
 
 IMPLEMENT_APP(MyApp)
@@ -302,6 +305,8 @@ MyFrame::MyFrame(wxLocale& locale)
     test_menu->Append(INTERNAT_TEST_1, _("&1 _() (gettext)"), _("Tests the _() macro"));
     test_menu->Append(INTERNAT_TEST_2, _("&2 _N() (ngettext)"), _("Tests the _N() macro"));
     test_menu->Append(INTERNAT_TEST_3, _("&3 wxTRANSLATE() (gettext_noop)"), _("Tests the wxTRANSLATE() macro"));
+    test_menu->Append(INTERNAT_TEST_MSGBOX, _("&Message box test"),
+                      _("Tests message box buttons labels translation"));
 
     wxMenuBar *menu_bar = new wxMenuBar;
     menu_bar->Append(file_menu, _("&File"));
@@ -498,4 +503,17 @@ void MyFrame::OnTest3(wxCommandEvent& WXUNUSED(event))
     wxMessageBox(s);
 }
 
-
+void MyFrame::OnTestMsgBox(wxCommandEvent& WXUNUSED(event))
+{
+    if ( wxMessageBox
+         (
+            _("Are the labels of the buttons in this message box "
+              "translated into the current locale language?"),
+            _("wxWidgets i18n sample"),
+            wxYES_NO,
+            this
+         ) != wxYES )
+    {
+        wxMessageBox(_("Please report the details of your platform to us."));
+    }
+}