Print Page | Close Window

Ribbon and menus

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=7431
Printed Date: 03 March 2025 at 1:08pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Ribbon and menus
Posted By: irekz
Subject: Ribbon and menus
Date 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



Replies:
Posted By: Oleg
Date 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


Posted By: irekz
Date Posted: 22 June 2007 at 3:16pm
Yes - that's what I thought I need to do :)
Thanks!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net