Print Page | Close Window

Tooltip following mouse cursor

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=11607
Printed Date: 20 January 2025 at 8:09am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Tooltip following mouse cursor
Posted By: Dmitry
Subject: Tooltip following mouse cursor
Date Posted: 27 July 2008 at 9:28pm
Hi,

In MFC, it possible to create a CToolTipCtrl tooltip in a CView that follows the mouse cursor around. The tooltip is activated using Activate() and its text is updated using UpdateTipText.

For example, add the following changes to the Scribble sample:

static CToolTipCtrl * tooltip = 0;
void CScribbleView::OnLButtonUp(UINT, CPoint point)
{
     if (tooltip)
     {
          tooltip ->Activate (false);
          delete tooltip;
          tooltip = 0;
     }
     else
     {
          tooltip = new CToolTipCtrl ();
          tooltip -> Create (this);
          tooltip -> AddTool (this);
          tooltip -> Activate (true);
          tooltip -> UpdateTipText ("Tooltip", this);
     }

     // Mouse button up is interesting in the Scribble application
     ...

void CScribbleView::OnMouseMove(UINT, CPoint point)
{
     if (tooltip)
     {
          CString toolText;
          toolText .Format ("Mouse: (%d, %d)", point.x, point.y);
          tooltip -> UpdateTipText (toolText, this);
     }
     // Mouse movement is interesting in the Scribble application
     ...

BOOL CScribbleView::PreTranslateMessage (MSG * pMsg)
{
     if (tooltip)
          tooltip -> RelayEvent (pMsg);

     return __super :: PreTranslateMessage (pMsg);
}


Run the application. Click to turn the tooltip on or off, and move the mouse – it will show mouse coordinates just under the cursor, as it moves:
    

Is there a way to create a similar scenario in XTP, using other styles of tooltip (RTF, Office, etc)? All the existing examples of CXTPToolTipContext currently use OnToolHitTest, but not Activate+UpdateTipText.


Thanks,
Dmitry



Replies:
Posted By: Oleg
Date Posted: 28 July 2008 at 2:08am
Hello,
 
Afraid, no. CXTPToolTipContext  currently works only with OnToolHitTest.


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


Posted By: Dmitry
Date Posted: 28 July 2008 at 8:46pm
Hi,

Are there plans to make this functionality available? And if so, when?

Regards,
Dmitry



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