Author Topic: How to set up a wxWidget project with a newer version of wxFormBuilder  (Read 5791 times)

Offline kagi3624

  • Single posting newcomer
  • *
  • Posts: 7
Hello, this are my specs:
Ubuntu 21.10
code::blocks 20.03
wx-config: gtk3-unicode-static-3.1
wxFormBuilder 3.10.0-4761b0c

When I set up a wxWIdget project (wx 3.1, wxFormBuilder) it compiles and runs just fine. But if I want to use the wxFormBuilder and open the .fbp file with it I get the message that the file format is outdated and that it will be updated. Then, depending on what I chose previously (form based or dialogue based), the formbuilder starts to remove labels, menu bars etc. and creates a new GUIFrame.cpp and GUIFrame.h that cannot be compiled in code::blocks any longer. When you check the files before and after they are updated you can see that code::blocks use a very old version of wxFormBuilder (attached as txt files). So my question is, how can I tell code::block to generate those GUIFrame files with the newer version of wxFormBuilder I have installed? I assumed that I can set this up in the wxWidgets project script (right click and edit script). But if it is there, I couldn't find the position.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: How to set up a wxWidget project with a newer version of wxFormBuilder
« Reply #1 on: September 30, 2021, 10:29:57 am »
The templates for wxFormbuilder are in
Code
share/CodeBlocks/templates/wizard/wxwidgets/wxfb

You can overwrite them with the new format files, but the problem is here:
Quote
[New files] cannot be compiled in code::blocks any longer

You must investigate why the files generated by wxFormBuilder are not compilable, and then file a bug where applicable. You can post a full rebuild log in code tags here (words in bold are important).

Offline kagi3624

  • Single posting newcomer
  • *
  • Posts: 7
Re: How to set up a wxWidget project with a newer version of wxFormBuilder
« Reply #2 on: September 30, 2021, 12:16:36 pm »
Hello Miguel, thank you for pointing out that those files are just copied over to the project! I found out, that for the messagebox function in Main.cpp  a header is missing.

Code
#include <wx/msgdlg.h>

The old GUIFrame.cpp had just

Code
#include <wx/wx.h>

which in the new file is replaced through a bunch of specific header files. I am also not sure if that is also a problem of wxformbuilder (somehow it should detect the messagebox in main) or the messege box itself (maybe it does not belong in the main.cpp any longer). I will report on that.