![]() |
Manual Creation of Ribbon System Menu |
Post Reply ![]() |
Author | ||
Jayonas ![]() Newbie ![]() Joined: 28 September 2007 Location: United States Status: Offline Points: 12 |
![]() ![]() ![]() ![]() ![]() Posted: 28 September 2007 at 1:00pm |
|
I'm trying to figure out how to create the ribbon-style system menu without converting it from a menu resource, as the ribbon samples do. I've figured out how to create the second column for displaying recent documents, by adding the xtpFlagWrapRow style to the first control in the second column.
However, what I can't figure out is how to get the buttons at the bottom of the menu (where the sample has an Options and Exit button). The SDI ribbon sample builds the system menu from the following resource:
It looks like the ", MENUBARBREAK" entry is what results in the last two items being displayed as buttons below the others, but when I debugged through the menu parsing code, the MENUBARBREAK looks like it results in the xtpFlagWrapRow style being applied, which is actually how I figured out how to start the second column. When I try having two items with the xtpFlagWrapRow style, then I just end up with a three column menu, rather than two columns and buttons below. I think this ultimately has something to do with some code somewhere being hard-coded to detect the Recent Document list in the menu. I need to work without any such hard-coding, because I don't think that MFC's built-in recent document handling can work with documents which aren't based on filenames (though I could be wrong there). That being the case, I'd also like to know which code is responsible for the "Recent Documents" label at the top of the second column in the sample apps. That doesn't look like a standard menu item. Here's the code I'm using so far and the menu it generates:
![]() Thanks! |
||
![]() |
||
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
|
Hi,,
See OnCreateControl method in Sample
and this block:
if (lpCreateControl->nID == ID_APP_EXIT || lpCreateControl->nID == ID_APP_OPTIONS)
{ lpCreateControl->pControl = new CXTPRibbonControlSystemPopupBarButton(); return TRUE;
} |
||
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||
![]() |
||
Jayonas ![]() Newbie ![]() Joined: 28 September 2007 Location: United States Status: Offline Points: 12 |
![]() ![]() ![]() ![]() ![]() |
|
Thanks! That's exactly what I needed. :)
One more thought/question: it might be nice if the menus that appear on top of the recent document list automatically set their width to match (just like they already seem to automatically set their height). Similarly, it would be nice if the height of the system menu took into account the heights of any menus that could appear on top of the recent document list. In my application, some of the sub-menus will probably be taller than the main system menu, meaning that by default they will hang off the bottom of the system menu (also covering up the Options and Exit buttons). I was able to work around this problem by including a button with no text and a set height at the end of the system menu, to act like a spacer. It'd be nice if that wasn't necessary, though. Thanks again! |
||
![]() |
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 |