Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: Biplab on December 23, 2006, 08:11:48 pm

Title: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on December 23, 2006, 08:11:48 pm
Hi Everybody,

I have modified and improved the wxWidgets Project Wizard. Please note that the modifications are Windows platform specific.

New Features:

Changes in Rev 1:

Changes in Rev 2:

Changes in Rev 3:

Changes in Rev 3.3:

Changes in Rev 4:

Changes in Rev 5:

Changes in Rev 6:

Changes in Rev 7:


(http://img171.imageshack.us/img171/8994/wxwizpage2vc8.th.png) (http://img171.imageshack.us/my.php?image=wxwizpage2vc8.png)
Wizard page to select wxWidgets Version.

(http://img300.imageshack.us/img300/9119/wxwizardaddlibrg7.th.png) (http://img300.imageshack.us/my.php?image=wxwizardaddlibrg7.png)
Wizard page to add additional libraries if Monolithic build is not selected. Check the option, in bold, to go the next page.

One point to remember that though there is no Next button, but clicking on Finish button will move to next page (if the Add more wxWidgets libraries is selected).

(http://img176.imageshack.us/img176/8264/wxwizardadvlibba0.th.png) (http://img176.imageshack.us/my.php?image=wxwizardadvlibba0.png)
If you need more, then add them here.

Tested with:

Known issues:

(http://img401.imageshack.us/img401/4995/wxwizarddisablddebgoptkx6.th.png) (http://img401.imageshack.us/my.php?image=wxwizarddisablddebgoptkx6.png)
"Use the debugging libraries" option is disabled (For Windows only).

I am attaching the modified files. Please take backup of old files and replace the new files in their place. The files shall be placed to <Code::Blocks Dir>\share\CodeBlocks\templates\wizard\wxwidgets folder.

Please test it and give your feedback and suggestions.  :D Please login to download the attachment. Also download the latest revision.

Latest Release: Revision 7

[attachment deleted by admin]
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Commodore64 on December 24, 2006, 09:53:40 am
It looks like an excellent improvement!
Thank you  :D and merry Christmas!
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on December 24, 2006, 11:55:23 am
Thanks for your encouraging words.

Please test the wizard and post your comments, suggestions. I didn't submit patch to Berlios as I could not test it with all possible configurations. After I get good feedback I'll upload patch to Berlios. :D
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: TDragon on December 24, 2006, 09:22:30 pm
Why, exactly, does your version disable the debug version under Windows? I use it with MinGW (and VC8, though not through C::B).
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on December 25, 2006, 06:50:56 am
I didn't disable the Debug target in Windows and it's there.

Earlier the wizard generated Debug target as Console mode application and the Debug target could be linked againts Debug or Release build of wxWidgets. E.g., let's say you've selected DLL, release lib of wx with earlier wizard, it used to create two targets -

With earlier wizard, Debug target didn't mean that you are linking against Debug lib of wx, rather to link against Debug lib of wx you had to select the option "Use the debugging libraries".

The modified wizard creates the target in the following way -

Thus the option, use the debugging libraries, have been disabled internally for Windows as it has little significance.

I hope I've cleared your doubts.

Also please give this wizard a try, this works nicely with MSVC 8.  :D
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: TDragon on December 25, 2006, 04:17:28 pm
Aside from throwing in a few libraries I don't really need (jpeg, tiff, etc.), this version works admirably well. My apologies for the earlier confusion.

Tested:
GCC, Debug, Shared, Multi-Lib, Non-Unicode
GCC, Release, Shared, Multi-Lib, Non-Unicode

Kudos!
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on December 25, 2006, 04:51:23 pm
Aside from throwing in a few libraries I don't really need (jpeg, tiff, etc.), this version works admirably well. My apologies for the earlier confusion.

Tested:
GCC, Debug, Shared, Multi-Lib, Non-Unicode
GCC, Release, Shared, Multi-Lib, Non-Unicode

Kudos!

Thanks for your reply.  :D

jpeg, tiff libs are sometimes necessary for proper linking of application written in wxWidgets. Therefore I have added most of the libraries to avoid flood of errors. Sometimes a number of errors are generated if you don't add them.

Unfortunately, if some libraries or some other options are added to Global scope in the Code::Blocks project file, they do not show up in the Build Options dialog. Thus you didn't find other libs. If you open the .cbp file with a Text editor, you'll find a number of win32 specific libraries have been added. Though not all of the libraries are necessary to compile a simple application but they were necessary to support other compilers.

Also thanks for testing the wizard.  :D
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: TDragon on December 25, 2006, 07:22:50 pm
jpeg, tiff libs are sometimes necessary for proper linking of application written in wxWidgets. Therefore I have added most of the libraries to avoid flood of errors. Sometimes a number of errors are generated if you don't add them.
Using GCC, wxbase28, wxmsw28, and wxmsw28_adv are all that I need to build and run one of my wxWidgets projects using the wxWidgets DLLs. None of the additional libraries from the wxWidgets lib directory appear to be necessary, nor do any of the Win32 libs. Conversely, most if not all of these additional libraries are necessary when statically linking wxWidgets.

If this is not the case for compilers other than GCC, then I would expect a well-designed wizard to distinguish among the various compilers and set the options accordingly.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on December 26, 2006, 04:49:03 am
jpeg, tiff libs are sometimes necessary for proper linking of application written in wxWidgets. Therefore I have added most of the libraries to avoid flood of errors. Sometimes a number of errors are generated if you don't add them.
Using GCC, wxbase28, wxmsw28, and wxmsw28_adv are all that I need to build and run one of my wxWidgets projects using the wxWidgets DLLs. None of the additional libraries from the wxWidgets lib directory appear to be necessary, nor do any of the Win32 libs. Conversely, most if not all of these additional libraries are necessary when statically linking wxWidgets.

To build an Win32 gui app, you need several libraries from Windows SDK. wxWidgets apps can't just be compiled only with wxbase, wxmswcore and wxmsw28_adv. Additional libraries are added by linkers. Try equivalent linker option of /NODEFAULTLIB (exists in MSVC and I don't know whether there are any equivalent option in GCC) in gcc and see which libraries it asks.

Unfortunately, if some libraries or some other options are added to Global scope in the Code::Blocks project file, they do not show up in the Build Options dialog.

I mentioned it to inform you that you may not see the couple of libraries that are added to your wxWidgets project even with the old wizard. These libraries are - comctl32, gdi32, ole32, oleaut32, uuid but you will not see them until you open the Code::Blocks Project file with Notepad. These are essential libraries and work for the minimal app. If the application uses any File Open/Save or any other common dialogs, you need to add comdlg32, for odbc related app add odbc32, for any network related calls you need wsock32, so on and so forth. So better add most of the common libraries otherwise user has to add them manually.

If this is not the case for compilers other than GCC, then I would expect a well-designed wizard to distinguish among the various compilers and set the options accordingly.

The wizard first adds common essential libraries and then adds compiler specific libraries, if any, in the project file. E.g., you need to add import32.lib, cw32mti.lib if you are using Borland C++ 5.5.1 compiler. You won't find them if you are using any other compilers.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: TDragon on December 26, 2006, 06:03:18 am
Using GCC, wxbase28, wxmsw28, and wxmsw28_adv are all that I need to build and run one of my wxWidgets projects using the wxWidgets DLLs. None of the additional libraries from the wxWidgets lib directory appear to be necessary, nor do any of the Win32 libs.
"Read my lips." If this were not the case, I'd expect the following command line, copied and pasted directly from the Build log, to kick up a few errors:
Code
mingw32-g++.exe -LE:\Libraries\wxMSW-2.8.0\lib\gcc_dll  -o test.exe main.o app.o    -lwxmsw28d_core -lwxbase28d -lwxmsw28d_adv
But there are none, and the resulting executable works without problems. So also does the more complex project I alluded to earlier, which has many more files' worth of code. You might notice that MinGW's "-mwindows" option is unnecessary to successfully build and run it.

Try equivalent linker option of /NODEFAULTLIB (exists in MSVC and I don't know whether there are any equivalent option in GCC) in gcc and see which libraries it asks.
The option, in case you're curious, is "-nodefaultlibs". It brings in a host of missing references to some objects in the CRT, C++ operators new and delete, and various objects relating to structured exceptions. None are present in your extraneous Win32 libraries.

I mentioned it to inform you that you may not see the couple of libraries that are added to your wxWidgets project even with the old wizard. These libraries are - comctl32, gdi32, ole32, oleaut32, uuid but you will not see them until you open the Code::Blocks Project file with Notepad.
The Build options visible in C::B for each of my wxWidgets projects mirror the options in the .cbp file when viewed in Notepad. The wxWidgets libraries appear in the Debug or Release build options, and the Win32 libraries in the overarching project build options. Modifying the libraries in either place and saving the project results in the expected changes to both the project file and the resulting command lines during the build process.

Some further explanation:
If you think about it, that's the way the wxWidgets DLLs should work. wxWidgets presents an entirely new interface to its users that completely hides Win32, such that no Win32 function calls exist in the wxWidgets headers. If your app's code contains no Win32 function calls, it has no dependencies on the Win32 libraries; every Win32 function call happens within the code in the wxWidgets DLL, and the resulting dependencies are resolved when the DLL is linked rather than when your app is.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on December 26, 2006, 08:18:18 am
Using GCC, wxbase28, wxmsw28, and wxmsw28_adv are all that I need to build and run one of my wxWidgets projects using the wxWidgets DLLs. None of the additional libraries from the wxWidgets lib directory appear to be necessary, nor do any of the Win32 libs.
"Read my lips." If this were not the case, I'd expect the following command line, copied and pasted directly from the Build log, to kick up a few errors:
Code
mingw32-g++.exe -LE:\Libraries\wxMSW-2.8.0\lib\gcc_dll  -o test.exe main.o app.o    -lwxmsw28d_core -lwxbase28d -lwxmsw28d_adv
But there are none, and the resulting executable works without problems. So also does the more complex project I alluded to earlier, which has many more files' worth of code. You might notice that MinGW's "-mwindows" option is unnecessary to successfully build and run it.

I've tested this with GCC and Borland. The app compiles even if you don't add a single extra Win32 SDK lib. But with Borland you need to add wxpng and wxzlib libraries in order to compile successfully. But I found a lot of errors while compiling with MSVC 8. Some of them are as follows --

Quote
:: === TestWX, Debug ===
wxmsw28d_core.lib(window.obj):: error LNK2019: unresolved external symbol __imp__GdiFlush@0 referenced in function "public: virtual void __thiscall wxWindow::Update(void)" (?Update@wxWindow@@UAEXXZ)
wxmsw28d_core.lib(window.obj):: error LNK2019: unresolved external symbol __imp__DragAcceptFiles@8 referenced in function "public: virtual void __thiscall wxWindow::DragAcceptFiles(bool)" (?DragAcceptFiles@wxWindow@@UAEX_N@Z)
wxmsw28d_core.lib(window.obj):: error LNK2019: unresolved external symbol __imp__GetTextMetricsA@8 referenced in function "public: virtual void __thiscall wxWindow::GetTextExtent(class wxString const &,int *,int *,int *,int *,class wxFont const *)const " (?GetTextExtent@wxWindow@@UBEXABVwxString@@PAH111PBVwxFont@@@Z)
wxmsw28d_core.lib(window.obj):: error LNK2019: unresolved external symbol __imp__GetTextExtentPoint32A@16 referenced in function "public: virtual void __thiscall wxWindow::GetTextExtent(class wxString const &,int *,int *,int *,int *,class wxFont const *)const " (?GetTextExtent@wxWindow@@UBEXABVwxString@@PAH111PBVwxFont@@@Z)
wxmsw28d_core.lib(window.obj):: error LNK2019: unresolved external symbol __imp__DragQueryPoint@8 referenced in function "public: bool __thiscall wxWindow::HandleDropFiles(unsigned int)" (?HandleDropFiles@wxWindow@@QAE_NI@Z)
wxmsw28d_core.lib(window.obj):: error LNK2019: unresolved external symbol __imp__DragFinish@4 referenced in function "public: bool __thiscall wxWindow::HandleDropFiles(unsigned int)" (?HandleDropFiles@wxWindow@@QAE_NI@Z)
wxmsw28d_core.lib(window.obj):: error LNK2019: unresolved external symbol __imp__DragQueryFileA@16 referenced in function "public: bool __thiscall wxWindow::HandleDropFiles(unsigned int)" (?HandleDropFiles@wxWindow@@QAE_NI@Z)
wxmsw28d_core.lib(window.obj):: error LNK2019: unresolved external symbol __imp__RealizePalette@4 referenced in function "public: bool __thiscall wxWindow::HandlePaletteChanged(void *)" (?HandlePaletteChanged@wxWindow@@QAE_NPAX@Z)
wxmsw28d_core.lib(window.obj):: error LNK2019: unresolved external symbol __imp__SelectPalette@12 referenced in function "public: bool __thiscall wxWindow::HandlePaletteChanged(void *)" (?HandlePaletteChanged@wxWindow@@QAE_NPAX@Z)
wxmsw28d_core.lib(window.obj):: error LNK2019: unresolved external symbol __imp__CreateRectRgn@16 referenced in function "public: bool __thiscall wxWindow::HandlePaint(void)" (?HandlePaint@wxWindow@@QAE_NXZ)
wxmsw28d_core.lib(checklst.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(listctrl.obj):: error LNK2019: unresolved external symbol __imp__SelectObject@8 referenced in function "public: virtual __thiscall wxCommandEvent::~wxCommandEvent(void)" (??1wxCommandEvent@@UAE@XZ)
wxmsw28d_core.lib(dib.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(clipbrd.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(dcprint.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(bmpbuttn.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(ownerdrw.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(notebook.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(treectrl.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(tooltip.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(button.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(dcmemory.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(listbox.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(window.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(tbar95.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(bitmap.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(dc.obj):: error LNK2001: unresolved external symbol __imp__SelectObject@8
wxmsw28d_core.lib(toplevel.obj):: error LNK2019: unresolved external symbol __imp__OffsetRgn@12 referenced in function "public: virtual bool __thiscall wxTopLevelWindowMSW::SetShape(class wxRegion const &)" (?SetShape@wxTopLevelWindowMSW@@UAE_NABVwxRegion@@@Z)
wxmsw28d_core.lib(region.obj):: error LNK2001: unresolved external symbol __imp__OffsetRgn@12
wxmsw28d_core.lib(statbox.obj):: error LNK2001: unresolved external symbol __imp__OffsetRgn@12
wxmsw28d_core.lib(toplevel.obj):: error LNK2019: unresolved external symbol __imp__ExtCreateRegion@12 referenced in function "public: virtual bool __thiscall wxTopLevelWindowMSW::SetShape(class wxRegion const &)" (?SetShape@wxTopLevelWindowMSW@@UAE_NABVwxRegion@@@Z)
wxmsw28d_core.lib(region.obj):: error LNK2001: unresolved external symbol __imp__ExtCreateRegion@12
wxmsw28d_core.lib(toplevel.obj):: error LNK2019: unresolved external symbol __imp__GetRegionData@12 referenced in function "public: virtual bool __thiscall wxTopLevelWindowMSW::SetShape(class wxRegion const &)" (?SetShape@wxTopLevelWindowMSW@@UAE_NABVwxRegion@@@Z)
wxmsw28d_core.lib(app.obj):: error LNK2019: unresolved external symbol __imp__InitCommonControls@0 referenced in function "public: virtual bool __thiscall wxApp::Initialize(int &,char * *)" (?Initialize@wxApp@@UAE_NAAHPAPAD@Z)
wxmsw28d_core.lib(app.obj):: error LNK2019: unresolved external symbol __imp__OleInitialize@4 referenced in function "bool __cdecl wxOleInitialize(void)" (?wxOleInitialize@@YA_NXZ)
wxmsw28d_core.lib(clipbrd.obj):: error LNK2001: unresolved external symbol __imp__OleInitialize@4
wxmsw28d_core.lib(app.obj):: error LNK2019: unresolved external symbol __imp__OleUninitialize@0 referenced in function "void __cdecl wxOleUninitialize(void)" (?wxOleUninitialize@@YAXXZ)
:: More errors follow but not being shown.
:: Edit the max errors limit in compiler options...
:: === Build finished: 50 errors, 0 warnings ===

To solve this I started adding Win32 libraries, one by one. At last the addition of following libraries solved the problem.
Quote
winmm.lib, rpcrt4.lib, kernel32.lib, user32.lib, gdi32.lib, ole32.lib, oleaut32.lib, comctl32.lib, comdlg32.lib, uuid.lib, advapi32.lib, shell32.lib

But I don't know why the number of libraries required varies with different compilers? wx Gurus, please shed more light on this.

But as long as I don't know why this is happening, I'll follow the safer route. It's better to have peaceful night rather than breaking one's head over huge number of cryptic error messages.

Code::Blocks team had added few libraries, and I've added few more so that I don't get any error messages and I don't see any point of removing them all, as long as it works with all compilers.  :D
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: bnilsson on December 26, 2006, 01:06:46 pm
Just for your information,
applying your new script gave me the script error message seen below.
I selected wxWidgets 2.6.x, no extra options.


[attachment deleted by admin]
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on December 26, 2006, 01:34:46 pm
Just for your information,
applying your new script gave me the script error message seen below.
I selected wxWidgets 2.6.x, no extra options.

I am very sorry, I may have missed to inform that the modifications are Windows specific.  :oops:  I would rather disable it for other platforms for the time being. I have no idea about Mac/Linux programming, thus I didn't modify them.

You got that script error due to some uninitialized variables, I'll look for that error. It would be of great help if someone modifies the script for Linux/Mac.  :D

Update:
Thanks for posting that bug. It was due to some uninitialised variables of Windows part coming to Unix part of the script. I have now modified the code to restrict all the modification to Windows platform only. Please check it once and post if you're getting any errors. Also my apologies for not mentioning the platform in my original post.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on December 26, 2006, 02:51:45 pm
Hi,

I've uploaded new wizard file. Modifications / Improvements are-

P.S. - I don't have any experience with Linux. It would be nice if someone modifies the Unix part of the wizard.  :D  I think couple of changes to the directory of wx-config for each version should do the job. But I don't know how to do that.  :(
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: TDragon on December 26, 2006, 05:31:37 pm
I've tested this with GCC and Borland. The app compiles even if you don't add a single extra Win32 SDK lib. But with Borland you need to add wxpng and wxzlib libraries in order to compile successfully. But I found a lot of errors while compiling with MSVC 8.
...
Code::Blocks team had added few libraries, and I've added few more so that I don't get any error messages and I don't see any point of removing them all, as long as it works with all compilers.  :D

If this is not the case for compilers other than GCC, then I would expect a well-designed wizard to distinguish among the various compilers and set the options accordingly.

The point of removing the unnecessary libraries is to provide a cleaner, more polished, more professional product. Sure, everything works as it is right now; it's an improvement over the current wizard, and so I congratulate you. As I said originally: aside from throwing in a few libraries I don't need, this version works admirably well.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: bnilsson on December 26, 2006, 05:53:29 pm
No errors this time, thanks for the fix.

Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on December 26, 2006, 06:15:53 pm
Hi bnilsson, Thanks for your confirmation.  :D

Hi TDragon, I'm not sure why the compilers work in such a way?? If anyone have any idea, please post.

I frequently use MSVC 8 as that comes for free with a great IDE. That's why I didn't notice that. Thanks for pointing that out. Also if you go through the makefiles in wxWidgets sample directory, you'll find they have also added a number of Win32 libraries. I'm just quoting one line from minimal app's makefile for GCC.
Code: makefile.gcc
$(OBJS)\minimal.exe: $(MINIMAL_OBJECTS) $(OBJS)\minimal_sample_rc.o
$(CXX) -o $@ $(MINIMAL_OBJECTS) $(LDFLAGS) $(__DEBUGINFO) $(__THREADSFLAG) -L$(LIBDIRNAME) -Wl,--subsystem,windows -mwindows  $(__WXLIB_CORE_p)  $(__WXLIB_BASE_p)  $(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p)  -lwxzlib$(WXDEBUGFLAG)  -lwxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG) -lwxexpat$(WXDEBUGFLAG) $(EXTRALIBS_FOR_BASE) $(__UNICOWS_LIB_p) $(__GDIPLUS_LIB_p) -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lodbc32

I don't know the reason  :?
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: mandrav on December 27, 2006, 10:18:34 am
Quote
I'm not sure why the compilers work in such a way?? If anyone have any idea, please post.

In a few simple words:

When you 're creating a DLL (e.g. foo.dll), every function that it needs from a static library (e.g. libABC.a) is embedded into the DLL. If you use that DLL later with your project and you don't use other functions from that static lib (i.e. from libABC.a) then there is no need for you to link to the static lib too.

On the other hand, when creating a static library (e.g. libfoo.a), it contains only its own symbols. If it needs symbols from another static lib (e.g. libABC.a), you have to link to it too when linking your app.

So, for wx, if you will be using the wx dll, no extra static libs are needed in linking stage. But if you use the wx lib, you need to link to all those static libs you see in the examples...

I hope that didn't complicate things more :).
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on December 27, 2006, 11:19:07 am
Thanks mandrav for your excellent reply.  :D :D

It cleared my doubts.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on December 29, 2006, 05:46:54 pm
Here is another update of the wizard.  :D

Changes:

(http://img300.imageshack.us/img300/9119/wxwizardaddlibrg7.png)
Check the option, in bold, to go the next page.

One point to remember that though there is no Next button, but clicking on Finish button will move to next page (if the Add more wxWidgets libraries is selected).

(http://img176.imageshack.us/img176/8264/wxwizardadvlibba0.png)
If you need more, then add them here.

Please test it and post your feedback.  :D
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: TDragon on December 29, 2006, 06:20:46 pm
Works like a charm, at least as far as I've tested it (using GCC). Any of the C::B devs feel like integrating it into the main project?
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: mandrav on December 29, 2006, 06:33:46 pm
Works like a charm, at least as far as I've tested it (using GCC). Any of the C::B devs feel like integrating it into the main project?

We sure will, once a few people test it and report that it works fine :).
Great job Biplab :).
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on December 29, 2006, 06:44:17 pm
Works like a charm, at least as far as I've tested it (using GCC). Any of the C::B devs feel like integrating it into the main project?

We sure will, once a few people test it and report that it works fine :).
Great job Biplab :).

Thanks Mandrav  :D

I am also waiting for others to test it before I request C::B devs to integrate it. :)
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: RJP Computing on December 30, 2006, 09:26:36 pm
Well it looks great.

There is a problem that makes it so that it won't link right out of the box.

I chose everything default except I un-checked "Use wxWidgets dll".

It needs to set the Debug and Release targets policy to "Prepend target options to project options" See screen shot below.

PS. It works great when building against a dll version of wxWidgets.

[attachment deleted by admin]
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: killerbot on December 30, 2006, 11:02:12 pm
well, I haven't looked at them. But I have one concern (will post another article about that somewhere next week), just make sure the header includes are ok, and just include what's needed.
For example the current simple wx project which is generated, it's header includes are not so nice.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on December 31, 2006, 07:09:30 am
Well it looks great.

There is a problem that makes it so that it won't link right out of the box.

I chose everything default except I un-checked "Use wxWidgets dll".

It needs to set the Debug and Release targets policy to "Prepend target options to project options" See screen shot below.

PS. It works great when building against a dll version of wxWidgets.

Thanks Ryan for your comments.  :D

Did you check with Static lib of wx? Can you please post the problems you've faced? The only problem I've faced is with Borland C++ 5.5.1 compiler and sometimes the debug target doesn't link with static debug lib of wx. I think this is due to the exe size limit of that compiler which is around 2.5 MB. It works fine with release target.

I have added the Linker Policy you've pointed out in the wizard. Please see the following screenshot (using the revised code). Do you think it needs to be added for the Compilers too??

I am attaching the revised code with this post. The revision is that now wizard adds Target Policy to linker. :D

(http://img226.imageshack.us/img226/7350/liinkerprependpolicyly5.png)


well, I haven't looked at them. But I have one concern (will post another article about that somewhere next week), just make sure the header includes are ok, and just include what's needed.
For example the current simple wx project which is generated, it's header includes are not so nice.

Thanks for your concern. I have modified only the wizard script, not the sample code. So I didn't remove or add anything from the sample code. But I am suggesting one change. Line no 14 of main .h should be changed.

Code: from "main.h, line 14"
DECLARE_EVENT_TABLE();

Code: to "main.h, line 14"
DECLARE_EVENT_TABLE()

The line works fine with GCC and MSVC, but not with BCC. Removing the ';' will not produce any error with GCC, BCC or MSVC.  :)

I think I should have posted this earlier.  :?

[attachment deleted by admin]
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: RJP Computing on December 31, 2006, 08:33:11 pm
Works great now. I have attached a screen shot of the settings that I used because I am not sure what you are exactly asking about when you said:
Quote
Did you check with Static lib of wx?

Quote
Can you please post the problems you've faced?
This is just a bit of the linking errors, but you get the idea.
Code
Linking executable: bin\Release\cbWizTest2.exe
C:\devel\Libraries\wxWidgets2.8\lib\gcc_lib/libwxmsw28u.a(monolib_app.o):app.cpp:(.text+0x665): undefined reference to `InitCommonControls@0'
C:\devel\Libraries\wxWidgets2.8\lib\gcc_lib/libwxmsw28u.a(monolib_app.o):app.cpp:(.text+0x680): undefined reference to `OleInitialize@4'
C:\devel\Libraries\wxWidgets2.8\lib\gcc_lib/libwxmsw28u.a(monolib_app.o):app.cpp:(.text+0x8be): undefined reference to `OleUninitialize@0'
C:\devel\Libraries\wxWidgets2.8\lib\gcc_lib/libwxmsw28u.a(monolib_statbr95.o):statbr95.cpp:(.text+0x16f): undefined reference to `CreateStatusWindowW@16'
C:\devel\Libraries\wxWidgets2.8\lib\gcc_lib/libwxmsw28u.a(monolib_droptgt.o):droptgt.cpp:(.text+0x904): undefined reference to `CoLockObjectExternal@12'
C:\devel\Libraries\wxWidgets2.8\lib\gcc_lib/libwxmsw28u.a(monolib_droptgt.o):droptgt.cpp:(.text+0x91c): undefined reference to `RegisterDragDrop@8'
C:\devel\Libraries\wxWidgets2.8\lib\gcc_lib/libwxmsw28u.a(monolib_droptgt.o):droptgt.cpp:(.text+0x94e): undefined reference to `CoLockObjectExternal@12'
C:\devel\Libraries\wxWidgets2.8\lib\gcc_lib/libwxmsw28u.a(monolib_droptgt.o):droptgt.cpp:(.text+0x971): undefined reference to `RevokeDragDrop@4'

Just a quick question for you, why do I get this message:
Quote
Precompiling header: wx_pch.h
Compiling: main.cpp
cc1plus.exe: warning: wx_pch.h.gch/Debug_wx_pch.h.gch: created using different flags
cc1plus.exe: warning: ./wx_pch.h.gch/Debug_wx_pch.h.gch: created using different flags
when I have first compiled as a Debug target, then go and rebuild the Release target?


[attachment deleted by admin]
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Pecan on December 31, 2006, 08:46:31 pm
Just a quick question for you, why do I get this message:
Quote
Precompiling header: wx_pch.h
Compiling: main.cpp
cc1plus.exe: warning: wx_pch.h.gch/Debug_wx_pch.h.gch: created using different flags
cc1plus.exe: warning: ./wx_pch.h.gch/Debug_wx_pch.h.gch: created using different flags
when I have first compiled as a Debug target, then go and rebuild the Release target?


I get that message all the time.

Each time, I switch between debug and release, I have to do a Re-Build to rebuild the pre-compiled headers because the -g flag has been toggled.

I don't think it's a result of the new wizard.

It's really annoying.

Lately, I don't even bother creating a release target. I just turn off the -g flag and re-build. Seems just as convienent as dealing with the precompiled issue.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 01, 2007, 06:08:55 am
Works great now. I have attached a screen shot of the settings that I used because I am not sure what you are exactly asking about when you said:
Quote
Did you check with Static lib of wx?

Hi Ryan, Thanks for your post.  :D

I asked the question because I have changed the wizard for wx DLL lib mode in Rev 2. In static lib mode, the wizard adds Win32 SDK libs in project scope and wx libs in target scope. If you are using DLL, it adds only wx libs in target scope but NO Win32 SDK libs are added. Though a couple of essential libs, which varies with compilers, are always added to project scope. As the policy was different, that was generating errors.

Just a quick question for you, why do I get this message:
Quote
Precompiling header: wx_pch.h
Compiling: main.cpp
cc1plus.exe: warning: wx_pch.h.gch/Debug_wx_pch.h.gch: created using different flags
cc1plus.exe: warning: ./wx_pch.h.gch/Debug_wx_pch.h.gch: created using different flags
when I have first compiled as a Debug target, then go and rebuild the Release target?

I get that message all the time.

Each time, I switch between debug and release, I have to do a Re-Build to rebuild the pre-compiled headers because the -g flag has been toggled.

I don't think it's a result of the new wizard.

It's really annoying.

Lately, I don't even bother creating a release target. I just turn off the -g flag and re-build. Seems just as convienent as dealing with the precompiled issue.

Pecan is right. It's not the fault of new wizard. Code::Blocks adds the file, required for pre-compilation, in target scope which is compiled, but not linked. As you can see that the file is added to Debug and Release target, it is compiled twice with different flags. See the following code.
Code
<Unit filename="wx_pch.h">
<Option compilerVar="CPP" />
<Option link="0" />
<Option weight="0" />
<Option target="Debug" />
<Option target="Release" />
</Unit>

I am currently working on adding support for pre-compiled headers for Borland C++ 5.5.1 and MSVC 8. I have added the support and it works fine for my project. After some more testing I'll post the revised code. But one point to note that it doesn't use Code::Block's PCH handling system.

Another problem with the sample code provided by the wizard is that it doesn't add wx_pch.h file to CPP files. Rather it is forcefully included. To me it should be included in the CPP file itself.

Wish you all Happy New Year. :D
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: RJP Computing on January 01, 2007, 06:51:02 pm
...
Another problem with the sample code provided by the wizard is that it doesn't add wx_pch.h file to CPP files. Rather it is forcefully included. To me it should be included in the CPP file itself.
I prefer this method. It is simple, smart and makes it easy to use. Please keep it this way, or at least a setting.

...
Pecan is right. It's not the fault of new wizard. Code::Blocks adds the file, required for pre-compilation, in target scope which is compiled, but not linked. As you can see that the file is added to Debug and Release target, it is compiled twice with different flags. See the following code.
Code
<Unit filename="wx_pch.h">
<Option compilerVar="CPP" />
<Option link="0" />
<Option weight="0" />
<Option target="Debug" />
<Option target="Release" />
</Unit>
Great I don't mind the warning I just wanted to make sure that I was still using pre-compiled headers in Release.

Quote
Wish you all Happy New Year. :D
Happy New year!
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 02, 2007, 05:08:55 pm
...
Another problem with the sample code provided by the wizard is that it doesn't add wx_pch.h file to CPP files. Rather it is forcefully included. To me it should be included in the CPP file itself.
I prefer this method. It is simple, smart and makes it easy to use. Please keep it this way, or at least a setting.

...
Another problem with the sample code provided by the wizard is that it doesn't add wx_pch.h file to CPP files. Rather it is forcefully included. To me it should be included in the CPP file itself.
I prefer this method. It is simple, smart and makes it easy to use. Please keep it this way, or at least a setting.

This will create problem with Borland Compilers. With Borland compiler, there is no command, AFAIK, to create a Precompiled header by specifying a header file. It tries to generate a precompiled header by compiling the CPP file. If the CPP file does not have a #pragma hdrstop the precompilation will not stop. Rather it will try to precompile the whole file. So if the project has many files, this will create many precompiled files.

To stop this headers, to be compiled as precompiled headers, should be added first and then the #pragna hdrstop should be there to stop it. Or one can take another approach, which wxWidgets dev team follows to compile wxWidgets. They add a dummy.cpp file to project which has some header includes only.

With GCC or MSVC, one can specify a header file to precompile and generate a precompile header first, then use the same precompiled header for the rest of the files. But with Borland this is a problem.

But one thing is for sure, pre-compiled headers save a lot of time. But the CPP file should be written in proper manner to get maximum benefit.

Just to give you an example, I am working on a project. My project has about 2700 lines of code (excluding comments and third party libs) spanning over 27 files and is dependent on TinyXml and LibHaru. The full recompilation statistics are (No create, use only, i.e. 2nd time onwards) -

+-------------+--------------+----------------+
| Compiler       | With PCH       | Without PCH     |
+-------------+--------------+----------------+
| BCC 5.5.1     |  3 sec           |  18 sec            |
| MSVC 8        |  6 sec           |  36 sec            |
+-------------+---------------+---------------+

The result may vary. Also the compilation mode is set to Create / Use Precompiled headers. So when the PCH file is created, it will take longer time. But from next time onwards, it will be super fast. Now I can compile my project within Code::Blocks using different compilers, thanks to latest modification.

I'll post the latest modification after some more tests.  :D
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: RJP Computing on January 02, 2007, 06:50:53 pm
That all makes sense, I just don't want to loose the settings part for GCC and MSVC. If you need to add some lines to the code generated, no problem.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: killerbot on January 02, 2007, 06:53:42 pm
but pch can increase builds a lot also, it's interesting when using a library like wx with should remain rather static.
For example in CB sources    , with the rate of current changes, a lot of the time the builds become longer because of pch.

I think the best thing is to have a correct project wizard without pch and then add the pch capabilities.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 02, 2007, 07:54:46 pm
That all makes sense, I just don't want to loose the settings part for GCC and MSVC. If you need to add some lines to the code generated, no problem.

For GCC, the options remains same. You need to include wx_pch.h

For Borland 5.5.1, I have added the following compiler options.
Code
-H -H=<Bin_Dir>/<Target>/<Project_Name>.csm

The following lines should be present on top of every CPP file.
Code
#include "wx/wxprec.h" or #include "wx_pch.h"

#ifdef __BORLANDC__
#pragma hdrstop
#endif //__BORLANDC__

For MSVC 6 or 7.1, no modification has been made. So there is NO support for them.

For MSVC 8 the following compiler options have been added.
Code
/Yc"wx/wxprec.h"
/Fp"<Bin_Dir>\<Target>\<Project_Name>.pch"

I have not added wx_pch.h as I've not used it in my project. But I'm trying to include wx_pch.h only. I'm stuck with some problem adding that.

but pch can increase builds a lot also, it's interesting when using a library like wx with should remain rather static.
For example in CB sources    , with the rate of current changes, a lot of the time the builds become longer because of pch.

Frankly speaking I don't have enough experience with PCH. But still I'm adding them as the settings worked for me. Any suggestions, improvements are always welcome.  :)

You are right, sometimes PCH may increase the build time. But if all the CPP files are properly planned, it can really boost the performance (Please don't mean that I'm telling Code::Blocks is not properly planned  :)). What I mean to say is that if the headers, up to the point of pre-compilation, in all the CPP files in a project or a subproject is inconsistent, it will increase the build time as it will try to regenerate / create new PCH file (I faced this with Borland and to some extent with MSVC 8 ).

In my case the same project was taking about 8 sec with PCH with Borland. When I closely looked into my CPP files, I found some #pragma hdrstop are missing. I fixed them and now it takes only 3 sec!!

I think the best thing is to have a correct project wizard without pch and then add the pch capabilities.

The option is always available. Earlier the Wizard used to pop-up a message saying that the PCH is available only with GCC and then proceeded without adding PCH support. Now it adds the compiler options only if you select them. Otherwise, they won't infect your project.  :)

I have few queries.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: RJP Computing on January 02, 2007, 08:54:54 pm
Great Biplab. When can I get my hands on the updated wizard code?
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: mandrav on January 02, 2007, 10:07:18 pm
I have few queries.
  • Does Code::Blocks support PCH for compilers other than GCC?
  • How is the PCH handled internally by Code::Blocks?

PCH support is provided for GCC currently and is hardcoded. This feature needs some planning in order to be generally available for all compilers that support PCHs.
The main reason I only added PCH support for GCC is that I had no clue how to do it for other compilers...
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: TDragon on January 03, 2007, 02:49:11 am
This feature needs some planning in order to be generally available for all compilers that support PCHs.
Quoted for truth. For instance, MSVC requires one to compile a PCH through a separate source file, and then specify that the header is a PCH in the command line for every file that needs to use it.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 03, 2007, 12:14:18 pm
Great Biplab. When can I get my hands on the updated wizard code?

I'm trying to upload it tonight.

This feature needs some planning in order to be generally available for all compilers that support PCHs.

All the compilers have different requirements. That is the main problem. GCC seems to be worst among them. It needs the header and gch file to be in the same directory.

Old wizard handles the gch file effectively, but if a different target is build, the invalid-gch warning comes up. I tried to move the file to <Obj>\<Target> directory to solve this. But GCC is not accepting that and after creating GCH file it is not using it. I have included the directory in search path, but no result. So I would not look into it for time being.

This is one of the reason I prefer not use GCC for my project. Though it's Standard Compliant, but it's too slow. It took 30 sec to compile my project in PCH mode!!

Regarding the PCH support in Code::Blocks I have few suggestions, which I'll post later.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: mandrav on January 03, 2007, 01:30:25 pm
Quote
GCC seems to be worst among them. It needs the header and gch file to be in the same directory.

That is certainly not true. Why do you think there are the different PCH options in the project properties dialog? As long as the compiler can locate the .gch file before the .h one, it will use the PCH...
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 03, 2007, 02:20:45 pm
Quote
GCC seems to be worst among them. It needs the header and gch file to be in the same directory.

That is certainly not true. Why do you think there are the different PCH options in the project properties dialog? As long as the compiler can locate the .gch file before the .h one, it will use the PCH...

Sorry for the incomplete comment about GCC. There are no different options in project properties dialog. What I tried to say is the approach to handle PCH for each compiler is bit different.

For Borland, there are couple of switches.

For MSVC 8,

Or compile a cpp file with appropriate switches with MSVC. They have similarities in feature, but they don't work similarly.

I had tried tweaking the wizard using the following manual.

http://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html (http://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html)

Options for PCH are -

Second option is followed by Code::Blocks. I tried the third one it seems that it is not working through Code::Blocks. I have tried specifying the GCH dir at the beginning. Still it didn't work.

Any suggestions on what went wrong?
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: TDragon on January 03, 2007, 03:30:49 pm
Any suggestions on what went wrong?
As mandrav said, he "hard-coded" support for GCC precompiled headers. In effect, this means that any header that is marked to be compiled will follow whichever rule you choose in the Precompiled headers section of your project properties: generate the pch alongside the original header, in a subdirectory of the original header's directory, or in the object output directory (this last option introduces the "-I-" (I-split) switch, which can cause issues with other includes, particularly from external libraries).
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: mandrav on January 03, 2007, 03:53:37 pm
Any suggestions on what went wrong?
As mandrav said, he "hard-coded" support for GCC precompiled headers. In effect, this means that any header that is marked to be compiled will follow whichever rule you choose in the Precompiled headers section of your project properties: generate the pch alongside the original header, in a subdirectory of the original header's directory, or in the object output directory (this last option introduces the "-I-" (I-split) switch, which can cause issues with other includes, particularly from external libraries).

And you can change this behaviour with your wizard by using the SetModeForPCH() function of cbProject...
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 03, 2007, 04:45:06 pm
Any suggestions on what went wrong?
As mandrav said, he "hard-coded" support for GCC precompiled headers. In effect, this means that any header that is marked to be compiled will follow whichever rule you choose in the Precompiled headers section of your project properties: generate the pch alongside the original header, in a subdirectory of the original header's directory, or in the object output directory (this last option introduces the "-I-" (I-split) switch, which can cause issues with other includes, particularly from external libraries).

And you can change this behaviour with your wizard by using the SetModeForPCH() function of cbProject...


I had changed it to SetModeForPCH(pchObjectDir)  Though it was creating GCH file in obj directory, but it was not used during compilation. I'm quoting the results.


It is obvious that SetModeForPCH(pchObjectDir) is not working properly. Then I tried to add -I flag to point that the GCH file is in obj dir. But it didn't work, possibly as the PCH compilation is hardcoded.

Setting SetModeForPCH(pchObjectDir) will fix a bug present in the old wizard where if you are compiling app in two targets, one after another, you'll be thrown an warning (which may stop the build) saying that the GCH file is compiled with different flag. As GCC uses the first GCH file found in file.h.gch folder, this problem arises.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: mandrav on January 03, 2007, 05:26:14 pm
Quote
As GCC uses the first GCH file found in file.h.gch folder, this problem arises.

Another misconception here. GCC will use the gch that matches the running build. It just emits a warning for those gch that it ignores (you can avoid this warning by not defining the -Winvalid-pch option).
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 03, 2007, 05:38:58 pm
Quote
As GCC uses the first GCH file found in file.h.gch folder, this problem arises.

Another misconception here. GCC will use the gch that matches the running build. It just emits a warning for those gch that it ignores (you can avoid this warning by not defining the -Winvalid-pch option).

Thanks for clearing the misconception.  :D
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 04, 2007, 05:30:43 pm
Another update to the wizard.

Changes:

(http://img401.imageshack.us/img401/4995/wxwizarddisablddebgoptkx6.th.png) (http://img401.imageshack.us/my.php?image=wxwizarddisablddebgoptkx6.png)

Known Issues:

Please post your valuable feedbacks.  :D

P.S. - I was trying to include support for MSVC 7.1 also. But my VC 7.1 installation is horribly broken.  :evil:  It wasted a lot of time.

[attachment deleted by admin]
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: MortenMacFly on January 04, 2007, 07:16:59 pm
  • Wizard CPP files are modified to support PCH.
Just my personal thoughts on that (nice!!!) work:
I wonder if it would make sense to separate the PCH feature into an own wizard. PCH isn't something possible for wx only (obviously). Do you think from your experience it would be possible to extract a "PCH enabling wizard" out of this one that can be applied to *any* project?
With regards, Morten.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 04, 2007, 08:09:44 pm
  • Wizard CPP files are modified to support PCH.
Just my personal thoughts on that (nice!!!) work:
I wonder if it would make sense to separate the PCH feature into an own wizard. PCH isn't something possible for wx only (obviously). Do you think from your experience it would be possible to extract a "PCH enabling wizard" out of this one that can be applied to *any* project?
With regards, Morten.

Thanks for your comments.  :D

A "PCH enabling wizard" is possible and I think that's a good idea, too. First I'm giving a rough sketch then I'll post my opinion.

My rough idea--

Page in Wizard  ---------------------
[ ] Option 1
[ ] Option 2
[ ] Option 3
..
[ ] Select to enable PCH support
------------------------------------

Now the wizard shows PCH page,

PCH Settings -----------------------

Please Remember that PCH works well only when you have a large
number of static headers to include and your project CPP files have
consistent header declaration.

Improper use may increase Build time!!

[ ] Create PCH through (*.h / *.cpp) file
Browse        [..................................]

PCH Handling
( ) Create & Use (Compiler Dependent)
( ) Use only (First C::B will create and then, will compile other files in Use only mode)
--------------------------------------

I would like to add it as a function in SDK so that the wizard can be called easily from any wizard.


If the Project involves huge amount of static headers, PCH would be beneficial. Otherwise not. Also the project/subproject cpp files should be consistent, otherwise regeneration of PCH file will kill the benefit.

But I feel the option may be misused by some users even for smaller and simpler projects. That would make them vent their anger on Code::Blocks itself. That's why I've put a warning message.

 :D
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 05, 2007, 07:23:35 pm
A minor update to the wizard. This version has some fixes and improvements.

Changes in rev 3.3:

BCC produces a lot of errors if you are using wxUSE_UNICODE preprocessor definition. It fails as in some part of several wxWidgets headers #if <expr> has been used in place of #if defined(<expr>)

Manually editing them to #if defined clears the errors, but there are too many to modify.

Another useful info, BCC will fail to compile wxWidgets 2.8.0 in Unicode mode. To solve this, apply the patch to wx/filefn.h

http://cvs.wxwidgets.org/viewcvs.cgi/wxWidgets/include/wx/filefn.h.diff?r1=1.157&r2=1.158&diff_format=u (http://cvs.wxwidgets.org/viewcvs.cgi/wxWidgets/include/wx/filefn.h.diff?r1=1.157&r2=1.158&diff_format=u)

Latest revision is attached with this post. Please login to download. :D

[attachment deleted by admin]
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: rjmyst3 on January 05, 2007, 10:20:58 pm
I think wxUSE_UNICODE needs to be defined to a number
#define wxUSE_UNICODE 1
not just defined. That probably explains why BCC was upset.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 06, 2007, 03:23:26 am
I think wxUSE_UNICODE needs to be defined to a number
#define wxUSE_UNICODE 1
not just defined. That probably explains why BCC was upset.

For the other two compilers, GCC and MSVC, setting flag -DwxUSE_UNICODE or /DwxUSE_UNICODE does the job. With BCC I faced the problem. I changed it to -DwxUSE_UNICODE=1 but the problem remained. Then I've decided to change it to -DUNICODE and it worked.

Will look into it again.  :)
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 09, 2007, 05:24:20 am
I think wxUSE_UNICODE needs to be defined to a number
#define wxUSE_UNICODE 1
not just defined. That probably explains why BCC was upset.

For the other two compilers, GCC and MSVC, setting flag -DwxUSE_UNICODE or /DwxUSE_UNICODE does the job. With BCC I faced the problem. I changed it to -DwxUSE_UNICODE=1 but the problem remained. Then I've decided to change it to -DUNICODE and it worked.

Will look into it again.  :)

Setting -DwxUSE_UNICODE OR -DwxUSE_UNICODE=1 compiler options does not solve the problem for BCC. Though adding #define wxUSE_UNICODE 1 to header files should solve the problem. The best solution I found for BCC is to add -DUNICODE to compiler option. wxWidgets then internally sets wxUSE_UNICODE to 1 for Unicode App and 0 for ANSI app internally.  :)
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: three_minute_hero on January 10, 2007, 12:23:24 am
Hi Everyone,

I write you here just to inform you about a little problem (I don't know if I can call it "bug", but I've been quite annoyed by that) in the wizard.
It seems that the generation of the linker libraries list produce a wrong ordered list (i.e. "libwxmsw28u_richtext.a" is putted after "libwxmsw28u_core.a", which gives rise to compilation's problems).

...and a big big sorry for my awful english language!
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 10, 2007, 01:36:31 am
Hi Everyone,

I write you here just to inform you about a little problem (I don't know if I can call it "bug", but I've been quite annoyed by that) in the wizard.
It seems that the generation of the linker libraries list produce a wrong ordered list (i.e. "libwxmsw28u_richtext.a" is putted after "libwxmsw28u_core.a", which gives rise to compilation's problems).

...and a big big sorry for my awful english language!

Thanks for posting that bug. I'll fix it soon.  :)
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: RJP Computing on January 10, 2007, 02:39:54 pm
I am testing out the wizard with VC 8.0 here are my problems/bugs. I am using wxPack.

When not using dlls and as a monolithic lib and using pch I get this error.
Quote
-------------- Build: Debug in vc8Test ---------------
Compiling: main.cpp
Compiling: app.cpp
main.cpp
app.cpp
c1xx : fatal error C1083: Cannot open compiler intermediate file: 'obj\Debug\vc8Test.pch': No such file or directory
Process terminated with status 2 (0 minutes, 0 seconds)
0 errors, 0 warnings
 
c1xx : fatal error C1083: Cannot open compiler intermediate file: 'obj\Debug\vc8Test.pch': No such file or directory
Process terminated with status 2 (0 minutes, 0 seconds)
0 errors, 0 warnings

When I try the same as before only un-check the use pch I get an error because you are including "wx_pch.h" at the top of main.cpp and app.cpp. If you comment the 2 occurances out and add "/Zc:wchar_t-" to the compiler options it works.

NOTE: Code::Blocks developers please fix the 'wchar_t is the native type, not a typedef' option to when unchecked it should be passing  "/Zc:wchar_t-" to the compiler and when you check the setting it should send "/Zc:wchar_t". Notice the "-" at the end. Right now when you check this it sends "/Zc:wchar_t" to the compiler and this is already the default, so it makes it impossible to actually change the setting through the checkbox. I hope this makes sense.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: RJP Computing on January 10, 2007, 03:59:49 pm
Here are my problems with the wizard when compiling VC7.1 toolkit. I choose the monolithic Unicode library as the options.


More details to come after I fix the builds of the compiled wxWidgets.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 10, 2007, 04:30:45 pm
If you add wx_pch.h file in NOPCH mode, it has no effect on PCH generation. It includes wx/wxprec.h file only.


Here are my problems with the wizard when compiling VC7.1 toolkit. I choose the monolithic Unicode library as the options.

  • It is missing 'Rpcrt4.lib' from the library list.
  • The run-time needs to be selected. For Debug it should be 'Mulit-threaded Debug Runtime Library' and for Release it should be 'Mulit-threaded Runtime Library'. This will also make it so that you manually don't need to add the msvcrt[d].lib in the vc8.0 setup.
  • I had to add /NODEFAULTLIB:libcmtd.lib to the linker other options. (I think this might be fixed with building the libraries including the static runtime)
  • I found out that I built the monolithic libraries without using the static run-time library which I will have to fix and repost wxPack. This will make the above work as expected. When using a static library there should be no reason to include a dll of the runtime. That defeats the purpose in my opinion.

More details to come after I fix the builds of the compiled wxWidgets.

I'm assuming you are compiling an app with MSVC7.1 generated by new wizard.

Problem 1-3 will come as nothing has been added for MSVC 7.1 or 6. So you are getting those errors. I had deliberately skipped adding any compiler options to MSVC 7.1 (some are very similar to MSVC 8 ) as I couldn't test it.

wx Dev team does not suggest us to use static library for MSVC in some cases. I'm quoting the following line from src/common/string.cpp file.
Code
#if defined(__VISUALC__) && defined(_MT) && !defined(_DLL)
#  pragma message (__FILE__ ": building with Multithreaded non DLL runtime has a performance impact on wxString!")

This warning was one of the reason I took a longer route of embedding manifest file for MSVC 8 to exe file after the build is finished. And I think it would be better if you continue building wxPack with dynamic runtime lib.  :D
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: RJP Computing on January 10, 2007, 08:05:19 pm
If you add wx_pch.h file in NOPCH mode, it has no effect on PCH generation. It includes wx/wxprec.h file only.
That would be fine but you are not creating the wx_pch.h file at all. It is missing.

...
I'm assuming you are compiling an app with MSVC7.1 generated by new wizard.
Yes I am.

Problem 1-3 will come as nothing has been added for MSVC 7.1 or 6. So you are getting those errors. I had deliberately skipped adding any compiler options to MSVC 7.1 (some are very similar to MSVC 8 ) as I couldn't test it.
OK, well that explains why it doesn't work very well.

wx Dev team does not suggest us to use static library for MSVC in some cases. I'm quoting the following line from src/common/string.cpp file.
Code
#if defined(__VISUALC__) && defined(_MT) && !defined(_DLL)
#  pragma message (__FILE__ ": building with Multithreaded non DLL runtime has a performance impact on wxString!")

This warning was one of the reason I took a longer route of embedding manifest file for MSVC 8 to exe file after the build is finished. And I think it would be better if you continue building wxPack with dynamic runtime lib.  :D
I have done some reading and a bit of testing and have determined that the impact for most uses is minimal. In my opinion you should be able to use the statically linked library with no other files to distribute. (Yes I know the Windows is coming with them more and more) and if you would be willing to use the runtime dll you will be willing to use wxWidgets as a dll as well. So I think this is the best compromise between speed and extra files needed to distribute.  :)
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 11, 2007, 05:40:58 am
If you add wx_pch.h file in NOPCH mode, it has no effect on PCH generation. It includes wx/wxprec.h file only.
That would be fine but you are not creating the wx_pch.h file at all. It is missing.

I found that stupid bug later. Thanks a lot for pointing that out. I'll fix it in next revision.  :D

wx Dev team does not suggest us to use static library for MSVC in some cases. I'm quoting the following line from src/common/string.cpp file.
Code
#if defined(__VISUALC__) && defined(_MT) && !defined(_DLL)
#  pragma message (__FILE__ ": building with Multithreaded non DLL runtime has a performance impact on wxString!")

This warning was one of the reason I took a longer route of embedding manifest file for MSVC 8 to exe file after the build is finished. And I think it would be better if you continue building wxPack with dynamic runtime lib.  :D
I have done some reading and a bit of testing and have determined that the impact for most uses is minimal. In my opinion you should be able to use the statically linked library with no other files to distribute. (Yes I know the Windows is coming with them more and more) and if you would be willing to use the runtime dll you will be willing to use wxWidgets as a dll as well. So I think this is the best compromise between speed and extra files needed to distribute.  :)

I'm not sure what is the exact performance impact. But if you are using dynamic CRT, then you do not need to use wxwidgets as DLL; you may use static wx lib too. That _DLL flag checks whether CRT is dynamic or not when Multi-threaded option is selected. For more info please visit the following link.
Quote
http://msdn2.microsoft.com/en-us/library/abx4dbyh(VS.80).aspx

If you create static lib of wxWidgets using dynamic CRT, only external dependency will be your CRT and therefore you'll be able to solve dll distribution problem.  :D
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 11, 2007, 04:27:12 pm
Here is another upgrade. This has some important fixes. So if you are using older revision, please download and use this revision.

Changes:

Known Issues:

Some Informations:

BCC 5.82 Compiler: This compiler comes with Turbo C++ Explorer edition. Get it for free from (http://www.turboexplorer.com/cpp). To add the compiler to Code::Blocks, see my video tutorial.

wx lib order: Only 3 libraries are vulnerable to lib orders; RichText, DB_Grid and XRC. Their additional dependencies (partial) are -

By the way, you may also need to add JPEG, TIFF, Expat and Regex libraries if you add them. Sorry I could not find out their complete dependency chart. Any help would be greatly appreciated. :D

[attachment deleted by admin]
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: titan7 on January 16, 2007, 12:40:39 am
This is facinating reading to me as I am trying to convert myself from BCB6 to Mingw/CB
I am struggling along trying to get wx280 to work
I could not get my wx UNICODE=0 build apps to work
But finally USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1
worked.
Wizards that work will help this IDE, keep up the good work.

Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 16, 2007, 06:30:38 am
Thanks for your comments. :)

By the way can you be more specific on the problems you've faced?
Title: Revision 5
Post by: Biplab on January 16, 2007, 04:06:51 pm
Here comes the Revision 5 of the modified wizard. Only one new feature has been added.

Changes:

Few Important Notes:

Please visit any one of the links to learn more on msvcprt[d].lib creation.
Code
http://www.delta3d.org/article.php?story=20050721180227305&mod
http://root.cern.ch/root/Procedure/Procedure%20to%20install%20the%20free%20Microsoft%20Visual%20C.htm

I've tested the wizard for MSVC 7.1 with wxPack. I've found that Non-Monolithic libraries are statically linked. That may generate the following error if you are using this wizard with wxPack's Non-Monolithic libs.
Quote
wxbase28d.lib(baselib_datetime.obj) : error LNK2001: unresolved external symbol _timezone
OLDNAMES.lib(timezone.obj) : error LNK2001: unresolved external symbol _timezone
OLDNAMES.lib(timezone.obj) : error LNK2001: unresolved external symbol __timezone

To solve this, do the following; Go to Project > Build Options menu, then go to Linker tab. Remove msvcrt[d].lib from Linker Libraries section and add libcmt[d].lib. Also remove /NODEFAULTLIB:libcmt[d].lib from Linker Options section.

I've informed Ryan, who is the creator of wxPack, over this issue.

Please download the files from the following link (I can't attach, system says Upload folder full  :( )

http://biplab.quotaless.com/wxwidgets_wizard_Rev5.zip

Enjoy Coding!



One Request to wx Gurus. If anyone has info regarding correct wx lib order and how to find them out (from .lib files, if possible) please post it here. I've found the build order from wx dlls using Dependency Walker. But I would like to know how you devs solve the problem.  :D
Title: Re: Revision 5
Post by: Pecan on January 16, 2007, 04:27:52 pm
One Request to wx Gurus. If anyone has info regarding correct wx lib order and how to find them out (from .lib files, if possible) please post it here. I've found the build order from wx dlls using Dependency Walker. But I would like to know how you devs solve the problem.  :D
I simply used the order provided by the wx samples.
They always worked fine.
Title: Rev 6: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 22, 2007, 12:58:53 pm
Revision 6 of wxWidgets Project wizard is now available. This revision comes with several new features.

Changes:

(http://img260.imageshack.us/img260/9104/wxwizlinux1us.th.png) (http://img260.imageshack.us/my.php?image=wxwizlinux1us.png)
New options available in Linux

(http://img267.imageshack.us/img267/3378/wxwiztargettype0ea.th.png) (http://img267.imageshack.us/my.php?image=wxwiztargettype0ea.png)
Check the Highlighted option to change target type

(http://img250.imageshack.us/img250/8937/wxwiztargettypepage1he.th.png) (http://img250.imageshack.us/my.php?image=wxwiztargettypepage1he.png)
Change Target Type here, but be cautious.

Tested in:

Known Issues:

Important Note:
Please be careful while changing Target Type. For GCC there shouldn't be any problem. But with BCC you'll have to manually change some compiler settings otherwise it won't link.

The new features may come with Gift of Hidden Bugs. Please share that gift once you get that. :wink: Download the latest release from the following link.

http://biplab.quotaless.com/wxwidgets_wizard_Rev6.zip (http://biplab.quotaless.com/wxwidgets_wizard_Rev6.zip)

Also please post your comments, feedbacks.

Hope you'd enjoy this new release.  :D

[attachment deleted by admin]
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: manutd on January 24, 2007, 01:18:43 am
One thing I'd like is the wx icon in the select template list, as everything else has an icon. I saw how: copy from the regular wxWidgets template the files logo.png (for the logo) and wizard.png (for the bar on the side) and paste them into the new wizard's folder.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 24, 2007, 01:33:09 am
The Icons will be available if you overwrite the wxwidgets folder's files with the files available in the new wizard's archive. The archive contains only those files which are different from the old wizard.

The reason why I didn't include the png files is the archive size. Excluding them keeps the archive size to minimum. :wink:
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: manutd on January 24, 2007, 01:37:19 am
Oh, OK. I just changed the name of the original and extracted the new one.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: biniou on January 25, 2007, 10:27:57 am
Just wanted to say thanks for the wizard. I used Rev3 to start my new Project with wxWidgets 2.6.3 and I was able to make 2 different targets for MinGW (this target is used to be sure that my code is GCC friendly, for Linux use) and for VC++ (used to compile faster and produce more compact exe in Windows).

Everything was compiled using static libraries, monolithic for MinGW and modular for VC++. Went well for dll use also.

Thanks a lot as I had really no idea on how to begin with wxWidgets !!
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 25, 2007, 10:52:07 am
Just wanted to say thanks for the wizard. I used Rev3 to start my new Project with wxWidgets 2.6.3 and I was able to make 2 different targets for MinGW (this target is used to be sure that my code is GCC friendly, for Linux use) and for VC++ (used to compile faster and produce more compact exe in Windows).

Everything was compiled using static libraries, monolithic for MinGW and modular for VC++. Went well for dll use also.

Thanks a lot as I had really no idea on how to begin with wxWidgets !!

Thanks a lot for your feedback. I hope the wizard will now be helpful for you to use in Linux, too. :D

Despite the release of 6 revisions, I've received very few feedbacks. Thus I've decided to add a Poll in this thread. Please rate it if you have tested it. That would help us improving it further. Thanks in advance for your time.  :)
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: raph on January 25, 2007, 02:06:02 pm
Despite the release of 6 revisions, I've received very few feedbacks. Thus I've decided to add a Poll in this thread. Please rate it if you have tested it. That would help us improving it further. Thanks in advance for your time.  :)
Hi Biplab,

you are doing a realy great job here  :D
I'm using your Wizard a lot.

Before my codeblocks time, I was using MsVisual C++ 6.0 which had a (in my opinion) pretty nice wizard.
Here are some ideas:
Wow, that would boost the number of codeblocks and wxwidgets users 8)
Keep on the good work

best regards
raph
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 25, 2007, 05:23:52 pm
Hi Biplab,

you are doing a realy great job here  :D
I'm using your Wizard a lot.

Thanks for your feedback.  :D

Regarding your suggestions, I would answer them one by one.

I would add an option to customize wx's lib filenames and paths since mine (compiled using msys) are different to the default ones. So I have to accept the error message, change the library names and modify the directories. This can make starting with wx very hard for beginners.
I have never used MSYS and wxWidgets together. So I've to figure out this one. But can you give me an idea about any advantage of using MSYS in windows? I compile wx with GCC without using MSYS.

Being able to choose between different presets or even better, the wizard could try to autodetect the available configuration.
Using presets is a Good Idea. But the sheer amount of combination can be confusing. Autodetection of config is difficult, but can be implemented somehow.

Being able to choose from different application types e.g.:
  • a completely empty project (so the wizard would just set up the project options)
  • an empty project with just a wxApp derived class
  • app with wxDialog
  • app with wxFrame
Can be done. But honestly I need to know how to instruct wizard to copy the required set of files. :)

customize window:
  • title
  • menu
  • toolbar
  • statusbar
  • style
May not be possible. To do this with C::B, wizard has to set few additional preprocessor directives which would make your project clumsy.

(optionally) add a default icon (cb-icon? :)), so user will just have to edit this icon. I remember all those apps out there, coming with the default blue Microsoft MFC-icon (sometimes even "professional" software) :lol:
Icons will work in Windows, but not in Linux. So they are excluded to avoid clashes in Linux.

being able to customize the name of the created classes and filenames!!
Not possible at the moment.

In last 3 answers I've expressed that they are not possible or can't be implemented. C::B's scripting system does not parse the source files for tags using which you can control the output of wizard (You can do this in MSVC IDE). C::B basically copies the files. Thus the last 3 suggestions may not feasible now.

Regards,

Biplab
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: raph on January 26, 2007, 03:13:18 pm
Hi,

I didn't know that the wizards are scripted. Squirrel? Never heard of it :shock:
I just had a quick look, but I think you are right, the possibilities currently are very limited  :?

I have never used MSYS and wxWidgets together. So I've to figure out this one. But can you give me an idea about any advantage of using MSYS in windows? I compile wx with GCC without using MSYS.
You don't have to setup any paths  :D. Seriously, as people have the choice, they will always decide differently.

Using presets is a Good Idea. But the sheer amount of combination can be confusing. Auto detection of config is difficult, but can be implemented somehow.
Maybe add some presets like (wxPack, mingw32-make, msys). Auto detection will require some work.

Can be done. But honestly I need to know how to instruct wizard to copy the required set of files. :)
After a quick look on your script, I think GetFilesDir() returns the directories containing the files.
So you would have to add a directory for every possibility. I hate redundant data :?

May not be possible. To do this with C::B, wizard has to set few additional preprocessor directives which would make your project clumsy.
Solving this with preprocessor directives surely is the wrong way. What we would need is the possibility of modifying the generated sourcefiles. Creating a temp directory, copying the files there, modifying them, let codeblocks copy them to the project dir and deleting the temp dir would be a alternative, but implementing this cross-platform is very hard.
The easiest and cleanest way would be codeblocks providing something like a callback function with the source filename and content as parameter allowing the wizard developers to modify them with string manipulation.

Icons will work in Windows, but not in Linux. So they are excluded to avoid clashes in Linux.
Then make it a Windows feature only. I think there are enough win developers out there that the "wow, that was easy" effect would be pay off :D

being able to customize the name of the created classes and filenames!!
Not possible at the moment.
Would be possible with the callback function (see above).

I haven't ever looked at cb's source, but I think implementing this callback feature would be just a few lines.
This would greatly enhance the wizards possibilities, wouldn't it?

Waiting for your opinions
raph
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: mandrav on January 26, 2007, 03:38:19 pm
I didn't know that the wizards are scripted. Squirrel? Never heard of it :shock:
I just had a quick look, but I think you are right, the possibilities currently are very limited  :?

Until now you didn't even know that wizards are script-driven and now you already think they 're too limited.
Let me tell you something: you don't even know what a script is capable of. And until you do, please refrain from criticizing other people's work.

I love it when someone who has no clue on how something works, has already an opinion on it...
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 26, 2007, 04:03:58 pm
Hi raph,

Thanks for your post.  :)

You don't have to setup any paths  :D. Seriously, as people have the choice, they will always decide differently.
I understand your point. But to support MSYS, the code overhead will be high. I've noticed that the naming convention of resulting wx libraries and directories are different from what is being used for other compilers in Windows or when you are using makefile to compile wx libs using GCC. Another point to remember that the automatic path setup depends upon a shell script which is not independent to execute.

Maybe add some presets like (wxPack, mingw32-make, msys). Auto detection will require some work.
wxPack comes with a lot of combinations. Which one should be made the Default One? IMHO, Putting 4 Checkboxes (Debug/Release; Static/Dynamic; ANSI/Unicode; Multi-lib/Monolithic) will be helpful to users rather than putting 16 options in a combo.

After a quick look on your script, I think GetFilesDir() returns the directories containing the files.
So you would have to add a directory for every possibility. I hate redundant data :?
Thanks for pointing this. I'll play with it.  :)

Solving this with preprocessor directives surely is the wrong way. What we would need is the possibility of modifying the generated sourcefiles. Creating a temp directory, copying the files there, modifying them, let codeblocks copy them to the project dir and deleting the temp dir would be a alternative, but implementing this cross-platform is very hard.
The easiest and cleanest way would be codeblocks providing something like a callback function with the source filename and content as parameter allowing the wizard developers to modify them with string manipulation.
I think you should put a feature request, expressing your idea on how to do that. C::B devs will surely listen to you.

Then make it a Windows feature only. I think there are enough win developers out there that the "wow, that was easy" effect would be pay off :D
I've added it in my to-do list. Will try to come up with it.  :)

Regards,

Biplab
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: raph on January 26, 2007, 04:35:34 pm
Until now you didn't even know that wizards are script-driven and now you already think they 're too limited.
Well, sorry, you misunderstood me.
With limited I referred to the fact, that codeblocks (as I understood it) currently just copies the source files without letting the wizard modify the content. This makes dynamic creating of source files pretty hard.
Since cb is os and under heavy development this doesn't mean very much...
Let me tell you something: you don't even know what a script is capable of.
Are you sure? Just wonder how good you have to know me...
And until you do, please refrain from criticizing other people's work.
As I said, my intention wasn't to criticize anything (especially not cb).
I love it when someone who has no clue on how something works, has already an opinion on it...
I love it when people blame each other to have no clue, especially if they know each others as good as we.

@Biplab
What about this:
First, let the user decide what method of wx-building he used (wxpack, mingw32-make, msys).
On the next panel, put the 4 checkboxes you said and maybe add something like "auto detect" which tries do find the right configuration available. Since if you know the path to the libs and the "build method", finding out the configuration shouldn't be too hard (trial and error).

with regards
raph
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 26, 2007, 05:41:46 pm
@Biplab
What about this:
First, let the user decide what method of wx-building he used (wxpack, mingw32-make, msys).
On the next panel, put the 4 checkboxes you said and maybe add something like "auto detect" which tries do find the right configuration available. Since if you know the path to the libs and the "build method", finding out the configuration shouldn't be too hard (trial and error).

Well I'll look into this. But please do not expect this feature to be coming up very soon.

Finding lib path is not difficult. To add 20 odd libraries with appropriate lib path will add up 30-40 lines of code (my guess) to script which will only be used for MSYS. That's why I've mentioned that the extra code will somehow become an overhead. I hope you can understand the problem.

wxPack uses makefile to compile with GCC. Thus if you add the installation path that is sufficient for the wizard.

One news, I've modified the wizard now to include Resource files and Icons in Windows. I've used standard wxWidgets Icon. Will post it after testing in Linux.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: mandrav on January 26, 2007, 06:06:32 pm
Let me tell you something: you don't even know what a script is capable of.
Are you sure? Just wonder how good you have to know me...
I love it when someone who has no clue on how something works, has already an opinion on it...
I love it when people blame each other to have no clue, especially if they know each others as good as we.

No raph, I do not know you. So my only knowledge on the subject comes from your post:

I didn't know that the wizards are scripted. Squirrel? Never heard of it :shock:
I just had a quick look, but I think you are right, the possibilities currently are very limited  :?
...
I haven't ever looked at cb's source, but I think
...

Anyway, I 'm just pointing out that first you should be aware of what is available to scripts and then come up with ways to improve it. You started the other way around...
And just for the record, all things that you have mentioned as "wizards' limitations", are possible for quite some time now.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: raph on January 26, 2007, 06:10:00 pm
One news, I've modified the wizard now to include Resource files and Icons in Windows. I've used standard wxWidgets Icon. Will post it after testing in Linux.
Good news 8)

Ok, forget about the msys stuff.
What do you think about an panel to let the user modify the names of the libs manually, after the "configuration could not be found" message occurred?

UPDATE
And just for the record, all things that you have entioned as "wizards' limitations", are possible for quite some time now.
So what do you suggest?
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: mandrav on January 26, 2007, 07:04:32 pm
And just for the record, all things that you have entioned as "wizards' limitations", are possible for quite some time now.
So what do you suggest?

I don't suggest anything. I 'm here to answer questions, give guidance on how to do certain things, etc.
What I mean is my time is limited these days and I can't help with this wizard. Besides, Biplab is doing a great job from what I see. Nevertheless, I 'm available for any questions that may arise on how to implement various things in the wizard. Just form solid questions and expect solid answers.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 26, 2007, 08:49:55 pm
Well Raph, I think I must clarify some of the points. My idea about the wizard is to make it powerful for advanced users as well as simpler to operate for all. My goal is to make C::B as the default IDE for beginners when they start learning wxWidgets in Windows/Linux/Mac. Because I feel C::B gives you the flexibility to choose different Platforms & Compilers. (I've a soft corner for faster compilers :wink:)

Thus my idea is not to stuff it with unnecessary features (Please don't get offended). Some of the features you are requesting are not feasible due to some reasons which I've already explained. One of your good, feasible suggestion has already been implemented and I'll implement other feasible ones.

What do you think about an panel to let the user modify the names of the libs manually, after the "configuration could not be found" message occurred?
Take this one. For an advanced user, if he gets the warning message saying that the configuration is not found he'll either use appropriate configuration or add the required libs in the project manually.

When a beginner will use it, if the wizard throws a page with few textboxes and asking him to fill them manually, he be in deep trouble. I know from my experience, for a beginner it is a big headache. I was jumping from one IDE to another to start learning wxWidgets as no one was good for beginners. I believe the purpose of wizard also gets defeated to some extent.

AFAIK, C::B now have feature to control the behaviour of panels in wizard more flexibly. But I've not gone through the changes and will need some more time to study that. If it is possible to add more interactivity to the wizard, I'll definitely add it.  :)

As I've written earlier, if you've any suggestions to improve C::B, please post details. C::B devs will surely listen to you.  :)
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 29, 2007, 03:15:34 pm
Hello Everybody,

I'm posting revision 7 of wxWidgets project wizard of Code::Blocks.

Changes:


(http://img2.freeimagehosting.net/uploads/c7d9e3425f.png) (http://www.freeimagehosting.net/)
Screenshot showing option to create empty project in Windows

(http://img2.freeimagehosting.net/uploads/32bedd0231.png) (http://www.freeimagehosting.net/)
Screenshot showing option to create empty project in Linux

(http://img2.freeimagehosting.net/uploads/14eb43cc8f.png)
Screenshot showing Author Details Page


Known Issues:

Thanks To:

Download it from:
Attachment of this post
or
http://biplab.quotaless.com/wxwidgets_wizard_Rev7.zip (http://biplab.quotaless.com/wxwidgets_wizard_Rev7.zip)

Regards,

Biplab

[attachment deleted by admin]
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: manutd on January 29, 2007, 10:20:30 pm
Thank you, thank you, thank you! I've been looking for the empty project! Is it still linked in full?
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: manutd on January 29, 2007, 10:43:40 pm
Ahh! Creating an empty file gives me all kinds of ugly linking errors!
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 30, 2007, 04:03:43 am
Ahh! Creating an empty file gives me all kinds of ugly linking errors!

Did you add the appropriate settings / libraries? I've tested it in Windows and Linux and it worked without problem.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: manutd on January 30, 2007, 01:40:04 pm
I tried. What did you use?
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 30, 2007, 02:57:08 pm
Just tested it again with MSVC 7.1 (Debug/Release-Dynamic-Ansi-Multilib) and GCC (Debug/Release-Static-Ansi-Multilib). It works smoothly.

What are the errors you are getting??
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: manutd on January 31, 2007, 01:48:24 am
I don't know why, but it works now  :? I think I may have found a bug with at least empty project, if not all projects: if you select created precompiled header, it is never created and thus at build time you get an error that it does not exist. Fixes?
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on January 31, 2007, 02:28:11 am
I don't know why, but it works now  :? I think I may have found a bug with at least empty project, if not all projects: if you select created precompiled header, it is never created and thus at build time you get an error that it does not exist. Fixes?

Thanks for the details. :)

I think the error is coming due to the force inclusion of {Project_Name}_pch.h file. It was kept to ensure that the pch header gets included to all the cpp files. The option is not visible to users as it is added in Project level.

PCH is only supported for GCC by Code::Blocks. Thus I've used different approach for other compilers.

Fix:
1. Rename your PCH header to {Project_Name}_pch.h,
Or
2. Open your project file and replace all instances of {Project_Name}_pch.h with the name of PCH header (e.g., wx_pch.h) you are using.

I'll try to improve this part so that it becomes painless.

Regards,

Biplab
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 01, 2007, 06:07:14 pm
Hi All,

I am late to announce that Revision 7 had been merged with 30th January 2007 Nightly Release. Therefore I would request users to download the latest nightly to get the latest C::B & wx wizard together.

This thread will be kept active for discussion. Please post your suggestions to improve it in this thread. But no wizard code will be released through this thread in future.

I would like to Thank all for their support & feedback.

Regards,

Biplab
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: manutd on February 02, 2007, 01:09:59 am
I'd just like to thank you for providing this wizard  :) Keep up the good work!
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: ascxaxsvcbsxbbqvcxqsbcvxs on February 02, 2007, 02:38:14 pm
I downloaded CB revision 3558, and installed it in a new directory, with the two extra dlls.
I downloaded wxWidgets version 2.8.0 then 2.6.3
I used the wizard to create lots of different non-empty projects. For each one, I compiled the project immediately, with the standard compiler, without modifying anything. I created some of them with 2.8.0, others with 2.6.3.

Some projects with or without unicode, with or without debug, or with release, ... I tried lot of the options available.

All projects generated more than 50 errors.
Most of them are in chkconf.h.
The first is usually "wxUSE_EXCEPTIONS must be defined."
then lots of wxUSE_ constants seem not defined.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: ascxaxsvcbsxbbqvcxqsbcvxs on February 02, 2007, 03:02:16 pm
BTW, there is NO space in CB directory, nor in project directory, nor in wxWidgets directory.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 02, 2007, 03:03:50 pm
I downloaded CB revision 3558, and installed it in a new directory, with the two extra dlls.
I downloaded wxWidgets version 2.8.0 then 2.6.3
I used the wizard to create lots of different non-empty projects. For each one, I compiled the project immediately, with the standard compiler, without modifying anything. I created some of them with 2.8.0, others with 2.6.3.

Some projects with or without unicode, with or without debug, or with release, ... I tried lot of the options available.

All projects generated more than 50 errors.
Most of them are in chkconf.h.
The first is usually "wxUSE_EXCEPTIONS must be defined."
then lots of wxUSE_ constants seem not defined.

Did you compile wxWidgets?? You have downloaded the source of wxWidgets which needs to be compiled. It seems that compiler can't find setup.h.

Also post more details.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 03, 2007, 04:41:49 pm
An update has been committed in Revision 3565.

Changes:

Known Issues:
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: marlo_nl on February 04, 2007, 07:24:43 pm
Biplab,

Thanks for the wxWidgets Wizard.

It's extremly useful for "newbies" like me who are just getting on the learning curve of making a GPL development toolset to work.

I've been browsing the internet for about a month now before setting up a toolset consisting of the Codeblocks IDE, the MinGW compiler and the wxWidgets framework.

I took me quite some time to succesfully build a first "Hello World" wxWidgets application in CodeBlocks and in the end I managed with the help of the Rev5 wizard.

As a "newbie" I would like to know if it would be possible to modify your wizard to allow different wxWidgets library types to be used for Debug and Release Builds.

If I'm correct the wizard currently will use the same library type (either Shared or Static) for both the Release Build and the Debug build.

My question is the following:
Would it be possible to extend the wizard such that the user can select different project options (Use wxWidgets DLL, wxWidgets is built as a monolithic library and Enable unicode) for Release Builds and for Debug Builds?

Regards, Marlo
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 04, 2007, 07:52:38 pm
Thanks for your feedback.

If I'm correct the wizard currently will use the same library type (either Shared or Static) for both the Release Build and the Debug build.

My question is the following:
Would it be possible to extend the wizard such that the user can select different project options (Use wxWidgets DLL, wxWidgets is built as a monolithic library and Enable unicode) for Release Builds and for Debug Builds?

You are correct. It uses same type of libraries (shared or static) for both release and debug target.

It is somewhat difficult. Because the way script system works it may not be possible easily. I'll keep your request in mind but honestly I can't promise you.  :)

For the time being you can use alternate method. Use workspace.

You can uncheck the appropriate target for appropriate projects. E.g., if you wish that the first project will be built in debug mode then uncheck release target during project creation.

I agree that my suggestion may not be the best one, but it should work.  :D

Regards,

Biplab
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: marlo_nl on February 04, 2007, 09:55:58 pm
Biplab,

Thanks for your quick reply.

For a newbie like me Squirrel and scripting Codeblocks is new as well  :)
Therefore I have no feel for what the impact of my request would be. But from your reply I understand that it's not straightforward.

Forgot to mention that I did manage to set up a project where Release Target and Build Target use different library types.
The project uses a shared library for the Debug Target and a static library for the Release Target.

The project was created the wxWidgets wizard with the "Use wxWidgets DLL" check box checked.
I changed the following "Project build options" manually:
a) In the Compiler tab moved #define WXUSINGDLL from "Project" (settings used for both Debug and Release Target) to "Debug"
b) Release Target - Linker tab
   added  Link libraries: libwxmsw28u.a, comctl32, gdi32, ole32, oleaut32 and uuid
c) Release Target - Directories tab
   Compiler tab: change <path>\wxWidgets-2.8.0\lib\gcc_dll\mswud to
                                <path>\wxWidgets-2.8.0\lib\gcc_lib\mswu
   Linker tab:   change  <path>\wxWidgets-2.8.0\lib\gcc_dll to
                                <path>\wxWidgets-2.8.0\lib\gcc_lib
   Resource compiler tab: change <path>\wxWidgets-2.8.0\lib\gcc_dll\mswud to
                                             <path>\wxWidgets-2.8.0\lib\gcc_lib\mswu

With these changes the Debug Target and the Release Target build succesfully.


I'll also check your suggestion to see which "trick" is easiest to use.



A short remark for other newbies who might think "why would you like different library types in the first place?"

For Release Targets I prefer to have an executable that doesn't depend on DLL files, hence the static library.
For the Debug Target I could use a static wxWidgets debug library. But the static wxWidgets library has a big disadvantage (when compiled with MinGW GCC) if you are short on HDD space: it is huge, about 360 MByte. The shared wxWidgets library "only consumes" about 75 MByte.


Regards, Marlo
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: saddam le pion on February 04, 2007, 10:01:19 pm
I downloaded CB revision 3558, and installed it in a new directory, with the two extra dlls.
I downloaded wxWidgets version 2.8.0 then 2.6.3
I used the wizard to create lots of different non-empty projects. For each one, I compiled the project immediately, with the standard compiler, without modifying anything. I created some of them with 2.8.0, others with 2.6.3.

Some projects with or without unicode, with or without debug, or with release, ... I tried lot of the options available.

All projects generated more than 50 errors.
Most of them are in chkconf.h.
The first is usually "wxUSE_EXCEPTIONS must be defined."
then lots of wxUSE_ constants seem not defined.

Did you compile wxWidgets?? You have downloaded the source of wxWidgets which needs to be compiled. It seems that compiler can't find setup.h.

Isn't CB able to compile a program AND its librairies?
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: TDragon on February 04, 2007, 10:53:04 pm
Isn't CB able to compile a program AND its librairies?
Technically speaking, C::B isn't able to compile anything. (GCC, or whatever other compiler you choose, does the footwork.) That said, large libraries generally come with their own specific method of compilation, and wxWidgets is no exception to this rule. The C::B wiki contains straightforward instructions on how to compile wxWidgets.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 05, 2007, 03:54:11 am
Forgot to mention that I did manage to set up a project where Release Target and Build Target use different library types.
The project uses a shared library for the Debug Target and a static library for the Release Target.

The project was created the wxWidgets wizard with the "Use wxWidgets DLL" check box checked.
I changed the following "Project build options" manually:
a) In the Compiler tab moved #define WXUSINGDLL from "Project" (settings used for both Debug and Release Target) to "Debug"
b) Release Target - Linker tab
   added  Link libraries: libwxmsw28u.a, comctl32, gdi32, ole32, oleaut32 and uuid
c) Release Target - Directories tab
   Compiler tab: change <path>\wxWidgets-2.8.0\lib\gcc_dll\mswud to
                                <path>\wxWidgets-2.8.0\lib\gcc_lib\mswu
   Linker tab:   change  <path>\wxWidgets-2.8.0\lib\gcc_dll to
                                <path>\wxWidgets-2.8.0\lib\gcc_lib
   Resource compiler tab: change <path>\wxWidgets-2.8.0\lib\gcc_dll\mswud to
                                             <path>\wxWidgets-2.8.0\lib\gcc_lib\mswu

With these changes the Debug Target and the Release Target build succesfully.

I'll also check your suggestion to see which "trick" is easiest to use.

That's great.  :D I gave you alternate suggestion so that you do not need to add them manually. Please post your feedback after testing the workspace feature.

A short remark for other newbies who might think "why would you like different library types in the first place?"

For Release Targets I prefer to have an executable that doesn't depend on DLL files, hence the static library.
For the Debug Target I could use a static wxWidgets debug library. But the static wxWidgets library has a big disadvantage (when compiled with MinGW GCC) if you are short on HDD space: it is huge, about 360 MByte. The shared wxWidgets library "only consumes" about 75 MByte.

I realised your problem and that's why I didn't ask you that question. ;) I follow similar principle for my project. While developing I use DLL for quick compilation and while distributing exe I recompile it with static wx lib and with gcc.

In my 2 PCs wxWidgets libs take almost 4 GB+ of space. Majority of these libs are used to test this wizard for any issues in Linux and Windows with different configurations. Fortunately the space is not problem for me. ;)

Isn't CB able to compile a program AND its librairies?

If you don't want to compile wxWidgets on your own, then download wxPack.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: ascxaxsvcbsxbbqvcxqsbcvxs on February 05, 2007, 09:48:42 am
If you don't want to compile wxWidgets on your own, then download wxPack.

thanks, i will try.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: ascxaxsvcbsxbbqvcxqsbcvxs on February 05, 2007, 11:43:19 am
I downloaded CB revision 3558, and installed it in a new directory, with the two extra dlls.
I downloaded wxWidgets version 2.8.0 then 2.6.3
I used the wizard to create lots of different non-empty projects. For each one, I compiled the project immediately, with the standard compiler, without modifying anything. I created some of them with 2.8.0, others with 2.6.3.

Some projects with or without unicode, with or without debug, or with release, ... I tried lot of the options available.

All projects generated more than 50 errors.
Most of them are in chkconf.h.
The first is usually "wxUSE_EXCEPTIONS must be defined."
then lots of wxUSE_ constants seem not defined.

Did you compile wxWidgets?? You have downloaded the source of wxWidgets which needs to be compiled. It seems that compiler can't find setup.h.

Also post more details.

I finally managed to compile wxWidgets OK (no errors, no warnings) with mingw on XP.

In the config.gcc there is the line
BUILD = debug

so in you wizard i checked "Debug". But i got the message "A matching Debug configuration cannot be found in the wxWidgets directory you specified."

I'am confused.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 05, 2007, 11:51:09 am
Wizard checks with the combination of options you've selected. The major parameters are Static/Dynamic-Ansi/Unicode-Non-monolithic/Monolithic. So BUILD=debug ensures a debug lib but it also depends upon three more variables namely SHARED=0/1 UNICODE=0/1 and MONOLITHIC=0/1. Check the values of these variables in the makefile and then select appropriate options. Wizard will not generate that warning.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: ascxaxsvcbsxbbqvcxqsbcvxs on February 05, 2007, 01:50:32 pm
OK, thanks, it worked.
You should group these 4 major parameters in the same panel, and make this obvious. For example, gray the options that do not correspond to the compiled wxWidgets, if not too complex to do.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 05, 2007, 02:18:54 pm
OK, thanks, it worked.
You should group these 4 major parameters in the same panel, and make this obvious. For example, gray the options that do not correspond to the compiled wxWidgets, if not too complex to do.

It's a good suggestion. I'll group them.  :D

Out of these 4 major parameters, 1 parameter is decided by the target(s) you've checked in the Compiler selection page. I'll group the remaining 3 parameters.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: ascxaxsvcbsxbbqvcxqsbcvxs on February 05, 2007, 03:04:06 pm
One more question: after compilation & execution OK, i tried to add one character in the title of the window, an acute letter. I got the message "Illegal byte sequence".
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 05, 2007, 03:17:53 pm
One more question: after compilation & execution OK, i tried to add one character in the title of the window, an acute letter. I got the message "Illegal byte sequence".

Probably you need to compile your app with Unicode build of wxWidgets lib.  :)
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: ascxaxsvcbsxbbqvcxqsbcvxs on February 05, 2007, 03:27:00 pm
i did it from the beginning. That's why i'm little bit surprised!
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: mandrav on February 05, 2007, 03:53:11 pm
One more question: after compilation & execution OK, i tried to add one character in the title of the window, an acute letter. I got the message "Illegal byte sequence".

GCC needs to be told the character set used in your code. The compiler option is named "-finput-charset" and takes the encoding as argument. The default value is "-finput-charset=utf-8" (if I 'm not mistaken).
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 05, 2007, 04:36:30 pm
wx lib configurations are conveniently grouped now. See the following screenshot for more details. The changes are Windows specific.

(http://img249.imageshack.us/img249/5113/wxwizprojwxconfnewlw8.png)

Committed in Revision 3570.

Thanks ascx.....
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: ascxaxsvcbsxbbqvcxqsbcvxs on February 05, 2007, 04:41:23 pm
One more question: after compilation & execution OK, i tried to add one character in the title of the window, an acute letter. I got the message "Illegal byte sequence".

GCC needs to be told the character set used in your code. The compiler option is named "-finput-charset" and takes the encoding as argument. The default value is "-finput-charset=utf-8" (if I 'm not mistaken).

With this option, must i compile wxWidgets, just my application, or both?
Is this option available in CB, like Settings|compiler? i didn't find it.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: ascxaxsvcbsxbbqvcxqsbcvxs on February 05, 2007, 04:59:12 pm
wx lib configurations are conveniently grouped now. See the following screenshot for more details. The changes are Windows specific.



Committed in Revision 3570.

Thanks ascx.....

It is better, but for newbies, i think you should slightly modify the messages, to point out that
=> the first group represent the past (how wxWidgets was compiled)
=> while the second group is the future (what you want your project to be).
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: marlo_nl on February 05, 2007, 11:08:57 pm
Hi Biplab,

I can confirm that your alternative method (described below) can be used to create a Debug Target based on a shared wxWidgets Debug Library and a Release Target based on a static wxWigets library.


For the time being you can use alternate method. Use workspace.
  • First create one wx project with one lib config, le's say static-unicode-non-monolithic. Keep this project open.
  • Create second wx project with another lib config, let's say dll-unicode-monolithic. You've to create it in a different folder.
  • Now remove generated source (if you've ur own source) and add same source to both the projects.
  • Now save the workspace from File > Save workspace menu. From next time onwards, open the workspace and code::blocks will load both the projects.

You can uncheck the appropriate target for appropriate projects. E.g., if you wish that the first project will be built in debug mode then uncheck release target during project creation.

I agree that my suggestion may not be the best one, but it should work.  :D

Regards,

Biplab


For those who don't like to create two seperate projects to support a Debug Target based on a shared wxWigets library and Release Target based on a static wxWidgets library you can do the following:



Regards, Marlo
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 06, 2007, 04:22:35 am
Thanks marlo_nl for the feedback.  :)
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: saddam le pion on February 07, 2007, 08:42:37 am
One more question: after compilation & execution OK, i tried to add one character in the title of the window, an acute letter. I got the message "Illegal byte sequence".

GCC needs to be told the character set used in your code. The compiler option is named "-finput-charset" and takes the encoding as argument. The default value is "-finput-charset=utf-8" (if I 'm not mistaken).

With this option, must i compile wxWidgets, just my application, or both?
Is this option available in CB, like Settings|compiler? i didn't find it.

Good question! as it seems to be here lots of non-english developers, who develop non-english applications. This implies almost automatically source codes with "special" letters, so source codes with utf8.
So we want our CB to automatically accept utf8 (or having to parameter it just one time for all), not having to parameter the compiler manually for each source file of each application...
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: thomas on February 07, 2007, 11:40:21 am
GCC uses UTF-8 unless told otherwise...
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: ascxaxsvcbsxbbqvcxqsbcvxs on February 07, 2007, 12:34:15 pm
GCC uses UTF-8 unless told otherwise...

1) I installed CB version 3565 on XP
2) I installed wxWidgets 2.8.0 and compiled it with gcc with unicode => OK
3) use of the wizard to generate a basic application with unicode => compile and execute OK with gcc
4) Then without modifying any CB option anywhere, i just add the special letter é to the title of the windows:

original line, generated by the wizard
azeFrame* frame = new azeFrame(0L, _("wxWidgets Application Template"));
modified line, for beginning to test the unicode support
azeFrame* frame = new azeFrame(0L, _("wxWidgets Application Templateé"));

no other modification except this character => i got the compile message "Illegal byte sequence".

5) If i suppress this character => compile OK
6) I've now tried several times with last build 3577 => same problem, but the error message is now
"converting to execution character set: Invalid argument"
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: ascxaxsvcbsxbbqvcxqsbcvxs on February 07, 2007, 04:06:54 pm
GCC uses UTF-8 unless told otherwise...

with Dev-C++ I have no problem with the special letters: so i don't think it is a compiler problem.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: yesidh on February 07, 2007, 10:11:02 pm
I'm using mingw compiled wxWidgets using the ./configure not using the makefile.gcc that comes with wxWidgets because someone it didn't work dor me. The make file generated me the files and I copied to the $wxWIN/lib/gcc_lib

The point is that the libraries generated are like this: libwx_base-2.8.a

Seeing the wizard.script in the codeblock, I can see that the wizard looks for something like libwxbase28.a according to my setting. So I modified the 3586 SVN and it is now working. Am I the only one with this issue?.

Thanks.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 08, 2007, 03:10:10 am
Wizard does not support wx libraries compiled in Windows with ./configure script as the naming convention is totally different.

Use makefiles in Windows to compile libraries with GCC. Wizard supports that. :)

Regards,

Biplab
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: ascxaxsvcbsxbbqvcxqsbcvxs on February 08, 2007, 11:06:41 am
with the last nightly build on XP

1) With the wizard i created a project. The automatically generated files appears in the "Management" CB windows.
2) i re-run the wizard to re-create the project with the same parameters. It ask if i want to overwrite => Yes
3) then a dialogbox says that one file has been changed outside the IDE. "Do you want to reload it" => Yes for each

4) Result: in the "Management" windows, the files *.h and *.cpp appear two times each, even if they can only be opened once each.

5) I re-run a third time the wizard with same parameters: the files appear 3 times each, and so on.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 08, 2007, 12:56:24 pm
with the last nightly build on XP

1) With the wizard i created a project. The automatically generated files appears in the "Management" CB windows.
2) i re-run the wizard to re-create the project with the same parameters. It ask if i want to overwrite => Yes
3) then a dialogbox says that one file has been changed outside the IDE. "Do you want to reload it" => Yes for each

4) Result: in the "Management" windows, the files *.h and *.cpp appear two times each, even if they can only be opened once each.

5) I re-run a third time the wizard with same parameters: the files appear 3 times each, and so on.

Thanks for the feedback.  :)

Truly speaking it's not wizard's fault. C::B is failing to check whether the file exists or not. I'll look into this.

Temporary Fix:
* Close the existing project before creating the same project with same name again.
Or
* Use a different project name. ;)

Regards,

Biplab
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 08, 2007, 01:55:01 pm
The Bug has been fixed. Patch submitted. Will be updated soon.  :)
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: ascxaxsvcbsxbbqvcxqsbcvxs on February 08, 2007, 02:10:53 pm
The Bug has been fixed. Patch submitted. Will be updated soon.  :)
Thank you  :D
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: ascxaxsvcbsxbbqvcxqsbcvxs on February 08, 2007, 02:14:40 pm
* Use a different project name. ;)

in that case no, i don't want the project anymore, i actually want to overwrite it.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 08, 2007, 02:18:10 pm
The patch will allow overwriting of files. But it won't add the files again and again. :)
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: ascxaxsvcbsxbbqvcxqsbcvxs on February 08, 2007, 04:13:23 pm
Another point, which is not really a bug, just not logical:
After choosing the version of wxWidgets you want/have, you choose the directory only 3 panels afterwards  :shock: As the version and the directory of wxWidgets are closely-related informations, they should be chosen either in the same panel, or in two consecutive panels.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 08, 2007, 04:23:29 pm
Another point, which is not really a bug, just not logical:
After choosing the version of wxWidgets you want/have, you choose the directory only 3 panels afterwards  :shock: As the version and the directory of wxWidgets are closely-related informations, they should be chosen either in the same panel, or in two consecutive panels.

Thanks for the feedback.  :)

The Version selection page and Path selection pages are created using C::B's internal wizard system and they comes in different pages. So there is no way to merge them unless I write the code for some other stuffs. ;)

But surely I'll look into this aspect. :)

I was trying to save the different wx directories in configuration file. But somehow left that.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: ascxaxsvcbsxbbqvcxqsbcvxs on February 08, 2007, 04:34:03 pm
is it possible for 2 consecutive pages?
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 08, 2007, 04:42:57 pm
is it possible for 2 consecutive pages?

Yes! It's possible and it' very easy to do. :)

But I'll discuss with Other C::B devs before I commit any changes as it involves a reorientation. So you may have to wait.  :)
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 12, 2007, 09:25:58 am
Latest Changes:
Committed in Revision 3593.  :)
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Pecan on February 12, 2007, 09:15:06 pm
I finally figured out what was confusing me so much about this new wizard.
It was creating a __wxdebug__ type project when I thought it meant it was creating a CB debug project. Those are way too different things:

(http://img353.imageshack.us/img353/554/139zn4.png)

To get a widgets CB debug target, I have to change all the compile names, all the linker names, all the resource names and remove the __wxdebug__.

To get what is usually thought of as a CB debug project(which is what the overwheming majority of users will want), we'll have to tell the user to create a Release target and set it by hand to produce a debug project.

Not a good thing to have to tell anyone. It's going to cause a huge amount of confused traffic on this forum. I know right now that not too many people can be generating debug targets with this wizard, because I know that can't have debug versions of wxWidgets sitting around.

(http://img512.imageshack.us/img512/8449/140nq6.png)

I suggest that you add a line in widgets library setting like:

wxWidgets is built in debug mode.

If checked, then generate the __wxdebug_ and append the 'd' to the file names.

If not, generate a "debug" target just like a "release" target but with the -g option and the warnings flags set.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 13, 2007, 06:11:47 am
"wxWidgets is built in debug mode" option was removed and now the debug target is linked against debug version of wx libs and release versions are linked against release lib of wx.

I've added this page sometimes back to allow developers more fine control over the way a project is generated. If you check the last option Set Target Types (For Advanced Users Only) in wx lib configuration page (the last screenshot in your post) you'll be presented with the following window.

(http://img250.imageshack.us/img250/8937/wxwiztargettypepage1he.png)

What I propose is to add one more option (One checkbox) saying Use Debugging wx Libraries for Both Targets in this page for Advanced Users. If you check it, it'll add debug wx libs to both targets.

IMHO, putting these advanced options in a separate page would be less confusing for newbies.  :)

Is it OK? But I'll make necessary changes tomorrow only as I'm quite busy with my studies today. :D

Regards,

Biplab
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Pecan on February 13, 2007, 02:44:50 pm

What I propose is to add one more option (One checkbox) saying Use Debugging wx Libraries for Both Targets in this page for Advanced Users. If you check it, it'll add debug wx libs to both targets.

IMHO, putting these advanced options in a separate page would be less confusing for newbies.  :)

Is it OK?

Yes, thank you.
Just please make sure that __wxdebug__ is never set unless the user explicitly clicks on it.

As an example, I've been debugging CB for almost a year and a half now, and I've only needed __wxdebug__ once. It's very *seldom* used.

I suspect that it's only been used once this year, probably by the likes of Tim S.  :D :D
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: TDragon on February 13, 2007, 03:17:14 pm
Just please make sure that __wxdebug__ is never set unless the user explicitly clicks on it.
Just as an FYI, when using wxWidgets with MSVC, it's almost always correct to define __WXDEBUG__ for a project's debug build and not define it for the release build. This is because of MSVC's debug and non-debug runtime library -- a project that links with the debug runtime requires wxWidgets to have been linked with the debug runtime also, and the same for the non-debug runtime.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Pecan on February 13, 2007, 03:56:14 pm
Just please make sure that __wxdebug__ is never set unless the user explicitly clicks on it.
Just as an FYI, when using wxWidgets with MSVC, it's almost always correct to define __WXDEBUG__ for a project's debug build and not define it for the release build. This is because of MSVC's debug and non-debug runtime library -- a project that links with the debug runtime requires wxWidgets to have been linked with the debug runtime also, and the same for the non-debug runtime.

Oh dear. What a mess.... Poor Biplab! What did you get yourself into?
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 13, 2007, 04:33:44 pm
Yes! It's indeed a mess. Not all the compilers behave similarly. So I kept the Common Minimum Options and left other options at the discretion of users. :)

Problems will arise with MSVC 7.1 & 8 and as well as BCC. BCC will not accept to compile wx app in Console mode unless some manual hacking is done.

So still in a mess on what to do. I can add another option saying "Don't Add __WXDEBUG__". But that'll mean a number of changes. ;)
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: TDragon on February 13, 2007, 04:45:10 pm
My suggestion: Use an option called "Debug target uses debug wxWidgets libraries", enabled by default for MSVC and disabled by default for GCC. (Using the debug libraries implies including __WXDEBUG__.)
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 13, 2007, 05:28:37 pm
By default Debug Target uses Debug wx lib with __WXDEBUG__ for all. But if it has to disable it then which library should be set default to for GCC?  :)
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Pecan on February 13, 2007, 05:49:26 pm
By default Debug Target uses Debug wx lib with __WXDEBUG__ for all. But if it has to disable it then which library should be set default to for GCC?  :)

For gcc, NOT using __WXDEBUG__ in a debug target is simply a release target with the -g flag set. ie, just don't append the "d" to any filenames and don't set the -D__WXDEBUG__.

It would also be nice if "Enable all compiler warnings" was set. But I won't quibble over this.

What we're after here is a debuggable CodeBlocks (or any wxwidgets target) with debug symbols linked in, but a wxWidgets with NO debug symbols linked in.

This way, when you're stepping trough CodeBlocks (or any wxwidgets target), you won't accidently step into the wxWidgets can of worms. Accidently stepping into wxWidgets can take a major effort to get out, especially since GDB "stepout" doesn't seem to work.

It also means that the user can debug CodeBlocks (or any wxwidget target) without having to build/load/maintain a debug version of wxWidgets.

Having to tell a new plugin builder that s/he first has to build and deal with a debug version of wxWidgets in order to debug a simple plugin is not a pleasant thought.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: TDragon on February 13, 2007, 07:33:57 pm
By default Debug Target uses Debug wx lib with __WXDEBUG__ for all. But if it has to disable it then which library should be set default to for GCC?  :)
The standard, non-debug library (i.e. libwxmsw26u.a for monolithic-unicode).

So if my suggested checkbox is checked, nothing changes: you get a standard debug target linking to the debug wx libs with __WXDEBUG__ defined. If the box isn't checked, the debug target uses the release wx libs and doesn't define __WXDEBUG__ (but still uses -g). Then you just make the box checked by default when using MSVC, and unchecked by default when using GCC.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 15, 2007, 04:51:20 pm
First of all my apologies to Pecan and TDragon for this late reply. I got busy with my studies and couldn't touch this.

I have made the following changes. (Screenshot has been removed)

If "Don't use __WXDEBUG__ and Debug wxWidgets lib" is selected, wizard will-

So the generated debug target will have -g option with release wx lib, but release target will remain as usual.

I've selected this option to maintain the flow of wizard. As this is specially available for GCC, this will remain hidden for newcomers.

You'll require just One additional click to activate this feature.

Please post your valuable opinion. :D

I've not committed the code to svn yet.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: TDragon on February 15, 2007, 05:23:59 pm
In my valuable opinion ( 8) ) that should work perfectly. (Although I could get extremely nitpicky and say that, according to human interface guidelines, checkboxes should be checked to indicate affirmation and unchecked to indicate negation. But I could hardly care less.)

At any rate, I'd like to know whenever you commit so I can give it another run-through with GCC and VC2005; I haven't actually tried the wizard in quite a while.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 15, 2007, 05:40:20 pm
In my valuable opinion ( 8) ) that should work perfectly.

Thanks for ur valuable opinion. :)

(Although I could get extremely nitpicky and say that, according to human interface guidelines, checkboxes should be checked to indicate affirmation and unchecked to indicate negation. But I could hardly care less.)

Thanks for the point. I'd change it to Use __WXDEBUG__ and Debug wxWidgets lib and keep it unchecked. I hope that would be acceptable. ;)

At any rate, I'd like to know whenever you commit so I can give it another run-through with GCC and VC2005; I haven't actually tried the wizard in quite a while.

I'd PM you and Pecan after I commit. :)
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 16, 2007, 05:43:23 pm
Latest Changes:


To use the new feature do the following. When you get the following screen, check Configure Advanced Options.

(http://img2.freeimagehosting.net/uploads/143c793a72.png)


You'll be taken to the following page.

(http://img2.freeimagehosting.net/uploads/356a925026.png)

By default, the option Use __WXDEBUG__ and Debug wxWidgets lib option is unchecked. Now wizard will not add debug wx libs and __WXDEBUG__ to project.

If you don't want to use this feature but only want to change the target type, then don't forget to check this again. :)

Thanks to Pecan and TDragon for discussing the necessity of this feature in details. :D

Changes are in Revision 3610.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: rjmyst3 on February 16, 2007, 07:03:42 pm
Biplab,
 If I were to supply you with a patch that added a "Use wxFormBuilder (http://www.wxformbuilder.org) for GUI Design" checkbox to the wizard and generated the necessary files, what are the chances that you would accept it?
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: byo on February 16, 2007, 07:34:24 pm
Biplab,
 If I were to supply you with a patch that added a "Use wxFormBuilder (http://www.wxformbuilder.org) for GUI Design" checkbox to the wizard and generated the necessary files, what are the chances that you would accept it?

Uhm, same question for wxSmith ;)
Maybe there could be some combo with "Preffered RAD tool" or something simillar?
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: RJP Computing on February 16, 2007, 08:00:01 pm
That would be AWESOME!
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 16, 2007, 08:33:47 pm
@rjmyst3

Yes I'd accept that if it doesn't break other parts. ;)

I am personally an user of wxFormBuilder. So I would be happy to see that. But there are couple of problems which needs to be addressed.

What is your idea about adding the support? In my opinion we can add the file (wxFB project file) to C::B Project as a dummy one which will not be compiled or linked. It will open externally in wxFB.

wxFB does not support addition of Event Handling at the present moment. So if an user regenerates the UI in wxFB, it can overwrite original source. Though subclassing is an option which is available in wxFB, but it could make the matter complicate for newbies (I could remember my ordials even some time back ;) )

So I need an fair idea of how you want to implement it. :)


@byo

I've tried only old wxSmith plugin long ago. So I need ur help to add support of this. What I suggest is to add another page (Just like version selection page) where user can select wxSmith or wxFormBuilder or None for GUI development.

IMHO, adding support for wxSmith would be far more easier as it's already integrated. Though I don't use it, I appreciate your hard work involved in that plugin. :)


@Both

Do you want the wizard to stop generating the sample source and rather use files generated by the GUI builder; or you just want to add a GUI project file so that user can Copy-Paste it (Though this is a bad idea)? As I've said, adding support for wxSmith would be easier in this regard for the first option. One important point to note is the first option would require the wizard to be modified thoroughly and would break few important features. :)

Regards,

Biplab
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: RJP Computing on February 16, 2007, 09:19:09 pm
@rjmyst3
...
wxFB does not support addition of Event Handling at the present moment. So if an user regenerates the UI in wxFB, it can overwrite original source. Though subclassing is an option which is available in wxFB, but it could make the matter complicate for newbies (I could remember my ordials even some time back ;) )
...

wxFormBuilder does support event handlers now as well as having a wizard to generate your inherited class. These are in in wxFormBuilder v3.0+
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: byo on February 16, 2007, 09:53:03 pm
@byo

I've tried only old wxSmith plugin long ago. So I need ur help to add support of this. What I suggest is to add another page (Just like version selection page) where user can select wxSmith or wxFormBuilder or None for GUI development.

IMHO, adding support for wxSmith would be far more easier as it's already integrated. Though I don't use it, I appreciate your hard work involved in that plugin. :)


To integate wxSmith into current wizard, two things have to be done:

Of course this is my first idea :)

Regards
   BYO
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: rjmyst3 on February 16, 2007, 10:11:18 pm
In my opinion we can add the file (wxFB project file) to C::B Project as a dummy one which will not be compiled or linked. It will open externally in wxFB.

This should work.

wxFB does not support addition of Event Handling at the present moment. So if an user regenerates the UI in wxFB, it can overwrite original source. Though subclassing is an option which is available in wxFB, but it could make the matter complicate for newbies (I could remember my ordials even some time back ;) )

The files generated by wxFB are not meant to be edited at all. The intended approach is that users create a class which inherits from the class that wxFB generates. The newest version of wxFB will create this class for the user, upon their request, so it should be easier for new users to get started. The newest version will also generate event handlers.

Do you want the wizard to stop generating the sample source and rather use files generated by the GUI builder; or you just want to add a GUI project file so that user can Copy-Paste it (Though this is a bad idea)? As I've said, adding support for wxSmith would be easier in this regard for the first option. One important point to note is the first option would require the wizard to be modified thoroughly and would break few important features. :)

I think we should create the sample with the GUI builder and use those files.

So, to sum up for wxFB, the wizard would generate the wxFB project file, the wxFB generated files, and the user's files which inherit from the generated classes.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: TDragon on February 17, 2007, 02:22:51 am
The wizard works quite well and has progressed quite a bit. There are only two things of note:
1. wxpng[d] and wxzlib[d] were added unnecessarily to both my GCC and VC2005 projects. (shared, multi-lib, non-unicode)
2. The tooltip text for the new checkbox says "This is available for GCC only", implying that compilers other than GCC would not be able to use the debug libs.

Keep up the good work!
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 17, 2007, 07:48:35 am
wxFormBuilder does support event handlers now as well as having a wizard to generate your inherited class. These are in in wxFormBuilder v3.0+

I think I have missed it. I have compiled the recent svn build few days back. But didn't try using the event handling. :)


To integate wxSmith into current wizard, two things have to be done:
  • Sources need few changes - this could be handled by [IF ...] macros so I guess there won't be a problem with it :)
  • wxSmith must be notified about new project and must create some internal bindings. I thought about adding few functions responsible for this task and add them to squirrel so script could call them.


By the way I'll try wxSmith to understand it.


This should work.

Then this can be done easily. :)

The files generated by wxFB are not meant to be edited at all. The intended approach is that users create a class which inherits from the class that wxFB generates. The newest version of wxFB will create this class for the user, upon their request, so it should be easier for new users to get started. The newest version will also generate event handlers.

Ok, then it can be tackled in following way.

This is when user does not want any GUI builder.
Code
#include "TestApp.h"

class TestFrame: public wxFrame

This will be when user is using wxFB.
Code
#include "TestApp.h"
#include "TestFrameGUI.h"

class TestFrame: public TestFrameGUI
where TestFrameGUI class will be generated by wxFB.

I hope for wxSmith the changes will be similar. :)


1. wxpng[d] and wxzlib[d] were added unnecessarily to both my GCC and VC2005 projects. (shared, multi-lib, non-unicode)
2. The tooltip text for the new checkbox says "This is available for GCC only", implying that compilers other than GCC would not be able to use the debug libs.

1. I checked that and I found that it works without them, too. :) I'll not make any further changes to this as this minimum config works fine with static and dll libs. Please don't misunderstand me, but changing this means I need to change the last two panels and as well as the script code itself. :)
2. I didn't add this to other compilers as there could be problems during linking. At least VC will not accept it. ;) But surely, if it works with other compilers, please inform me. I'll update the wizard. :)

Regards,

Biplab
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: rjmyst3 on February 17, 2007, 02:22:25 pm
Ok, then it can be tackled in following way.

This is when user does not want any GUI builder.
Code
#include "TestApp.h"

class TestFrame: public wxFrame

This will be when user is using wxFB.
Code
#include "TestApp.h"
#include "TestFrameGUI.h"

class TestFrame: public TestFrameGUI
where TestFrameGUI class will be generated by wxFB.

Sounds Perfect!  :D
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: TDragon on February 17, 2007, 06:49:04 pm
2. I didn't add this to other compilers as there could be problems during linking. At least VC will not accept it. ;) But surely, if it works with other compilers, please inform me. I'll update the wizard. :)
What I'm saying is that your description is misleading. Saying that an option called "Use __WXDEBUG__ and Debug wxWidgets lib" is available for GCC only implies that non-GCC compilers can't use the debug wxWidgets lib -- which is obvioulsy wrong, since the wizard correctly generated a debug target for VC2005 using the debug libs. You just need to reword things.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 17, 2007, 07:17:37 pm
Yes, TDragon I noticed that discrepancy after my commit. Actually in the code there is check so that it does not affect any other compilers. Somehow missed to change the text. ;)

I'll change that in next commit.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: byo on February 17, 2007, 08:05:33 pm
  • First one is easy. This code is available in cbplugin wizard (Handling [IF] macros) and I need to copy-paste that
  • Second one I didn't understand. Please explain me a little bit. :)

By the way I'll try wxSmith to understand it.

Ok, I've modified result of wxWidgets wizard little bit to support wxSmith and whole project is in attachment. I've also tried to change files right in wizard's files, but this may be useless since some changes to these files are required when using wxFormBuilder too. If I could make a suggestion, I propose adding these three macros:

Then it would be really easy to modify template files to use one of three schemes.
wxSmith also require one more file (included as wxsmith/wxwizardframe.wxs in attachment), but that should be really easy ;)

About this second 'thing' - wxSmith adds some extensions to C::B projects - each resource is mapped to source/header files and to .wxs file (containing resource's structure or some required extra stuff). Usually these bindings are read from cbp file using C::B's extensions support . But when project is generated from wizard, there's no way to support it. So the first solution I've found is to add special wxSmith-related function to squirrel (and thus allowing them in wizards), which would notice wxSmith about new project and would let it create proper bindings. This function would be enough to properly add full wxSmith support for project.

Regards
  BYO

[attachment deleted by admin]
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 17, 2007, 08:26:36 pm
Thanks Byo for the code. I'll go through it. :D

Actually Today I tried wxSmith again to understand it. But could not post as there was some problem during posting. I've created the following page. Please have a look at it.

(http://img258.imageshack.us/img258/7646/wxguiselectalpha1uj3.th.png) (http://img258.imageshack.us/my.php?image=wxguiselectalpha1uj3.png)

My idea is also similar of using macros. Already it's in use in one place. While you add the support to add extension to project file, I would start working with basic templates of wxSmith and as well as wxFormBuilder. :)

Regards,

Biplab
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: byo on February 17, 2007, 08:55:21 pm
Thanks Byo for the code. I'll go through it. :D

Actually Today I tried wxSmith again to understand it. But could not post as there was some problem during posting. I've created the following page. Please have a look at it.

(http://img258.imageshack.us/img258/7646/wxguiselectalpha1uj3.th.png) (http://img258.imageshack.us/my.php?image=wxguiselectalpha1uj3.png)

My idea is also similar of using macros. Already it's in use in one place. While you add the support to add extension to project file, I would start working with basic templates of wxSmith and as well as wxFormBuilder. :)

Regards,

Biplab

Looks promising :)

But there may be some problem when using wxSmith's extension - what will happen when wxSmith plugin is not loaded and there's no extra function registered? I hope that squirrel won't fail and that there's a way to check if function is declared.
Making wxWidgets wizard useless only because wxSmith plugin is not loaded sound really badly :(

BYO
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 19, 2007, 08:06:50 am
Hi All,

Here is an update. The wizard code has been modified to enable support for wxFormBuilder + wxFrame based app. The wizard works fine in generating the files.

But I'm facing couple of problems. Files can be added to a Project by the Wizard in two ways.

Problem with the first method is that it doesn't parse the files. So customisations of files are not possible.

Problem with the second method is that you can parse files, but AFAIK it can't add files with unrecognised extensions. The wxFormBuilder (wxFB) project file extension is unrecognised by C::B and therefore it is not adding to project after parsing it.

There is another problem with the second method to parse wxFB project file. Pre-processor definition to enable PCH support can't be customised. If I add the wxFB project file with/without parsing, it is going to break the PCH support.

Following piece of code will make my point clear. An example of wxFB generated code is as follows. wxFB uses WX_GCH whereas the project will use USE_PCH.
Code
#ifdef WX_GCH
#include <wx_pch.h>
#else
#include <wx/wx.h>
#endif

I have decided to go with first method for the time being. But the PCH support will remain broken for wxFB generated code. Though PCH support should work with remaining part of the project.

@rjmyst3
Is it possible to add customisation of this Pre-processor directive in wxFB project file? I just want to change the Pre-processor directive to USE_PCH and want wxFB to use this while regenerating the source. I don't think this would be quite difficult to implement. :)

@Mandrav
Is there any better alternative to Second method? A link to help would be sufficient. :)

@byo
I'll implement wxSmith after I fix initial problems. But I have one request. Can you please provide me with two project files, one for Dialog based and one for Frame based? Please include wxs file, cpp and header files. :)

Regards,

Biplab

Edit 1: Fixed a Typo.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: mandrav on February 19, 2007, 10:21:13 am
Quote
Problem with the second method is that you can parse files, but AFAIK it can't add files with unrecognised extensions. The wxFormBuilder (wxFB) project file extension is unrecognised by C::B and therefore it is not adding to project after parsing it.

Where did you get that from? You can add whatever kinds of files you want in a project. It's only checking the extensions to decide if each file needs to be built/linked or not.
Give me more info on this. Either you did something wrong or you discovered a bug which we 'll fix.

Quote
There is another problem with the second method. Pre-processor definition to enable PCH support can't be customised. If I add the wxFB project file with/without parsing, it is going to break the PCH support.

How come? Why can't you use WX_GCH instead of USE_PCH?

Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 19, 2007, 10:47:08 am
Where did you get that from? You can add whatever kinds of files you want in a project. It's only checking the extensions to decide if each file needs to be built/linked or not.
Give me more info on this. Either you did something wrong or you discovered a bug which we 'll fix.

I didn't get it from SDK manual. ;) I found that the script is adding additional *.cpp  or *.h files but not adding the *.fbp file. I checked it with ShowInfo() to see whether the parsing is being done or not. I found the parsing is done but it is not adding the file. Later I checked the Debug Log and I found C::B is complaining.

Quote
[17:53:14.125]: Add project Test in parsing queue
[17:53:14.218]: Project's base path: C:\Projects\Test\
[17:53:14.218]: Project's common toplevel path: C:\Projects\Test\
[17:53:14.296]: Generated file C:\Projects\Test\TestApp.h
[17:53:14.312]: Generated file C:\Projects\Test\TestApp.cpp
[17:53:14.328]: Generated file C:\Projects\Test\TestMain.h
[17:53:14.359]: Generated file C:\Projects\Test\TestMain.cpp
[17:53:14.375]: Generated file C:\Projects\Test\Test_pch.h
[17:53:14.390]: Generated file C:\Projects\Test\TestGUIFrame.h
[17:53:14.406]: Generated file C:\Projects\Test\TestGUIFrame.cpp
[17:53:14.406]: Attempt to generate a file with forbidden extension!
File: TestGUIFrame.fbp

I'm posting a part of the script for your information.
Code
function GetGeneratedFile(file_index)
{
    if (!IsEmpty)
{
local ProjectName = Wizard.GetProjectName();
if (file_index == 0)
return ProjectName + _T("App.h") + _T(";") + GenerateHeader(file_index);
else if (file_index == 1)
        return ProjectName + _T("App.cpp") + _T(";") + GenerateSource(file_index);
else if (file_index == 2)
        return ProjectName + _T("Main.h") + _T(";") + GenerateHeader(file_index);
else if (file_index == 3)
return ProjectName + _T("Main.cpp") + _T(";") + GenerateSource(file_index);
else if (file_index == 4)
{
if (WantPCH)
return ProjectName + _T("_pch.h") + _T(";") + GenerateHeader(file_index); // PCH file
else
{
if (GuiBuilder == 0)
return _T(""); // Stop Here.
else if (GuiBuilder == 1)
return ProjectName + _T("_wxsmith.wxs") + _T(";") + GenerateHeader(file_index); // wxSmith file
else if (GuiBuilder == 2)
//return ProjectName + _T("_wxfb.fbp") + _T(";") + GenerateHeader(file_index); // wxFormBuilder file
ShowInfo(ProjectName + _T("_wxfb.fbp") + _T(";") + GenerateHeader(file_index)); // This one is for testing
}
}
else if (file_index == 5)
{
if (GuiBuilder == 2)
{
if (GuiAppType == 1)
return ProjectName + _T("GUIFrame.h") + _T(";") + GenerateHeader(file_index);
else if (GuiAppType == 0)
return ProjectName + _T("GUIDialog.h") + _T(";") + GenerateHeader(file_index);
}
}
else if (file_index == 6)
{
if (GuiBuilder == 2)
{
if (GuiAppType == 1)
return ProjectName + _T("GUIFrame.cpp") + _T(";") + GenerateHeader(file_index);
else if (GuiAppType == 0)
return ProjectName + _T("GUIDialog.cpp") + _T(";") + GenerateHeader(file_index);
}
}
else if (file_index == 7 && WantPCH) // This is to ensure that if WantPCH is true, then project file should be added
{
if (GuiBuilder == 1)
return _T(""); // WIll be added later
else if (GuiBuilder == 2)
{
if (GuiAppType == 0)
return ProjectName + _T("GUIDialog.fbp") + _T(";") + GenerateHeader(file_index);
else if (GuiAppType == 1)
return ProjectName + _T("GUIFrame.fbp") + _T(";") + GenerateHeader(file_index);
}
}
}
    return _T(""); // no more generated files
}

I'm also attaching the full source if you wish to test it. But please make a backup of old folder as this is not fully working yet. :)

Quote
There is another problem with the second method. Pre-processor definition to enable PCH support can't be customised. If I add the wxFB project file with/without parsing, it is going to break the PCH support.

Sorry mandrav, this one is a typo. It should be "There is another problem with the second method to parse wxFB project file. Pre-processor definition to enable PCH support can't be customised (as they are not available in Project file). If I add the wxFB project file with/without parsing, it is going to break the PCH support."

How come? Why can't you use WX_GCH instead of USE_PCH?

I'm afraid that may create problem when wxSmith support will be added. For all the three possible options (None, wxSmith and wxFormBuilder), the same Pre-processor definition would be helpful. Either we 3 settle for same Pre-processor flag or there should be options available to customise them. :)

[attachment deleted by admin]
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: rjmyst3 on February 19, 2007, 03:11:50 pm
wxFB uses WX_GCH whereas the project will use USE_PCH.

 It would be pretty easy for wxFB to change to this:
Code
#if ( defined(WX_GCH) || defined(USE_PCH) )
#include <wx_pch.h>
#else
#include <wx/wx.h>
#endif

That way existing projects setup with WX_GCH would not break, but it should also work the with Code::Blocks wizard.
Customization would be better, probably, but I'll need to talk to the other devs about adding a property.
Will that work for you?
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 19, 2007, 04:27:55 pm
It would be pretty easy for wxFB to change to this:
Code
#if ( defined(WX_GCH) || defined(USE_PCH) )
#include <wx_pch.h>
#else
#include <wx/wx.h>
#endif

That way existing projects setup with WX_GCH would not break, but it should also work the with Code::Blocks wizard.

Yes! This will work. But I'll request you to NOT to add this immediately. Because I'm not sure about wxSmith. These three options need a common Pre-processor define to avoid this problem.  :D

Customization would be better, probably, but I'll need to talk to the other devs about adding a property.
This would be a nice addition.  :)
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: byo on February 19, 2007, 10:05:24 pm
@byo
Can you please provide me with two project files, one for Dialog based and one for Frame based? Please include wxs file, cpp and header files. :)

Project file for wxDialog-based app is in attachment :) I've added some content into dialog since wxDialog can not have menus nor toolbars

Yes! This will work. But I'll request you to NOT to add this immediately. Because I'm not sure about wxSmith. These three options need a common Pre-processor define to avoid this problem.  :D

wxSmith uses the same scheme as in current wizard, this can be changed without any harm to wxSmith's behaviour. Maybe current content of files could be tweaked a little bit because wxSmith always generates list of includes in source/header files - these could be disabled when using PCH by putting inside #if block. wxSmith should easily handle this :)

Regards
  BYO

[attachment deleted by admin]
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 20, 2007, 09:58:06 am
Project file for wxDialog-based app is in attachment :) I've added some content into dialog since wxDialog can not have menus nor toolbars

Many Thanks to You, Byo!  :D

I'll add the same contents to wxFormBuilder, too. ;)

wxSmith uses the same scheme as in current wizard, this can be changed without any harm to wxSmith's behaviour. Maybe current content of files could be tweaked a little bit because wxSmith always generates list of includes in source/header files - these could be disabled when using PCH by putting inside #if block. wxSmith should easily handle this :)

OK, I'll change the PCH Pre-processor definition to WX_PRECOMP. This is also supported by wxFormBuilder. As wxSmith can use it easily, this could solve our problem.

@rjmyst3
As byo wrote that wxSmith can support WX_PRECOMP Pre-processor definition without any problem, I'll go ahead with it.

The following code, in the generated header, should not be a problem. AFAIK, if you wish to use this header to create Pre-Compiled Header then the following code is necessary, otherwise Not. IMHO, the following code is bit redundant.

Code
#ifdef WX_GCH
#include <wx_pch.h>
#else
#include <wx/wx.h>
#endif

During compilation of cpp file, this code may not play a big role. :)

Regards,

Biplab
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: rjmyst3 on February 20, 2007, 03:27:17 pm
Quote
IMHO, the following code is bit redundant.

Code
#ifdef WX_GCH
#include <wx_pch.h>
#else
#include <wx/wx.h>
#endif

During compilation of cpp file, this code may not play a big role.

I tend to agree, but I didn't create it and I don't know enough, yet. I've posted about it on our forum, and am researching, so hopefully I'll figure it out soon.

Anyway, I'm looking forward to the wizard, thanks for your work!  :D
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: byo on February 21, 2007, 10:13:44 pm
I've managed to add extra function to squirrel (was pretty easy using SqPlus - this lib rocks  8) ). Currently new function only popups dialog with parameters passed to it but for testing purposes it works like a charm :D

I've used this code in script:
Code
local ProjectName = Wizard.GetProjectName();   
WxsAddWxExtensions(project,ProjectName+_T("App.cpp"),ProjectName+_T("Main.cpp"),ProjectName+_T("Main.h"),_T("wxsmith/")+ProjectName+_T("dialog.wxs"));
(The last parameter may need some update since the file may be little bit different)

I've checked and if function is not registered, wizard works fine as long as function is not called (even if it's used in script's source) so we can be sure that even if wxSmith is not loaded, wizard will work fine as long as there's no wxSmith RAD selected.

The only thing I haven't found out yet is how to check if WxsAddWxExtensions function is defined using script's code - if it's not, wxSmith RAD should be disabled (or it should show some message).

Regards
   BYO
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: mandrav on February 21, 2007, 11:05:51 pm
Quote
The only thing I haven't found out yet is how to check if WxsAddWxExtensions function is defined using script's code - if it's not, wxSmith RAD should be disabled (or it should show some message).

To those interested in this, the "safe" way to check if a function exists without raising an error, is this:

Code
if ("WxsAddWxExtensions" in getroottable())
{
    ...
}

@byo: it's great that you added the first wxSmith script binding :). But make sure to de-register it when the plugin is unloaded (at least if the app is not shutting down). If you don't know how to do it, check compilergcc.cpp: it does this for a script function named "BuildLog" iirc.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: byo on February 22, 2007, 12:31:29 am
Code
if ("WxsAddWxExtensions" in getroottable())
{
    ...
}

Jay, that's everything we need :D Thanks Boss :)

Quote
@byo: it's great that you added the first wxSmith script binding :). But make sure to de-register it when the plugin is unloaded (at least if the app is not shutting down). If you don't know how to do it, check compilergcc.cpp: it does this for a script function named "BuildLog" iirc.

Yup, right, forgot to unregister, thansk again ;)

EDIT:

I guess that mentioned function is not unregistered in compilergcc.cpp coz I couldn't find it :(
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: MortenMacFly on February 22, 2007, 07:59:53 am
EDIT:
I guess that mentioned function is not unregistered in compilergcc.cpp coz I couldn't find it :(
It is as simple as that:
Code
    // disable script functions
    ScriptBindings::gBuildLogId = -1;
(in void CompilerGCC::OnRelease(bool appShutDown))... If I get Yiannis correctly.
With regards, Morten.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 22, 2007, 05:50:12 pm
Hi Everybody,

Here is an glimpse of the next most interesting change in wxWidgets wizard. We're trying to add support for wxSmith or wxFormBuilder right through the wizard. Here is the first part.

Feature:

Warning:

I'll commit it to main repository after some more tests.

@rjmyst3

Please test it once and give your feedback. :)

@byo

wxSmith support will be added after I finish this one. :)

Regards,

Biplab

[attachment deleted by admin]
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: byo on February 22, 2007, 06:11:38 pm
EDIT:
I guess that mentioned function is not unregistered in compilergcc.cpp coz I couldn't find it :(
It is as simple as that:
Code
    // disable script functions
    ScriptBindings::gBuildLogId = -1;
(in void CompilerGCC::OnRelease(bool appShutDown))... If I get Yiannis correctly.
With regards, Morten.

Nop, it won't unregister function from squirrel, it will simply make this function do nothing. But if copmpiler's dll is unloaded, any call to this function from script will cause a seg fault. I've already looked into squirrel and probably got a solution, but have to test it.

/EDIT:
Following part of code does the job:
Code
    Manager::Get()->GetScriptingManager();
    HSQUIRRELVM v = SquirrelVM::GetVMPtr();
    if ( v )
    {
        sq_pushroottable(v);
        sq_pushstring(v,"WxsAddWxExtensions",-1);
        sq_deleteslot(v,-2,false);
        sq_poptop(v);
    }
EDIT/

@byo
wxSmith support will be added after I finish this one. :)
No problem, there's no rush. I hope to have it in 1.0 final, and it rather won't be released in a week ;)

BYO
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: rjmyst3 on February 22, 2007, 06:49:56 pm
Supports Only wxFormBuilder+wxFrame based app.
@rjmyst3
Please test it once and give your feedback. :)

I tested wxFB + wxFrame on Windows XP, and it worked flawlessly. Very Nice!  :D

I only have one suggestion:
 The title for the frame ("wxWidgets Application Template") should be set in wxFB. Otherwise the user will not be able to easily change it in wxFB later.

I will test it in Linux tonight.

Good Work!
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 22, 2007, 06:53:58 pm
I tested wxFB + wxFrame on Windows XP, and it worked flawlessly. Very Nice!  :D

I only have one suggestion:
 The title for the frame ("wxWidgets Application Template") should be set in wxFB. Otherwise the user will not be able to easily change it in wxFB later.

Thanks a lot for the feedback.  :D

You are right, it should be set by wxFormBuilder. I'll change it. FYI, work on wxDialog+wxFB is in progress. :)
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 22, 2007, 07:56:51 pm
Here is second update of latest development on wxwidgets wizard.

Feature:

Known Issues:
Wizard generated project will fail to compile in Non-PCH+wxFB mode. This is due to Not wrapping PCH header include with appropriate Pre-Processor definition. Though I can wrap it manually but if you regenerate the source using wxFB, everything will be gone.

To solve this, Just comment out the following line (In Non-PCH mode only)
Code
#include "wx_pch.h"
in GUIDialog.cpp or GUIFrame.cpp file. Alternatively you may change it to
Code
#ifdef WX_PRECOMP
#include "wx_pch.h"
#endif

@rjmyst3
I think wrapping the include with appropriate Pre-Processor definition will be the best solution of this problem. Presently wxFB generated files include <wx/wxprec.h> by default which is always available and thus this issue have not come up earlier. Though this works, IMHO, creating custom PCH file will be beneficial for large projects. :)

Also please post your feedback on this update. Title issue will be solved once it is stable. :)

Regards,

Biplab

[attachment deleted by admin]
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: rjmyst3 on February 22, 2007, 10:18:43 pm
Quote
I think wrapping the include with appropriate Pre-Processor definition will be the best solution of this problem. Presently wxFB generated files include <wx/wxprec.h> by default which is always available and thus this issue have not come up earlier. Though this works, IMHO, creating custom PCH file will be beneficial for large projects. Smile

I tend to agree with you, I've posted on our forum and I await the other devs' replies.

The wxDialog works great.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: rjmyst3 on February 23, 2007, 01:46:23 pm
I tested wxFB + wxFrame and wxFB + wxDialog on Linux (Ubuntu 6.10) and they work great.

I did notice one small bug though.

The event table generated in Main.cpp has the wrong base class.
The generated code is:
Code
BEGIN_EVENT_TABLE(<generated Frame Name>, wxFrame)
when it should be:
Code
BEGIN_EVENT_TABLE(<generated Frame Name>, GUIFrame)

If GUIFrame is not the base specified in the BEGIN_EVENT_TABLE macro, then the event table generated by wxFB will be skipped.

It would be even better if wxFB was used to generate the event table, but I don't know how difficult that would be to conditionally implement in the wizard.

Everything else is superb. Great job.  :D
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 23, 2007, 03:54:09 pm
Thanks for the feedback. :D

I'll update it and post it.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 23, 2007, 07:03:37 pm
Here is another update.

Features:

Known Issues:

@rjmyst3
Please check the new release once (in Windows and Linux) and provide your feedback and suggestions.  :D

I'm proposing one solution for this annoying known bug. I'll revert the PCH header include of wxFB generated files to <wx/wxprec.h> untill you wrap it. For the remaining files this will not be used. Once you fix this issue, please inform me and I'll update the wizard. What's ur opinion? :)

Regards,

Biplab

[attachment deleted by admin]
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: rjmyst3 on February 23, 2007, 07:51:19 pm
@rjmyst3
Please check the new release once (in Windows and Linux) and provide your feedback and suggestions.  :D

Works great in Windows, I'll test in Linux tonight.
Good work on the event handling, that is much better.
I saw that you updated the title in wxFB, however, App.cpp sets it again in this line:
Code
Dialog* dlg = new Dialog(0L, _("wxWidgets Application Template"));
This code will always override what wxFB generates, so the user still cannot change the title in wxFB.

The constructor for the class should probably just take a parent parameter, like this:
Main.h
Code
Dialog( wxDialog *dlg );

Main.cpp
Code
Dialog::Dialog(wxDialog *dlg)
    : GUIDialog(dlg)
{
}

It is the same for Frame.

I'm proposing one solution for this annoying known bug. I'll revert the PCH header include of wxFB generated files to <wx/wxprec.h> untill you wrap it. For the remaining files this will not be used. Once you fix this issue, please inform me and I'll update the wizard. What's ur opinion? :)

That should work. I have approval from one of the devs to wrap it, I'm still waiting for the other's opinion. I hope to have it resolved this weekend.


Overall, excellent work. This is very exciting for me!  :)
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 23, 2007, 08:54:26 pm
Thanks for the quick feedback. :D

I saw that you updated the title in wxFB, however, App.cpp sets it again in this line:
Code
Dialog* dlg = new Dialog(0L, _("wxWidgets Application Template"));
This code will always override what wxFB generates, so the user still cannot change the title in wxFB.

I forgot that somehow. This issue has been resolved. Latest revision is attached. :)

That should work. I have approval from one of the devs to wrap it, I'm still waiting for the other's opinion. I hope to have it resolved this weekend.

If that change breaks other or deviates from the development plan that wxFB team have adopted, then you may wish to provide it as an add-on. Means, by default wxFB will remain same but if user wishes then wxFB will wrap it. I don't want to be too demanding. :D

If everything is ok, then I'm planning to put it in main repository this weekend.

Regards,

Biplab

[attachment deleted by admin]
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: rjmyst3 on February 24, 2007, 02:00:58 am
I tested the wxFB portion of the wizard on Linux - it works perfectly, minus pch support of course. I confirm that the title bug is fixed.
I'm very happy with it.

Two thumbs up  :D

If that change breaks other or deviates from the development plan that wxFB team have adopted, then you may wish to provide it as an add-on. Means, by default wxFB will remain same but if user wishes then wxFB will wrap it. I don't want to be too demanding. :D

This issue will be resolved in some way this weekend.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 24, 2007, 08:16:22 pm
Thanks a lot.  :D

I'll try to commit it tomorrow (I need to clean the code ;)).
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 25, 2007, 07:37:11 pm
A Big update has been applied today. :D

Newer Features:

Modifications:

Many Thanks To: :D

Known Issues:

wxSmith support will be added soon.

Committed in revision 3543 and 3544.

Regards,

Biplab
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: byo on February 26, 2007, 01:01:07 am
wxSmith support will be added soon.

Should I start working on the "special function" added to squirrel? IT should be done in one day, but probably current Message-Box implementation would be better for testing purposes ;)

BYO
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 26, 2007, 06:05:36 am
Should I start working on the "special function" added to squirrel? IT should be done in one day, but probably current Message-Box implementation would be better for testing purposes ;)

Please add it. As the first part is over, adding wxSmith support should not take much time. ;)

Biplab
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: rjmyst3 on February 26, 2007, 03:45:54 pm
Known Issues:
  • There is one issue with PCH support. Presently all the apps generated will compile successfully. But there will be an additional amount of Pre-Compiled Header generated in some cases.

I did some more looking into this. The way wxFB works right now is, if the "precompiled_header" property has content, the #include statement will be generated, but if left empty, wxFB does not generate anything.

So I suggest:
If the user wants pch support, set wxFB's "precompiled_header" property to "wx_pch.h", and wxFB will generate this:
Code
#include "wx_pch.h"

#ifdef __BORLANDC__
#pragma hdrstop
#endif //__BORLANDC__

#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif //WX_PRECOMP

If the user does not want pch support, set the property to nothing (an empty string) and wxFB with generate this:
Code
#ifdef __BORLANDC__
#pragma hdrstop
#endif //__BORLANDC__

#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif //WX_PRECOMP

The wizard should be able to modify the contents of wxFB's .fbp file to change the property, just as it would any other source file. It is just xml.

Will this solve the pch problem?
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 26, 2007, 04:14:41 pm
Thanks for the suggestion. :)

Initially I started with parsing and generating custom wxFB project files. But C::B was refusing to add it. Thus I dropped the idea. See more details on the following thread.

Quote
http://forums.codeblocks.org/index.php?topic=4768.msg40734#msg40734

I've not looked into the issue yet. Once we figure this out, I'll make necessary changes. :)

Currently, few more MB of pch file will be generated with BCC and VC. ;)



But I'm not quite sure whether that will solve the problem or not.

AFAIK, compiler will expect similar headers across all the cpp files to create the pch file. Once you issue the following command, BCC will be in trouble. Following code will tell BCC to create a PCH file without any header includes which may create utter confusion for the compiler and most probably will fail to compile.

Code
#ifdef __BORLANDC__
#pragma hdrstop
#endif //__BORLANDC__

#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif //WX_PRECOMP



The best solution is to use, <wx/wxprec.h> across all the files but this will limit fine tuning if necessary. There will be another problem with GCC in this case. GCC requires <wx/wxprec.h> and <wx/wxprec.h.gch> to be at the same folder or the folder name containing *.gch file to be matching to compile.

This could create problems with C::B. C::B would then require this file to be added as a part of the project.

So you can see I'm also confused. :)
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: rjmyst3 on February 26, 2007, 04:39:41 pm
Following code will tell BCC to create a PCH file without any header includes which may create utter confusion for the compiler and most probably will fail to compile.

Code
#ifdef __BORLANDC__
#pragma hdrstop
#endif //__BORLANDC__

#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif //WX_PRECOMP


It seems as that is a bad idea then. So the #pragma hdrstop for borland is only necessary when using a pch?

Should the pch block look more like this?
Code
#ifdef WX_PRECOMP

#include <pch header file>

#ifdef __BORLANDC__
#pragma hdrstop
#endif //__BORLANDC__

#else

#include <wx/wx.h>

#endif //WX_PRECOMP
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 26, 2007, 04:49:30 pm
It seems as that is a bad idea then. So the #pragma hdrstop for borland is only necessary when using a pch?

You are correct. That is necessary to tell BCC to stop at that point. Unless BCC gets that pragma, it will include all header file in that cpp file to generate compiled pch file.

IMHO, your solution should work. I'll try and update you more details whether this works or not. :D
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: rjmyst3 on February 26, 2007, 05:35:01 pm
wxFB now generates that code, as of svn revision 899.

Also, we recently had to uprev our project file for an unrelated change, so if the wizard were to generate .fbp files of version 1.6, then older versions of wxFB would refuse to open them, thus ensuring that users have a recent enough version. This could be helpful for non-pch mode, at least.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 26, 2007, 05:40:26 pm
I'm using Feb 17, 2007 build (3.0.20 beta 3) which produces v1.5 project files. So do I need to update the project files or wxFB will convert it once opened? :)
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: rjmyst3 on February 26, 2007, 05:46:15 pm
I'm using Feb 17, 2007 build (3.0.20 beta 3) which produces v1.5 project files. So do I need to update the project files or wxFB will convert it once opened? :)

wxFB will convert them.

You can expect a new build today - hopefully within the hour.  8)
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on February 27, 2007, 03:40:57 am
An important update has been applied to the wizard. I found that the generated apps are not closing properly if they are closed by pressing the Close(x) button. This update fixes that issue.

Changes:

Committed in revision 3645. :)



wxFB will convert them.

You can expect a new build today - hopefully within the hour.  8)

That's great.  :)
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on March 02, 2007, 10:36:53 am
Latest change:

Known Issue:

Tested with OpenWatcom 1.6, wxMSW-2.9.0-CVS-(Debug & Release-DLL-Unicode-Monolithic) wxWidgets Lib. :)
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: basurapr on March 11, 2007, 04:12:18 am

1) I installed CB version 3565 on XP
2) I installed wxWidgets 2.8.0 and compiled it with gcc with unicode => OK
3) use of the wizard to generate a basic application with unicode => compile and execute OK with gcc
4) Then without modifying any CB option anywhere, i just add the special letter é to the title of the windows:

original line, generated by the wizard
azeFrame* frame = new azeFrame(0L, _("wxWidgets Application Template"));
modified line, for beginning to test the unicode support
azeFrame* frame = new azeFrame(0L, _("wxWidgets Application Templateé"));

no other modification except this character => i got the compile message "Illegal byte sequence".

5) If i suppress this character => compile OK
6) I've now tried several times with last build 3577 => same problem, but the error message is now
"converting to execution character set: Invalid argument"


I was having the same problem,

First goto the menu "Project->Build Options" then click your project name. Inside of your global project settings select "Compiler Settings" then click "Other Options" tab, now in that multiline text control write this:

-finput-charset=iso-8859-1

That will fix the problem compiling the standard Latin characters available in the ascci table: á é í ó ú ñ Ñ É and others I does not remember. :)
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: ascxaxsvcbsxbbqvcxqsbcvxs on March 12, 2007, 09:17:38 am

1) I installed CB version 3565 on XP
2) I installed wxWidgets 2.8.0 and compiled it with gcc with unicode => OK
3) use of the wizard to generate a basic application with unicode => compile and execute OK with gcc
4) Then without modifying any CB option anywhere, i just add the special letter é to the title of the windows:

original line, generated by the wizard
azeFrame* frame = new azeFrame(0L, _("wxWidgets Application Template"));
modified line, for beginning to test the unicode support
azeFrame* frame = new azeFrame(0L, _("wxWidgets Application Templateé"));

no other modification except this character => i got the compile message "Illegal byte sequence".

5) If i suppress this character => compile OK
6) I've now tried several times with last build 3577 => same problem, but the error message is now
"converting to execution character set: Invalid argument"


I was having the same problem,

First goto the menu "Project->Build Options" then click your project name. Inside of your global project settings select "Compiler Settings" then click "Other Options" tab, now in that multiline text control write this:

-finput-charset=iso-8859-1

That will fix the problem compiling the standard Latin characters available in the ascci table: á é í ó ú ñ Ñ É and others I does not remember. :)

Tested it: thank you it works  :lol:
Someone here said before that these characters were supported natively, so i was confused. Nevermind, thank you very much!
I wonder, why such an important option have to be put manually in the "other options" tab? :shock: If you use Unicode, this option is mandatory!
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: Biplab on April 30, 2007, 01:28:05 pm
Hi All,

Digging out this old post. ;)

A major change has been applied. The change will affect Additional Libraries addition page. Earlier wizard used to have Two pages, but now it will have only one page.

The single page will look like-
(http://img48.imageshack.us/img48/3660/wxaddllibpagevn5.png)

Please check the libraries you want to add to your project.

Another interesting addition is, wizard will now add additional dependencies of few advanced libraries (e.g., wxXrc depends upon wxXml).

Now it will be possible to add an additional target to an existing project.

A major portion of the wizard has been modified. So there could be some bugs. I've fixed bugs which I found.

The update will be available in the next nightly.

Please post bugs if you find them.

Regards,

Biplab
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: oliver1974 on January 10, 2008, 03:34:56 pm
..Digging out this old thread....

Quote

-finput-charset=iso-8859-1
(...)
I wonder, why such an important option have to be put manually in the "other options" tab? If you use Unicode, this option is mandatory!

Yes, indeed... Is there no way to make this more obvious? (Or is there a solution already
and I didn't see it?)

It took me hours to find this one out.....

Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: 00061205 on June 15, 2008, 04:49:02 pm

1) I installed CB version 3565 on XP
2) I installed wxWidgets 2.8.0 and compiled it with gcc with unicode => OK
3) use of the wizard to generate a basic application with unicode => compile and execute OK with gcc
4) Then without modifying any CB option anywhere, i just add the special letter é to the title of the windows:

original line, generated by the wizard
azeFrame* frame = new azeFrame(0L, _("wxWidgets Application Template"));
modified line, for beginning to test the unicode support
azeFrame* frame = new azeFrame(0L, _("wxWidgets Application Templateé"));

no other modification except this character => i got the compile message "Illegal byte sequence".

5) If i suppress this character => compile OK
6) I've now tried several times with last build 3577 => same problem, but the error message is now
"converting to execution character set: Invalid argument"


I was having the same problem,

First goto the menu "Project->Build Options" then click your project name. Inside of your global project settings select "Compiler Settings" then click "Other Options" tab, now in that multiline text control write this:

-finput-charset=iso-8859-1

That will fix the problem compiling the standard Latin characters available in the ascci table: á é í ó ú ñ Ñ É and others I does not remember. :)

There is another method to solve this problem which don't need to add "-finput-charset=iso-8859-1" in Other options.
1.Convert your source files which contain the utf-8 characters (eg.á é í ó ú ñ Ñ É 中文) into utf-8 format.
2.Compile the project again in C::B. (Press F9)

tip:Convert method.
1.open editplus.
2.file->open
3.choose source files
4.change the Encoding choose list to UTF-8 (at the bottom of the dialog box) and click open button.
5.file->Save all
now your source files become utf-8 format.
Title: Re: Modified & Improved wxWidgets Project Wizard
Post by: vfdff on April 05, 2009, 09:42:52 am
Removed non english content !

Only english postings are allowed.

In the future the post might be silently removed and/or your account locked !!!

Sorry !

Jens