[Lazarus] TIpHTMLPanel bug and extension

Krzysztof dibo20 at wp.pl
Wed May 21 20:22:49 CEST 2014


Hi,

Where report bugs for TurboPower IpHTMLPanel? I don't see category for this
package in mantis bugtracker.

***Bug***
I have html table. I want to add new rows on runtime by creating new node
TIpHtmlNodeTR.Create() to avoid reloading and reparsing whole HTML. Table
can contain thousands rows and this trick speed up adding new row
extremely. But there is a bug which I could not find while debugging. When
you add new row, all rows losing its Align and VAlign property (seems like
set to default Left and Top). I even tried to enumerate all TD nodes and
set it again to center but it doesn't help. See attached demo. Maybe
someone who ported this library could look at this?
Demo: http://ovh.to/KsMZ3T

***Extension***
New property for TIpHtmlNodeIMG.FreePicture . This flag check if private
FPicture object should be freed. So everywhere where code is:

Code: (pascal)

    if FPicture <> Owner.DefaultImage then begin
{!!.10}
      FPicture.Free;                                                 {!!.10}
      FPicture := nil;
{!!.10}
    end;

... it should be:
Code: (pascal)

    if FPicture <> Owner.DefaultImage then begin
{!!.10}
      if FFreePicture then
        FPicture.Free;
{!!.10}
      FPicture := nil;
{!!.10}
    end;

This is very helpful if you have chat dialog where users have avatars.
Instead of creating new instance of TPicture for each message you are just
pointing to same instance and free it by your self. This avoid to increase
memory usage and you can change graphic without reloading whole HTML.

Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20140521/ec212641/attachment-0002.html>


More information about the Lazarus mailing list