Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Libraries and TheIDE: i18n, Unicode and Internationalization » Internationalization problem when using ctr as member of TopWindow
Internationalization problem when using ctr as member of TopWindow [message #10098] Wed, 20 June 2007 04:01 Go to previous message
westcity1973 is currently offline  westcity1973
Messages: 5
Registered: June 2007
Location: China
Promising Member
I have studied UPP for three months, I find it is excellent.It is very easy and powerful. But when I try to use ctrls as member of Top window, it seems that the Internationalization does'nt work. My code is as follows:

class TransWithCtrlInTopWnd : public TopWindow {
public:
MenuBar menu ;
Button bt ; // a ctrl
bool langIsChina ;

public :
// menu handler
void MainMenu(Bar &bar)
{
bar.Add(t_("Try It"), THISBACK(SubMenu)) ;
}

void SubMenu (Bar &bar) {
bar.Add(t_("Menu1"), THISBACK(BlankFun) ) ;
bar.Add(t_("Menu2"), THISBACK(BlankFun) ) ;
}

void BlankFun() {}

// Button handler
void ChangeLanguage()
{
// When push button, change language between english and chinese.

Razz langIsChina = (!langIsChina) ;

if (langIsChina)
SetLanguage( LNGC_('Z','H','C','N', CHARSET_UTF8) ) ;
else
SetLanguage(LNGC_('E','N','U','S', CHARSET_UTF8) ) ;

menu.Set(THISBACK(MainMenu)) ; // Refresh menu
}

public:
typedef TransWithCtrlInTopWnd CLASSNAME;

TransWithCtrlInTopWnd() {
langIsChina = true ;

AddFrame(menu) ;
menu.Set(THISBACK(MainMenu)) ;

(*this) << bt.LeftPos(5, 100).TopPos(20, 20) ;

bt.SetLabel(t_("Push Me")) ;
bt <<= THISBACK(ChangeLanguage) ;
}
};

And I attatch my upp project file.
 
Read Message
Read Message
Read Message
Previous Topic: Internationalizing Keyboard Accelerator Keys?
Next Topic: Problem with non-English dirs
Goto Forum:
  


Current Time: Fri Apr 26 01:34:43 CEST 2024

Total time taken to generate the page: 0.06840 seconds