Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Inserting into CXTPMDiframeWnd hosted menu
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Inserting into CXTPMDiframeWnd hosted menu

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


Joined: 26 May 2005
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote beatle Quote  Post ReplyReply Direct Link To This Post Topic: Inserting into CXTPMDiframeWnd hosted menu
    Posted: 30 May 2007 at 6:57pm
I am converting an MFC application to use Codejock's ribbon bars. The application dynamically adds menu items at startup as it loads plug-ins. Out old code would store away the MainFrame's CMenu* on startup and then call pMenu->InsertMenu to insert items.
 
With a CXTPMDIFrameWnd derived frame window I have a problem, GetMenu() no longer returns the Window's menu so I have to dig a little deeper:
 

CXTPCommandBars* pCommandBars=CGatanApp::GetGatanMainFrame()->GetCommandBars();

_ASSERTE(pCommandBars);

CXTPMenuBar* pMenuBar=pCommandBars->GetMenuBar();

_ASSERTE(pMenuBar);
 
At this point I'm stuck. Can I somehow extract a CMenu from CXTPMenuBar? It doesn't look like it. How do I insert a menu into the existing menu?
 
Thanks.
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: 31 May 2007 at 12:42am
Hello,
 
You need convert your old code to new. Something like:
 
pMenuBar->GetControls()->Add(xtpControlButton, ID);
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
beatle View Drop Down
Newbie
Newbie


Joined: 26 May 2005
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote beatle Quote  Post ReplyReply Direct Link To This Post Posted: 31 May 2007 at 10:09am
Originally posted by oleg oleg wrote:

Hello,
 
You need convert your old code to new. Something like:
 
pMenuBar->GetControls()->Add(xtpControlButton, ID);
 
Oleg,
 
Please elucidate, your answer really doesn't help me very much. I need to insert a menu item not add a button.
 
Thanks.
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 2007 at 7:29am
pMenuBar->GetControls()->Add(xtpControlPopup , ID); for Popup menu.
 
Please check our samples first - they will help you figure out how commandars work.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
beatle View Drop Down
Newbie
Newbie


Joined: 26 May 2005
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote beatle Quote  Post ReplyReply Direct Link To This Post Posted: 01 June 2007 at 10:53pm
Originally posted by oleg oleg wrote:

pMenuBar->GetControls()->Add(xtpControlPopup , ID); for Popup menu.
 
Please check our samples first - they will help you figure out how commandars work.
 
Of course I have looked at the samples.
 
I asked how to insert a menu and you told me how to add button. I'm just looking for a little help.
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: 02 June 2007 at 3:43am
xtpControlPopup  will add popup button with submenu.
now you can add buttons to this submenu.
 
CXTPControlPopup* pPopup = (CXTPControlPopup*)pMenuBar->GetControls()->Add(xtpControlPopup , ID);
pPopup->GetCommandBar()->GetControls()->Add(...);
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
beatle View Drop Down
Newbie
Newbie


Joined: 26 May 2005
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote beatle Quote  Post ReplyReply Direct Link To This Post Posted: 02 June 2007 at 12:18pm
Thanks Oleg.
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.063 seconds.