Author Topic: wxWidget project wizard  (Read 9306 times)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
wxWidget project wizard
« on: July 05, 2007, 08:39:01 pm »
suggestion : in case of linux could the "`wx-config --libs` and `wx-config --cflags`" be put at the project level instead of at the targets 'debug and release' level. Since it applies unchanged to both.

So in case they must be changed (OpenSuse wx-config-2.8) there's only one place to adjust.

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: wxWidget project wizard
« Reply #1 on: July 06, 2007, 06:01:44 am »
Nice catch. Thanks for pointing it. :)

I'll make necessary changes.
Be a part of the solution, not a part of the problem.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: wxWidget project wizard
« Reply #2 on: July 06, 2007, 02:48:37 pm »
in my case I created a little dialog app. So I ended up with 1 wxs file. But that file was NOT added to the project, so that means if I change it and then build, it does NOT get autosaved !!!

Could you fix this too ?

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: wxWidget project wizard
« Reply #3 on: July 06, 2007, 03:02:56 pm »
in my case I created a little dialog app. So I ended up with 1 wxs file. But that file was NOT added to the project, so that means if I change it and then build, it does NOT get autosaved !!!

Could you fix this too ?

I'll try to fix this too. :)
Be a part of the solution, not a part of the problem.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: wxWidget project wizard
« Reply #4 on: July 07, 2007, 11:29:53 am »
I have a few more questions or maybe remarks about the wx project wizard (focusing on the wxSmith track) :

When I have the wizard create me a wxSmith project (dialog based) I have in the
blablaMain.cpp, the following includes :

Code
//(*InternalHeaders(blablaDialog)
#include <wx/bitmap.h>
#include <wx/font.h>  //wxFont
#include <wx/fontenum.h>
#include <wx/fontmap.h>
#include <wx/image.h>
#include <wx/intl.h> // _()
#include <wx/settings.h> // wxSystemSettings, wxSystemSettings
#include <wx/string.h> // wxString
//*)

I *think*  that the following are NOT needed :
1) wx/bitmap.h
2) wx.fontenum.h
3) wx/fontmap.h
4) wx/image.h

Is this correct ?

A remark about readability : several methods their arguments are all concatenated without any whitespace in between, which makes it hard to read. Is it possible to insert a space (no tab ;-) ) ?
Turn :
Code
    Create(parent,id,_("wxWidgets app"),wxDefaultPosition,wxDefaultSize,wxDEFAULT_DIALOG_STYLE,_T("wxDialog"));

into :

Code
    Create(parent, id, _("wxWidgets app"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T("wxDialog"));


Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: wxWidget project wizard
« Reply #5 on: July 07, 2007, 12:12:50 pm »
I believe Byo would be the best person to answer both the questions. :)

The sample code is a wxSmith generated code. I am unsure whether the generated code can be customised or not.

BTW, I have one question for you.

in my case I created a little dialog app. So I ended up with 1 wxs file. But that file was NOT added to the project, so that means if I change it and then build, it does NOT get autosaved !!!

On which platform did you face this issue? :)
Be a part of the solution, not a part of the problem.

Offline raph

  • Almost regular
  • **
  • Posts: 242
Re: wxWidget project wizard
« Reply #6 on: July 07, 2007, 01:21:07 pm »
The sample code is a wxSmith generated code. I am unsure whether the generated code can be customised or not.
Yes, wxSmith will regenerate that code frequently, so simply changing that code will not help.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: wxWidget project wizard
« Reply #7 on: July 07, 2007, 01:34:49 pm »
@Biplab : on linux

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: wxWidget project wizard
« Reply #8 on: July 07, 2007, 01:37:49 pm »
well I should restate it : I looked at my project file (cbp) :

Code
		<Unit filename="UtcTranslatorApp.cpp" />
<Unit filename="UtcTranslatorApp.h" />
<Unit filename="UtcTranslatorMain.cpp" />
<Unit filename="UtcTranslatorMain.h" />
<Unit filename="wxsmith/UtcTranslatordialog.wxs" />

So it seems it is added to the project. Seems more a bug of CB then, that a build time it refuses to save it !!!

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 836
Re: wxWidget project wizard
« Reply #9 on: July 09, 2007, 01:08:03 pm »

I *think*  that the following are NOT needed :
1) wx/bitmap.h
2) wx.fontenum.h
3) wx/fontmap.h
4) wx/image.h

Is this correct ?


Right, those are not needed, but including them conditionally will require some more sophisticated include-generating system checking whether wxBitmap / wxImage etc is really used in generated code. Generated code is correct and will compile fine so I've marked it to post-release feature.

Quote
A remark about readability : several methods their arguments are all concatenated without any whitespace in between, which makes it hard to read. Is it possible to insert a space (no tab ;-) ) ?

Quite easy to do but time-consuming. I just wonder why someone would like to read wxSmith's generated code ;) Since it's automatically generated, people may thread it as some black-box (even though it's content is available) which just do what it should. Currently I don't have enough time to switch. So this is probably also post-release task.

Regards
   BYO

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: wxWidget project wizard
« Reply #10 on: July 09, 2007, 01:18:52 pm »
Quote
Quite easy to do but time-consuming. I just wonder why someone would like to read wxSmith's generated code Wink Since it's automatically generated, people may thread it as some black-box (even though it's content is available) which just do what it should. Currently I don't have enough time to switch. So this is probably also post-release task.

If you can pinpoint me the code, I am happy to help ;-)

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 836
Re: wxWidget project wizard
« Reply #11 on: July 09, 2007, 02:15:13 pm »
Quote
Quite easy to do but time-consuming. I just wonder why someone would like to read wxSmith's generated code Wink Since it's automatically generated, people may thread it as some black-box (even though it's content is available) which just do what it should. Currently I don't have enough time to switch. So this is probably also post-release task.

If you can pinpoint me the code, I am happy to help ;-)

Search for OnBuildCreatingCode functions in classes inside wxSmith/wxwidgets/defitems directory. Each of these functions is responsible for generating code and usually it's done through Codef function. This function works simillar to printf but is dedicated to code generation. So when you have f. ex. :
Code
Code << Codef(Language,_T("%C(%W,%I,%P,%S,%T,%N);\n"));

Just change it to:
Code
Code << Codef(Language,_T("%C(%W, %I, %P, %S, %T, %N);\n"));

That's all :)

(Note that some funcitons may use easier version of Codef - without streaming operator and Language argument,  but it works the same).

Regards
   BYO