📄 msn_msg.~pas
字号:
//=============================================================
// Component Name : MSN_Msg
// Author : SteedSky
// LastUpDate : 2004.09.05
// E-Mail : SteedSky@163.net
// CopyRight(c) 2004 By SteedSky
//=============================================================
unit MSN_Msg;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
StdCtrls, ExtCtrls, Variants, ComCtrls, Typinfo, MsgFrm, MsgUnit ;
type
TMSN_Msg = class(TComponent)
private
{ Private declarations }
FMsgFont : TFontSet ;
FShowDelay : Integer ;
FPosition : TShowPos ;
FShowKind : TMsgKind ;
FMsgStyle : TMsgStyle ;
FCaption : String ;
FInfo : String ;
FAutoClose : Boolean ;
Fclick:TNotifyEvent;
procedure SetShowDelay(Value: Integer) ;
procedure SetPosition(const Value: TShowPos) ;
procedure SetShowKind(const Value: TMsgKind) ;
procedure SetMsgStyle(const Value: TMsgStyle) ;
procedure SetCaption(const Value: String) ;
procedure SetInfo(const Value: String) ;
procedure SetMsgFont(const Value: TFontSet) ;
procedure SetAutoClose(const Value: Boolean) ;
protected
public
{ Public declarations }
constructor Create (AOwner: TComponent); override;
destructor Destroy; override;
// procedure MsgClick(Sender: TObject);
published
property MsgCaption: String read FCaption write SetCaption ;
property MsgInfo: String read FInfo write SetInfo ;
property MsgFont: TFontSet read FMsgFont write SetMsgFont ;
property ShowDelay: Integer read FShowDelay write SetShowDelay ;
property Position: TShowPos read FPosition write SetPosition default spRightBottom;
property ShowKind: TMsgKind read FShowKind write SetShowKind default mkInfo;
property Style: TMsgStyle read FMsgStyle write SetMsgStyle default msXpBlue;
property AutoClose: Boolean read FAutoClose write SetAutoClose ;
property MSgClick :TNotifyEvent Read Fclick Write Fclick;
procedure Show ;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('System', [TMSN_Msg]);
end;
constructor TMSN_Msg.Create(aOwner: TComponent);
begin
inherited Create(AOwner);
FMsgFont := TFontSet.Create ;
FShowDelay := 5 ;
FPosition := spRightBottom ;
FShowKind := mkInfo ;
FAutoClose := True ;
end;
destructor TMSN_Msg.Destroy;
begin
FMsgFont.Free ;
inherited Destroy;
end;
procedure TMSN_Msg.SetShowDelay(Value: Integer) ;
begin
if Value <> FShowDelay then
FShowDelay := Value ;
end;
procedure TMSN_Msg.SetPosition(const Value: TShowPos) ;
begin
if Value <> FPosition then
FPosition := Value ;
end;
procedure TMSN_Msg.SetShowKind(const Value: TMsgKind) ;
begin
if Value <> FShowKind then
FShowKind := Value ;
end;
procedure TMSN_Msg.SetMsgStyle(const Value: TMsgStyle) ;
begin
if Value <> FMsgStyle then
FMsgStyle := Value ;
end;
procedure TMSN_Msg.SetCaption(const Value: String) ;
begin
if Value <> FCaption then
FCaption := Value ;
end;
procedure TMSN_Msg.SetInfo(const Value: String) ;
begin
if Value <> FInfo then
FInfo := Value ;
end;
procedure TMSN_Msg.SetMsgFont(const Value: TFontSet);
begin
FMsgFont.Assign(Value) ;
end;
procedure TMSN_Msg.SetAutoClose(const Value: Boolean) ;
begin
if Value <> FAutoClose then
FAutoClose := Value ;
end;
procedure TMSN_Msg.Show;
begin
try
if ShowDelay < 1 then ShowDelay := 1;
MsgFrm.ShowCaption := FCaption ;
MsgFrm.ShowPos := FPosition ;
MsgFrm.ShowDelay := FShowDelay ;
MsgFrm.AutoClose := FAutoClose ;
MsgFrm.ShowMsgStyle := FMsgStyle ;
MsgFrm.ShowMsg(FInfo, FShowKind, FMsgFont.CaptionFont, FMsgFont.InfoFont,FClick);
except
end ;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -