<?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 : Popups within Popups - How?</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Popups within Popups - How?]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Mon, 27 Apr 2026 14:33:07 +0000</pubDate>
  <lastBuildDate>Thu, 06 Apr 2006 12:50:42 +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=3726</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[Popups within Popups - How? : Hi,  I have finally managed...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=3726&amp;PID=12016&amp;title=popups-within-popups-how#12016</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1909">BruceW</a><br /><strong>Subject:</strong> 3726<br /><strong>Posted:</strong> 06 April 2006 at 12:50pm<br /><br />Hi,<br><br>I have finally managed to get it to work.<br><br>... on to the next issue.<br><br>Thanks.<br><br>Bruce.<br>]]>
   </description>
   <pubDate>Thu, 06 Apr 2006 12:50:42 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=3726&amp;PID=12016&amp;title=popups-within-popups-how#12016</guid>
  </item> 
  <item>
   <title><![CDATA[Popups within Popups - How? : Hi,  I have the same requirement...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=3726&amp;PID=12014&amp;title=popups-within-popups-how#12014</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1909">BruceW</a><br /><strong>Subject:</strong> 3726<br /><strong>Posted:</strong> 06 April 2006 at 11:32am<br /><br />Hi,<br><br>I have the same requirement (completely dynamic menu with submenus).<br><br>However I find the above examples very hard to follow.<br><br>Is there a simple example somewhere which shows how to create a menu and within it a submenu.<br><br>Thanks,<br><br>Bruce.<br>]]>
   </description>
   <pubDate>Thu, 06 Apr 2006 11:32:42 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=3726&amp;PID=12014&amp;title=popups-within-popups-how#12014</guid>
  </item> 
  <item>
   <title><![CDATA[Popups within Popups - How? : That did it thanks. I can&amp;#039;t...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=3726&amp;PID=11290&amp;title=popups-within-popups-how#11290</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1814">shrapnel</a><br /><strong>Subject:</strong> 3726<br /><strong>Posted:</strong> 06 March 2006 at 1:37pm<br /><br /><P>That did it thanks.&nbsp; I can't say that's very natural though.</P><P>But thanks for the help.</P><P>Paul</P>]]>
   </description>
   <pubDate>Mon, 06 Mar 2006 13:37:23 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=3726&amp;PID=11290&amp;title=popups-within-popups-how#11290</guid>
  </item> 
  <item>
   <title><![CDATA[Popups within Popups - How? : try: pPopupcontrol-&amp;gt;GetCom...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=3726&amp;PID=11289&amp;title=popups-within-popups-how#11289</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 3726<br /><strong>Posted:</strong> 06 March 2006 at 1:29pm<br /><br /><P>try:</P><P>pPopupcontrol-&gt;GetCommandBar()-&gt;GetControls()-&gt;Add</P>]]>
   </description>
   <pubDate>Mon, 06 Mar 2006 13:29:13 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=3726&amp;PID=11289&amp;title=popups-within-popups-how#11289</guid>
  </item> 
  <item>
   <title><![CDATA[Popups within Popups - How? : I guess what I&amp;#039;m asking is...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=3726&amp;PID=11288&amp;title=popups-within-popups-how#11288</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1814">shrapnel</a><br /><strong>Subject:</strong> 3726<br /><strong>Posted:</strong> 06 March 2006 at 1:28pm<br /><br /><P>I guess what I'm asking is can you provide an example of creating nested menus on the fly using the <FONT size=2>CXTPPopupBar class.&nbsp;No resources can be used.</FONT></P><P><FONT size=2>Thanks,</FONT></P><P>Paul&nbsp;</P>]]>
   </description>
   <pubDate>Mon, 06 Mar 2006 13:28:53 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=3726&amp;PID=11288&amp;title=popups-within-popups-how#11288</guid>
  </item> 
  <item>
   <title><![CDATA[Popups within Popups - How? : I think there is a miscommunication...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=3726&amp;PID=11287&amp;title=popups-within-popups-how#11287</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1814">shrapnel</a><br /><strong>Subject:</strong> 3726<br /><strong>Posted:</strong> 06 March 2006 at 1:19pm<br /><br /><P>I think there is a miscommunication here.&nbsp; I already&nbsp;figured out how to create the sub menu by using the xtpControlPopup constant as the first argument.&nbsp; This returns a CXTPControl type so that you can modify the caption and other things.&nbsp; The problem is populating the sub menu.&nbsp; Here's my code snippet:</P><FONT size=2><P>map&lt; </FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>, CString &gt;::const_iterator objMapIter = objDocTypeMap.begin();</P><P></FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> i=0;</P><P></FONT><FONT color=#0000ff size=2>for</FONT><FONT size=2>( objMapIter; objMapIter != objDocTypeMap.end(); objMapIter++ )</P><P>{</P><P>CString strMenuCaption = "";</P><P></P><P>objChildTypeIter = objDocumentTypeDetails.find(objMapIter-&gt;second);</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> ( objChildTypeIter != objDocumentTypeDetails.end() )</P><P>{</P><P>strMenuCaption = (objChildTypeIter-&gt;second).m_strCaption;</P><P>}</P><P></FONT><FONT color=#0000ff size=2>else</P></FONT><FONT size=2><P>{</P><P>strMenuCaption = objMapIter-&gt;second;</P><P>}</P><P></P><P></FONT><FONT color=#008000 size=2>/</FONT><FONT color=#008000 size=2>/ the document type map.</P></FONT><FONT size=2><P>UINT uintIconId = (objChildTypeIter-&gt;second).m_uintIconID;</P><P></P></FONT><FONT size=2><P>CXTPControlPopup* pControl =  (CXTPControlPopup*)pObjPopupBar-&gt;GetControls()-&gt;Add(xt pControlButton, objMapIter-&gt;first);</P><P>pControl-&gt;SetID(objMapIter-&gt;first);</P><P>pControl-&gt;SetCaption(strMenuCaption);</P><P>pControl-&gt;SetIconId(uintIconId);</P><P>}</P><P>This creates the inner sub menu.&nbsp; Then I do this to try and set a parent popup bar items:</P><FONT size=2><FONT size=2><P>CXTPControlPopup* pPopupControl = (CXTPControlPopup*)pObj<FONT color=#ff0000><strong>Parent</strong></FONT>PopupBar-&gt;GetControls()-&gt;Add(xtpControlPopup,-1);</P><P> pPopupControl-&gt;SetCaption(objResourceProvider.GetStringRe source(IDS_SKSD_ADD));</P><P>But how do I get my first menu inside the parent menu.&nbsp; I tried doing this:</P><P>CXTPControl* aControl = pPopupcontrol-&gt;GetControls()-&gt;Add(<FONT size=2>xtpControlButton, 8900);</FONT></P><P><FONT size=2>However, this just menu item is created at the same level as the&nbsp;xtpControlPopup type listed &nbsp;above.</FONT></P><P>This is quite simple to do with CMenu but it's becoming difficult with CodeJock.</P><P>Regards,</P><P>Paul</P><P><FONT size=2>&nbsp;</P></FONT></FONT></FONT></FONT>]]>
   </description>
   <pubDate>Mon, 06 Mar 2006 13:19:00 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=3726&amp;PID=11287&amp;title=popups-within-popups-how#11287</guid>
  </item> 
  <item>
   <title><![CDATA[Popups within Popups - How? : Hi, I just copied it from your...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=3726&amp;PID=11286&amp;title=popups-within-popups-how#11286</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 3726<br /><strong>Posted:</strong> 06 March 2006 at 10:51am<br /><br /><P>Hi,</P><P>I just copied it from your first sample. use&nbsp;-1 as Id for popups.</P>]]>
   </description>
   <pubDate>Mon, 06 Mar 2006 10:51:23 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=3726&amp;PID=11286&amp;title=popups-within-popups-how#11286</guid>
  </item> 
  <item>
   <title><![CDATA[Popups within Popups - How? : I&amp;#039;m sorry but I dont&amp;#039;...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=3726&amp;PID=11274&amp;title=popups-within-popups-how#11274</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1814">shrapnel</a><br /><strong>Subject:</strong> 3726<br /><strong>Posted:</strong> 03 March 2006 at 2:16pm<br /><br /><P>I'm sorry but I dont' understand this code.&nbsp; All I'm trying to do is</P><P>place one <FONT size=2>CXTPPopupBar within another.&nbsp; That Add api clearly doesn't provide for this so I'm confused with the code snippet you gave me.</P></FONT><P>Can you please provide an explanation of what should be placed in objMapiter-&gt;first when you don't have a resource id to use.</P><P>CXTPControlPopup* pControlPopup = (CXTPControlPopup)pObjPopupBar-&gt;GetControls()-&gt;Add(xtp ControlPopup, <FONT color=#cc0000>objMapIter-&gt;first)</FONT>;</P><P>Perhaps it because I'm new to the product but I'm not understanding how to do this.</P><P>Regards,</P><P>&nbsp;</P><P>Paul</P><!-- Signature -->]]>
   </description>
   <pubDate>Fri, 03 Mar 2006 14:16:21 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=3726&amp;PID=11274&amp;title=popups-within-popups-how#11274</guid>
  </item> 
  <item>
   <title><![CDATA[Popups within Popups - How? : Ok I seemed to figure how to place...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=3726&amp;PID=11273&amp;title=popups-within-popups-how#11273</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1814">shrapnel</a><br /><strong>Subject:</strong> 3726<br /><strong>Posted:</strong> 03 March 2006 at 10:41am<br /><br /><P>Ok I seemed to figure how to place one menu inside the other.&nbsp; It's a mix of CMenu and codejock controls - definitely not an elegant.&nbsp; I prefer just using&nbsp; codejock controls so if you have an answer to my first reply it would be appreciated.&nbsp; One thing I don't understand with&nbsp; this solution&nbsp;is why&nbsp;the icons are being placed next to the caption of the sub menu since I'm no longer setting the icon id using the CXTPControl - I'm using a simple CMenu.&nbsp; A further&nbsp;problem is my sub menu is all grayed out - not sure why either.&nbsp; The code is below.&nbsp; </P><FONT color=#0000ff size=2><P>int</FONT><FONT size=2> intMenuCmd = MENU_ID_CANCEL;</P><P>CMenu objMainMenu, objSubMenu;</P><P>BOOL bMenuCreated = FALSE;</P><P>CPoint objPoint;</P><P>BOOL bGetCursorPos = FALSE;</P><P>CXTPPopupBar* pObjPopupBar;</P><P>CXTPPopupBar* pObjParentPopupBar;</P><P>CXTPFrameWnd* pFrame = (CXTPFrameWnd*)AfxGetMainWnd();</P><P></P><P></P><P></FONT><FONT color=#008000 size=2>// Create the popup bars</P></FONT><FONT size=2><P>pObjParentPopupBar = CXTPPopupBar::CreatePopupBar(0);</P><P>pObjPopupBar = CXTPPopupBar::CreatePopupBar(0);</P><P></P><P></P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>// Create the top level menu</P></FONT><FONT size=2><P>bMenuCreated = objMainMenu.CreatePopupMenu();</P><P></FONT><P><FONT size=2></P></FONT><FONT color=#008000 size=2>// Create the sub menu</P></FONT><FONT size=2><P>bMenuCreated = objSubMenu.CreatePopupMenu();</FONT><FONT size=2></P><P></FONT><FONT color=#008000 size=2>// Obtain a list of supported document types. These types are specified</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>// Load the menu into a popup bar</P></FONT><FONT size=2><P>pObjPopupBar-&gt;LoadMenu(&amp;objSubMenu);</P><P></P><P>CXTPControls* pControls = pObjPopupBar-&gt;GetControls();</P><P></FONT><FONT color=#0000ff size=2>for</FONT><FONT size=2>( </FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> i=0; i&lt; pControls-&gt;GetCount(); i++ )</P><P>{</P><P>CXTPControl* a = pControls-&gt;GetAt(i);</P><P>a-&gt;SetEnabled(TRUE);</P><P>}</P><P></P><P></FONT><FONT color=#008000 size=2>// Determine if the Add menu item should appear - Note: this menu item</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>// contains a sub-menu</P></FONT><FONT size=2><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2>( objSubMenu.GetMenuItemCount() )</P><P>{</P><P>objMainMenu.AppendMenu( MF_POPUP, </P><P>(UINT)objSubMenu.m_hMenu, </P><P>objResourceProvider.GetStringResource(IDS_SKSD_ADD));</P><P></P><P>CXTPControl* pControl =  pObjParentPopupBar-&gt;GetControls()-&gt;AddMenuItem(&amp;ob jMainMenu, objMainMenu.GetMenuItemCount()-1);</P><P> pControl-&gt;SetCaption(objResourceProvider.GetStringResourc e(IDS_SKSD_ADD));</P><P>pControl-&gt;SetFlags(xtpFlagManualUpdate);</P><P>}</P><P></P><P></P><P></FONT><FONT color=#008000 size=2>// Determine if the Delete menu item should appear</P></FONT><FONT size=2><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2>( pDocument-&gt;CanBeRemoved() )</P><P>{</P><P>objMainMenu.AppendMenu( MF_STRING, </P><P>IDS_SKSD_DELETE , </P><P>objResourceProvider.GetStringResource(IDS_SKSD_DELETE));</P><P></P><P>CXTPControl* pControl =  pObjParentPopupBar-&gt;GetControls()-&gt;AddMenuItem(&amp;ob jMainMenu, objMainMenu.GetMenuItemCount()-1);</P><P> pControl-&gt;SetCaption(objResourceProvider.GetStringResourc e(IDS_SKSD_DELETE));</P><P></FONT><FONT color=#008000 size=2>//pControl-&gt;SetFlags(xtpFlagManualUpdate);</P></FONT><FONT size=2><P>}</P><P></P><P></FONT><FONT color=#008000 size=2>// Determine if the Rename menu item should appear </P></FONT><FONT size=2><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2>( pDocument-&gt;CanBeRenamed() )</P><P>{</P><P>objMainMenu.AppendMenu( MF_STRING, </P><P>IDS_SKSD_RENAME, </P><P>objResourceProvider.GetStringResource(IDS_SKSD_RENAME));</P><P></P><P>CXTPControl* pControl =  pObjParentPopupBar-&gt;GetControls()-&gt;AddMenuItem(&amp;ob jMainMenu, objMainMenu.GetMenuItemCount()-1);</P><P> pControl-&gt;SetCaption(objResourceProvider.GetStringResourc e(IDS_SKSD_RENAME));</P><P>pControl-&gt;SetFlags(xtpFlagManualUpdate);</P><P>}</P><P>UINT intCommand = CXTPCommandBars::TrackPopupMenu(pObjParentPopupBar, TPM_RETURNCMD, objPoint.x, objPoint.y, (CWnd*)m_pParentWnd);</P><P>thanks</P></FONT>]]>
   </description>
   <pubDate>Fri, 03 Mar 2006 10:41:03 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=3726&amp;PID=11273&amp;title=popups-within-popups-how#11273</guid>
  </item> 
  <item>
   <title><![CDATA[Popups within Popups - How? : Thanks for responding but I&amp;#039;m...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=3726&amp;PID=11271&amp;title=popups-within-popups-how#11271</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1814">shrapnel</a><br /><strong>Subject:</strong> 3726<br /><strong>Posted:</strong> 03 March 2006 at 9:13am<br /><br /><P>Thanks for responding but I'm a little confused.&nbsp; Wouldn't I need a another parent popup object to place the child popup&nbsp;into?&nbsp; Also, I'm a little confused about the id as well.&nbsp; I'm not creating any of the menus from resources - they are all created on the fly?&nbsp; Is the id the first control in the child popup bar?</P><P>To be clear - I have my pObjPopupBar populated with a list of controls.&nbsp; I then want to place this popup inside&nbsp; another popup so that it has the following structure:&nbsp; The Add menu item in the parent displays all the menu items of pObjPopuBar.&nbsp; The parent popupbar will also have some non-nested menu items as well.&nbsp; What's throwing me off is the id in the Add method when added to the parent.&nbsp; What does this represent?&nbsp; I mean, it does popup another blank menu but it needs to popup the child - how is this connection made?</P><P>I was thinking something like this - except I don't know what to put in for the id value:</P><FONT size=2><P></FONT><FONT size=2>CXTPControlPopup* pControlPopup =  (CXTPControlPopup)pObjParentPopupBar-&gt;GetControls()-&gt;A dd(xtp ControlPopup, ?????);</FONT></P><P><FONT size=2></FONT>&nbsp;</P><P><FONT size=2>&nbsp;</P></FONT>]]>
   </description>
   <pubDate>Fri, 03 Mar 2006 09:13:06 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=3726&amp;PID=11271&amp;title=popups-within-popups-how#11271</guid>
  </item> 
 </channel>
</rss>