![]() |
Inserting into CXTPMDiframeWnd hosted menu |
Post Reply
|
| Author | |
beatle
Newbie
Joined: 26 May 2005 Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Topic: Inserting into CXTPMDiframeWnd hosted menuPosted: 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. |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
beatle
Newbie
Joined: 26 May 2005 Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Posted: 31 May 2007 at 10:09am |
Oleg,
Please elucidate, your answer really doesn't help me very much. I need to insert a menu item not add a button.
Thanks.
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
beatle
Newbie
Joined: 26 May 2005 Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Posted: 01 June 2007 at 10:53pm |
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.
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 02 June 2007 at 3:43am |
|
xtpControlPopup will add popup button with submenu.
now you can add buttons to this submenu.
pPopup->GetCommandBar()->GetControls()->Add(...);
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
beatle
Newbie
Joined: 26 May 2005 Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Posted: 02 June 2007 at 12:18pm |
|
Thanks Oleg.
|
|
![]() |
|
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 |