[yunqa.de] Re: Suggestion - Make TDiHtmlLabel.FRect protected.

  • From: Delphi Inspiration <delphi@xxxxxxxx>
  • To: yunqa@xxxxxxxxxxxxx
  • Date: Thu, 29 Mar 2012 15:16:51 +0200

On 21.02.2012 18:41, Edwin Yip wrote:

> Well, by creating an decedent component I don't have to write the
>  OnMouseEnter/Leave event handlers - this is the only benefit and I
> believe it's the benefit of OOP.

I have just uploaded DIHtmlLabel 2.7 which publishes the OnMouseEnter /
OnMouseLeave for Delphi 2006 and later:

  http://www.yunqa.de/delphi/doku.php/products/htmllabel/index

You can now use these new events to change the color property so there
is no more need to overwrite the Paint method:

procedure TForm1.DIHtmlLabel_MouseEnter(Sender: TObject);
begin
  DIHtmlLabel.Color := clRed;
end;

procedure TForm1.DIHtmlLabel_MouseLeave(Sender: TObject);
begin
  DIHtmlLabel.Color := clWhite;
end;

If you prefer, you can of course derive your own component, but there is
likewise no more need to overwrite the Paint method.

Ralf
_______________________________________________
Delphi Inspiration mailing list
yunqa@xxxxxxxxxxxxx
//www.freelists.org/list/yunqa



Other related posts: