<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : Manual Creation of Ribbon System Menu</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Manual Creation of Ribbon System Menu]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 10 Jun 2026 19:42:23 +0000</pubDate>
  <lastBuildDate>Mon, 01 Oct 2007 16:17:44 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=8213</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[Manual Creation of Ribbon System Menu : Thanks!  That&amp;#039;s exactly what...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8213&amp;PID=26730&amp;title=manual-creation-of-ribbon-system-menu#26730</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3350">Jayonas</a><br /><strong>Subject:</strong> 8213<br /><strong>Posted:</strong> 01 October 2007 at 4:17pm<br /><br />Thanks!  That's exactly what I needed. :)<br /><br />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).<br /><br />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.<br /><br />Thanks again!]]>
   </description>
   <pubDate>Mon, 01 Oct 2007 16:17:44 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8213&amp;PID=26730&amp;title=manual-creation-of-ribbon-system-menu#26730</guid>
  </item> 
  <item>
   <title><![CDATA[Manual Creation of Ribbon System Menu : Hi,, See OnCreateControl method...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8213&amp;PID=26627&amp;title=manual-creation-of-ribbon-system-menu#26627</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 8213<br /><strong>Posted:</strong> 29 September 2007 at 1:59am<br /><br />Hi,,<DIV>See OnCreateControl method in Sample </DIV><DIV>&nbsp;</DIV><DIV>and this block:</DIV><DIV>&nbsp;</DIV><DIV>if (lpCreateControl-&gt;nID == ID_APP_EXIT || lpCreateControl-&gt;nID == ID_APP_OPTIONS)<BR>&nbsp;{&nbsp;&nbsp;<BR>&nbsp;&nbsp;lpCreateControl-&gt;pControl = new CXTPRibbonControlSystemPopupBarButton();</DIV><DIV>&nbsp;&nbsp;return TRUE;<BR>&nbsp;}<BR></DIV>]]>
   </description>
   <pubDate>Sat, 29 Sep 2007 01:59:02 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8213&amp;PID=26627&amp;title=manual-creation-of-ribbon-system-menu#26627</guid>
  </item> 
  <item>
   <title><![CDATA[Manual Creation of Ribbon System Menu : I&amp;#039;m trying to figure out...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=8213&amp;PID=26611&amp;title=manual-creation-of-ribbon-system-menu#26611</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3350">Jayonas</a><br /><strong>Subject:</strong> 8213<br /><strong>Posted:</strong> 28 September 2007 at 1:00pm<br /><br />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.<br /><br />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:<br /><br /><table width="99%"><tr><td class="BBquote"><img src="forum_images/quote_box.png" title="Quote" alt="Quote" style="vertical-align: text-bottom;" /> <br />&nbsp;&nbsp;&nbsp;&nbsp;POPUP "&File"<br />&nbsp;&nbsp;&nbsp;&nbsp;BEGIN<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MENUITEM "&New\tCtrl+N", ID_FILE_NEW<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MENUITEM "&Open...\tCtrl+O", ID_FILE_OPEN<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MENUITEM "&Save\tCtrl+S", ID_FILE_SAVE<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MENUITEM "Save &As...", ID_FILE_SAVE_AS<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MENUITEM SEPARATOR<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MENUITEM "&Print", ID_FILE_PRINT<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MENUITEM "Pr&epare", ID_FILE_PREPARE<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MENUITEM "Sen&d", ID_FILE_SEND<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MENUITEM "P&ublish", ID_FILE_PREPARE<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MENUITEM SEPARATOR<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MENUITEM "Close", ID_APP_CLOSE<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MENUITEM SEPARATOR<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MENUITEM "Recent Documents", ID_FILE_RECENTDOCUMENTS<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , MENUBARBREAK<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MENUITEM "Opt&ions", ID_APP_OPTIONS<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MENUITEM "E&xit Sample", ID_APP_EXIT<br />&nbsp;&nbsp;&nbsp;&nbsp;END<br /></td></tr></table><br /><br />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.<br /><br />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.<br /><br />Here's the code I'm using so far and the menu it generates:<br /><br /><table width="99%"><tr><td class="BBquote"><img src="forum_images/quote_box.png" title="Quote" alt="Quote" style="vertical-align: text-bottom;" /> <br />Popup = m_Ribbon-&gt;AddSystemButton(IDS_Menu_System);<br />this-&gt;LoadImage(IDP_VLogo_32, IDP_VLogo_32, CSize(32,32));<br />Popup-&gt;SetIconId(IDP_VLogo_32);<br />Popup-&gt;GetCommandBar()-&gt;SetIconSize(CSize(32,32));<br />Control = Popup-&gt;GetCommandBar()-&gt;GetControls()-&gt;Add(xtpControlButton, IDC_NewResource);<br />Control = Popup-&gt;GetCommandBar()-&gt;GetControls()-&gt;Add(xtpControlButton, IDC_OpenResource);<br />Control = Popup-&gt;GetCommandBar()-&gt;GetControls()-&gt;Add(xtpControlButton, IDC_SaveResource);<br />Control = Popup-&gt;GetCommandBar()-&gt;GetControls()-&gt;Add(xtpControlButton, IDC_PrintResource);<br />Control-&gt;SetBeginGroup(TRUE);<br />Control = Popup-&gt;GetCommandBar()-&gt;GetControls()-&gt;Add(xtpControlButton, IDC_RecentDocuments);<br />Control-&gt;SetBeginGroup(TRUE);<br />Control-&gt;SetFlags(Control-&gt;GetFlags() | xtpFlagWrapRow);<br />Control = Popup-&gt;GetCommandBar()-&gt;GetControls()-&gt;Add(xtpControlButton, IDC_ShowOptions);<br />Control-&gt;SetFlags(Control-&gt;GetFlags() | xtpFlagWrapRow);<br />Control = Popup-&gt;GetCommandBar()-&gt;GetControls()-&gt;Add(xtpControlButton, IDC_ExitProgram);<br /></td></tr></table><br /><br /><img src="uploads/20070928_125458_SystemMenu.jpg" border="0"><br /><br />Thanks!]]>
   </description>
   <pubDate>Fri, 28 Sep 2007 13:00:25 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=8213&amp;PID=26611&amp;title=manual-creation-of-ribbon-system-menu#26611</guid>
  </item> 
 </channel>
</rss>