Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Mouse wheel and CXTPToolTipContext::FilterToolTipM
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Mouse wheel and CXTPToolTipContext::FilterToolTipM

 Post Reply Post Reply
rdhd View Drop Down
Senior Member
Senior Member

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 839
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Topic: Mouse wheel and CXTPToolTipContext::FilterToolTipM
    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)))

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.109 seconds.