News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Important change to C::B code base and SDK wrt wx30

Started by MortenMacFly, February 06, 2016, 03:47:16 PM

Previous topic - Next topic

MortenMacFly

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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

stahta01

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

        // 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.

        // 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.

     // 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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

MortenMacFly

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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]