unit HoverLabel;
interface
uses
Classes, Graphics, Controls, StdCtrls,
Windows, Messages, SysUtils, Variants, Forms,
Dialogs;
type
THoverLabel=Class(TLabel)
private
{ Private-Deklarationen }
HLHoverColor: TColor;
HLHoverStyles: TFontStyles;
HLHoverCaption: TCaption;
HLHoverCursor: TCursor;
HLLeaveColor: TColor;
HLLeaveStyles: TFontStyles;
HLLeaveCaption: TCaption;
HLLeaveCursor: TCursor;
public
{ Public-Deklarationen }
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
protected
{ Protected-Deklarationen }
procedure MouseEnter(var Message: TMessage); message CM_MOUSEENTER;
procedure MouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
published
property HoverColor: TColor read HLHoverColor write HLHoverColor;
property HoverStyles: TFontStyles read HLHoverStyles write HLHoverStyles;
property HoverCaption: TCaption read HLHoverCaption write HLHoverCaption;
property HoverCursor: TCursor read HLHoverCursor write HLHoverCursor;
property LeaveColor: TColor read HLLeaveColor write HLLeaveColor;
property LeaveStyles: TFontStyles read HLLeaveStyles write HLLeaveStyles;
property LeaveCaption: TCaption read HLLeaveCaption write HLLeaveCaption;
property LeaveCursor: TCursor read HLLeaveCursor write HLLeaveCursor;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('HoverLabel',[THoverLabel]);
end;
constructor THoverLabel.Create;
begin
inherited Create
end;
procedure THoverLabel.MouseEnter;
begin
Cursor:=HLHoverCursor;
Font.Color:=HLHoverColor;
Font.Style:=HLHoverStyles;
Caption:=HLHoverCaption
end;
procedure THoverLabel.MouseLeave;
begin
Cursor:=HLLeaveCursor;
Font.Color:=HLLeaveColor;
Font.Style:=HLLeaveStyles;
Caption:=HLLeaveCaption
end;
destructor THoverLabel.Destroy;
begin
inherited destroy
end;
end.