]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/preferences/preferences.cpp
Make wxMSW wxSpinCtrl "not enough space" messages more helpful.
[wxWidgets.git] / samples / preferences / preferences.cpp
index 87fbcccd861aada28303ec3077bdbe75244ddef6..990fb0d43746354b0323d4589d3298ea2389ccf3 100644 (file)
@@ -58,10 +58,10 @@ public:
         SetMenuBar(menuBar);
 
         Connect(wxID_PREFERENCES,
-                wxEVT_COMMAND_MENU_SELECTED,
+                wxEVT_MENU,
                 wxCommandEventHandler(MyFrame::OnPref), NULL, this);
         Connect(wxID_EXIT,
-                wxEVT_COMMAND_MENU_SELECTED,
+                wxEVT_MENU,
                 wxCommandEventHandler(MyFrame::OnExit), NULL, this);
         Connect(wxEVT_CLOSE_WINDOW,
                 wxCloseEventHandler(MyFrame::OnClose), NULL, this);
@@ -104,10 +104,10 @@ public:
         // immediately rather than after the OK or Apply button is pressed.
         if ( wxPreferencesEditor::ShouldApplyChangesImmediately() )
         {
-            m_useMarkdown->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED,
+            m_useMarkdown->Connect(wxEVT_CHECKBOX,
                                    wxCommandEventHandler(PrefsPageGeneralPanel::ChangedUseMarkdown),
                                    NULL, this);
-            m_spellcheck->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED,
+            m_spellcheck->Connect(wxEVT_CHECKBOX,
                                   wxCommandEventHandler(PrefsPageGeneralPanel::ChangedSpellcheck),
                                   NULL, this);
         }
@@ -173,7 +173,7 @@ public:
 
         if ( wxPreferencesEditor::ShouldApplyChangesImmediately() )
         {
-            m_fulltext->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED,
+            m_fulltext->Connect(wxEVT_CHECKBOX,
                                 wxCommandEventHandler(PrefsPageTopicsPanel::ChangedFulltext),
                                 NULL, this);
         }
@@ -224,6 +224,11 @@ bool MyApp::OnInit()
     if ( !wxApp::OnInit() )
         return false;
 
+    // This will be used in the title of the preferences dialog under some
+    // platforms, don't leave it as default "Preferences" because this would
+    // result in rather strange "Preferences Preferences" title.
+    SetAppDisplayName("wxWidgets Sample");
+
     MyFrame *frame = new MyFrame();
     frame->Show(true);