![]() |
Ribbon and menus |
Post Reply ![]() |
Author | |
irekz ![]() Newbie ![]() Joined: 15 June 2007 Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() 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
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
irekz ![]() Newbie ![]() Joined: 15 June 2007 Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() |
Yes - that's what I thought I need to do :)
Thanks!
|
|
![]() |
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 |