Bug in TeeTree hint handler

TeeTree VCL for Borland Delphi and C++ Builder.
Post Reply
Roland
Newbie
Newbie
Posts: 5
Joined: Wed Sep 29, 2004 4:00 am

Bug in TeeTree hint handler

Post by Roland » Mon Dec 11, 2006 11:50 pm

Hi

Delphi 7 Pro; Win2K; TeeChart 7.07 with source.

The hint handling in TeeTree is not working properly. The following code segment effectively deletes the tree's hint property setting when the ShowHintShapes property is true.

// Called when moving the mouse...
procedure TCustomTree.MouseMove(Shift: TShiftState; X, Y: Integer);

Procedure DoCancelHint; // hide hint
begin
if ShowHintShapes then
begin
Hint:='';
Application.CancelHint;
end;
end;
.......

Please provide a suitable solution.

Regards

Roland

tom
Advanced
Posts: 211
Joined: Mon Dec 01, 2003 5:00 am
Contact:

Post by tom » Sat Dec 16, 2006 6:00 pm

Hi Roland,

What is exactly not working with the shape hints?

This is the explanation of ShowHintShapes poperty:

Set ShowHintShapes to True to show the hints of partially displayed node shapes.

I've just tested it and it works as is designed. Is this not working on you side? Could you provide me a sample source code where it is not functioning correctly?

Or do you expect another behavior?

Thanks,
Tom.

Roland
Newbie
Newbie
Posts: 5
Joined: Wed Sep 29, 2004 4:00 am

Post by Roland » Sun Dec 17, 2006 1:59 am

Hi Tom

Say I place a TTree on a form. I store a hint in Tree1.hint which I use for a tool tip when the mouse hovers which is normal Windows behaviour with the ShowHint properties set correctly for both Tree1 and the form.

I now run the program but the hint does not show. So, I place a button on the form with a click event handler:

procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(Tree1.Hint);
end;

to see what is happening. When I click the button, I get a message showing the hint as expected but when the mouse is passed over Tree1 for the first time, clicking the button reveals Tree1.Hint has been set to an empty string and the hint lost. This appears to be why the normal hint behavior does not work.

The default ShowHintShapes property setting is True. When I set it to False, the normal hint behaviour works and the hint is no longer deleted.

While I can understand normal hint behaviour being switched off while the ShowHintShapes property is True, the deletion of Tree1.Hint is not normal behaviour and prevents the toggling of these properties at run time because the hint then has to be stored elsewhere and the Tree1.Hint reset when required.

Hope this makes it clearer.

Roland

tom
Advanced
Posts: 211
Joined: Mon Dec 01, 2003 5:00 am
Contact:

Post by tom » Mon Dec 18, 2006 6:05 pm

Hi Roland,

Okay, so if I understand correctly, you want that the Tree's Hint property is restored when the shape's hint is not needed anymore?

Regards,
Tom.

Roland
Newbie
Newbie
Posts: 5
Joined: Wed Sep 29, 2004 4:00 am

Post by Roland » Tue Dec 19, 2006 8:03 am

Hi Tom,

<<you want that the Tree's Hint property is restored when the shape's hint is not needed anymore?>>

This is correct. I use hints to provide instruction to the User. I also provide a toggle button on all forms to toggle tool tips off when they are familiar with the application. This means that the hint may be toggled on and off. I expect a hint property to remain constant until it is programatically changed.

Regards

Roland

Post Reply