<?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 : Customizati&#111;n of dynamic Menu</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Customizati&#111;n of dynamic Menu]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 11 Apr 2026 23:34:19 +0000</pubDate>
  <lastBuildDate>Fri, 29 Oct 2004 09:28:03 +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=955</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[Customizati&#111;n of dynamic Menu : My codefills the commands page...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=955&amp;PID=3760&amp;title=customization-of-dynamic-menu#3760</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=757">krulle</a><br /><strong>Subject:</strong> 955<br /><strong>Posted:</strong> 29 October 2004 at 9:28am<br /><br /><P>My code&nbsp;fills the commands page even if you have dynamic menus, hope it will help. It could be a good idea to make a recursive version of my code if you need also need the submenus included in the list.</P><P><FONT face="Courier New, Courier, mono">void CMainFrame::OnCustomize()<BR>{<BR>&nbsp;&nbsp;&nbsp; // get a pointer to the command bars object.<BR>&nbsp;&nbsp;&nbsp; CXTPCommandBars* pCommandBars = GetCommandBars();<BR>&nbsp;&nbsp;&nbsp; if (pCommandBars == NULL)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;</FONT></P><P><FONT face="Courier New, Courier, mono">&nbsp;&nbsp;&nbsp; // instanciate the customize dialog<BR>&nbsp;&nbsp;&nbsp; CXTPCustomizeSheet dlg(pCommandBars);</FONT></P><P><FONT face="Courier New, Courier, mono">&nbsp;&nbsp;&nbsp; // add the options page to the customize dialog.<BR>&nbsp;&nbsp;&nbsp; CXTPCustomizeOptionsPage pageOptions(&amp;dlg);<BR>&nbsp;&nbsp;&nbsp; dlg.AddPage(&amp;pageOptions);</FONT></P><P><FONT face="Courier New, Courier, mono">&nbsp;&nbsp;&nbsp; // add the commands page to the customize dialog.<BR>&nbsp;&nbsp;&nbsp; CXTPCustomizeCommandsPage* pCommands = dlg.GetCommandsPage();<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp; // fill the page with menu controls<BR>&nbsp;&nbsp;&nbsp; CXTPControls* pMenuControls = GetCommandBars()-&gt;GetMenuBar()-&gt;GetControls();<BR>&nbsp;&nbsp;&nbsp; for(int i = 0; i &lt; pMenuControls-&gt;GetCount(); i++)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CXTPControlPopup* pMenubarControl = DYNAMIC_DOWNCAST(CXTPControlPopup, pMenuControls-&gt;GetAt(i));<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(pMenubarControl)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; CString caption = pMenubarControl-&gt;GetCaption();<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; caption.Replace("&amp;", "");</FONT></P><P><FONT face="Courier New, Courier, mono"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; CXTPControls* pPageControls = pCommands-&gt;InsertCategory(caption);<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; CXTPControls* pSourceControls = pMenubarControl-&gt;GetCommandBar()-&gt;GetControls();</FONT></P><P><FONT face="Courier New, Courier, mono"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; for(int j = 0; j &lt; pSourceControls-&gt;GetCount(); j++)<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; {<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CXTPControl* tmp = pSourceControls-&gt;GetAt(j);<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(!(tmp-&gt;GetFlags() &amp; xtpFlagNoMovable))<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pPageControls-&gt;AddClone(tmp);<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; }</FONT></P><P><FONT face="Courier New, Courier, mono">&nbsp;&nbsp;&nbsp; pCommands-&gt;InsertAllCommandsCategory();</FONT></P><P><FONT face="Courier New, Courier, mono">&nbsp;&nbsp;&nbsp; // display the customize dialog.<BR>&nbsp;&nbsp;&nbsp; dlg.DoModal();<BR>}</FONT></P>]]>
   </description>
   <pubDate>Fri, 29 Oct 2004 09:28:03 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=955&amp;PID=3760&amp;title=customization-of-dynamic-menu#3760</guid>
  </item> 
  <item>
   <title><![CDATA[Customizati&#111;n of dynamic Menu :     I still do not understand...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=955&amp;PID=2536&amp;title=customization-of-dynamic-menu#2536</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=389">yoavo</a><br /><strong>Subject:</strong> 955<br /><strong>Posted:</strong> 20 July 2004 at 11:18am<br /><br /><TABLE id=HB_Mail_C&#111;ntainer height="100%" cellSpacing=0 cellPadding=0 width="100%" border=0 UNABLE="&#111;n"><T><TR height="100%" width="100%" UNABLE="&#111;n"><TD id=HB_Focus_Element vAlign=top width="100%" background="" height=250 UNABLE="off"><P>I still do not understand how do I get the commands of each category ?</P><P>This is my code for displaying the categories:</P><P>void CMainFrame::OnCustomize()<BR>{<BR>&nbsp;CXTPCustomizeSheet cs(GetCommandBars());<BR>&nbsp;CXTPCustomizeOptionsPage pageOptions(&amp;cs);<BR>&nbsp;cs.AddPage(&amp;pageOptions);<BR>&nbsp;<BR>&nbsp;CXTPCustomizeCommandsPage* pCommands = cs.GetCommandsPage();<BR>&nbsp;CXTPMenuBar* pMenuBar = GetCommandBars()-&gt;GetMenuBar();</P><P>&nbsp;CXTPControls* pMenuControls = pMenuBar-&gt;GetControls();<BR>&nbsp;int aCount = pMenuControls-&gt;GetCount();<BR>&nbsp;for (int i = 0 ; i &lt; aCount ; ++i)<BR>&nbsp;{<BR>&nbsp;&nbsp;CXTPControl* pMenubarControl = pMenuControls-&gt;GetAt(i);<BR>&nbsp;&nbsp;CString aCaption = pMenubarControl-&gt;GetCaption();<BR>&nbsp;&nbsp;CXTPControls* pPageControls = pCommands-&gt;InsertCategory(aCaption);<BR>...</P><P>what do I need do add inorder that the commands of each category will be displayed ?</P><P><BR>&nbsp;</P></TD></TR><TR hb_tag="1" UNABLE="&#111;n"><TD style="FONT-SIZE: 1pt" height=1 UNABLE="&#111;n"><DIV id=hotbar_promo></DIV></TD></TR></T></TABLE><BLOCKQUOTE id=bc82bc38><TABLE id=HB_Mail_C&#111;ntainer height="100%" cellSpacing=0 cellPadding=0 width="100%" border=0 UNABLE="&#111;n"><T><TR height="100%" width="100%" UNABLE="&#111;n"><TD id=HB_Focus_Element vAlign=top width="100%" background="" height=250 UNABLE="off"></TD></TR><TR hb_tag="1" UNABLE="&#111;n"><TD style="FONT-SIZE: 1pt" height=1 UNABLE="&#111;n"><DIV id=hotbar_promo></DIV></TD></TR></T></TABLE></BLOCKQUOTE>]]>
   </description>
   <pubDate>Tue, 20 Jul 2004 11:18:47 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=955&amp;PID=2536&amp;title=customization-of-dynamic-menu#2536</guid>
  </item> 
  <item>
   <title><![CDATA[Customizati&#111;n of dynamic Menu : pMenuBar-&amp;gt;GetControls()-&amp;gt...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=955&amp;PID=2526&amp;title=customization-of-dynamic-menu#2526</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 955<br /><strong>Posted:</strong> 19 July 2004 at 11:36am<br /><br /><P>pMenuBar-&gt;GetControls()-&gt;GetCount()</P><P>pMenuBar-&gt;GetControl(i)-&gt;GetCaption().</P>]]>
   </description>
   <pubDate>Mon, 19 Jul 2004 11:36:54 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=955&amp;PID=2526&amp;title=customization-of-dynamic-menu#2526</guid>
  </item> 
  <item>
   <title><![CDATA[Customizati&#111;n of dynamic Menu :    But how do I expolre the...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=955&amp;PID=2524&amp;title=customization-of-dynamic-menu#2524</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=389">yoavo</a><br /><strong>Subject:</strong> 955<br /><strong>Posted:</strong> 19 July 2004 at 9:01am<br /><br /><TABLE id=HB_Mail_C&#111;ntainer height="100%" cellSpacing=0 cellPadding=0 width="100%" border=0 UNABLE="&#111;n"><T><TR height="100%" width="100%" UNABLE="&#111;n"><TD id=HB_Focus_Element vAlign=top width="100%" background="" height=250 UNABLE="off">But how do I expolre the CXTPMenuBar ? I did not find a way to recieve a CMenu out of the CXTPMenuBar. (how do I recieve from a CXTPMenuBar&nbsp;its categories ??? )</TD></TR><TR hb_tag="1" UNABLE="&#111;n"><TD style="FONT-SIZE: 1pt" height=1 UNABLE="&#111;n"><DIV id=hotbar_promo></DIV></TD></TR></T></TABLE>]]>
   </description>
   <pubDate>Mon, 19 Jul 2004 09:01:14 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=955&amp;PID=2524&amp;title=customization-of-dynamic-menu#2524</guid>
  </item> 
  <item>
   <title><![CDATA[Customizati&#111;n of dynamic Menu : You also can create categories...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=955&amp;PID=2523&amp;title=customization-of-dynamic-menu#2523</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 955<br /><strong>Posted:</strong> 19 July 2004 at 8:52am<br /><br /><P>You also can create categories and items of customize dialog dynamically:</P><P>CXTPControls* CXTPCustomizeCommandsPage::InsertCategory(CString strCategory, int nIndex = -1);</P><P>CXTPControls::Add</P><P>&nbsp;</P>]]>
   </description>
   <pubDate>Mon, 19 Jul 2004 08:52:55 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=955&amp;PID=2523&amp;title=customization-of-dynamic-menu#2523</guid>
  </item> 
  <item>
   <title><![CDATA[Customizati&#111;n of dynamic Menu :     Hi, In my application...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=955&amp;PID=2521&amp;title=customization-of-dynamic-menu#2521</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=389">yoavo</a><br /><strong>Subject:</strong> 955<br /><strong>Posted:</strong> 19 July 2004 at 6:53am<br /><br /><TABLE id=HB_Mail_C&#111;ntainer height="100%" cellSpacing=0 cellPadding=0 width="100%" border=0 UNABLE="&#111;n"><T><TR height="100%" UNABLE="&#111;n" width="100%"><TD id=HB_Focus_Element vAlign=top width="100%" background="" height=250 UNABLE="off"><P>Hi,</P><P>In my application I creates my menu dynamically and attach it to a CXTPMenuBar object. I want to see this menu in the customize dialog. How can I do that ? (I saw only an option to show a menu that is created by resources).</P><P>thanks, Yoav.</P></TD></TR><TR UNABLE="&#111;n" hb_tag="1"><TD style="FONT-SIZE: 1pt" height=1 UNABLE="&#111;n"><DIV id=hotbar_promo></DIV></TD></TR></T></TABLE>]]>
   </description>
   <pubDate>Mon, 19 Jul 2004 06:53:25 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=955&amp;PID=2521&amp;title=customization-of-dynamic-menu#2521</guid>
  </item> 
 </channel>
</rss>