unit uSRKInfoBox;
interface
USES
Windows, Graphics, StdCtrls, Forms, Controls, ShellApi;
TYPE TSRKInfoBox =
class
PRIVATE
TYPE TButtons =
record
PRIVATE
PROCEDURE SetCaption(ACaption:String='
Close');
FUNCTION GetCaption:
String;
PROCEDURE SetOnClick(Sender: TObject);
PROCEDURE SetVisible(AVisible:Boolean=TRUE);
FUNCTION GetVisible:Boolean;
PUBLIC
PROCEDURE Create;
PROPERTY Caption:
String READ GetCaption
WRITE SetCaption;
PROCEDURE Show;
PROPERTY Visible:Boolean
READ GetVisible
WRITE SetVisible;
END;
PROCEDURE SetCaption(ACaption:
String);
PROCEDURE SetColor(Color:TColor);
PROCEDURE SetHeight(AHeight:Integer);
PROTECTED
FFTButtons : TButtons;
PUBLIC
PROCEDURE Create;
PROPERTY Caption:
String WRITE SetCaption;
PROPERTY Color:TColor
WRITE SetColor;
PROCEDURE Free;
PROPERTY Height:Integer
WRITE SetHeight;
PROCEDURE Show;
PROPERTY CloseButton:TButtons
READ FFTButtons;
END;
VAR
SRKIB:TSRKInfoBox;
SRKIBNewForm : TForm;
SRKIBNewButton : TButton;
SRKIBNewWebLabel : TLabel;
implementation
PROCEDURE TSRKInfoBox.Create;
BEGIN
SRKIBNewForm := TForm.Create(Application.Owner);
WITH SRKIBNewForm
DO BEGIN
BorderIcons := [biSystemMenu];
BorderStyle := bsToolWindow;
Position := poDesktopCenter;
END;
END;
PROCEDURE TSRKInfoBox.SetCaption(ACaption:
String);
BEGIN
SRKIBNewForm.Caption := ACaption;
END;
PROCEDURE TSRKInfoBox.SetColor(Color:TColor);
BEGIN
SRKIBNewForm.Color := Color;
END;
PROCEDURE TSRKInfoBox.Free;
BEGIN
SRKIBNewForm.Free;
END;
PROCEDURE TSRKInfoBox.SetHeight(AHeight:Integer);
BEGIN
SRKIBNewForm.Height := AHeight;
END;
PROCEDURE TSRKInfoBox.Show;
BEGIN
SRKIBNewForm.Show;
END;
///////////////////////////////////////////////////////////////////////////
PROCEDURE TSRKInfoBox.TButtons.Create;
BEGIN
SRKIBNewButton := TButton.Create(SRKIBNewForm);
SRKIBNewButton.Parent := SRKIBNewForm;
//-------------------------------------------\\
SRKIBNewButton.OnClick := SRKIB.FFTButtons.SetOnClick;
SRKIBNewButton.OnClick := SRKIB.TButtons.SetOnKlick;
//-------------------------------------------\\
END;
PROCEDURE TSRKInfoBox.TButtons.SetCaption(ACaption:String='
Close');
BEGIN
SRKIBNewButton.Caption := ACaption;
END;
FUNCTION TSRKInfoBox.TButtons.GetCaption:
String;
BEGIN
result := SRKIBNewButton.Caption;
END;
PROCEDURE TSRKInfoBox.TButtons.SetOnClick(Sender: TObject);
BEGIN
SRKIBNewButton.Free;
SRKIBNewForm.Free;
END;
PROCEDURE TSRKInfoBox.TButtons.SetVisible(AVisible:Boolean=TRUE);
BEGIN
SRKIBNewButton.Visible := AVisible;
END;
FUNCTION TSRKInfoBox.TButtons.GetVisible:Boolean;
BEGIN
result := SRKIBNewButton.Visible;
END;
PROCEDURE TSRKInfoBox.TButtons.Show;
BEGIN
SRKIBNewButton.Show;
END;