Print Page | Close Window

TTM_UPDATETIPTEXT don't work!

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=22222
Printed Date: 13 May 2024 at 8:50am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: TTM_UPDATETIPTEXT don't work!
Posted By: Michl
Subject: TTM_UPDATETIPTEXT don't work!
Date Posted: 27 February 2014 at 9:01am
We like to show a tooltip depends on key state.

Sample use case:
Tooltip over a link (like in an internet browser).
Mouse over a link shows "follow link"
STRG+Mouse over a link shows "follow link a new tab"

But we have serveral problems:

a) if mouse is over a link and you press STRG after, the tooltip is to be destroyed!?
This happends because you scan for key strokes!? (system tooltip don't hide if pressing a key)

        BOOL bKeys = (message >= WM_KEYFIRST && message <= WM_KEYLAST) ||
            (message >= WM_SYSKEYFIRST && message <= WM_SYSKEYLAST);

        if ((bKeys ||
            (message == WM_LBUTTONDOWN || message == WM_LBUTTONDBLCLK) ||
            (message == WM_RBUTTONDOWN || message == WM_RBUTTONDBLCLK) ||
            (message == WM_MBUTTONDOWN || message == WM_MBUTTONDBLCLK) ||
            (message == WM_NCLBUTTONDOWN || message == WM_NCLBUTTONDBLCLK) ||
            (message == WM_NCRBUTTONDOWN || message == WM_NCRBUTTONDBLCLK) ||
            (message == WM_NCMBUTTONDOWN || message == WM_NCMBUTTONDBLCLK)))
        {
            CancelToolTips();
        }


b) if the new text was calculated in OnToolHitTest(CPoint point, TOOLINFO* pTI) and written to pTI->lpszText, the base class doesn't modify the tooltip!
If I manually call TTM_UPDATETIPTEXT, I saw that the string was internally updated in array m_arrTools but no recalculation and redraw action follows (like system tooltip)!!!!!!!
A manually redaw don't neither work, because the OnPaint() method reads the old string from m_toolVisible.

Please support changes of tooltip text while it is displayed! Thanks



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