You've already forked lina-components
mirror of
https://bitbucket.org/Dennis07/lina-components.git
synced 2026-06-03 16:03:46 +02:00
3360df48a3
Signed-off-by: Dennis07 <den.goehlert@t-online.de>
156 lines
4.1 KiB
ObjectPascal
156 lines
4.1 KiB
ObjectPascal
unit uMain;
|
|
|
|
interface
|
|
|
|
uses
|
|
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
|
|
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, uFrmCtrls, uBase, uSysTools,
|
|
Vcl.ExtCtrls;
|
|
|
|
type
|
|
TfmMain = class(TForm)
|
|
gbForm: TGroupBox;
|
|
gbImage: TGroupBox;
|
|
pnButtons: TPanel;
|
|
btShow: TButton;
|
|
laWidth: TLabel;
|
|
edWidth: TEdit;
|
|
edHeight: TEdit;
|
|
laHeight: TLabel;
|
|
edCaption: TEdit;
|
|
laCaption: TLabel;
|
|
laColor: TLabel;
|
|
edAlpha: TEdit;
|
|
coColor: TColorBox;
|
|
cbAlpha: TCheckBox;
|
|
imImage: TImage;
|
|
edImage: TEdit;
|
|
btImage: TButton;
|
|
laAnimation: TLabel;
|
|
coAnimation: TComboBox;
|
|
SplashScreen: TSplashScreen;
|
|
procedure btShowClick(Sender: TObject);
|
|
procedure SplashScreenTimer(Sender: TObject);
|
|
procedure FormShow(Sender: TObject);
|
|
procedure edWidthChange(Sender: TObject);
|
|
procedure edHeightChange(Sender: TObject);
|
|
procedure edAlphaChange(Sender: TObject);
|
|
procedure edCaptionChange(Sender: TObject);
|
|
procedure cbAlphaClick(Sender: TObject);
|
|
private
|
|
{ Private-Deklarationen }
|
|
public
|
|
{ Public-Deklarationen }
|
|
end;
|
|
|
|
var
|
|
fmMain: TfmMain;
|
|
|
|
implementation
|
|
|
|
{$R *.dfm}
|
|
|
|
procedure TfmMain.btShowClick(Sender: TObject);
|
|
begin
|
|
SplashScreen.SplashForm.Width := StrToInt(edWidth.Text);
|
|
SplashScreen.SplashForm.Height := StrToInt(edHeight.Text);
|
|
SplashScreen.SplashForm.Caption := edCaption.Text;
|
|
SplashScreen.SplashForm.Color := coColor.Selected;
|
|
SplashScreen.SplashForm.AlphaBlend := cbAlpha.Checked;
|
|
SplashScreen.SplashForm.AlphaBlendValue := StrToInt(edAlpha.Text);
|
|
SplashScreen.SplashImage.Picture.Assign(imImage.Picture);
|
|
if coAnimation.ItemIndex = 0 then
|
|
begin
|
|
SplashScreen.Animation := ssaNone;
|
|
end else
|
|
begin
|
|
SplashScreen.Animation := ssaShallow;
|
|
end;
|
|
|
|
if SplashScreen.Visible = True then
|
|
begin
|
|
SplashScreen.Hide;
|
|
btShow.Caption := 'Show...';
|
|
end else
|
|
begin
|
|
SplashScreen.Show;
|
|
btShow.Caption := 'Hide';
|
|
end;
|
|
end;
|
|
|
|
procedure TfmMain.cbAlphaClick(Sender: TObject);
|
|
begin
|
|
edAlpha.Enabled := cbAlpha.Checked;
|
|
end;
|
|
|
|
procedure TfmMain.edAlphaChange(Sender: TObject);
|
|
begin
|
|
if (StrIsInt(edAlpha.Text) = False) or (not (StrToInt(edAlpha.Text) in [0..255])) then
|
|
begin
|
|
MessageDlg('Unvalid value',mtError,[mbCancel],0);
|
|
edAlpha.Text := IntToStr(SplashScreen.SplashForm.AlphaBlendValue);
|
|
end;
|
|
end;
|
|
|
|
procedure TfmMain.edCaptionChange(Sender: TObject);
|
|
begin
|
|
if Length(edCaption.Text) > 255 then
|
|
begin
|
|
MessageDlg('Unvalid value',mtError,[mbCancel],0);
|
|
edCaption.Text := SplashScreen.SplashForm.Caption;
|
|
end;
|
|
end;
|
|
|
|
procedure TfmMain.edHeightChange(Sender: TObject);
|
|
begin
|
|
if StrIsInt(edHeight.Text) = False then
|
|
begin
|
|
MessageDlg('Unvalid value',mtError,[mbCancel],0);
|
|
edHeight.Text := IntToStr(SplashScreen.SplashForm.Height);
|
|
end;
|
|
end;
|
|
|
|
procedure TfmMain.edWidthChange(Sender: TObject);
|
|
begin
|
|
if StrIsInt(edWidth.Text) = False then
|
|
begin
|
|
MessageDlg('Unvalid value',mtError,[mbCancel],0);
|
|
edWidth.Text := IntToStr(SplashScreen.SplashForm.Width);
|
|
end;
|
|
end;
|
|
|
|
procedure TfmMain.FormShow(Sender: TObject);
|
|
begin
|
|
edWidth.Text := IntToStr(SplashScreen.SplashForm.Width);
|
|
edHeight.Text := IntToStr(SplashScreen.SplashForm.Height);
|
|
edCaption.Text := SplashScreen.SplashForm.Caption;
|
|
coColor.Selected := SplashScreen.SplashForm.Color;
|
|
cbAlpha.Checked := SplashScreen.SplashForm.AlphaBlend;
|
|
edAlpha.Enabled := cbAlpha.Checked;
|
|
edAlpha.Text := IntToStr(SplashScreen.SplashForm.AlphaBlendValue);
|
|
imImage.Picture.Assign(SplashScreen.SplashImage.Picture);
|
|
if SplashScreen.Animation = ssaNone then
|
|
begin
|
|
coAnimation.ItemIndex := 0;
|
|
end else
|
|
begin
|
|
coAnimation.ItemIndex := 1;
|
|
end;
|
|
end;
|
|
|
|
procedure TfmMain.SplashScreenTimer(Sender: TObject);
|
|
begin
|
|
if SplashScreen.SplashProgressBar.Position < SplashScreen.SplashProgressBar.Max then
|
|
begin
|
|
SplashScreen.SplashProgressBar.Position := SplashScreen.SplashProgressBar.Position + 10;
|
|
end else
|
|
begin
|
|
SplashScreen.Hide;
|
|
SplashScreen.SplashTimer.Enabled := False;
|
|
SplashScreen.ApplyChanges;
|
|
end;
|
|
//showmessage(inttostr(splashscreen.SplashProgressBar.Position));
|
|
end;
|
|
|
|
end.
|