2

I wrote a handler for the OnGetHint event of the Virtual StringTree control, and I'm sure that the hint text is returned, but the hint window is blank, see the screenshot below, what might caused this problem? thank you in advance.

Screenshot

The settings of the control:

AnimationDuration := 0;
ClipboardFormats.Clear;
ClipboardFormats.Add('HTML Format');
ClipboardFormats.Add('Plain text');
ClipboardFormats.Add('Rich Text Format');
ClipboardFormats.Add('Rich Text Format Without Objects');
ClipboardFormats.Add('Unicode text');
ClipboardFormats.Add('Virtual Tree Data');
DefaultPasteMode := amInsertBefore;
DragOperations := [doCopy, doMove, doLink];
EditDelay := 200;
HintMode := hmHint;
Images := dmImages.lstProjectTree;
IncrementalSearch := isAll;
Indent := 16;
Margin := 0;
ParentFont := False;
PopupMenu := pmTree;
SelectionCurveRadius := 5;
OnCollapsed := treePrjCollapsed;
OnColumnClick := treePrjColumnClick;
OnDblClick := treePrjDblClick;
OnDragAllowed := treePrjDragAllowed;
OnDragOver := treePrjDragOver;
OnDragDrop := treePrjDragDrop;
OnExpanded := treePrjExpanded;
OnFocusChanged := treePrjFocusChanged;
OnGetCursor := treePrjGetCursor;
OnGetText := treePrjGetText;
OnPaintText := treePrjPaintText;
OnGetImageIndexEx := treePrjGetImageIndexEx;
OnGetHint := treePrjGetHint;
OnKeyDown := treePrjKeyDown;
OnMouseDown := treePrjMouseDown;
OnNewText := treePrjNewText;
OnNodeMoving := treePrjNodeMoving;
with Columns.Add do begin
  Position := 0;
  Width := 153;
end;
with Columns.Add do begin
  Layout := blGlyphRight;
  MinWidth := 20;
  Position := 1;
  Width := 20;
end;
with Columns.Add do begin
  Layout := blGlyphRight;
  MinWidth := 20;
  Position := 2;
  Width := 20;
end;
with Columns.Add do begin
  Layout := blGlyphRight;
  MinWidth := 16;
  Position := 3;
  Width := 20;
end;
Community
  • 1
  • 1
Edwin Yip
  • 4,089
  • 4
  • 40
  • 86
  • 3
    If you're so sure you're setting the hint text correctly, prove it. Show the code. Include at least some of the OnGetText handler, too. – Rob Kennedy Jan 19 '10 at 06:02
  • Sorry for the link, it is:
    http://dl.dropbox.com/u/367923/Screenshots/Virtual%20TreeView%20OnGetHint%20Problem.JPG

    @Rob, for the testing purpose I'm using this code:
    HintText := 'my testing hint text';
    Moreover, if no hint text the hint window will not be shown.
    – Edwin Yip Jan 19 '10 at 06:30
  • 1
    Hi, I found the culprit of the problem! It's AnimationDuration := 0; – Edwin Yip Jan 19 '10 at 06:49
  • 1
    Add that as an answer, Edwin. You'll be able to mark it as the accepted answer. Also, easy on the
    tags; they don't work in comments, and in answers, you make a new paragraph with a blank line.
    – Rob Kennedy Jan 19 '10 at 07:02
  • Rob, I guess he did prove it :-) – Francesca Jan 19 '10 at 07:12
  • I suppose so, François. The screen shot was very helpful in explaining the problem. Before the image was available, I expected it would be fully painted, but without any text, and maybe it was being painted as a very small rectangle (as though it was sized for an empty string). But in fact the entire surface of the hint window was missing; it had nothing to do with the text. – Rob Kennedy Jan 19 '10 at 14:37

1 Answers1

3

I found the culprit of the problem myself! It's AnimationDuration := 0

As Rob suggested, I added this finding as the answer so that I can accept it.

Edwin Yip
  • 4,089
  • 4
  • 40
  • 86