User forums > General (but related to Code::Blocks)

[Work In Progress] Patches to Compile C::B against wxWidgets 2.9.0

<< < (5/9) > >>

stahta01:
Patch to Contrib DragScroll
Tim S


--- Code: ---Index: src/plugins/contrib/dragscroll/dragscroll.cpp
===================================================================
--- src/plugins/contrib/dragscroll/dragscroll.cpp (revision 5585)
+++ src/plugins/contrib/dragscroll/dragscroll.cpp (working copy)
@@ -977,7 +977,11 @@
         wheelEvt.SetEventObject(pWindow);
         wheelEvt.m_controlDown = true;
         wheelEvt.m_wheelRotation = 0;
+        #if wxCHECK_VERSION(2, 9, 0)
+        pWindow->GetEventHandler()->AddPendingEvent(wheelEvt);
+        #else
         pWindow->AddPendingEvent(wheelEvt);
+        #endif
     }while(0);
 
     // Issue SetFont() for saved font sizes on our monitored windows
@@ -1006,7 +1010,11 @@
                 wheelEvt.SetEventObject(pWindow);
                 wheelEvt.m_controlDown = true;
                 wheelEvt.m_wheelRotation = 0;
+                #if wxCHECK_VERSION(2, 9, 0)
+                pWindow->GetEventHandler()->AddPendingEvent(wheelEvt);
+                #else
                 pWindow->AddPendingEvent(wheelEvt);
+                #endif
                 #if defined(LOGGING)
                 //LOGIT( _T("OnAppStartupDoneInit Issued Wheel Zoom event 0[%p]size[%d]"),pWindow, fontSize);
                 #endif
@@ -1143,7 +1151,11 @@
                     wheelEvt.SetEventObject(pWindow);
                     wheelEvt.m_controlDown = true;
                     wheelEvt.m_wheelRotation = 0; //set user font
+                    #if wxCHECK_VERSION(2, 9, 0)
+                    pWindow->GetEventHandler()->AddPendingEvent(wheelEvt);
+                    #else
                     pWindow->AddPendingEvent(wheelEvt);
+                    #endif
                     #if defined(LOGGING)
                     //LOGIT( _T("OnWindowOpen Issued htmlWindow Zoom event"));
                     #endif

--- End code ---

stahta01:
Got to do School Work Now; be a week before I can do any major work.

Tim S

Biplab:

--- Quote from: stahta01 on May 03, 2009, 08:15:03 pm ---My Method is to use wxWidgets version of wxPropertyGrid; which will need OK from wxSmith maintainer.
Will submit the wxSmith patch as separate file from rest. And, I am not sure how to do this using wxCHECK_VERSION() so will likely take time to work on some parts of wxSmith patch.

--- End quote ---

Please go ahead with the patch. No objections to that.

I didn't read the code; but you can do it like-

--- Code: ---#if wxCHECK_VERSION(2, 9, 0)
#include <wx/propgrid/propgrid.h>
#else
#include "propgrid/propgrid.h"
#endif
--- End code ---

As long as the API remain unchanged, this should do. I'll commit rest of your patches tonight. :)

stahta01:

--- Quote from: Biplab on May 04, 2009, 02:34:10 am ---As long as the API remain unchanged, this should do. I'll commit rest of your patches tonight. :)

--- End quote ---

There was a change in wxPropertyGrid API.

Three clear and separate ways to proceed.
1. Wait till wxWidgets 3.0 is released before doing wxSmith
2. Upgrade wxSmith to using a newer wxPropertyGrid more compatible with wxWidgets 2.9 wxPropertyGrid
3. Add Patches to wxSmith guarded by both wxCHECK_VERSION and wxPropertyGrid version guard.

I plan to do option 3 add guards based on wxPropertyGrid version and wxWidgets version.
Edit: I am going to try with just wxCHECK_VERSION for now.
If option 2 is taken will likely need to use wxCHECK_PROPGRID_VERSION in addition.

Option 3 Failed with about 6 API changes where I could not determine the correct action.

Planning on doing a very limited patch of current wxPropertyGrid.
Will try to use the below to make wxPropertyGrid more like wxWidgets 2.9 version
#define wxPG_PGVARIANT_IS_VARIANT
#define wxPG_ID_IS_PTR 1



Tim S

MortenMacFly:

--- Quote from: Biplab on May 04, 2009, 02:34:10 am ---Please go ahead with the patch. No objections to that.

--- End quote ---
Careful!!! This won't easily work. The wxPropgrid of wxWidgets has heavily changed its API. I once tried to port wxSmith but unfortunately this got lost on the way. If you really want to try make sure you *remove* the old propgrid sources from C::B, including the compiled library.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version