Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Ribbon and menus
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Ribbon and menus

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


Joined: 15 June 2007
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote irekz Quote  Post ReplyReply Direct Link To This Post Topic: Ribbon and menus
    Posted: 22 June 2007 at 11:27am
Hi there :)
 
I'm porting application that has a lot of menus into ribbon.
I found it very slow to add every tab, group and button to ribbon with C++ code. Is there a way to add a complete submenu into ribbon tab (for example as a group)? Idealy it would add all items as butons, take care of separators and if there is a submenu it woul insert a button with down arrow and submenu would appear on click.
 
 
Pseudo code I want:
 

CMenu myMenu;

myMenu.LoadMenu( IDR_MAINFRAME );

CXTPRibbonTab* pTab = pMyRibbon->AddTab( "MyTab" );

pTab->AddGroup( myMenu.GetSubMenu(0));   <--- any way to do this?

Thanks for your help guys!
Irek
 
ps. I know that there is a way to do someting similar by loading a toolbar:  pGroup->LoadToolbar  - but I need to do it from menu
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 22 June 2007 at 1:25pm
So what problem? Add CMainFrame method, loop menu items and add new buttons?
 
int nCount = ::GetMenuItemCount(pMenu->m_hMenu);
 for (int i = 0; i < nCount; i++)
 {
CString strCaption;
 pMenu->GetMenuString(i, strCaption, MF_BYPOSITION);
...
}
 
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
irekz View Drop Down
Newbie
Newbie


Joined: 15 June 2007
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote irekz Quote  Post ReplyReply Direct Link To This Post Posted: 22 June 2007 at 3:16pm
Yes - that's what I thought I need to do :)
Thanks!
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.