Article View: comp.lang.pascal.delphi.misc
Article #366Sv: Hot to implement MouseEnter and MouseExit with SpeedButton ??
From: News - Image Scandinavia
Date: Sat, 10 Jul 1999 00:00
Date: Sat, 10 Jul 1999 00:00
150 lines
4875 bytes
4875 bytes
Have a look at one of my components that includes cm_mouseEnter and
cm_mouseLeave
unit JpURLLabel;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ShellAPI;
type
TJpURLLabel = class(TCustomLabel)
private
FURL_Text : string;
{ Private declarations }
protected
{ Protected declarations }
procedure Click; override;
procedure MouseEnter (var Msg: TMessage);
message cm_mouseEnter;
procedure MouseLeave (var Msg: TMessage);
message cm_mouseLeave;
public
constructor Create(AOwner : TComponent); override;
procedure Action;
{ Public declarations }
published
{ Published declarations }
property OnClick;
property URL_Text : string read FURL_Text write FURL_Text;
property Align;
property Alignment;
property Autosize;
property Caption;
property Color;
property DragCursor;
property DragMode;
property Enabled;
property FocusControl;
property Font;
property ParentColor;
property ParentFont;
property ParentShowHint;
property PopUpMenu;
property ShowAccelChar;
property ShowHint;
property Transparent;
property Layout;
property Visible;
property WordWrap;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnStartDrag;
end;
var
oldCol:integer;
procedure Register;
implementation
constructor TJpURLLabel.Create(AOwner : TComponent);
begin
inherited;
FURL_Text:='mailto:jpsoft@image.dk';
caption:=FURL_Text;
font.color:=clBlue;
font.style:=font.style+[fsUnderline];
cursor:=crHandPoint;
end;
procedure TJpURLLabel.Action;
var
s:string;
begin
if FURL_Text='' then
Exit;
shellExecute(0, nil, pChar(FURL_Text), nil, nil, sw_shownormal);
end;
procedure TJpURLLabel.Click;
var
s:string;
begin
if FURL_Text='' then
Exit;
shellExecute(0, nil, pChar(FURL_Text), nil, nil, sw_shownormal);
inherited Click;
end;
procedure TJpURLLabel.MouseEnter(var Msg: TMessage);
begin
oldCol:=Font.Color;
Font.Color := clRed;
end;
procedure TJpURLLabel.MouseLeave(var Msg: TMessage);
begin
Font.Color:=oldCol;
end;
procedure Register;
begin
RegisterComponents('JPSoft DK', [TJpURLLabel]);
end;
end.
--
Mvh. JPSoft DK
jpsoft@jpsoft.dk
http://www.jpsoft.dk
Bes�g JPSoft DK for de seneste programmer og opdateringer.
Tilmeld dig JPSoft DK Mail-info hvis du automatisk vil informeres
om �ndringer hos JPSoft DK.
Alan MacArthur <alan.s.macarthur@boeing.com> skrev i en
nyhedsmeddelelse:3731D799.F79@boeing.com...
> Eric wrote:
> >
> > Hello,
> >
> > Would you please to give me a simple example to implement MouseEnter and
> > MouseExit on SpeedButton ????
> >
> > Best regards,
> > Eric
> >
> > --
> > _ _
> > / ) |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| ( \
> > / / | | \ \
> > _( /_ | _ Chow Hoi Ka, Eric _ | _) )_
> > (((\ \> |/ ) ( \| </ /)))
> > (\\\\ \_/ / E-Mail : d951686@sftw.umac.mo \ \_/ ////)
> > \ / \ /
> > \ _/ http://www.sftw.umac.mo/~d951686/ \_ /
> > / / |____________________________________________| \ \
> > / / \ \
>
> It's a private procedure.
Technical Details
Message-ID:
<AOOh3.2101$K4.43660@news020.image.dk>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<372925B3.9D95827E@sftw.umac.mo> <3731D799.F79@boeing.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: fb0ea,161c96c908e39ff X-Google-Attributes: gidfb0ea,public X-Google-Thread: fd817,161c96c908e39ff X-Google-Attributes: gidfd817,public X-Google-Thread: 10baee,161c96c908e39ff X-Google-Attributes: gid10baee,public X-Google-Thread: 1043cf,161c96c908e39ff X-Google-Attributes: gid1043cf,public X-Google-Thread: 10c3d1,161c96c908e39ff X-Google-Attributes: gid10c3d1,public From: "News - Image Scandinavia" <jpsoft@image.dk> Subject: Sv: Hot to implement MouseEnter and MouseExit with SpeedButton ?? Date: 1999/07/10 Message-ID: <AOOh3.2101$K4.43660@news020.image.dk> X-Deja-AN: 499568469 References: <372925B3.9D95827E@sftw.umac.mo> <3731D799.F79@boeing.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Complaints-To: news-abuse@image.dk X-Trace: news020.image.dk 931641632 212.54.76.138 (Sat, 10 Jul 1999 23:20:32 MET DST) X-MSMail-Priority: Normal NNTP-Posting-Date: Sat, 10 Jul 1999 23:20:32 MET DST Newsgroups: comp.lang.pascal.delphi.misc,alt.comp.lang.borland-delphi,borland.public.delphi.objectpascal,borland.public.delphi.vcl.components,borland.public.delphi.vcl.components.using