]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/preferences/preferences.cpp
fix vertical mouse wheel event rotation value, sign was reversed in r74805
[wxWidgets.git] / samples / preferences / preferences.cpp
index 87fbcccd861aada28303ec3077bdbe75244ddef6..979cfe98ec9e7b4399025a2d0f4bbb26acd42160 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:     Sample demonstrating wxPreferencesEditor use.
 // Author:      Vaclav Slavik
 // Created:     2013-02-19
 // Purpose:     Sample demonstrating wxPreferencesEditor use.
 // Author:      Vaclav Slavik
 // Created:     2013-02-19
-// RCS-ID:      $Id$
 // Copyright:   (c) 2013 Vaclav Slavik <vslavik@fastmail.fm>
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 // Copyright:   (c) 2013 Vaclav Slavik <vslavik@fastmail.fm>
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
@@ -58,10 +57,10 @@ public:
         SetMenuBar(menuBar);
 
         Connect(wxID_PREFERENCES,
         SetMenuBar(menuBar);
 
         Connect(wxID_PREFERENCES,
-                wxEVT_COMMAND_MENU_SELECTED,
+                wxEVT_MENU,
                 wxCommandEventHandler(MyFrame::OnPref), NULL, this);
         Connect(wxID_EXIT,
                 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);
                 wxCommandEventHandler(MyFrame::OnExit), NULL, this);
         Connect(wxEVT_CLOSE_WINDOW,
                 wxCloseEventHandler(MyFrame::OnClose), NULL, this);
@@ -104,10 +103,10 @@ public:
         // immediately rather than after the OK or Apply button is pressed.
         if ( wxPreferencesEditor::ShouldApplyChangesImmediately() )
         {
         // 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);
                                    wxCommandEventHandler(PrefsPageGeneralPanel::ChangedUseMarkdown),
                                    NULL, this);
-            m_spellcheck->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED,
+            m_spellcheck->Connect(wxEVT_CHECKBOX,
                                   wxCommandEventHandler(PrefsPageGeneralPanel::ChangedSpellcheck),
                                   NULL, this);
         }
                                   wxCommandEventHandler(PrefsPageGeneralPanel::ChangedSpellcheck),
                                   NULL, this);
         }
@@ -173,7 +172,7 @@ public:
 
         if ( wxPreferencesEditor::ShouldApplyChangesImmediately() )
         {
 
         if ( wxPreferencesEditor::ShouldApplyChangesImmediately() )
         {
-            m_fulltext->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED,
+            m_fulltext->Connect(wxEVT_CHECKBOX,
                                 wxCommandEventHandler(PrefsPageTopicsPanel::ChangedFulltext),
                                 NULL, this);
         }
                                 wxCommandEventHandler(PrefsPageTopicsPanel::ChangedFulltext),
                                 NULL, this);
         }
@@ -224,6 +223,11 @@ bool MyApp::OnInit()
     if ( !wxApp::OnInit() )
         return false;
 
     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);
 
     MyFrame *frame = new MyFrame();
     frame->Show(true);