Author Topic: wxSmith support Unicode string  (Read 4116 times)

Offline samsam598

  • Multiple posting newcomer
  • *
  • Posts: 15
wxSmith support Unicode string
« 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
« Last Edit: October 09, 2011, 04:00:05 pm by samsam598 »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: wxSmith support Unicode string
« Reply #1 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 :)
(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!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: wxSmith support Unicode string
« Reply #2 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: wxSmith support Unicode string
« Reply #3 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. ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline samsam598

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: wxSmith support Unicode string
« Reply #4 on: October 10, 2011, 02:19:18 am »
Hi both,

Thank you all.

Regards,
Sam