Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » CMenu dynamic changes Collapse All
Subject Author Date
Christophe Guibert Dec 6, 2004 - 3:15 AM

Dear Sir,


My application program is multi-language, and the menu texts are set at runtime.


Before using Prof-UIS, I used the GetMenu() method from the MainFrame window, walked the menu structure and changed the text labels with the ModifyMenu() method, and this worked perfectly.


Now that I’m using Prof-UIS menu inside a CExtMenuControlBar, the GetMenu() method gives an unusable menu structure.


I guess that the best method is to use the CExtCmdItem elements and change their properties, but two problems remain :


- 1. The menu is not updated after a change of the m_menuText property in the CExtCmdItem : how can I do it ?


- 2. The menu title can’t be accessed through CextCmdItem element since there is no cmd ID (for instance, if I have a "File" menu in the menu bar, with "New", "Open", "Save"... entries, I can’t access and change the "File" text) : how can I do it ?



I suppose that it would be feasible to subclass the CExtMenuControlBar and intercept all text labels while it constructs its own menus. In your opinion, what is the best method to solve my two problems ?



Thanks in advance, and Best Regards,



Christophe Guibert

Technical Support Dec 7, 2004 - 10:01 AM

Dear Christophe,

We are about to release Prof-UIS 2.27 that includes the LanguageSwitcher sample application. This app demonstrates how to switch the languages on-the-fly by loading language-dependant resources from Prof-UIS and those available in your application. We will send you a preview version by e-mail today. So, please wait a bit and you will have a ready-to-use solution.

Christophe Guibert Dec 8, 2004 - 4:16 AM

Dear Sir,


I could solve my two problems while using the GetMenu() method of CExtMenuControlBar instead of the main frame window native one. I get the real menu and can dynamically change the text labels.


I find the LanguageSwitcher interesting but it still relies on different Windows resource files that must be assembled with the program at build time. My need is to add a new language without recompiling : I have one resource set, then replace all text labels at run-time (approximatively 2 000 different labels). So adopting a LanguageSwitcher method would be painfull, and could be done (in my case), only on a new developement.


However, I’ll be pleased to localize LanguageSwitcher in French.


Best Regards,


Christophe Guibert


www.webideatree.com

Technical Support Dec 8, 2004 - 9:58 AM

Dear Christophe,

The resource manager component may be useful for you. For instance, you may override its CExtResourceManager::LoadStringEx method to read some string storage instead of loading EXE/DLL resources