View Issue Details

IDProjectCategoryView StatusLast Update
0004246JEDI VCL00 JVCL Componentspublic2008-02-21 07:26
ReporterfegyvejAssigned Toobones 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.32 
Target VersionFixed in Version3.34 
Summary0004246: TJvLinkLabel has problems with painting dynamic tags
DescriptionI 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 InformationI attached my changed JvLinkLabelParser with 3 small changes solving this problem.

It took several hours to find the source of the problem.
TagsNo tags attached.

Relationships

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

Activities

2007-09-28 03:03

 

JvLinkLabelParser.pas (13,832 bytes)

obones

2007-10-12 09:01

administrator   ~0013943

Can you provide us with the zipped sources of a sample application showing this so that I can validate the fix? Thanks in advance.

fegyvej

2007-10-13 11:11

reporter   ~0013956

Last edited: 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.

2007-10-15 04:08

 

TestLinkLabel.zip (3,216 bytes)

obones

2007-10-15 04:08

administrator   ~0013965

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.

fegyvej

2007-10-15 10:04

reporter   ~0013970

Just a small note to the upload problem.
This is written in the upload section: (Max size: 5,000k).

obones

2008-02-21 07:25

administrator   ~0014258

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-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