Disko Forum logo Login  |  Register  |  Lost Password
Re:setTargetLang not working immediately

jervis
Posts: 4
graphgraph

setTargetLang not working immediately 5 Years, 1 Month ago  
Hi all,
I want to change the language from one the another. The code is as follows:
MMSTranslator trans;
trans.setTargetLang(MMSLANG_DE);
But, it's not work immediately. It woks well after hide() & show() the window.

Kind regards,

Jervis
 
  The administrator has disabled public write access.
Re:setTargetLang not working immediately

jervis
Posts: 4
graphgraph

Re:setTargetLang not working immediately 5 Years, 1 Month ago  
At present, only support label and textbox switch. If language translator supporting picture will be better, because the picture may be written. THX.
 
 
Last Edit: 2009/09/15 11:00 By jervis.
  The administrator has disabled public write access.
Re:setTargetLang not working immediately

Guido
Admin
Posts: 54
graphgraph

Re:setTargetLang not working immediately 5 Years, 1 Month ago  
Hi jervis,

you have to refresh your window manually using the refresh() method.

Code:

this->myWindow->refresh();
regards Guido
 
  The administrator has disabled public write access.
Re:setTargetLang not working immediately

jervis
Admin
Posts: 4
graphgraph

Re:setTargetLang not working immediately 5 Years, 1 Month ago  
THX
 
  The administrator has disabled public write access.
Re:setTargetLang not working immediately

jervis
Admin
Posts: 4
graphgraph

Re:setTargetLang not working immediately 5 Years, 1 Month ago  
Hi Guido,

In file MMSWindow.cpp, function targetLangChanged(), line 4083, the code as follows:

####################################
// for all child windows
for (unsigned int i = 0; i < childwins.size(); i++)
childwins.at(i).window->targetLangChanged(lang, false);
####################################

Why not to change it as follows:

####################################
// for all child windows
for (unsigned int i = 0; i < childwins.size(); i++)
childwins.at(i).window->targetLangChanged(lang, refresh);
####################################

The all child windows will be refreshed. Users will not be needed to manual refresh. THX.

Best regards,

Jervis
 
 
Last Edit: 2009/09/16 03:51 By jervis.
  The administrator has disabled public write access.
Re:setTargetLang not working immediately

Stefan
Admin
Posts: 91
graph

Re:setTargetLang not working immediately 5 Years, 1 Month ago  
Hi Jervis,

the code is allright at this function. Refreshing each childwindow individially would trigger numerous redraws. The refresh() at line 4100 should refresh the children as well.

As the default value for refresh is true, you should not need to specify anything. Obviously there is a bug in another place.

Could you post some of your code, that we ca go into the debugging?

kind regards
Stefan
 
  The administrator has disabled public write access.
Powered by FireBoard
get the latest posts directly to your desktop