]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/xrc/objrefdlg.cpp
fixes potential crash under gatekeeper
[wxWidgets.git] / samples / xrc / objrefdlg.cpp
index 8d91b64601e5a553f3789fa8ca2fd20f60179671..0b0b625ece76b96dd047d55ebc33c61a7ba217cb 100644 (file)
@@ -49,7 +49,7 @@ ObjrefDialog::ObjrefDialog(wxWindow* parent)
     wxCHECK_RET(nb, "failed to find objref_notebook");
 
     // Connect different event handlers.
     wxCHECK_RET(nb, "failed to find objref_notebook");
 
     // Connect different event handlers.
-    nb->Connect(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED,
+    nb->Connect(wxEVT_NOTEBOOK_PAGE_CHANGED,
                 wxNotebookEventHandler(ObjrefDialog::OnNotebookPageChanged),
                 NULL, this);
 
                 wxNotebookEventHandler(ObjrefDialog::OnNotebookPageChanged),
                 NULL, this);
 
@@ -74,11 +74,11 @@ ObjrefDialog::ObjrefDialog(wxWindow* parent)
     // Connect the id ranges, using the [start] and [end] 'typedefs'
     page = nb->GetPage(calc_page);
     page->Connect(XRCID("digits[start]"), XRCID("digits[end]"),
     // Connect the id ranges, using the [start] and [end] 'typedefs'
     page = nb->GetPage(calc_page);
     page->Connect(XRCID("digits[start]"), XRCID("digits[end]"),
-                  wxEVT_COMMAND_BUTTON_CLICKED,
+                  wxEVT_BUTTON,
                   wxCommandEventHandler(ObjrefDialog::OnNumeralClick),
                   NULL, this);
     page->Connect(XRCID("operators[start]"), XRCID("operators[end]"),
                   wxCommandEventHandler(ObjrefDialog::OnNumeralClick),
                   NULL, this);
     page->Connect(XRCID("operators[start]"), XRCID("operators[end]"),
-                  wxEVT_COMMAND_BUTTON_CLICKED,
+                  wxEVT_BUTTON,
                   wxCommandEventHandler(ObjrefDialog::OnOperatorClick),
                   NULL, this);
 
                   wxCommandEventHandler(ObjrefDialog::OnOperatorClick),
                   NULL, this);
 
@@ -138,8 +138,6 @@ void ObjrefDialog::OnNotebookPageChanged( wxNotebookEvent &event )
                 ClearCalculator();
                 break;
             }
                 ClearCalculator();
                 break;
             }
-
-         default: return;
     }
 }
 
     }
 }
 
@@ -255,7 +253,8 @@ void ObjrefDialog::OnOperatorClick(wxCommandEvent& event)
     {
         wxLogMessage("You clicked operators[%i], XRCID %d, 'Clear'",
                      ID, event.GetId());
     {
         wxLogMessage("You clicked operators[%i], XRCID %d, 'Clear'",
                      ID, event.GetId());
-        return ClearCalculator();
+        ClearCalculator();
+        return;
     }
 
     switch(ID)
     }
 
     switch(ID)