Print Page | Close Window

How to change name of item into menu?

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=4210
Printed Date: 10 November 2025 at 3:41pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to change name of item into menu?
Posted By: Hayder
Subject: How to change name of item into menu?
Date Posted: 15 May 2006 at 1:09am
Hello,
I have a SDI project. I use Xtreme ToolkitPro 2006.
I wish to change names of items into menu(General menu - IDR_MAINFRAME).
You suggest to use this solution...

void CMainFrame::OnUpdate***(CCmdUI *pCmdUI)

{pCmdUI->SetText();}

1) How do I change root menu items (File, Edit, View etc.)?
They do not have a OnUpdate event.
2) Can I get 'CMenu'?



Replies:
Posted By: Oleg
Date Posted: 15 May 2006 at 8:40am

Hi,

Two solutions - to assign some ID + add handler

pCommandBars->GetMenuBar()->GetControl(0)->SetID(.. );

or change text using SetCaption:

pCommandBars->GetMenuBar()->GetControl(0)->SetCapti on("new Caption");



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Hayder
Date Posted: 16 May 2006 at 1:24am

Hi Oleg,

It's work.

Thank you very much

But menu name in Customize->Commands don't change.

Is it possible to update them?



Posted By: Oleg
Date Posted: 17 May 2006 at 11:12am

Hi,

You can get list of controls in Tools category:

CXTPControls* pControls = pCommands->GetControls(const CString& strCategory);

then

pControls->GetAt(i)->SetCaption(...);



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: RedDragon
Date Posted: 01 June 2006 at 9:18am
I have a question regarding changing the names of the root menus:

The solution mentioned above:
pCommandBars->GetMenuBar()->GetControl(0)->SetCapti on("new Caption");

works only if I know the exact position of the menus. What do I do if the menu "View" appears on position 1 or 2, depending on if a file has been opened or not? And if I add another menu sometime, the indexes will of course be changed..

Regards



Posted By: Oleg
Date Posted: 01 June 2006 at 12:33pm

Hi,

You can Assign some ID for menus and use Update handler/Use FindControl.

also you can loop menu items and find control you need.

 

etc..



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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