Author
Topic: wxSmith and the Style woes of the future. (Read 4768 times)

The new trunk version of wxWidgets is changing border style names. I know it's not a release version yet but it's been a pain to work with in the editor so I've attached a patch to fix it for those who are using the trunk version of wxwidgets.

For patches fixing version issues should we use an ifdef wall or are you directly comparing the wxwidgets version in a variable someplace?

Good work!Hope some wxSmith export would give some advice. wxSmith should know which wx version does the generated code link to.

Logged

If some piece of memory should be reused, turn them to variables (or const variables).If some piece of operations should be reused, turn them to functions.If they happened together, then turn them to classes.

For patches fixing version issues should we use an ifdef wall or are you directly comparing the wxwidgets version in a variable someplace?

At the moment wxSmith needs to be able to generate valid wx2.8.12 code. C::B uses it and we're still building for wx2.8.The best option is to generate something that is available in both versions. If not wxCHECK_VERSION macros should be generated.

How do I test this patch if it generates correct code?

Logged

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

It's not that it doesn't compile, it's that you get an assert popup every time an old style is used now. (Except for wxNO_BORDER for some reason)

Testing the patch is easy, before you apply it though. Build codeblocks against the latest trunk of wxwidgets and leave the debug asserts on. (I actually don't touch the settings in setup.h I leave them as default) Go into any codeblocks project with a .wxs layout, click on a control and try to change the border. You will get a bunch of invalid border style assert popups. Your style will also not be applied.

Now apply the patch and rebuild codeblocks, once again go find a project containing a .wxs click on a control and change it's border. The popups will be gone and the control will get the border you selected applied.

The wxsmith generated code/xrc will also have the new style listed instead of the old one as well.

I also believe I saw this popup when certain codeblocks windows get loaded. Although I don't remember which. But if you apply the second patch those will go away too.

@ouch: I have found it is easier to get the changes to the CB Core applied/accepted without changes to the contrib plugins being part of the first patch. Your luck might very from mine.

Edit: Looking more en-depth at the problem; the wxSmith plugin needs fixed before the CB core.It would be a good idea to add a feature to change wxs files that are opened with wxSmith to use the new names.Because otherwise it would be a nightmare doing support for newbie users of wxSmith.

It would be a good idea to add a feature to change wxs files that are opened with wxSmith to use the new names.Because otherwise it would be a nightmare doing support for newbie users of wxSmith.

What do you mean? I think we need a feature which does recreate the source code for all wxs files in a project. This way when wxsmith changes one can update the hole project he/she is working on. Currently wxsmith updates source code only when a file is edited. So the user ends with multiple unrelated changes to the source files.

Logged

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