![]() |
How to use CXTPToolTipContext in a dialog |
Post Reply
|
| Author | |
rdhd
Senior Member
Joined: 13 August 2007 Location: United States Status: Offline Points: 954 |
Post Options
Thanks(0)
Quote Reply
Topic: How to use CXTPToolTipContext in a dialogPosted: 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?
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 24 October 2007 at 1:47am |
|
Hi,
in Samples\CommandBars\ToolTipContext we show tips for dialog.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
rdhd
Senior Member
Joined: 13 August 2007 Location: United States Status: Offline Points: 954 |
Post Options
Thanks(0)
Quote Reply
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? |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |