Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - How to change name of item into menu?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to change name of item into menu?

 Post Reply Post Reply
Author
Message
Hayder View Drop Down
Newbie
Newbie


Joined: 06 May 2006
Location: Russian Federation
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hayder Quote  Post ReplyReply Direct Link To This Post 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'?
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: 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
Back to Top
Hayder View Drop Down
Newbie
Newbie


Joined: 06 May 2006
Location: Russian Federation
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hayder Quote  Post ReplyReply Direct Link To This Post 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?

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: 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
Back to Top
RedDragon View Drop Down
Newbie
Newbie


Joined: 01 June 2006
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote RedDragon Quote  Post ReplyReply Direct Link To This Post 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

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: 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
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.031 seconds.