ItemHint Not Changing

General TRichView support forum. Please post your questions here
Post Reply
Michel
Posts: 92
Joined: Fri Oct 14, 2005 2:56 pm
Contact:

ItemHint Not Changing

Post by Michel »

Hi Sergey,

If I have 2 directly adjacent Hyperlinks (actually, this applies to any Items), for example, one directly above the other on 2 lines, and if I have rvoShowItemHints in Options, and OnItemHint() event handler set up:
If, once the Hint appears for the first Item, I move the mouse so that the cursor passes over some empty space or an Item with an empty Hint, and then ends up over the second Item, I get the Hint for the second Item, which is as it should be.
If I move the mouse so that the cursor passes directly from first Item that just displayed its Hint (which is still shown) onto the second Item, the first Item simply keeps its Hint as if the mouse were still over it, which is a problem.

OnItemHint() is properly called in all cases, and I'm certainly properly assigning HintText. The above problem is most easy to reproduce with a single line in OnItemHint():
HintText = String("ItemNo=") + ItemNo;
I know the event fires properly because I also put an OutputDebugString() there.

It seems to me that RichView gets confused by consecutive Items with Hints – even if the Items (and Hints) are different. Based on this assumption I devised a workaround that works: bail out of OnItemHint() the first time it is called for any Item, and only assign HintText on subsequent invocations. This works because OnItemHint() is called more than once when the mouse is hovering over an Item. And this seems to have the effect of deactivating the previous Item's Hint (when bailing out), and re-activating it on 2nd invocation.

Hope this narrows it down for you!

Michel
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I cannot reproduce this problem.
Which version of TRichView do you use?
Michel
Posts: 92
Joined: Fri Oct 14, 2005 2:56 pm
Contact:

Post by Michel »

It's either just 1.9 or 1.9.0.1. (Definitely not very recent). If you can't reproduce it, maybe you have already fixed it, so all the better!
Post Reply