<?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 : TrackPopupMenu Markup</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : XAML Snippets : TrackPopupMenu Markup]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Tue, 09 Jun 2026 22:52:11 +0000</pubDate>
  <lastBuildDate>Fri, 13 Mar 2009 02:08:16 +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=13645</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[TrackPopupMenu Markup : Hi,  Guess its something in...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13645&amp;PID=46605&amp;title=trackpopupmenu-markup#46605</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 13645<br /><strong>Posted:</strong> 13 March 2009 at 2:08am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>Guess its something in our code - your looks fine :) </DIV>]]>
   </description>
   <pubDate>Fri, 13 Mar 2009 02:08:16 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13645&amp;PID=46605&amp;title=trackpopupmenu-markup#46605</guid>
  </item> 
  <item>
   <title><![CDATA[TrackPopupMenu Markup : Hmm. I&amp;#039;ve managed to solve...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13645&amp;PID=46563&amp;title=trackpopupmenu-markup#46563</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3688">BobWansink</a><br /><strong>Subject:</strong> 13645<br /><strong>Posted:</strong> 12 March 2009 at 6:51am<br /><br />Hmm. I've managed to solve this problem via a work-around. Instead of using MouseLeftButtonDown or MouseRightButtonDown, I've started using MouseLeftButtonUp and MouseRightButtonUp. I'd still like to know what's wrong in the above code, in case I need something like this again.&nbsp;]]>
   </description>
   <pubDate>Thu, 12 Mar 2009 06:51:53 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13645&amp;PID=46563&amp;title=trackpopupmenu-markup#46563</guid>
  </item> 
  <item>
   <title><![CDATA[TrackPopupMenu Markup :    // XAML   &amp;lt;Border Style=&amp;#034;{StaticResource...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13645&amp;PID=46549&amp;title=trackpopupmenu-markup#46549</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3688">BobWansink</a><br /><strong>Subject:</strong> 13645<br /><strong>Posted:</strong> 12 March 2009 at 3:47am<br /><br /><font face="Courier New, Courier, mono"><font color="#006600">// XAML</font><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Border Style="{StaticResource TabButtonBorder}"&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Border Style="{StaticResource TabButton}"&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;StackPanel Orientation="Horizontal"&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Image Style="{StaticResource ImageStyle}" Source="file://images/nieuweversie.png"/&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;TextBlock MouseRightButtonDown="ShowContextMenu" Margin="5,7,16,0"&gt;Boe&lt;/TextBlock&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/StackPanel&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/Border&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/Border&gt;<br><font color="#006600">//</font><br><br><font color="#006600">// class ProjectCentrumXAMLPanel : public ZXAMLPanel<br>// class ZXAMLPanel : public ZPanel, public CXTPMarkupContext </font><br><br>void ProjectCentrumXAMLPanel::RightClickOnElement(CXTPMarkupObject * pSender, CXTPMarkupMouseButtonEventArgs* pArgs)<br>{<br>&nbsp; CXTPMarkupBorder * pEl = (CXTPMarkupBorder *) pSender;<br>&nbsp; pArgs-&gt;SetHandled();<br>&nbsp; this-&gt;makeContextMenu(pEl);<br>}<br><br><br><br>void ZXAMLPanel::makeContextMenu(CXTPMarkupInputElement * pEl)<br>{<br><br>&nbsp; CRect r1(0,0,0,0);<br>&nbsp; this-&gt;GetWindowRect(r1);<br>&nbsp; elementDatRechterMuisMenuOpriep = pEl;<br>&nbsp; CRect r = this-&gt;GetClientBoundingRect(pEl);<br><br>&nbsp; CPoint pt(r1.left+r.left, r1.top+r.bottom);<br>&nbsp; CMenu menu;<br>&nbsp; menu.CreatePopupMenu();<br>&nbsp; UINT flags = MF_STRING;<br>&nbsp; menu.AppendMenu(flags,1100,"Bob");<br>&nbsp; menu.TrackPopupMenu(TPM_LEFTALIGN|TPM_RIGHTBUTTON,pt.x,pt.y,this);<br>}<br><br><br><br><br>BEGIN_MESSAGE_MAP(ZXAMLPanel, CWnd)<br>&nbsp; ON_COMMAND_RANGE(1000, 2000, processContextMenu)<br>END_MESSAGE_MAP()<br><br><font color="#006600">// ZXAMLPanel</font><br>virtual afx_msg void processContextMenu(UINT nID);<br><br>void ZXAMLPanel::processContextMenu(UINT nID)<br>{<br>&nbsp; return;<br>}<br><br>void ProjectCentrumXAMLPanel::processContextMenu(UINT nID)<br>{<br>&nbsp; if (nID == 1100) this-&gt;OpenBestand(elementDatRechterMuisMenuOpriep, 0);<br>&nbsp; if (nID == 1101) this-&gt;VerwijderBestand(elementDatRechterMuisMenuOpriep, 0);<br>&nbsp; if (nID == 1102) this-&gt;OpslaanVersie(elementDatRechterMuisMenuOpriep, 0);<br>&nbsp; if (nID == 1103) this-&gt;NieuweVersie(elementDatRechterMuisMenuOpriep, 0);<br>&nbsp; if (nID == 1104) this-&gt;HernoemBestand(elementDatRechterMuisMenuOpriep, 0);<br>&nbsp; if (nID == 1105) this-&gt;ArchiveerBestand(elementDatRechterMuisMenuOpriep, 0);<br>&nbsp; if (nID == 1106) this-&gt;BackupBestand(elementDatRechterMuisMenuOpriep, 0);<br>&nbsp; this-&gt;elementDatRechterMuisMenuOpriep = NULL;<br>&nbsp; <br>&nbsp; return;<br>}<br><br><br><br><br></font>]]>
   </description>
   <pubDate>Thu, 12 Mar 2009 03:47:29 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13645&amp;PID=46549&amp;title=trackpopupmenu-markup#46549</guid>
  </item> 
  <item>
   <title><![CDATA[TrackPopupMenu Markup : Hi,  Need to test. Show related...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13645&amp;PID=46547&amp;title=trackpopupmenu-markup#46547</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 13645<br /><strong>Posted:</strong> 12 March 2009 at 2:27am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>Need to test. Show related code.</DIV>]]>
   </description>
   <pubDate>Thu, 12 Mar 2009 02:27:55 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13645&amp;PID=46547&amp;title=trackpopupmenu-markup#46547</guid>
  </item> 
  <item>
   <title><![CDATA[TrackPopupMenu Markup :  Hi,we&amp;#039;ve added a Contextmenu...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13645&amp;PID=46519&amp;title=trackpopupmenu-markup#46519</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3688">BobWansink</a><br /><strong>Subject:</strong> 13645<br /><strong>Posted:</strong> 11 March 2009 at 7:44am<br /><br />Hi,<br><br>we've added a Contextmenu to our markupcode. Example:<br><br><font face="Courier New, Courier, mono">&lt;TextBlock MouseRightButtonDown="ShowMenu"&gt;bla&lt;/TextBlock&gt;</font><br><br>with function ShowMenu:<br><br><font face="Courier New, Courier, mono">CMenu men;<br>men.CreatePopupMenu();<br>&nbsp; men.AppendMenu(MF_STRING, 100, "Bla");<br>men.TrackPopupMenu(TPM_LEFTALIGN|TPM_RIGHTBUTTON,pt.x,pt.y,this);</font><br><font color="#00cc00" face="Courier New, Courier, mono">// x and y are fixed, not GetCursorPos(); I want the menu to display at a specific location.</font><br><br>If I click outside the menu with the left mousebutton, the menu disappears. Rightclicking outside the menu DOESN'T makes the menu disappear, but the ShowMenu function is immediately excecuted. This means the menu is .<br><br>What can i do to make the menu disappear on both buttons? <br><br>I think this has something to do with RightMouseButtonDown being excecuted again, even though the mouse has moved away from the element that called it. I've tried pArgs-&gt;SetHandled(), but that was to no avail.<br><br>I'd appreciate any help.<br><br>Thanks!<br>]]>
   </description>
   <pubDate>Wed, 11 Mar 2009 07:44:52 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13645&amp;PID=46519&amp;title=trackpopupmenu-markup#46519</guid>
  </item> 
 </channel>
</rss>