Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: samsam598 on October 09, 2011, 03:51:47 pm

Title: wxSmith support Unicode string
Post by: samsam598 on October 09, 2011, 03:51:47 pm
Greetings!

As I searched key words like "wxSmith Unicode" ,"GUI Desinger Unicode " etc and did not find any match result,I asked the question here:

When I design UI,I noticed the string literals are guarded by _ other than wxT.This cause a problem if I were a Chinese user.
Code
wxButton* btnOK=new wxButton(ID,_("button name"),bla,bla,...);//if the button name is in Chinese,I need to replace _ with wxT

I need to manually modify above code to
Code
wxButton* btnOK=new wxButton(ID,wxT("Chinese Name"),bla,bla,...);

The pity thing is that every time when there is a modification on the UI,the modification on the above code(s) lost changes and get back to the wizard generated one(All those wxT were replaced by _),that is, a mess when the UI display Chinese named buttons,menus,etc.



Could anybody figure me out whether there is  solution already on this issue ,even a workaround?

I use the latest SVN of C::B.

Thanks for your help in advance.

Regards,
Sam
Title: Re: wxSmith support Unicode string
Post by: oBFusCATed on October 09, 2011, 04:05:09 pm
No, workaround, this should be fixed in the code, but there is no one who has done it, already.

If you think you're brave enough you can try to hack it and provide a patch:)
It should be somewhere inside src/plugins/contrib/wxsmith :)
Title: Re: wxSmith support Unicode string
Post by: MortenMacFly on October 09, 2011, 04:13:14 pm
Could anybody figure me out whether there is  solution already on this issue ,even a workaround?
As a work-around, you can use a customized extra code using macros, e.g.:
$(THIS) = new $(CLASS)($(PARENT),$(ID),$(POS),$(SIZE),$(STYLE),$(NAME));
and blnd the other code by adding a /* BEFORE the wxSmith section and an */ BEFORE the extra code.
Title: Re: wxSmith support Unicode string
Post by: MortenMacFly on October 09, 2011, 04:15:06 pm
If you think you're brave enough you can try to hack it and provide a patch:)
A good solution would be is each wxSmith element would have the ability to customise the creation code as desired. Similar to "extra" code, but just for the creation. The "Custom" control shows how this would work, hence it should be a general function not limited to this.

@oBFusCATed: Our posts crossed. ;-)
Title: Re: wxSmith support Unicode string
Post by: samsam598 on October 10, 2011, 02:19:18 am
Hi both,

Thank you all.

Regards,
Sam