+void MyFrame::OnObjRefToolOrMenuCommand(wxCommandEvent& WXUNUSED(event))
+{
+ // The dialog redirects log messages, so save the old log target first
+ wxLog* oldlogtarget = wxLog::SetActiveTarget(NULL);
+
+ // Make an instance of the dialog
+ ObjrefDialog* objrefDialog = new ObjrefDialog(this);
+ // Show the instance of the dialog, modally.
+ objrefDialog->ShowModal();
+ objrefDialog->Destroy();
+
+ // Restore the old log target
+ delete wxLog::SetActiveTarget(oldlogtarget);
+}
+
+