Author Topic: Important change to C::B code base and SDK wrt wx30  (Read 3364 times)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Important change to C::B code base and SDK wrt wx30
« on: February 06, 2016, 03:47:16 pm »
We have committed an important change to SVN towards the wx30 development. As a dev, please read carefully:

1.) We set wx 2,8,12 as minimum version for compile time assertions. This means, the SDK won't compile with wx versions below that.
2.) We removed a lot of wrapper code wrt wx version 2.4.x [...] 2.8.11
3.) We changed wx29 checks to proper wx3 checks. With the release of wx3 the wx29 devel branch isn't used anyways.
4.) Left are ONLY: wx2.8.12, wx30 and wx31 checks in the code base
5.) ONE EXCEPTION: Actively maintained 3rd party libs (like wxPDFDoc) have been left "as-is".

So the new guideline that should makes things easier for you is:
  • don't care about wx versions below 2.8.12
  • that said, we won't accept any wrapped code like wxCHECK_VERSION(2, 6, 0) or alike
  • wrap your wx30-only code using wxCHECK_VERSION(3, 0, 0) (notice the space between the numbers)
  • wrap your wx31-only code using wxCHECK_VERSION(3, 1, 0) (notice the space between the numbers)
  • there is one exception: you can (and should) leave code of actively maintained 3rd party wx components untouched
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: 7591
    • My Best Post
Re: Important change to C::B code base and SDK wrt wx30
« Reply #1 on: February 07, 2016, 01:48:39 am »
FYI: You might wish to look at sdk/scrollingdialog.cpp because I think it might violate your rules.

Edit: Looks like someone fixed it in the wrong way in the past; did NOT look at SVN history.

What it was in the past; as found on http://www.anthemion.co.uk/code.htm
Code
        // The wxRTTI is wrong for wxNotebook in < 2.8.8 and 2.9, so use dynamic_cast instead
#if !wxCHECK_VERSION(2,8,8) || (wxCHECK_VERSION(2,9,0) && !wxCHECK_VERSION(3,0,0))
        wxBookCtrlBase* bookContentWindow = dynamic_cast<wxBookCtrlBase*>(dialog->GetContentWindow());
#else
        wxBookCtrlBase* bookContentWindow = wxDynamicCast(dialog->GetContentWindow(), wxBookCtrlBase);
#endif

What it is now.
Code
        // The wxRTTI is wrong for wxNotebook in < 2.8.8 and 2.9, so use dynamic_cast instead
#if !wxCHECK_VERSION(2, 8, 8) && !wxCHECK_VERSION(3, 0, 0)
        wxBookCtrlBase* bookContentWindow = dynamic_cast<wxBookCtrlBase*>(dialog->GetContentWindow());
#else
        wxBookCtrlBase* bookContentWindow = wxDynamicCast(dialog->GetContentWindow(), wxBookCtrlBase);
#endif

What I think it should be by your rules.
Code
     // The wxRTTI is wrong for wxNotebook in < 2.8.8 and 2.9, so wxDynamicCast does NOT work for those versions.
wxBookCtrlBase* bookContentWindow = wxDynamicCast(dialog->GetContentWindow(), wxBookCtrlBase);

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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Important change to C::B code base and SDK wrt wx30
« Reply #2 on: February 07, 2016, 10:49:36 am »
Good point and corrected. We have customised scrollingdialog already, so its no longer a (actively developed) and clean 3rd party lib.
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