Print Page | Close Window

How to use CXTPToolTipContext in a dialog

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=8508
Printed Date: 14 November 2025 at 1:42am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to use CXTPToolTipContext in a dialog
Posted By: rdhd
Subject: How to use CXTPToolTipContext in a dialog
Date Posted: 23 October 2007 at 3:56pm
I am trying to figure out how to use the CXTPToolTipContext in a dialog box that is currently using CToolTipCtrl.
 
It looks like I can call CXTPToolTipContext::FilterToolTipMessage in my dialog's PreTranslateMessage where I currently call CToolTipCtrl::RelayEvent.
 
So far so good (I have not yet tried the above but I am optimistic).
 
What I am missing is the analogy to the CToolTipCtrl::AddTool call. I see from the source code that TTM_ADDTOOL is sent to the CXTPToolTipContextToolTip from the CXTPToolTipContext code.
 
But the m_pToolTip member of CXTPToolTipContext is protected so I cannot directly get to the member to send it a message.
 
So how do I add a tool after creating the CXTPToolTipContext?
 
Or is there some other way to hook up a dialog with codejock tooltip functionality?



Replies:
Posted By: Oleg
Date Posted: 24 October 2007 at 1:47am
Hi,
 
in Samples\CommandBars\ToolTipContext  we show tips for dialog.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: rdhd
Date Posted: 24 October 2007 at 5:31pm
I have seen that sample. I am trying to convert some existing code that uses AddTool. Your sample does not use AddTool.
 
Nor does the sample really seem to fully work. Go to the sample and open the dialog box in the resource editor. Then give your system style group some ID other than IDC_STATIC. I changed it to IDC_SYSTEM_STYLE_GROUP (resource editor gave it an id of 1007). Then build and run. Notice the tips for the "standard/balloon" tooltip style radio buttons quit working. Set a break in your sample's OnToolTipText and see that the group window (and hence control ID) is the only one the codejock tooltip will request.
 
I mention this because I have dialogs with groups and codejock does not call OnToolTipNeedText (my notification handler)  for the controls in my group but instead sends in the group.
 
However, I can resize the dialog so that a control in a group is right on the edge of the dialog so there is no "white space" for the cursor to pass over as I move into the window. If I do so and hover over a control in a group, then codejock does send in the control and the right text is displayed to the user. I did not modify the dialog in your sample to make it resizable but I assume if I do and perform the same test I will see the tooltips again.
 
I did find that after compiling my code last night (after my first post) that if I don't have groups, then the call to AddTool that is necessary with the MFC tooltip is not necessary for the codejock tooltip.  But my elation was short-lived as now I have to wonder if not being able to specifically call AddTool on the codejock tooltip is part of the problem with the codejock tooltip not tracking the correct window.
 
I guess I can subclass the context and implement a public AddTool method and see if that addresses the problem.
 
Is there some technical reason that AddTool is not exposed, even as a passthrough from the context to the actual tooltip control?



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net