![]() |
Modify Main Menu textes |
Post Reply
|
| Author | |
Bert1
Newbie
Joined: 07 May 2007 Location: Germany Status: Offline Points: 2 |
Post Options
Thanks(0)
Quote Reply
Topic: Modify Main Menu textesPosted: 07 May 2007 at 2:43am |
|
Hi,
I need to change the textes of the main menu, how can I do this?
Because the GetMenu() function is not supported I don't find a solution for it! For the submenus I'm using
CXTPControl* pControl = pControls->FindControl(xtpControlButton, ID_FILE_NEW, FALSE, TRUE); if ( pControl != NULL ) {
pControl->SetCaption(szDummy);
} but I need the ID of the control for this function which is not available for the top menu items. Because my App is supporting multi languages I need to modify the menus on runtime.
Can somebody help my?
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 07 May 2007 at 7:39am |
|
Hello,
something like pControls->GetAt(2)->SetCaption("...");
but if your application supports customization - better don't use predefine indexes for this - user can copy/delete some command.
I very recommend you use Actions to localize commandbars - see
Samples\CommandBars\ActionsSample and
Samples\CommandBars\ScribbleMultiLang
check scribble sample - if you even copy/delete "File" menu - it will be localized anyway.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Ashok
Senior Member
Joined: 02 May 2007 Status: Offline Points: 164 |
Post Options
Thanks(0)
Quote Reply
Posted: 10 May 2007 at 1:35am |
|
Hai,
I have some idea(just what I have understand) about your query, just see the below code
// Get a pointer to the command bars object. CXTPCommandBars* pCommandBars = pMainFrame->GetCommandBars(); if(pCommandBars == NULL){ TRACE0( "Failed to create command bars object.\n"); return; // fail to create} // Get the menu barCXTPMenuBar* pMenuBar = pCommandBars->GetMenuBar(); if(pMenuBar == NULL){ TRACE0( "Failed to create menu bar.\n"); return; // fail to create} pMenuBar->LoadMenu(pModifiedMenu,1); -- This pModifiedMenu is what the runtime menu you are going to load.
It is working fine for me. Try it out. |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |