Author Topic: [Work In Progress] Patches to Compile C::B against wxWidgets 2.9.0  (Read 33955 times)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: [Work In Progress] Patches to Compile C::B against wxWidgets 2.9.0
« Reply #15 on: May 03, 2009, 08:15:03 pm »
@Biplab:

Ok, Will do the rest of C::B Plugins using wxCHECK_VERSION() around wx_str() and C_str().

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.

Note: I am currently getting new error, less that two months old, on shutting in down Code::Blocks.
I plan to work on finding this error before doing the wxSmith patch.

Tim S

PS: Waiting for a rebuild of wxWidgets 2.9.0 RC2 to finish patches.
« Last Edit: May 03, 2009, 09:51:23 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: [Work In Progress] Patches to Compile C::B against wxWidgets 2.9.0
« Reply #16 on: May 04, 2009, 12:36:12 am »
Patch to Contrib envvars attached to message.
Deleted patch to save space.

Not had time to test under wxWidgets 2.8, but compiles under wxWidgets 2.9.0 RC2.

Tim S


Note: The file also contains patch to devpak_plugin
« Last Edit: June 19, 2009, 01:57:38 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: [Work In Progress] Patches to Compile C::B against wxWidgets 2.9.0
« Reply #17 on: May 04, 2009, 01:46:39 am »
Patch to Contrib ThreadSearch
Tim S

Code
Index: src/plugins/contrib/ThreadSearch/ThreadSearchView.cpp
===================================================================
--- src/plugins/contrib/ThreadSearch/ThreadSearchView.cpp (revision 5585)
+++ src/plugins/contrib/ThreadSearch/ThreadSearchView.cpp (working copy)
@@ -491,7 +491,11 @@
 
  wxFocusEvent ev(wxEVT_SET_FOCUS);
  ev.SetWindow(this);
+ #if wxCHECK_VERSION(2, 9, 0)
+ control->GetEventHandler()->AddPendingEvent(ev);
+ #else
  control->AddPendingEvent(ev);
+ #endif
  }
 }
 
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: [Work In Progress] Patches to Compile C::B against wxWidgets 2.9.0
« Reply #18 on: May 04, 2009, 01:49:13 am »
Patch to lib_finder attached to this message.

Deleted Patch to save website resources

« Last Edit: June 18, 2009, 02:04:47 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: [Work In Progress] Patches to Compile C::B against wxWidgets 2.9.0
« Reply #19 on: May 04, 2009, 02:04:54 am »
Patches Still Needed for
  Profiler
  Exporter
  Games
  Code Snippets
  DragScroll
  wxSmith
  wxSmith - Contrib Items


Note: I am working currently on a very large patch for wxSmith
« Last Edit: May 07, 2009, 08:23:41 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: [Work In Progress] Patches to Compile C::B against wxWidgets 2.9.0
« Reply #20 on: May 04, 2009, 02:10:37 am »
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
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: [Work In Progress] Patches to Compile C::B against wxWidgets 2.9.0
« Reply #21 on: May 04, 2009, 02:33:46 am »
Got to do School Work Now; be a week before I can do any major work.

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: [Work In Progress] Patches to Compile C::B against wxWidgets 2.9.0
« Reply #22 on: May 04, 2009, 02:34:10 am »
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.

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

As long as the API remain unchanged, this should do. I'll commit rest of your patches tonight. :)
Be a part of the solution, not a part of the problem.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: [Work In Progress] Patches to Compile C::B against wxWidgets 2.9.0
« Reply #23 on: May 04, 2009, 04:26:36 am »
As long as the API remain unchanged, this should do. I'll commit rest of your patches tonight. :)

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

« Last Edit: May 04, 2009, 06:45:16 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: [Work In Progress] Patches to Compile C::B against wxWidgets 2.9.0
« Reply #24 on: May 04, 2009, 09:23:48 am »
Please go ahead with the patch. No objections to that.
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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: [Work In Progress] Patches to Compile C::B against wxWidgets 2.9.0
« Reply #25 on: May 04, 2009, 09:38:49 am »
Please go ahead with the patch. No objections to that.
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.

I have three separate patches for wxSmith. Rewriting with guards takes time.
1. Normal wxWidgets 2.9 changes
2. wxPropertyGrid API changes
No idea of best way to do the below, I am thinking make separate CB Project to
build/not build wxPropertyGrid.
3. Build changes (remove wxPropertyGrid code from Code::Blocks to test wxWidgets 2.9)
Write patch to do step 4.
4. Upgrade CB wxPropertyGrid to newer API used by wxWidgets 2.9 to support CB with wxWidgets 2.8

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: [Work In Progress] Patches to Compile C::B against wxWidgets 2.9.0
« Reply #26 on: May 04, 2009, 04:34:48 pm »
Please go ahead with the patch. No objections to that.
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.

I don't want to remove wxpropgrid sources now. Rather I want to make wxsmith ready to work with wxWidgets 2.9. As I've been doing so far, all wx-2.9 migration patches are to be guarded by wxCHECK_VERSION to avoid breaking present compatibility with wx-2.8.x. As long as we support wx-2.8.x we can't remove wxpropgrid from trunk.
Be a part of the solution, not a part of the problem.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
« Last Edit: May 07, 2009, 08:23:13 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: [Work In Progress] Patches to Compile C::B against wxWidgets 2.9.0
« Reply #28 on: May 05, 2009, 08:48:53 pm »
Guarded Patch to devpak. Tim S

Code
Index: src/plugins/contrib/devpak_plugin/mytar.cpp
===================================================================
--- src/plugins/contrib/devpak_plugin/mytar.cpp (revision 5588)
+++ src/plugins/contrib/devpak_plugin/mytar.cpp (working copy)
@@ -19,7 +19,11 @@
     m_SkipBytes(0),
     m_Size(0)
 {
+    #if wxCHECK_VERSION(2, 9, 0)
+    if (!filename.IsEmpty())
+    #else
     if (filename)
+    #endif
         Open(filename);
 }
 
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: [Work In Progress] Patches to Compile C::B against wxWidgets 2.9.0
« Reply #29 on: May 05, 2009, 08:56:45 pm »
Patch to Games

Code
Index: src/plugins/contrib/byogames/byosnake.cpp
===================================================================
--- src/plugins/contrib/byogames/byosnake.cpp (revision 5588)
+++ src/plugins/contrib/byogames/byosnake.cpp (working copy)
@@ -300,7 +300,11 @@
     DC->SetTextBackground(*wxBLACK);
     DC->SetFont(m_Font);
     wxString Line1 = wxString::Format(_("Lives: %d    Score: %d   Length: %d"),m_Lives,m_Score,m_SnakeLen);
+    #if wxCHECK_VERSION(2, 9, 0)
+    wxString Line2 = IsPaused() ? wxString(_("Paused")) : wxString(wxEmptyString);
+    #else
     wxString Line2 = IsPaused() ? _("Paused") : wxEmptyString;
+    #endif
     wxString Line3 = GetBackToWorkString();
     DC->DrawText(Line1,5,5);
     int xs, ys;
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org