Print Page | Close Window

Modify Main Menu textes

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=7058
Printed Date: 12 November 2025 at 7:38pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Modify Main Menu textes
Posted By: Bert1
Subject: Modify Main Menu textes
Date 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?



Replies:
Posted By: Oleg
Date 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


Posted By: Ashok
Date 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.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net