Patch #1737 2006-12-19 00:12

stahta01

selecttargetdlg patch for wxWidgets 2.8
Download
1737-selecttargetdl.patch (1.0 KB)
Category
Application::Refinement
Status
Closed
Close date
2007-01-02 10:44
Assigned to
killerbot
Index: src/sdk/selecttargetdlg.cpp
===================================================================
--- src/sdk/selecttargetdlg.cpp    (revision 3173)
+++ src/sdk/selecttargetdlg.cpp    (working copy)
@@ -92,6 +92,14 @@
 
 // events
 
+#if wxCHECK_VERSION(2, 8, 0)
+void SelectTargetDlg::OnOK(wxCommandEvent& /*event*/)
+{
+    this->wxDialog::SetAffirmativeId(wxID_OK);
+    this->wxDialog::AcceptAndClose();
+} // end of OnOK
+#endif
+
 void SelectTargetDlg::OnListboxSelection(wxCommandEvent& /*event*/)
 {
     UpdateSelected();
Index: src/sdk/selecttargetdlg.h
===================================================================
--- src/sdk/selecttargetdlg.h    (revision 3173)
+++ src/sdk/selecttargetdlg.h    (working copy)
@@ -15,6 +15,9 @@
         void EndModal(int retCode);
         int GetSelection() const { return m_Selected; }
         ProjectBuildTarget* GetSelectionTarget();
+#if wxCHECK_VERSION(2, 8, 0)
+        void OnOK(wxCommandEvent& event);
+#endif
     private:
         void OnListboxSelection(wxCommandEvent& event);
         void OnCheckboxSelection(wxCommandEvent& event);
stahta01 2006-12-19 00:15

Change: wxDialog::OnCancel and wxDialog::OnOK no longer exists in wxWidgets 2.8.0.

Problem: SelectTargetDlg inherits wxDialog::OnOK.

Solution: Added void OnOK(wxCommandEvent& event); to header for SelectTargetDlg and added code to support it.

Note: I am NOT sure if my code is correct way to implement OnOK.

Tim S

killerbot 2006-12-27 11:03

question : if it no longer exists, what's the use of implementing it, who will ever call it.

We have the EndModal() hook where we process retCode==wxID_OK.

killerbot 2006-12-27 16:00

ok I just noted an event is mapped to it. Could we map that event to something else for wx 280 ?

stahta01 2006-12-27 17:32

I really do NOT know wxWidgets events so I did the easiest solution of re-creating the missing method of OnOK. I have no idea how to fix it another way that keeps 2.6.3 working without adding a lot of #if wxCHECK_VERSION(2, 8, 0) blocks. Tim S

mandrav 2007-01-02 09:57

We just have to move the code from OnOK() to EndModal(), inside a "if (retCode == wxID_OK)" block and remove the OnOK() event and function. This will work with all wx versions...

killerbot 2007-01-02 10:44

removed the double click entry -> patch is no longer needed.

Explicitly clicking the OK button is now required.