Print Page | Close Window

Mouse wheel and CXTPToolTipContext::FilterToolTipM

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=24379
Printed Date: 22 December 2024 at 3:27am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Mouse wheel and CXTPToolTipContext::FilterToolTipM
Posted By: rdhd
Subject: Mouse wheel and CXTPToolTipContext::FilterToolTipM
Date Posted: 07 April 2023 at 8:29am
I have noticed a tool can persist in the tooltip tools array when it should be removed. In particular, I have found that when scrolling a tree control this can occur. Later, when the timer goes off, the tip code can find the wrong tool as it finds the tool that was previously under the mouse before it was scrolled away. Essentially the array contains two tools with the same rect and the search is top down using the point in rectangle paradigm to find the tool. The second item is placed at the end of the array and it is the item currently under the mouse and the item for which the tip should be displayed. Instead, the tip for the item that was under the mouse before the scroll occurred is displayed.

In CXTPToolTipContext::FilterToolTipMessageHelper I have added WM_MOUSEWHEEL at the bottom of the routine so that CancelTooltips is called on that event too when that event or the other events in the test for calling CancelTooltips is made.

This issue can be quite hard to duplicate and I knew it was related to mouse scrolling on a tree control. Without this change, when a tip appears for a tree item and I scroll, the tip remains on screen until it times out. We have a lengthy timeout as we have html tooltips that contain extensive information and even some that have short videos.

Now with this change, as soon as I scroll the tip is cancelled. So far in testing, the issue where the tool remains in the array of tools even though the item was scrolled has not occurred.

It appears "random" when this issue shows up due to timing (cpu load) and the timer involved.

I think this change should be added to the current CJ code.

        BOOL bKeys = (message >= WM_KEYFIRST && message <= WM_KEYLAST)
                     || (message >= WM_SYSKEYFIRST && message <= WM_SYSKEYLAST);
        if ((bKeys || (message == WM_LBUTTONDOWN || message == WM_LBUTTONDBLCLK)
             || message == WM_MOUSEWHEEL ||
             || (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();
        }




Replies:
Posted By: astoyan
Date Posted: 04 June 2023 at 1:54pm
Thanks for reporting the problem and suggesting the fix. It has been reviewed and included into the next update.

Regards,
   Alexander



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