![]() |
How to change name of item into menu? |
Post Reply
|
| Author | |
Hayder
Newbie
Joined: 06 May 2006 Location: Russian Federation Status: Offline Points: 4 |
Post Options
Thanks(0)
Quote Reply
Topic: How to change name of item into menu?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'? |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Hayder
Newbie
Joined: 06 May 2006 Location: Russian Federation Status: Offline Points: 4 |
Post Options
Thanks(0)
Quote Reply
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?
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
RedDragon
Newbie
Joined: 01 June 2006 Status: Offline Points: 2 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
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 |