Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004246 [JEDI VCL] 00 JVCL Components major always 2007-09-28 03:03 2008-02-21 07:26
Reporter fegyvej View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version 3.32
Summary 0004246: TJvLinkLabel has problems with painting dynamic tags
Description I experience strange look of TJvLinkLabel when using dynamic tags.
The dynamic tag is not drawn in the proper place, sometimes only the top of the text is visible sometimes not visible at all.

The problem comes from TTextHandler.EmptyBuffer where
TextOut( FPosX + Element.Node.Root.StartingPoint.X,
                 FPosY + Element.Node.Root.StartingPoint.Y,
                 Buffer);
prints to a random location because Element.Node.Root.StartingPoint contains trash.

The cause of the problem is in JvLinkLabelParser.pas with procedure TDefaultParser.AddSourceTreeToDynamicNode. Actually Tree.Root is bad for Addchild parameter because Tree is just a temporary variable here and it is freed. It is not the correct root for LinkLabel.

I changed it to Node.Root but this requires that to be initialized before calling AddSourceTreeToDynamicNode. The problem is solved painting is stable.


  Tree := nil;
  try
    Parser := TDefaultParser.Create;
    try
      Tree := Parser.Parse(Source);
    finally
      Parser.Free;
    end;

    Tree.Root.OwnsChildren := False;
    for I := 0 to Tree.Root.Children.Count - 1 do
      Node.AddChild(Tree.Root.Children[I], Tree.Root);
  finally
    Tree.Free;
  end;
Additional Information I attached my changed JvLinkLabelParser with 3 small changes solving this problem.

It took several hours to find the source of the problem.
Tags No tags attached.
Attached Files ? file icon JvLinkLabelParser.pas [^] (13,832 bytes) 2007-09-28 03:03
zip file icon TestLinkLabel.zip [^] (3,216 bytes) 2007-10-15 04:08

- Relationships
related to 0004247resolvedobones TJvLinkLabel does not call OnDynamicTagInit during/after component load 

-  Notes
(0013943)
obones (administrator)
2007-10-12 09:01

Can you provide us with the zipped sources of a sample application showing this so that I can validate the fix? Thanks in advance.
(0013956)
fegyvej (reporter)
2007-10-13 11:11
edited on: 2007-10-13 11:16

Hi,

I attached a sample application and a word document with pictures.
It is easier to produce the problem with 2 linklabel on the form but it also happens with 1 label as you can see on some pictures.
There are also some pictures showing the wrong values causing the bad painting.

You can also see that starting up the application does not call the dynamic tag init. It is only called when changing the caption at runtime.


Unfortunatelly I am unable to attach the zip file. First I get "The page cannot be displayed" after clicking upload. When I push enter again in the address field I get this message (I tried multiple times):
APPLICATION ERROR 0000200
A required parameter to this page (bug_id) was not found.
Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section.

(0013965)
obones (administrator)
2007-10-15 04:08

That's because the file was too big. I removed the exe and doc file from your zip and it uploaded just fine after that.
(0013970)
fegyvej (reporter)
2007-10-15 10:04

Just a small note to the upload problem.
This is written in the upload section: (Max size: 5,000k).
(0014258)
obones (administrator)
2008-02-21 07:25

This is now in SVN

- Issue History
Date Modified Username Field Change
2007-09-28 03:03 fegyvej New Issue
2007-09-28 03:03 fegyvej File Added: JvLinkLabelParser.pas
2007-10-12 09:01 obones Note Added: 0013943
2007-10-12 09:01 obones Status new => feedback
2007-10-13 11:11 fegyvej Note Added: 0013956
2007-10-13 11:16 fegyvej Note Edited: 0013956
2007-10-13 11:26 fegyvej Issue Monitored: obones
2007-10-15 04:08 obones File Added: TestLinkLabel.zip
2007-10-15 04:08 obones Note Added: 0013965
2007-10-15 10:04 fegyvej Note Added: 0013970
2008-02-21 07:06 obones Relationship added related to 0004247
2008-02-21 07:25 obones Status feedback => resolved
2008-02-21 07:25 obones Fixed in Version => Daily / SVN
2008-02-21 07:25 obones Resolution open => fixed
2008-02-21 07:25 obones Assigned To => obones
2008-02-21 07:25 obones Note Added: 0014258


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker