Author Topic: Modified & Improved wxWidgets Project Wizard  (Read 224058 times)

titan7

  • Guest
Re: Modified & Improved wxWidgets Project Wizard
« Reply #60 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.


Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Modified & Improved wxWidgets Project Wizard
« Reply #61 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?
Be a part of the solution, not a part of the problem.

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Revision 5
« Reply #62 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:
  • Supports Microsoft Visual C++ 7.1 Compiler.
  • PCH support is activated for MSVC 7.1 compiler.

Few Important Notes:
  • Wizard assumes that Multi-threaded Dynamic C and C++ Runtimes are being used. If you are using wx lib statically linked with C Runtime Library (CRT) you should make couple of changes in the libraries added. I'll discuss it later in this post.
  • If your installation does not comes with msvcprt[d].lib (Most probably it won't), please visit the following website on how to do that. Wizard generated projects will fail during linking if it doesn't find msvcprt[d].lib

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
« Last Edit: January 16, 2007, 05:13:22 pm by Biplab »
Be a part of the solution, not a part of the problem.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2769
Re: Revision 5
« Reply #63 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.

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Rev 6: Modified & Improved wxWidgets Project Wizard
« Reply #64 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:
  • Added support (partial) for Linux and Mac (Untested). It's now possible to select different wxWidgets version present in Linux system.
  • Added option to select Static/Dynamic, ANSI/Unicode build of wxWidgets in Linux.
  • Added option to select Application Target Type in Windows (For Advanced users only)
  • Wizard now checks the presence of wx configuration, selected for project, precisely in Windows. Expect almost No false warning.
  • Couple of minor fixes and code clean-up.


New options available in Linux


Check the Highlighted option to change target type


Change Target Type here, but be cautious.

Tested in:
  • OpenSUSE 10.2 with GCC 4.1.2, wxGTK-2.6.3 & 2.8.0 Dynamic-(Debug/Release)-Unicode-Monolithic build of lib.

Known Issues:
  • Does not check the presence of wxWidgets lib in Linux system. So be careful to select correct lib configuration otherwise the generated project will fail to compile.
  • Checked with Monolithic builds in Linux; it may give you trouble if you are using non-monolithic builds in Linux.

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

Also please post your comments, feedbacks.

Hope you'd enjoy this new release.  :D

[attachment deleted by admin]
« Last Edit: January 23, 2007, 09:07:02 am by Biplab »
Be a part of the solution, not a part of the problem.

manutd

  • Guest
Re: Modified & Improved wxWidgets Project Wizard
« Reply #65 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.

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Modified & Improved wxWidgets Project Wizard
« Reply #66 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:
« Last Edit: January 25, 2007, 11:18:15 am by Biplab »
Be a part of the solution, not a part of the problem.

manutd

  • Guest
Re: Modified & Improved wxWidgets Project Wizard
« Reply #67 on: January 24, 2007, 01:37:19 am »
Oh, OK. I just changed the name of the original and extracted the new one.

biniou

  • Guest
Re: Modified & Improved wxWidgets Project Wizard
« Reply #68 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 !!

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Modified & Improved wxWidgets Project Wizard
« Reply #69 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.  :)
« Last Edit: January 25, 2007, 11:17:38 am by Biplab »
Be a part of the solution, not a part of the problem.

Offline raph

  • Almost regular
  • **
  • Posts: 242
Re: Modified & Improved wxWidgets Project Wizard
« Reply #70 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:
  • 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.
  • Being able to choose between different presets or even better, the wizard could try to autodetect the available configuration.
  • More options how the default application should look like. Following features would be nice:
    • 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
    • customize window:
      • title
      • menu
      • toolbar
      • statusbar
      • style
    • (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:
  • being able to customize the name of the created classes and filenames!!

Wow, that would boost the number of codeblocks and wxwidgets users 8)
Keep on the good work

best regards
raph

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Modified & Improved wxWidgets Project Wizard
« Reply #71 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
« Last Edit: January 25, 2007, 05:32:24 pm by Biplab »
Be a part of the solution, not a part of the problem.

Offline raph

  • Almost regular
  • **
  • Posts: 242
Re: Modified & Improved wxWidgets Project Wizard
« Reply #72 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

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Modified & Improved wxWidgets Project Wizard
« Reply #73 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...
Be patient!
This bug will be fixed soon...

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Modified & Improved wxWidgets Project Wizard
« Reply #74 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
« Last Edit: January 26, 2007, 04:07:04 pm by Biplab »
Be a part of the solution, not a part of the problem.