<?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 : Dynamic menus</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Dynamic menus]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 04 Apr 2026 09:44:17 +0000</pubDate>
  <lastBuildDate>Tue, 05 Jul 2005 04:41:30 +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=1569</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[Dynamic menus : Now I know answers for my previous...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1569&amp;PID=7465&amp;title=dynamic-menus#7465</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1289">Sera</a><br /><strong>Subject:</strong> 1569<br /><strong>Posted:</strong> 05 July 2005 at 4:41am<br /><br />Now I know answers for my previous questions.<br />But I still have some problems.<br /><br />Now i've created the toolbar dynamically. It's normal, but when using "chevron" "Add and remove buttons" -&gt; "MyToolbar", in popup menu there are <br />a) items from not used resource toolbar;<br />b) my items (disabled).]]>
   </description>
   <pubDate>Tue, 05 Jul 2005 04:41:30 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1569&amp;PID=7465&amp;title=dynamic-menus#7465</guid>
  </item> 
  <item>
   <title><![CDATA[Dynamic menus : and one more question.  What is...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1569&amp;PID=7397&amp;title=dynamic-menus#7397</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1289">Sera</a><br /><strong>Subject:</strong> 1569<br /><strong>Posted:</strong> 01 July 2005 at 7:32am<br /><br />and one more question.<br /><br />What is about creating toolbar dynamically from CToolBar?<br />Maybe you know simple solution.<br /><br />thanks a lot<br />]]>
   </description>
   <pubDate>Fri, 01 Jul 2005 07:32:49 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1569&amp;PID=7397&amp;title=dynamic-menus#7397</guid>
  </item> 
  <item>
   <title><![CDATA[Dynamic menus : A lot of thanks! That&amp;#039;s really...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1569&amp;PID=7396&amp;title=dynamic-menus#7396</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1289">Sera</a><br /><strong>Subject:</strong> 1569<br /><strong>Posted:</strong> 01 July 2005 at 7:25am<br /><br />A lot of thanks!<br />That's really works. ^)<br /><br />I'm just a newbie of codejoke, so cannot understand a lot of things. <br />Maybe you can explain me, how to work with menu and toolbar? I'm about changing state and style of them (at run time).<br />How to substitute functions:<br />CMenu::CheckMenuRadioItem,<br />CMenu::EnableMenuItem,<br />CToolBar::SetButtonStyle (enable/disable button)<br /><br />thanks]]>
   </description>
   <pubDate>Fri, 01 Jul 2005 07:25:18 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1569&amp;PID=7396&amp;title=dynamic-menus#7396</guid>
  </item> 
  <item>
   <title><![CDATA[Dynamic menus : I&amp;#039;m doing this like crazy,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1569&amp;PID=7385&amp;title=dynamic-menus#7385</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=205">spiderM9</a><br /><strong>Subject:</strong> 1569<br /><strong>Posted:</strong> 30 June 2005 at 2:13pm<br /><br />I'm doing this like crazy, all from XML.<br>Start with this, from inside your CXTPMDIFrameWnd (typically CMainFrame)<br><br>&nbsp;&nbsp;&nbsp; CXTPCommandBars* pBars = GetCommandBars();<br>&nbsp;&nbsp;&nbsp; CXTPCommandBar* pMenu = pBars-&gt;GetMenuBar();<br>&nbsp;&nbsp;&nbsp; CXTPControls* pControls = pMenu-&gt;GetControls();<br><br>then, after gathering the menu hierarchy from XML, I set up a recursivecall to add commands.&nbsp; as a parameter to this call is a queue ofcommand bars.&nbsp; the top level bar (e.g. MainMenu, which typicallycontains only top level menus like File, Edit etc.) is pushed into thequeue.<br><br>the first item from the queue is popped, and as you add items, if theitem is another sub-menu, push it into the stack to be "FixedUp".&nbsp; assuming "current" is the menu being built (which on thefirst pass will be MainMenu and on the second will be "FileMenu"etc..., the following is a pseudo-code snippet of the operation...<br><br>HRESULT CCommandBarFixer::FixCommandBar(CXTPControls* pControls, &#091;unique identifier from XML&#093;, &#091;various other services&#093;)<br>{<br>&nbsp;&nbsp;&nbsp; HRESULT hr;<br><br>&nbsp;&nbsp;&nbsp; // push to start iteration<br>&nbsp;&nbsp;&nbsp; //<br>&nbsp;&nbsp;&nbsp; c_of_fixmenu fixmenu_q; // a std::list&lt;CFixMenu&gt;<br>&nbsp;&nbsp;&nbsp; fixmenu_q.push_back(CFixMenu(&#091;menu identifier from xml&#093;, pControls));<br><br>&nbsp;&nbsp;&nbsp; while (!fixmenu_q.empty())<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CFixMenu current = fixmenu_q.front();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fixmenu_q.pop_front();<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // collect the children of this command bar<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &#091;collection of your xml data&#093;extracted = &#091;extract children from XML&#093;(current.&#091;menu identifier&#093;);<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // this is a purely manifestdriven menu, simply loop through the finished menu and add them all<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // (this code is similar to the short circuit code in FixBootstrapMenu)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; int nInsertHere = 0;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; int i_ct = current.controls-&gt;GetCount();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; _ASSERT(0 == i_ct);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (0 == i_ct)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CXTPControls* pControls = current.controls;<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; bool bFoundInterveningGroup = false;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for(&#091;collection of your xml data&#093;::iterator ii = extracted.begin(); ii !=extracted.end(); ++ii)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AddCommand(pControls, XTPControlFlags(0),nInsertHere /*byref*/, fixmenu_q /*byref*/, &#091;various info pulled fromii&#093;);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; return S_OK;<br>}<br><br>where AddCommand basically calls pControls-&gt;Add(type, ...<br>then decorates the returned pControl with data gathered from the XML,like the icon, display name etc.&nbsp; if the item added was asub-menu, it pushes the identifier into the queue, and the driver loopcontinues until the queue is empty, which allows for arbitrarily deeplynested menu structures.<br><br>Another trick was dealing with the automatic generation of separatorsby having the XML definition just group commands together, whichrequires some extra logic to determine if you are at the beginning orend of a group of commands, and automatically inserting theseparator.&nbsp; With explicitly defined separators, it makes itdifficult to dynamically add commands at a specific location(especially when there are multiple 3rd parties trying to extend themenu system).<br><br>Note that if you want true extensibility without clashes, I'd suggesthaving each command uniquely identified within a Guid namespace using aGuid+Id pair, and providing a dynamically created mapping between trueunique identifiers and the UINT needed by Windows/CodeJock.<br><br>The XML approach is very nice, I've got key-bindings, extensions fordynamic walkout menus and custom widgets, but it takes a bit of work tocoerce Xtreme toolkit since it is really set up for static definitions.<br><br>P.S., I had to do the same type of thing for docking panes, since wedon't know at compile time which types of panes are going to berequested, so a simple numeric pane identifier is an impossiblity in anextensible system.<br><br><br><br>]]>
   </description>
   <pubDate>Thu, 30 Jun 2005 14:13:23 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1569&amp;PID=7385&amp;title=dynamic-menus#7385</guid>
  </item> 
  <item>
   <title><![CDATA[Dynamic menus : Hi!  I did the following:  CXTPCommandBars*...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1569&amp;PID=7382&amp;title=dynamic-menus#7382</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=633">hpesata</a><br /><strong>Subject:</strong> 1569<br /><strong>Posted:</strong> 30 June 2005 at 11:30am<br /><br />Hi!<br><br>I did the following:<br><br>CXTPCommandBars* pCommandBars = GetCommandBars();<br>if ( pCommandBars )<br>{&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; // Create fixed XTP menubar<br>&nbsp;&nbsp;&nbsp; CXTPMenuBar* pMenuBar = pCommandBars-&gt;SetMenu(_T("Menu Bar"), 0);<br>}<br><br>using "0" within SetMenu() allows you to create an empty menu-bar.<br><br>afterwards I use<br><br>pMenuBar -&gt; LoadMenu(&amp;mymenu, TRUE)<br><br>to convert my MFC-menu to an XTP-menu.<br><br>Hope this helps!<br><br>regrads,<br>Hans<br><br>]]>
   </description>
   <pubDate>Thu, 30 Jun 2005 11:30:56 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1569&amp;PID=7382&amp;title=dynamic-menus#7382</guid>
  </item> 
  <item>
   <title><![CDATA[Dynamic menus : I have the same problem.  How...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1569&amp;PID=7381&amp;title=dynamic-menus#7381</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1289">Sera</a><br /><strong>Subject:</strong> 1569<br /><strong>Posted:</strong> 30 June 2005 at 11:00am<br /><br />I have the same problem. <br />How to initialize <br />CXTPCommandBars member: CXTPMenubar* m_pMenuBar;<br />not from resources, but dynamically?<br /><br />class CXTPMenuBar has the only method:<br />BOOL LoadMenuBar(UINT nIDResource);<br />And it's even not virtual!<br />]]>
   </description>
   <pubDate>Thu, 30 Jun 2005 11:00:09 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1569&amp;PID=7381&amp;title=dynamic-menus#7381</guid>
  </item> 
  <item>
   <title><![CDATA[Dynamic menus : Hi!  I am currentlx trying to...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=1569&amp;PID=4491&amp;title=dynamic-menus#4491</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=633">hpesata</a><br /><strong>Subject:</strong> 1569<br /><strong>Posted:</strong> 21 December 2004 at 9:14am<br /><br />Hi!<br><br>I am currentlx trying to use an existing VC++.NET MFC application with Xtreme Toolkit Pro.<br>my application loads its menu entries from a XML-file and creates the app-menu<br>dynamically. I couldnt find a way to use XTreme Tooklit Pro with this approach, altough<br>I browsed through this forum, reading all related topics.<br><br>how can I dynamically create a CXTPMenubar object and attach it to the CXTPCommandbars ?<br>how can I attach my MFC-CMenu information to the CXTPMenuBar object ?<br>I would like to use the xtpThemeOffice2003 style wijh my menus.<br><br>any hints and sample code on how to accomplish this would be greatly appreciated,<br>thanx in advance!<br><br>best regards,<br>Hans<br><br>]]>
   </description>
   <pubDate>Tue, 21 Dec 2004 09:14:59 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=1569&amp;PID=4491&amp;title=dynamic-menus#4491</guid>
  </item> 
 </channel>
</rss>