Author Topic: CodeBlocks and wxWidgets 3.x  (Read 5975 times)

Offline sodev

  • Regular
  • ***
  • Posts: 497
CodeBlocks and wxWidgets 3.x
« on: October 30, 2014, 11:50:03 pm »
Once again i tried to get CodeBlocks running with wxWidgets 3.x and once again the results were pretty disappointing. The only positive thing is that CodeBlocks looks quite nicer with that wxWidgets version, but its still not usable. I don't know if anyone else is using CodeBlocks with wxWidgets 3.x or if im the only one with these issues, so im going to post my results here.

First my setup:
CodeBlocks SVN rev 10016
wxWidgets SVN rev 78078
TDM MinGW GCC 4.8.2 x32
Windows 7 SP1 x64

Because the wxWidgets version i used has already the version number 3.1 and the current https://github.com/rjpcomputing/wxpack i used to build my wxWidgets snapshot uses versioned library folders i had to update all *_wx30 project files to use a matching version number and the correct paths for the libraries, i attached a patch of my changes.

Because of a recent change in wxPropgrid CodeBlocks doesn't compile, i did a quickhack to fix this, i attached a patch of that as well. Note, this patch does not compile under wxWidgets 2.8.

---

CodeBlocks and the Contrib Workspace compiles just fine and the compiled version starts without problems. The first thing i usually do is to turn off all that toolbars i dont need, for that i right click on the toolbar and that causes an assertion. This is because wxWindow::PopupMenu() must not use a menu that is already owned by someone else, in this case its owned by the menu bar, i attached my patch that fixes this by making a simple copy of that menu instead.

The second thing i noticed is that the bottom of all texts in the combo boxes in the toolbar is clipped, it looks like the wxToolBar now gives these custom controls the same height like the buttons so there is simply not enough room left, this can be fixed by turning on 22x22 toolbars. However that special control used for the occurences highlighting is still not tall enough.

After this, i start changing the settings to fit my needs and to setup my compiler. A habit from old days when CodeBlocks sometimes crashed is i always close it after i made a bunch of changes and start it again. I noticed that after some restarts the Search Menu and the DoxyBlocks Menu are broken like on the attached screenshots. The defect is more severe than you might notice at a first look, some entries are so wrong shifted they are actually the action of some other entry, e.g. the Load Template in the DoxyBlocks Menu actually is the Save Template entry. I could fix the Search Menu by disabling the Incremental Search plugin, but i dont know if this was just by accident or can be reproduced, i didnt test further.

Now the most annoying part, there seem to be a lot of refresh bugs in the text editor. At first i thought the ocurrences highlighting takes ages to highlight the occurences, but in fact they just didnt get drawn. If i scroll around they appear. I am also using the "Highlight line under caret" feature, if i click on some lines every line i click gets marked, scrolling clears some marks, some not. And during scrolling the text display gets totally corrupted, e.g. parts of old lines remain because the new line at that position is shorter and lots of other visual defects.

Occassionally (maybe related to the broken menus?) if i close CodeBlocks the window closes but a dormant codeblocks process remains that i have to kill with the process manager. One time i also got an assert about a missing event handler but i could not reproduce that.

Sadly in this state CodeBlocks is not usable with wxWidgets 3.1.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CodeBlocks and wxWidgets 3.x
« Reply #1 on: October 31, 2014, 12:15:41 am »
Last time I tried it the watches window has been unusable...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: CodeBlocks and wxWidgets 3.x
« Reply #2 on: October 31, 2014, 10:49:26 am »
Last time I tried it the watches window has been unusable...
At least selecting a property fails (when clicking on it).
I might find the time to look into it at the evening.
I also have many fixes for font-constant related warnings on my system.
There remain many brush- and pen-constant related warnings, but they can not be fixed easily without ifdefs, so I left them for the moment.
All the fixes are tested on linux and windows with wx from svn and wx2.8.12.
I (most likely) can commit them this evening.

Offline zaleksf

  • Single posting newcomer
  • *
  • Posts: 8
Re: CodeBlocks and wxWidgets 3.x
« Reply #3 on: December 10, 2014, 12:35:29 am »
I've had some luck getting C::B SVN_10050 to build with wxWidgets-3.0.3 and run, but with different results on different Windows OSs. From what I can see (and personal experience) C::B is not set up to build with wxWidgets-3.1.x yet.

C::B svn 10050 builds just fine on Debian Testing/Jessie x64 with wxWidgets-3.0.2 using gcc-4.9.2-x64(from Testing repos).

I can build wxWidgets 3.0.3 (WX_3_0_BRANCH) on Win7_x64 with the newly released TDM-GCC-4.9.2-x32 compiler. A couple of issues (typos) in the wxWidgets folder/file names have to be overcome for the monolithic, shared build by adding two folders to the $WX\build\msw\ folder: 'cc_mswudll' and 'gc_mswudll'. Move monodll_ctrlsub.o and -.o.d to 'cc_mswudll' folder and monodll_xh_panel.o and -.o.d to 'gc_mswudll' folder once the build crashes, and then just restart the build - all should compile and link just fine now (hope the folder names get fixed soon). I also have to build with CXXFLAGS = '-std=gnu++11'. I also use CXXFLAGS = '-fno-keep-inline-dllexport'.

I build C::B SVN_10050 using the included 'CodeBlocks_wx30.workspace' template from within an older version of C::B.
For the entire workspace:
Compiler settings/Other options: -std=gnu++11
Compiler settings/#defines: NDEBUG (otherwise get very irritating 'Assert' messages from wxWidgets 3.0.x on C::B start-up)

For just the 'Code::Blocks wx3.0.x' project:
Compiler settings/Other options: -std=c++11 -U__STRICT_ANSI__ (otherwise the project will not build at all)

I build the entire Workspace until...the 'rndgen' project fails to build (static std::mersenne_twister not a template... ???). I manually select the projects after that point and each builds just fine. The 'update30.bat' file runs just fine.

I have performed the exact same build with the exact same code libraries, settings, installations, etc., on a Win7_x64 machine and a Win8.1_x64 machine. The C::B executable launches just fine on the Win7_x64 machine. On the Win8.1_x64 machine the C::B executable launches, shows the splash screen, shortly followed by the initial 'Compiler Selection' dialog. Within 1-2 seconds an error notification appears indicating that C::B has failed (and politely offers to let Windows to find a solution...).

I succeeded in getting C::B to launch on the Win8.1_x64 OS by making a short batch file which included a 'no splash screen' flag, and it worked! (e.g. codeblocks.exe --no-splash-screen). I don't know what the issue is with the C::B splash screen on Win8 - hopefully it's easy to fix.

I have successfully compiled and run the 'dummy-hello-world' wxWidgets dialog-with-buttons project on both installations, but haven't pushed the IDE harder yet with other projects. Hope this helps.





« Last Edit: December 10, 2014, 12:39:23 am by zaleksf »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CodeBlocks and wxWidgets 3.x
« Reply #4 on: December 10, 2014, 01:19:22 am »
Can you run the cb using another cb (nightly) and use the debugger to pinpoint where the crash happens?

Probably you're seeing something like https://sourceforge.net/p/codeblocks/tickets/4/

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]