Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Modify Main Menu textes
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Modify Main Menu textes

 Post Reply Post Reply
Author
Message
Bert1 View Drop Down
Newbie
Newbie
Avatar

Joined: 07 May 2007
Location: Germany
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bert1 Quote  Post ReplyReply Direct Link To This Post Topic: Modify Main Menu textes
    Posted: 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?
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Ashok View Drop Down
Senior Member
Senior Member


Joined: 02 May 2007
Status: Offline
Points: 164
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ashok Quote  Post ReplyReply Direct Link To This Post 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 bar

CXTPMenuBar* 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.

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.