<?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 : No tooltip for context menus. Why?</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : No tooltip for context menus. Why?]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 13 Jun 2026 12:58:43 +0000</pubDate>
  <lastBuildDate>Wed, 28 Jul 2010 09:30: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=16706</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[No tooltip for context menus. Why? : But Zan that is what I do for...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16706&amp;PID=59513&amp;title=no-tooltip-for-context-menus-why#59513</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> 16706<br /><strong>Posted:</strong> 28 July 2010 at 9:30am<br /><br />But Zan that is what I do for my right-click context menus. We have our own TrackPopupMenu on our frame that takes in a CMenu. If the frame is the tracking window, I get the command bars object from the frame and obtain the command bar options (to set bShowContextMenuAccelerators to TRUE) and also so I can pass in the TPM_RETURNCMD flag since CJ context menus call SendMessage instead of PostMessage (Send versus Post causes us all sorts of problems). <DIV>&nbsp;</DIV><DIV>If the frame is not the tracking window (we have params to tell us that) I create a new CXTPCommandBars object and set the site to the tracking window. I set up a theme and then give the new cbars an image manager (to avoid CJ going to the frames image manager). I get the tooltip context from the cbars object I created and initialize it to our specifications. Finally I get the options and if an input flag indicates tips are wanted, I get the options from the cbars object I created and set bShowPopupBarToolTips to TRUE.</DIV><DIV>&nbsp;</DIV><DIV>We also have an app setting that allows the user to turn off all tipping. If that flag is set, I ignore the caller's flag and honor the global setting and bShowPopupBarToolTips is set to FALSE.</DIV><DIV>&nbsp;</DIV><DIV>This works for me. All our shortcut/context/right-click menu invokation calls now go through my frame's method and I either get tooltips on the shortcut menur or don't get them based on my call to set the option. Here is the code I go thru when I detect the caller does NOT want the frame to track the menu. In such cases it is up to the caller to provide the tip strings and images by handling WM_XTP_INITCOMMANDSPOPUP if the menu contains "command" IDs that are not known to our frame window.</DIV><DIV>&nbsp;</DIV><DIV><FONT size=2><P>CRuntimeClass* pCommandBarsClass = RUNTIME_CLASS(CXTPCommandBars);</P><P>CXTPCommandBars* pCommandBars = (CXTPCommandBars*) pCommandBarsClass-&gt;CreateObject();</P><P></P><P>ASSERT(pCommandBars);</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2> (!pCommandBars)</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>return</FONT></FONT><FONT size=2> FALSE;</P><DIV></DIV><DIV>...</DIV><DIV>&nbsp;</DIV><DIV><FONT size=2><P>pCommandBars-&gt;SetTheme(xtpThemeRibbon);</P><DIV><FONT size=2></FONT>&nbsp;<FONT size=2><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2>( (Options &amp; JSetSiteToMenuOwner) &amp;&amp; pWnd &amp;&amp; pWnd-&gt;GetSafeHwnd() )</P><P>{</P><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// variable table flashes too much if site is set to its frame so we</P></FONT></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// added the new option to force the site to the tracking/owner window.</P></FONT></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// The var table can leave a bit of "trash" on the bottom edge if the</P></FONT></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// user right-clicks a lot and fast and we decided that is better than</P></FONT></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// the excessive flashing due to the var table updating.</P></FONT></FONT><FONT size=2><P>pCommandBars-&gt;SetSite(pWnd);</P><P>}</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>else</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2>( pWnd )</P><P>{</P><P>CFrameWnd* pFrame = pWnd-&gt;GetParentFrame();</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2>( pFrame != </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>this</FONT></FONT><FONT size=2> )</P><P>{</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2>( pFrame )</P><P>{</P><P>pCommandBars-&gt;SetSite(pFrame);</P><P>}</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>else</P></FONT></FONT><FONT size=2><P>{</P><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// out of options. Dennis said the hyperlink command in draft has no parent frame and that causes an exception.</P></FONT></FONT><FONT size=2><P>pCommandBars-&gt;SetSite(</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>this</FONT></FONT><FONT size=2>);</P><P>}</P><P>}</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>else</P></FONT></FONT><FONT size=2><P>{</P><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>//pCommandBars-&gt;SetSite(pWnd);</P></FONT></FONT><FONT size=2><P>pCommandBars-&gt;SetSite(</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>this</FONT></FONT><FONT size=2>);</P><P>}</P><P>}</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>else</P></FONT></FONT><FONT size=2><P>{</P><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// out of options. Dennis said the hyperlink command in draft has no parent frame and that causes an exception.</P></FONT></FONT><FONT size=2><P>pCommandBars-&gt;SetSite(</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>this</FONT></FONT><FONT size=2>);</P><P>}</P></FONT></DIV><FONT size=2><DIV>pCommandBars-&gt;SetImageManager(<FONT color=#0000ff size=2><FONT color=#0000ff size=2>new</FONT></FONT><FONT size=2> CXTPImageManager()); </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// Keeps icons from appearing due to usage of the frames command bars image manager</DIV><DIV></FONT></FONT>&nbsp;</DIV><DIV><FONT size=2><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// Implement a message handler for the CodeJock WM_XTP_INITCOMMANDSPOPUP notification in ComamndBars. </P></FONT></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// See \Samples\CommandBars\Notifications for an example. Or see x:\dsl\src\dcx\dimcmd\dev\skdimrib.cpp for</P></FONT></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// and example that gets the notification and then calls skmoddim.cpp where icons, tooltips and descriptions are added.</P></FONT></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// To display the prompts listen to WM_SETMESSAGESTRING and then call SetPrompt(). Again, see the skmoddim.cpp</P></FONT></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// and skdimrib.cpp file for an example. And no, CodeJock does not seem to use the description when setting the</P></FONT></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// prompt. And if the ID of the control is not part of the current resource module chain, CodeJock will call send</P></FONT></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// the WM_SETMESSAGESTRING with the lparam set to some string saying something like "the description for cmd xxx is</P></FONT></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// not available".</P><DIV></FONT></FONT>CXTPToolTipContext* pTipContext = pCommandBars-&gt;GetToolTipContext();</DIV></DIV><DIV><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2>( pTipContext )</P><P>{</P><P>InitializeToolTipContext( pTipContext );</P><P>}</P><P>CXTPCommandBarsOptions* pOptions = pCommandBars-&gt;GetCommandBarsOptions();</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2>( pOptions )</P><P>{</P><P>pOptions-&gt;bDisableCommandIfNoHandler = Options &amp; JDisableCommandIfNoHandler ? TRUE:FALSE;</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2>( GetDisplayTooltips() )</P><P>{</P><P>pOptions-&gt;bShowPopupBarToolTips = Options &amp; JShowToolTips ? TRUE:FALSE;</P><P>}</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>else</P></FONT></FONT><FONT size=2><P>{</P><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// Frame rules supreme.</P></FONT></FONT><FONT size=2><P>pOptions-&gt;bShowPopupBarToolTips = FALSE;</P><P>}</P><P>pOptions-&gt;bShowContextMenuAccelerators = TRUE;</P><P>}</P><P>bSelected = pCommandBars-&gt;TrackPopupMenuEx(pMenu, nFlags, xPos, yPos, pWnd, lptpm);</P><P>pCommandBars-&gt;InternalRelease();</FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// delete the object</P><DIV></DIV><DIV></DIV><DIV><FONT size=+0>You may not be getting tips if your site is not your frame and the window that is the site does not implement tipping in the standard way and does not respond to WM_XTP_INITCOMMANDSPOPUP.</FONT></DIV></FONT></FONT></DIV></FONT></DIV></FONT></DIV>]]>
   </description>
   <pubDate>Wed, 28 Jul 2010 09:30:03 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16706&amp;PID=59513&amp;title=no-tooltip-for-context-menus-why#59513</guid>
  </item> 
  <item>
   <title><![CDATA[No tooltip for context menus. Why? : Hi,Look into ToolTipContext sample....]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16706&amp;PID=59478&amp;title=no-tooltip-for-context-menus-why#59478</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=233">jimmy</a><br /><strong>Subject:</strong> 16706<br /><strong>Posted:</strong> 27 July 2010 at 3:37pm<br /><br />Hi,<br><br>Look into ToolTipContext sample. <br>here it work.<br><br>&nbsp; Jimmy<br>]]>
   </description>
   <pubDate>Tue, 27 Jul 2010 15:37:14 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16706&amp;PID=59478&amp;title=no-tooltip-for-context-menus-why#59478</guid>
  </item> 
  <item>
   <title><![CDATA[No tooltip for context menus. Why? : Since I haven&amp;#039;t seen such...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16706&amp;PID=59356&amp;title=no-tooltip-for-context-menus-why#59356</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2198">znakeeye</a><br /><strong>Subject:</strong> 16706<br /><strong>Posted:</strong> 16 July 2010 at 5:45pm<br /><br />Since I haven't seen such tooltips in CJ's samples, I assume it's not supported. I did dig through the source code, and I couldn't find anything that would yield the desired behavior.<DIV>&nbsp;</DIV><DIV>When I'm talking about context menus, I mean right-click menus. <EM>bShowPopupBarToolTips</EM> does not affect those menus, which is why I created the post.</DIV>]]>
   </description>
   <pubDate>Fri, 16 Jul 2010 17:45:54 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16706&amp;PID=59356&amp;title=no-tooltip-for-context-menus-why#59356</guid>
  </item> 
  <item>
   <title><![CDATA[No tooltip for context menus. Why? : I get my tips by doing this: ...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16706&amp;PID=59297&amp;title=no-tooltip-for-context-menus-why#59297</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> 16706<br /><strong>Posted:</strong> 12 July 2010 at 4:22pm<br /><br />I get my tips by doing this:<DIV>&nbsp;</DIV><DIV>pOptions-&gt;bShowPopupBarToolTips = TRUE;</DIV><DIV><BR>Not sure what the default is. I am creating my own CCommandBars object when I do that. Since I have not had a complaint when I use the frame's CComandBars object, I assume TRUE is the default.</DIV>]]>
   </description>
   <pubDate>Mon, 12 Jul 2010 16:22:02 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16706&amp;PID=59297&amp;title=no-tooltip-for-context-menus-why#59297</guid>
  </item> 
  <item>
   <title><![CDATA[No tooltip for context menus. Why? : Hi, how do you create pPopupBar...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16706&amp;PID=59228&amp;title=no-tooltip-for-context-menus-why#59228</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=233">jimmy</a><br /><strong>Subject:</strong> 16706<br /><strong>Posted:</strong> 06 July 2010 at 5:55am<br /><br />Hi, <br>how do you create pPopupBar ?<br>with<br>&nbsp; CXTPPopupBar* pPopupBar = CXTPPopupBar::CreatePopupBar(((CXTPMDIFrameWnd*)AfxGetMainWnd())-&gt;GetCommandBars());<br>or with ...(NULL).<br><br>&nbsp;Jimmy<br><br><br>]]>
   </description>
   <pubDate>Tue, 06 Jul 2010 05:55:08 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16706&amp;PID=59228&amp;title=no-tooltip-for-context-menus-why#59228</guid>
  </item> 
  <item>
   <title><![CDATA[No tooltip for context menus. Why? : No? ]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16706&amp;PID=59225&amp;title=no-tooltip-for-context-menus-why#59225</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2198">znakeeye</a><br /><strong>Subject:</strong> 16706<br /><strong>Posted:</strong> 05 July 2010 at 5:00pm<br /><br />No?]]>
   </description>
   <pubDate>Mon, 05 Jul 2010 17:00:31 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16706&amp;PID=59225&amp;title=no-tooltip-for-context-menus-why#59225</guid>
  </item> 
  <item>
   <title><![CDATA[No tooltip for context menus. Why? : I&amp;#039;ve tried enabling tooltips...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=16706&amp;PID=58485&amp;title=no-tooltip-for-context-menus-why#58485</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2198">znakeeye</a><br /><strong>Subject:</strong> 16706<br /><strong>Posted:</strong> 13 May 2010 at 1:46pm<br /><br />I've tried enabling tooltips for context menus. Can't get it working (and I suspect it's not supported).<DIV><FONT color=#808080 size=2 face=C&#111;nsolas><FONT color=#808080 size=2 face=C&#111;nsolas><FONT color=#808080 size=2 face=C&#111;nsolas></FONT></FONT></FONT>&nbsp;</DIV><DIV><FONT color=#808080 size=2 face=C&#111;nsolas><FONT color=#808080 size=2 face=C&#111;nsolas><FONT color=#808080 size=2 face=C&#111;nsolas>pCommandBars</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>-&gt;</FONT></FONT><FONT color=#880000 size=2 face=C&#111;nsolas><FONT color=#880000 size=2 face=C&#111;nsolas><FONT color=#880000 size=2 face=C&#111;nsolas>GetCommandBarsOptions</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>()-&gt;</FONT></FONT><FONT color=#808080 size=2 face=C&#111;nsolas><FONT color=#808080 size=2 face=C&#111;nsolas><FONT color=#808080 size=2 face=C&#111;nsolas>bShowPopupBarToolTips</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> = </FONT></FONT><FONT color=#a000a0 size=2 face=C&#111;nsolas><FONT color=#a000a0 size=2 face=C&#111;nsolas><FONT color=#a000a0 size=2 face=C&#111;nsolas>TRUE</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>;</DIV><DIV><DIV>Only works for ribbon menus... :(</DIV><DIV>&nbsp;</DIV><DIV>Not affected:</DIV><DIV><FONT color=#010001 size=2 face=C&#111;nsolas><FONT color=#010001 size=2 face=C&#111;nsolas><FONT color=#010001 size=2 face=C&#111;nsolas>CXTPCommandBars</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>::</FONT></FONT><FONT color=#880000 size=2 face=C&#111;nsolas><FONT color=#880000 size=2 face=C&#111;nsolas><FONT color=#880000 size=2 face=C&#111;nsolas>TrackPopupMenu</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>(</FONT></FONT><FONT color=#010001 size=2 face=C&#111;nsolas><FONT color=#010001 size=2 face=C&#111;nsolas><FONT color=#010001 size=2 face=C&#111;nsolas>pPopupBar</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>, </FONT></FONT><FONT color=#a000a0 size=2 face=C&#111;nsolas><FONT color=#a000a0 size=2 face=C&#111;nsolas><FONT color=#a000a0 size=2 face=C&#111;nsolas>TPM_LEFTALIGN</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> | </FONT></FONT><FONT color=#a000a0 size=2 face=C&#111;nsolas><FONT color=#a000a0 size=2 face=C&#111;nsolas><FONT color=#a000a0 size=2 face=C&#111;nsolas>TPM_RIGHTBUTTON</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>, </FONT></FONT><FONT color=#880000 size=2 face=C&#111;nsolas><FONT color=#880000 size=2 face=C&#111;nsolas><FONT color=#880000 size=2 face=C&#111;nsolas>pos</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>.</FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>x</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>, </FONT></FONT><FONT color=#880000 size=2 face=C&#111;nsolas><FONT color=#880000 size=2 face=C&#111;nsolas><FONT color=#880000 size=2 face=C&#111;nsolas>pos</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>.</FONT></FONT><FONT color=#808080 size=2 face=C&#111;nsolas><FONT color=#808080 size=2 face=C&#111;nsolas><FONT color=#808080 size=2 face=C&#111;nsolas>y</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>, </FONT></FONT><FONT color=#010001 size=2 face=C&#111;nsolas><FONT color=#010001 size=2 face=C&#111;nsolas><FONT color=#010001 size=2 face=C&#111;nsolas>pWnd</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>, </FONT></FONT><FONT color=#a000a0 size=2 face=C&#111;nsolas><FONT color=#a000a0 size=2 face=C&#111;nsolas><FONT color=#a000a0 size=2 face=C&#111;nsolas>NULL</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>, 0);</DIV></DIV></FONT></FONT><DIV>&nbsp;</DIV></FONT></FONT>]]>
   </description>
   <pubDate>Thu, 13 May 2010 13:46:01 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=16706&amp;PID=58485&amp;title=no-tooltip-for-context-menus-why#58485</guid>
  </item> 
 </channel>
</rss>