diff --git a/Example/TSplashScreen/pExample.identcache b/Example/TSplashScreen/pExample.identcache index 4458f7a..6d21ad4 100644 Binary files a/Example/TSplashScreen/pExample.identcache and b/Example/TSplashScreen/pExample.identcache differ diff --git a/Example/TSplashScreen/uMain.dfm b/Example/TSplashScreen/uMain.dfm index 55b506f..4aeb3a7 100644 --- a/Example/TSplashScreen/uMain.dfm +++ b/Example/TSplashScreen/uMain.dfm @@ -14,6 +14,7 @@ object fmMain: TfmMain Font.Style = [] OldCreateOrder = False Position = poScreenCenter + OnCreate = FormCreate OnShow = FormShow PixelsPerInch = 96 TextHeight = 13 @@ -123,13 +124,22 @@ object fmMain: TfmMain Width = 201 Height = 103 Center = True + Stretch = True end object edImage: TEdit Left = 16 Top = 129 Width = 169 Height = 21 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False TabOrder = 0 + OnChange = edImageChange + OnExit = edImageExit end object btImage: TButton Left = 191 @@ -138,6 +148,7 @@ object fmMain: TfmMain Height = 21 Caption = '...' TabOrder = 1 + OnClick = btImageClick end end object pnButtons: TPanel @@ -179,7 +190,20 @@ object fmMain: TfmMain end end object SplashScreen: TSplashScreen + OnTimer = SplashScreenTimer + SplashForm.BorderStyle = bsDialog + SplashForm.BorderIcons = [biSystemMenu] + SplashProgressBar.Position = 60 + SplashTimer.Enabled = True + SplashTimer.Interval = 500 Left = 368 Top = 186 end + object OpenPictureDialog: TOpenPictureDialog + Filter = 'Alle (*.bmp; *.gif; *.jpg; *.jpeg)|*.bmp;*.gif;*.jpg;*.jpeg' + Options = [ofReadOnly, ofHideReadOnly, ofPathMustExist, ofFileMustExist, ofNoTestFileCreate, ofNoNetworkButton, ofNoDereferenceLinks, ofDontAddToRecent] + OptionsEx = [ofExNoPlacesBar] + Left = 336 + Top = 186 + end end diff --git a/Example/TSplashScreen/uMain.pas b/Example/TSplashScreen/uMain.pas index a520de8..b27dfc6 100644 --- a/Example/TSplashScreen/uMain.pas +++ b/Example/TSplashScreen/uMain.pas @@ -1,11 +1,15 @@ unit uMain; +{$IF CompilerVersion <> 26.0} + {$MESSAGE ERROR 'This example was written to compile under Delphi XE5'} +{$ENDIF} + 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; + Vcl.ExtCtrls, Vcl.Imaging.jpeg, Vcl.ExtDlgs; type TfmMain = class(TForm) @@ -29,6 +33,7 @@ type laAnimation: TLabel; coAnimation: TComboBox; SplashScreen: TSplashScreen; + OpenPictureDialog: TOpenPictureDialog; procedure btShowClick(Sender: TObject); procedure SplashScreenTimer(Sender: TObject); procedure FormShow(Sender: TObject); @@ -37,6 +42,10 @@ type procedure edAlphaChange(Sender: TObject); procedure edCaptionChange(Sender: TObject); procedure cbAlphaClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure btImageClick(Sender: TObject); + procedure edImageExit(Sender: TObject); + procedure edImageChange(Sender: TObject); private { Private-Deklarationen } public @@ -50,6 +59,17 @@ implementation {$R *.dfm} +procedure TfmMain.btImageClick(Sender: TObject); +begin + if OpenPictureDialog.Execute = True then + begin + if FileExists(OpenPictureDialog.FileName) = True then + begin + edImage.Text := OpenPictureDialog.FileName; + end; + end; +end; + procedure TfmMain.btShowClick(Sender: TObject); begin SplashScreen.SplashForm.Width := StrToInt(edWidth.Text); @@ -110,6 +130,27 @@ begin end; end; +procedure TfmMain.edImageChange(Sender: TObject); +begin + if edImage.Text = 'Background.jpg' then + begin + edImage.Font.Color := clGray; + end else + begin + edImage.Font.Color := clWindowText; + end; +end; + +procedure TfmMain.edImageExit(Sender: TObject); +begin + try + imImage.Picture.LoadFromFile(edImage.Text); + except + edImage.Text := 'Background.jpg'; + imImage.Picture.LoadFromFile(edImage.Text); + end; +end; + procedure TfmMain.edWidthChange(Sender: TObject); begin if StrIsInt(edWidth.Text) = False then @@ -119,6 +160,12 @@ begin end; end; +procedure TfmMain.FormCreate(Sender: TObject); +begin + SplashScreen.SplashImage.Picture.LoadFromFile('Background.jpg'); + edImage.Text := 'Background.jpg'; +end; + procedure TfmMain.FormShow(Sender: TObject); begin edWidth.Text := IntToStr(SplashScreen.SplashForm.Width); @@ -145,11 +192,10 @@ begin SplashScreen.SplashProgressBar.Position := SplashScreen.SplashProgressBar.Position + 10; end else begin + SplashScreen.SplashProgressBar.Position := 0; SplashScreen.Hide; - SplashScreen.SplashTimer.Enabled := False; - SplashScreen.ApplyChanges; end; - //showmessage(inttostr(splashscreen.SplashProgressBar.Position)); + //SplashScreen.ApplyChanges; end; end. diff --git a/Information/Readme.txt b/Information/Readme.txt index b73c20f..05549b9 100644 --- a/Information/Readme.txt +++ b/Information/Readme.txt @@ -13,4 +13,8 @@ https://bitbucket.org/Dennis07/lina-components/wiki/Home Please note that the code of Lina Components is available under Mozilla Public License (MPL) 2.0, see "Information\License.txt" for -more details. \ No newline at end of file +more details. +The public changes done since version 1.00 are listed in the +"Information\Changelog.txt" file and for a list of all contributors +and supporters please have a look at the "Information\Credits.txt" +file. \ No newline at end of file diff --git a/Information/Statistics.txt b/Information/Statistics.txt index 15338bf..93beeb8 100644 --- a/Information/Statistics.txt +++ b/Information/Statistics.txt @@ -1,4 +1,4 @@ These statistics cover the official repository of Lina Components. -Total lines of code (LoC): 4800+ +Total lines of code (LoC): 5300+ Total visual components (VC): 13 \ No newline at end of file diff --git a/Package/Delphi_XE5/LINA_D_XE5.dproj.local b/Package/Delphi_XE5/LINA_D_XE5.dproj.local index 2339bf1..fbc382b 100644 --- a/Package/Delphi_XE5/LINA_D_XE5.dproj.local +++ b/Package/Delphi_XE5/LINA_D_XE5.dproj.local @@ -1,44 +1,47 @@  - 1899.12.30 00:00:00.000.932,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\uFileCtrls.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas + 1899.12.30 00:00:00.000.204,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\uFileCtrls.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uFileCtrls.pas 1899.12.30 00:00:00.000.325,=dbrtl.dcp 1899.12.30 00:00:00.000.508,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uBase.pas + 1899.12.30 00:00:00.000.650,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uBattery.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uSysCtrls.pas 1899.12.30 00:00:00.000.576,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uSysTools.pas - 1899.12.30 00:00:00.000.592,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uFileTools.pas - 1899.12.30 00:00:00.000.412,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas + 1899.12.30 00:00:00.000.791,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas 1899.12.30 00:00:00.000.675,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas - 1899.12.30 00:00:00.000.809,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Resource\Lina.rc 1899.12.30 00:00:00.000.681,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Resource\Lina.rc= - 1899.12.30 00:00:00.000.650,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uSysCtrls.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uBattery.pas - 1899.12.30 00:00:00.000.414,C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uLinaTest.pas= + 1899.12.30 00:00:00.000.592,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uFileTools.pas + 1899.12.30 00:00:00.000.809,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Resource\Lina.rc 1899.12.30 00:00:00.000.621,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uLinaTest.pas + 1899.12.30 00:00:00.000.318,=vcl.dcp + 1899.12.30 00:00:00.000.414,C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uLinaTest.pas= 1899.12.30 00:00:00.000.577,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uBattery.pas - 1899.12.30 00:00:00.000.633,C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\LINA_D_XE5.dproj=C:\Users\Dennis\Documents\RAD Studio\Projekte\Package1.dproj - 1899.12.30 00:00:00.000.204,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uFileCtrls.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\uFileCtrls.pas + 1899.12.30 00:00:00.000.556,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uLocalMgr.pas 1899.12.30 00:00:00.000.648,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uScriptMgr.pas 1899.12.30 00:00:00.000.518,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uBattery.pas - 1899.12.30 00:00:00.000.556,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uLocalMgr.pas - 1899.12.30 00:00:00.000.318,=vcl.dcp - 1899.12.30 00:00:00.000.196,=rtl.dcp - 1899.12.30 00:00:00.000.686,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\uSysTools.pas - 1899.12.30 00:00:00.000.555,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uBase.pas + 1899.12.30 00:00:00.000.537,C:\Users\Dennis G\Documents\CodeQuality.htm=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Untitled1.htm + 1899.12.30 00:00:00.000.143,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Untitled1.htm + 1899.12.30 00:00:00.000.896,C:\Users\Dennis G\Documents\CodeQuality.htm= + 1899.12.30 00:00:00.000.837,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas 1899.12.30 00:00:00.000.971,=IndySystem.dcp - 1899.12.30 00:00:00.000.672,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\uFrmCtrls.pas + 1899.12.30 00:00:00.000.196,=rtl.dcp + 1899.12.30 00:00:00.000.555,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uBase.pas + 1899.12.30 00:00:00.000.686,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\uSysTools.pas + 1899.12.30 00:00:00.000.584,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uVirtObj.pas 1899.12.30 00:00:00.000.118,=IndyCore.dcp 1899.12.30 00:00:00.000.535,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uFileTools.pas 1899.12.30 00:00:00.000.633,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uLocalMgr.pas - 1899.12.30 00:00:00.000.582,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uWebCtrls.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas 1899.12.30 00:00:00.000.525,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uCrypt.pas - 1899.12.30 00:00:00.000.546,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uFrmCtrls.pas - 1899.12.30 00:00:00.000.411,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uAdvCtrls.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas - 1899.12.30 00:00:00.000.791,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas - 1899.12.30 00:00:00.000.837,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas + 1899.12.30 00:00:00.000.672,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\uFrmCtrls.pas + 1899.12.30 00:00:00.000.932,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\uFileCtrls.pas 1899.12.30 00:00:00.000.566,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uScriptMgr.pas + 1899.12.30 00:00:00.000.412,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas + 1899.12.30 00:00:00.000.411,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uAdvCtrls.pas + 1899.12.30 00:00:00.000.582,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uWebCtrls.pas 1899.12.30 00:00:00.000.045,=IndyProtocols.dcp - 1899.12.30 00:00:00.000.584,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uVirtObj.pas - 1899.12.30 00:00:00.000.799,=PascalScript_Core_D19.dcp + 1899.12.30 00:00:00.000.633,C:\Users\Dennis\Documents\RAD Studio\Projekte\Package1.dproj=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\LINA_D_XE5.dproj 1899.12.30 00:00:00.000.857,=PascalScript_Core_D19.dcp + 1899.12.30 00:00:00.000.546,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uFrmCtrls.pas + 1899.12.30 00:00:00.000.799,=PascalScript_Core_D19.dcp @@ -48,9 +51,9 @@ + - diff --git a/Package/Delphi_XE5/LINA_D_XE5.identcache b/Package/Delphi_XE5/LINA_D_XE5.identcache index e050cfe..7bab036 100644 Binary files a/Package/Delphi_XE5/LINA_D_XE5.identcache and b/Package/Delphi_XE5/LINA_D_XE5.identcache differ diff --git a/Source/Compiled/uAdvCtrls.dcu b/Source/Compiled/uAdvCtrls.dcu index 1d86414..4c025a3 100644 Binary files a/Source/Compiled/uAdvCtrls.dcu and b/Source/Compiled/uAdvCtrls.dcu differ diff --git a/Source/Compiled/uBase.dcu b/Source/Compiled/uBase.dcu index df96a67..ae0699c 100644 Binary files a/Source/Compiled/uBase.dcu and b/Source/Compiled/uBase.dcu differ diff --git a/Source/Compiled/uCrypt.dcu b/Source/Compiled/uCrypt.dcu index 045aef3..e13fc50 100644 Binary files a/Source/Compiled/uCrypt.dcu and b/Source/Compiled/uCrypt.dcu differ diff --git a/Source/Compiled/uFileCtrls.dcu b/Source/Compiled/uFileCtrls.dcu index 87c0fc0..e21feb7 100644 Binary files a/Source/Compiled/uFileCtrls.dcu and b/Source/Compiled/uFileCtrls.dcu differ diff --git a/Source/Compiled/uFileTools.dcu b/Source/Compiled/uFileTools.dcu index e019cab..acc6b31 100644 Binary files a/Source/Compiled/uFileTools.dcu and b/Source/Compiled/uFileTools.dcu differ diff --git a/Source/Compiled/uFrmCtrls.dcu b/Source/Compiled/uFrmCtrls.dcu index 612475b..c1ebc8d 100644 Binary files a/Source/Compiled/uFrmCtrls.dcu and b/Source/Compiled/uFrmCtrls.dcu differ diff --git a/Source/Compiled/uLocalMgr.dcu b/Source/Compiled/uLocalMgr.dcu index 900135a..a644164 100644 Binary files a/Source/Compiled/uLocalMgr.dcu and b/Source/Compiled/uLocalMgr.dcu differ diff --git a/Source/Compiled/uScriptMgr.dcu b/Source/Compiled/uScriptMgr.dcu index b8620fe..a20674c 100644 Binary files a/Source/Compiled/uScriptMgr.dcu and b/Source/Compiled/uScriptMgr.dcu differ diff --git a/Source/Compiled/uSysCtrls.dcu b/Source/Compiled/uSysCtrls.dcu index ef9c1ba..ac3ec22 100644 Binary files a/Source/Compiled/uSysCtrls.dcu and b/Source/Compiled/uSysCtrls.dcu differ diff --git a/Source/Compiled/uSysTools.dcu b/Source/Compiled/uSysTools.dcu index adda1ec..1c66947 100644 Binary files a/Source/Compiled/uSysTools.dcu and b/Source/Compiled/uSysTools.dcu differ diff --git a/Source/Compiled/uVirtObj.dcu b/Source/Compiled/uVirtObj.dcu index 7491828..323d424 100644 Binary files a/Source/Compiled/uVirtObj.dcu and b/Source/Compiled/uVirtObj.dcu differ diff --git a/Source/Compiled/uWebCtrls.dcu b/Source/Compiled/uWebCtrls.dcu index 5805dc8..2c5eb6f 100644 Binary files a/Source/Compiled/uWebCtrls.dcu and b/Source/Compiled/uWebCtrls.dcu differ diff --git a/Source/uBase.pas b/Source/uBase.pas index 4ad182b..504bbf4 100644 --- a/Source/uBase.pas +++ b/Source/uBase.pas @@ -6,7 +6,7 @@ unit uBase; /// (c) 2014 Dennis Göhlert a.o. /// ////////////////////////////////////// - {$IF CompilerVersion < 18.0} + {$IF CompilerVersion < 18.5} { Unter früheren Delphi-Versionen als 2007 gab es (offiziell) noch keine Unterstützung für Windows-Vista-spezifische funktionen wie die TaskDialog- Komponente oder einige Funktionen. diff --git a/Source/uFrmCtrls.pas b/Source/uFrmCtrls.pas index cbd1c09..bb5efff 100644 --- a/Source/uFrmCtrls.pas +++ b/Source/uFrmCtrls.pas @@ -21,7 +21,6 @@ type TSplashScreenAnimation = (ssaNone,ssaShallow); TProgressBarManagerMode = (pmmNone,pmmBattery,pmmDownload); TListBoxManagerMode = (lmmNone,lmmEdit,lmmComboBox); - TParamReferenceType = (prtAutomatic,prtChar,prtString,prtInteger,prtFloat); type { Ereignisse } @@ -37,131 +36,182 @@ type { Hauptklassen } { TSplash... } - TSplashForm = class + TSplashObject = class(TPersistent) private { Private-Deklarationen } - FBorderStyle: TFormBorderStyle; - FBorderIcons: TBorderIcons; - FLeft: Integer; - FTop: Integer; - FWidth: Integer; - FHeight: Integer; - FAlign: TAlign; - FAlphaBlend: Boolean; - FAlphaBlendValue: Byte; - FCaption: TCaption; - FColor: TColor; + SplashScreenVisible: Boolean; + public + { Public-Deklarationen } + constructor Create; + destructor Destroy; override; + end; + + TSplashForm = class(TSplashObject) + private + { Private-Deklarationen } + FormObject: TForm; + { Methoden } + function GetBorderStyle: TFormBorderStyle; + procedure SetBorderStyle(Value: TFormBorderStyle); + function GetBorderIcons: TBorderIcons; + procedure SetBorderIcons(Value: TBorderIcons); + function GetLeft: Integer; + procedure SetLeft(Value: Integer); + function GetTop: Integer; + procedure SetTop(Value: Integer); + function GetWidth: Integer; + procedure SetWidth(Value: Integer); + function GetHeight: Integer; + procedure SetHeight(Value: Integer); + function GetAlign: TAlign; + procedure SetAlign(Value: TAlign); + function GetAlphaBlend: Boolean; + procedure SetAlphaBlend(Value: Boolean); + function GetAlphaBlendValue: Byte; + procedure SetAlphaBlendValue(Value: Byte); + function GetCaption: TCaption; + procedure SetCaption(Value: TCaption); + function GetColor: TColor; + procedure SetColor(Value: TColor); + function GetEnabled: Boolean; + procedure SetEnabled(Value: Boolean); + function GetWindowState: TWindowState; + procedure SetWindowState(Value: TWindowState); + function GetPosition: TPosition; + procedure SetPosition(Value: TPosition); + function GetCursor: TCursor; + procedure SetCursor(Value: TCursor); + public + { Public-Deklarationen } + constructor Create; + destructor Destroy; override; + published + { Published-Deklarationen } + property BorderStyle: TFormBorderStyle read GetBorderStyle write SetBorderStyle default bsNone; + property BorderIcons: TBorderIcons read GetBorderIcons write SetBorderIcons default []; + property Left: Integer read GetLeft write SetLeft default 0; + property Top: Integer read GetTop write SetTop default 0; + property Width: Integer read GetWidth write SetWidth default 600; + property Height: Integer read GetHeight write SetHeight default 400; + property Align: TAlign read GetAlign write SetAlign default alNone; + property AlphaBlend: Boolean read GetAlphaBlend write SetAlphaBlend default False; + property AlphaBlendValue: Byte read GetAlphaBlendValue write SetAlphaBlendValue default 255; + property Caption: TCaption read GetCaption write SetCaption; + property Color: TColor read GetColor write SetColor default clBtnFace; + property Enabled: Boolean read GetEnabled write SetEnabled default True; + property WindowState: TWindowState read GetWindowState write SetWindowState default wsNormal; + property Position: TPosition read GetPosition write SetPosition default poScreenCenter; + property Cursor: TCursor read GetCursor write SetCursor default crHourGlass; + end; + + TSplashProgressBar = class(TSplashObject) + private + { Private-Deklarationen } + ProgressBarObject: TProgressBar; + { Methoden } + function GetLeft: Integer; + procedure SetLeft(Value: Integer); + function GetTop: Integer; + procedure SetTop(Value: Integer); + function GetWidth: Integer; + procedure SetWidth(Value: Integer); + function GetHeight: Integer; + procedure SetHeight(Value: Integer); + function GetVisible: Boolean; + procedure SetVisible(Value: Boolean); + function GetPosition: Integer; + procedure SetPosition(Value: Integer); + function GetMax: Integer; + procedure SetMax(Value: Integer); + function GetMin: Integer; + procedure SetMin(Value: Integer); + function GetAlign: TAlign; + procedure SetAlign(Value: TAlign); + function GetBackgroundColor: TColor; + procedure SetBackgroundColor(Value: TColor); + function GetBarColor: TColor; + procedure SetBarColor(Value: TColor); + function GetState: TProgressBarState; + procedure SetState(Value: TProgressBarState); + function GetStyle: TProgressBarStyle; + procedure SetStyle(Value: TProgressBarStyle); + function GetSmooth: Boolean; + procedure SetSmooth(Value: Boolean); + function GetSmoothReverse: Boolean; + procedure SetSmoothReverse(Value: Boolean); + function GetMarqueeInterval: Integer; + procedure SetMarqueeInterval(Value: Integer); + function GetStep: Integer; + procedure SetStep(Value: Integer); + public + { Public-Deklarationen } + constructor Create; + destructor Destroy; override; + published + { Published-Deklarationen } + property Left: Integer read GetLeft write SetLeft default 250; + property Top: Integer read GetTop write SetTop default 250; + property Width: Integer read GetWidth write SetWidth default 100; + property Height: Integer read GetHeight write SetHeight default 50; + property Visible: Boolean read GetVisible write SetVisible default True; + property Position: Integer read GetPosition write SetPosition default 0; + property Max: Integer read GetMax write SetMax default 100; + property Min: Integer read GetMin write SetMin default 0; + property Align: TAlign read GetAlign write SetAlign default alNone; + property BackgroundColor: TColor read GetBackgroundColor write SetBackgroundColor default clDefault; + property BarColor: TColor read GetBarColor write SetBarColor default clDefault; + property State: TProgressBarState read GetState write SetState default pbsNormal; + property Style: TProgressBarStyle read GetStyle write SetStyle default pbstNormal; + property Smooth: Boolean read GetSmooth write SetSmooth default False; + property SmoothReverse: Boolean read GetSmoothReverse write SetSmoothReverse default False; + property MarqueeInterval: Integer read GetMarqueeInterval write SetMarqueeInterval default 10; + property Step: Integer read GetStep write SetStep default 10; + end; + + TSplashImage = class(TSplashObject) + private + { Private-Deklarationen } + ImageObject: TImage; + { Methoden } + function GetVisible: Boolean; + procedure SetVisible(Value: Boolean); + function GetTransparent: Boolean; + procedure SetTransparent(Value: Boolean); + function GetPicture: TPicture; + procedure SetPicture(Value: TPicture); + public + { Public-Deklarationen } + constructor Create; + destructor Destroy; override; + published + { Published-Deklarationen } + property Visible: Boolean read GetVisible write SetVisible default True; + property Transparent: Boolean read GetTransparent write SetTransparent default False; + property Picture: TPicture read GetPicture write SetPicture; + end; + + TSplashTimer = class(TSplashObject) + private + { Private-Deklarationen } + TimerObject: TTimer; FEnabled: Boolean; - FWindowState: TWindowState; - FPosition: TPosition; - FCursor: TCursor; + { Methoden } + procedure SetEnabled(Value: Boolean); + function GetInterval: Cardinal; + procedure SetInterval(Value: Cardinal); public { Public-Deklarationen } constructor Create; destructor Destroy; override; published { Published-Deklarationen } - property BorderStyle: TFormBorderStyle read FBorderStyle write FBorderStyle default bsNone; - property BorderIcons: TBorderIcons read FBorderIcons write FBorderIcons default []; - property Left: Integer read FLeft write FLeft default 0; - property Top: Integer read FTop write FTop default 0; - property Width: Integer read FWidth write FWidth default 600; - property Height: Integer read FHeight write FHeight default 400; - property Align: TAlign read FAlign write FAlign default alNone; - property AlphaBlend: Boolean read FAlphaBlend write FAlphaBlend default False; - property AlphaBlendValue: Byte read FAlphaBlendValue write FAlphaBlendValue default 255; - property Caption: TCaption read FCaption write FCaption; - property Color: TColor read FColor write FColor default clBtnFace; - property Enabled: Boolean read FEnabled write FEnabled default True; - property WindowState: TWindowState read FWindowState write FWindowState default wsNormal; - property Position: TPosition read FPosition write FPosition default poScreenCenter; - property Cursor: TCursor read FCursor write FCursor default crHourGlass; - end; - - TSplashProgressBar = class - private - { Private-Deklarationen } - FLeft: Integer; - FTop: Integer; - FWidth: Integer; - FHeight: Integer; - FVisible: Boolean; - FPosition: Integer; - FMin: Integer; - FMax: Integer; - FAlign: TAlign; - FBackgroundColor: TColor; - FBarColor: TColor; - FState: TProgressBarState; - FStyle: TProgressBarStyle; - FSmooth: Boolean; - FSmoothReverse: Boolean; - FMarqueeInterval: Integer; - FStep: Integer; - public - { Public-Deklarationen } - constructor Create; - destructor Destroy; override; - published - { Published-Deklarationen } - property Left: Integer read FLeft write FLeft default 250; - property Top: Integer read FTop write FTop default 250; - property Width: Integer read FWidth write FWidth default 100; - property Height: Integer read FHeight write FHeight default 50; - property Visible: Boolean read FVisible write FVisible default True; - property Position: Integer read FPosition write FPosition default 0; - property Max: Integer read FMax write FMax default 100; - property Min: Integer read FMin write FMin default 0; - property Align: TAlign read FAlign write FAlign default alNone; - property BackgroundColor: TColor read FBackgroundColor write FBackgroundColor default clDefault; - property BarColor: TColor read FBarColor write FBarColor default clDefault; - property State: TProgressBarState read FState write FState default pbsNormal; - property Style: TProgressBarStyle read FStyle write FStyle default pbstNormal; - property Smooth: Boolean read FSmooth write FSmooth default False; - property SmoothReverse: Boolean read FSmoothReverse write FSmoothReverse default False; - property MarqueeInterval: Integer read FMarqueeInterval write FMarqueeInterval default 10; - property Step: Integer read FStep write FStep default 10; - end; - - TSplashImage = class - private - { Private-Deklarationen } - FVisible: Boolean; - FTransparent: Boolean; - FPicture: TPicture; - public - { Public-Deklarationen } - constructor Create; - destructor Destroy; override; - published - { Published-Deklarationen } - property Visible: Boolean read FVisible write FVisible default True; - property Transparent: Boolean read FTransparent write FTransparent default False; - property Picture: TPicture read FPicture write FPicture; - end; - - TSplashTimer = class - private - { Private-Deklarationen } - FEnabled: Boolean; - FInterval: Cardinal; - public - { Public-Deklarationen } - constructor Create; - destructor Destroy; - published - { Published-Deklarationen } - property Enabled: Boolean read FEnabled write FEnabled default False; - property Interval: Cardinal read FInterval write FInterval default 1000; + property Enabled: Boolean read FEnabled write SetEnabled default False; + property Interval: Cardinal read GetInterval write SetInterval default 1000; end; TSplashScreen = class(TComponent) private { Private-Deklarationen } - FormObject: TForm; - ProgressBarObject: TProgressBar; - ImageObject: TImage; - TimerObject: TTimer; AnimationTimerShow: TTimer; AnimationTimerHide: TTimer; FAbout: TComponentAbout; @@ -184,11 +234,15 @@ type FTimerEvent: TSplashTimerEvent; { Methoden } procedure SetVisible(Value: Boolean); + procedure SetSplashForm(Value: TSplashForm); + procedure SetSplashProgressBar(Value: TSplashProgressBar); + procedure SetSplashImage(Value: TSplashImage); + procedure SetSplashTimer(Value: TSplashTimer); + procedure AnimationTimerShowTimer(Sender: TObject); + procedure AnimationTimerHideTimer(Sender: TObject); procedure FormObjectShow(Sender: TObject); procedure FormObjectHide(Sender: TObject); procedure TimerObjectTimer(Sender: TObject); - procedure AnimationTimerShowTimer(Sender: TObject); - procedure AnimationTimerHideTimer(Sender: TObject); protected { Protected-Deklarationen } procedure Refresh; //Vorberaitung (benutzerdefinierte Werte) @@ -212,10 +266,10 @@ type property OnTimer: TSplashTimerEvent read FTimerEvent write FTimerEvent; { Eigenschaften } property About: TComponentAbout read FAbout; - property SplashForm: TSplashForm read FSplashForm write FSplashForm; - property SplashProgressBar: TSplashProgressBar read FSplashProgressBar write FSplashProgressBar; - property SplashImage: TSplashImage read FSplashImage write FSplashImage; - property SplashTimer: TSplashTimer read FSplashTimer write FSplashTimer; + property SplashForm: TSplashForm read FSplashForm write SetSplashForm; + property SplashProgressBar: TSplashProgressBar read FSplashProgressBar write SetSplashProgressBar; + property SplashImage: TSplashImage read FSplashImage write SetSplashImage; + property SplashTimer: TSplashTimer read FSplashTimer write SetSplashTimer; property DisplayTime: Cardinal read FDisplayTime write FDisplayTime default 2000; property AutoShow: Boolean read FAutoShow write FAutoShow default False; property Mode: TSplashScreenMode read FMode write FMode default ssmDefault; @@ -235,7 +289,7 @@ type { Public-Deklarationen } constructor Create(AOwner: TComponent); override; destructor Destroy; override; - procedure Update; + procedure Update; virtual; published { Published-Deklarationen } { Ereignisse } @@ -260,7 +314,7 @@ type { Public-Deklarationen } constructor Create(AOwner: TComponent); override; destructor Destroy; override; - procedure Update; + procedure Update; override; published { Published-Deklarationen } property Target: TProgressBar read FTarget write SetTarget; @@ -288,7 +342,7 @@ type { Public-Deklarationen } constructor Create(AOwner: TComponent); override; destructor Destroy; override; - procedure Update; + procedure Update; override; procedure LoadList; published { Published-Deklarationen } @@ -300,7 +354,7 @@ type end; { TParam... } - TParamFormat = class + TParamFormat = class(TPersistent) private { Private-Deklarationen } FPrefix: String; @@ -317,22 +371,22 @@ type property Seperator: String read FSeperator write FSeperator; end; - TParamReference = class + TParamReference = class(TPersistent) private { Private-Deklarationen } - FParamType: TParamReferenceType; - FDefaultValue: Variant; - FConnector: Pointer; + FDefaultValue: String; + FConnector: PString; FFormat: TParamFormat; public { Public-Deklarationen } - constructor Create; + constructor Create(AConnector: PString); destructor Destroy; override; + procedure Update; + { Eigenschaften } + property Connector: PString read FConnector write FConnector; published { Published-Deklarationen } - property ParamType: TParamReferenceType read FParamType write FParamType default prtAutomatic; - property DefaultValue: Variant read FDefaultValue write FDefaultValue; - // property Connector: Pointer read FConnector write FConnector; + property DefaultValue: String read FDefaultValue write FDefaultValue; property Format: TParamFormat read FFormat write FFormat; end; @@ -340,15 +394,14 @@ type private { Private-Deklarationen } FAbout: TComponentAbout; - // FReferences: TObjectList; public { Public-Deklarationen } constructor Create(AOwner: TComponent); override; destructor Destroy; override; - // property References [Index]: TParamReference read FReferences write FReferences; published { Published-Deklarationen } property About: TComponentAbout read FAbout; + end; procedure Register; @@ -382,66 +435,460 @@ begin RegisterComponents(ComponentsPage,[TSplashScreen,TProgressBarManager,TListBoxManager]); end; +{ ---------------------------------------------------------------------------- + TSplashObject + ---------------------------------------------------------------------------- } + +constructor TSplashObject.Create; +begin + inherited; + SplashScreenVisible := False; +end; + +destructor TSplashObject.Destroy; +begin + //... + inherited; +end; + { ---------------------------------------------------------------------------- TSplashForm ---------------------------------------------------------------------------- } constructor TSplashForm.Create; begin - //... + FormObject := TForm.Create(nil); + FormObject.Visible := False; end; destructor TSplashForm.Destroy; begin - //... + FormObject.Close; + FormObject.Free; inherited; end; +function TSplashForm.GetBorderStyle: TFormBorderStyle; +begin + Result := FormObject.BorderStyle; +end; + +procedure TSplashForm.SetBorderStyle(Value: TFormBorderStyle); +begin + FormObject.BorderStyle := Value; +end; + +function TSplashForm.GetBorderIcons: TBorderIcons; +begin + Result := FormObject.BorderIcons; +end; + +procedure TSplashForm.SetBorderIcons(Value: TBorderIcons); +begin + FormObject.BorderIcons := Value; +end; + +function TSplashForm.GetLeft: Integer; +begin + Result := FormObject.Left; +end; + +procedure TSplashForm.SetLeft(Value: Integer); +begin + FormObject.Left := Value; +end; + +function TSplashForm.GetTop: Integer; +begin + Result := FormObject.Top; +end; + +procedure TSplashForm.SetTop(Value: Integer); +begin + FormObject.Top := Value; +end; + +function TSplashForm.GetWidth: Integer; +begin + Result := FormObject.Width; +end; + +procedure TSplashForm.SetWidth(Value: Integer); +begin + FormObject.Width := Value; +end; + +function TSplashForm.GetHeight: Integer; +begin + Result := FormObject.Height; +end; + +procedure TSplashForm.SetHeight(Value: Integer); +begin + FormObject.Height := Value; +end; + +function TSplashForm.GetAlign: TAlign; +begin + Result := FormObject.Align; +end; + +procedure TSplashForm.SetAlign(Value: TAlign); +begin + FormObject.Align := Value; +end; + +function TSplashForm.GetAlphaBlend: Boolean; +begin + Result := FormObject.AlphaBlend; +end; + +procedure TSplashForm.SetAlphaBlend(Value: Boolean); +begin + FormObject.AlphaBlend := Value; +end; + +function TSplashForm.GetAlphaBlendValue: Byte; +begin + Result := FormObject.AlphaBlendValue; +end; + +procedure TSplashForm.SetAlphaBlendValue(Value: Byte); +begin + FormObject.AlphaBlendValue := Value; +end; + +function TSplashForm.GetCaption: TCaption; +begin + Result := FormObject.Caption; +end; + +procedure TSplashForm.SetCaption(Value: TCaption); +begin + FormObject.Caption := Value; +end; + +function TSplashForm.GetColor: TColor; +begin + Result := FormObject.Color; +end; + +procedure TSplashForm.SetColor(Value: TColor); +begin + FormObject.Color := Value; +end; + +function TSplashForm.GetEnabled: Boolean; +begin + Result := FormObject.Enabled; +end; + +procedure TSplashForm.SetEnabled(Value: Boolean); +begin + FormObject.Enabled := Value; +end; + +function TSplashForm.GetWindowState: TWindowState; +begin + Result := FormObject.WindowState; +end; + +procedure TSplashForm.SetWindowState(Value: TWindowState); +begin + FormObject.WindowState := Value; +end; + +function TSplashForm.GetPosition: TPosition; +begin + Result := FormObject.Position; +end; + +procedure TSplashForm.SetPosition(Value: TPosition); +begin + FormObject.Position := Value; +end; + +function TSplashForm.GetCursor: TCursor; +begin + Result := FormObject.Cursor; +end; + +procedure TSplashForm.SetCursor(Value: TCursor); +begin + FormObject.Cursor := Value; +end; + { ---------------------------------------------------------------------------- TSplashProgressBar ---------------------------------------------------------------------------- } constructor TSplashProgressBar.Create; begin - //... + ProgressBarObject := TProgressBar.Create(nil); end; destructor TSplashProgressBar.Destroy; begin - //... + ProgressBarObject.Free; inherited; end; +function TSplashProgressBar.GetLeft: Integer; +begin + Result := ProgressBarObject.Left; +end; + +procedure TSplashProgressBar.SetLeft(Value: Integer); +begin + ProgressBarObject.Left := Value; +end; + +function TSplashProgressBar.GetTop: Integer; +begin + Result := ProgressBarObject.Top; +end; + +procedure TSplashProgressBar.SetTop(Value: Integer); +begin + ProgressBarObject.Top := Value; +end; + +function TSplashProgressBar.GetWidth: Integer; +begin + Result := ProgressBarObject.Width; +end; + +procedure TSplashProgressBar.SetWidth(Value: Integer); +begin + ProgressBarObject.Width := Value; +end; + +function TSplashProgressBar.GetHeight: Integer; +begin + Result := ProgressBarObject.Height; +end; + +procedure TSplashProgressBar.SetHeight(Value: Integer); +begin + ProgressBarObject.Height := Value; +end; + +function TSplashProgressBar.GetVisible: Boolean; +begin + Result := ProgressBarObject.Visible; +end; + +procedure TSplashProgressBar.SetVisible(Value: Boolean); +begin + ProgressBarObject.Visible := Value; +end; + +function TSplashProgressBar.GetPosition: Integer; +begin + Result := ProgressBarObject.Position; +end; + +procedure TSplashProgressBar.SetPosition(Value: Integer); +begin + ProgressBarObject.Position := Value; +end; + +function TSplashProgressBar.GetMax: Integer; +begin + Result := ProgressBarObject.Max; +end; + +procedure TSplashProgressBar.SetMax(Value: Integer); +begin + ProgressBarObject.Max := Value; +end; + +function TSplashProgressBar.GetMin: Integer; +begin + Result := ProgressBarObject.Min; +end; + +procedure TSplashProgressBar.SetMin(Value: Integer); +begin + ProgressBarObject.Min := Value; +end; + +function TSplashProgressBar.GetAlign: TAlign; +begin + Result := ProgressBarObject.Align; +end; + +procedure TSplashProgressBar.SetAlign(Value: TAlign); +begin + ProgressBarObject.Align := Value; +end; + +function TSplashProgressBar.GetBackgroundColor: TColor; +begin + Result := ProgressBarObject.BackgroundColor; +end; + +procedure TSplashProgressBar.SetBackgroundColor(Value: TColor); +begin + ProgressBarObject.BackgroundColor := Value; +end; + +function TSplashProgressBar.GetBarColor: TColor; +begin + Result := ProgressBarObject.BarColor; +end; + +procedure TSplashProgressBar.SetBarColor(Value: TColor); +begin + ProgressBarObject.BarColor := Value; +end; + +function TSplashProgressBar.GetState: TProgressBarState; +begin + Result := ProgressBarObject.State; +end; + +procedure TSplashProgressBar.SetState(Value: TProgressBarState); +begin + ProgressBarObject.State := Value; +end; + +function TSplashProgressBar.GetStyle: TProgressBarStyle; +begin + Result := ProgressBarObject.Style; +end; + +procedure TSplashProgressBar.SetStyle(Value: TProgressBarStyle); +begin + ProgressBarObject.Style := Value; +end; + +function TSplashProgressBar.GetSmooth: Boolean; +begin + Result := ProgressBarObject.Smooth; +end; + +procedure TSplashProgressBar.SetSmooth(Value: Boolean); +begin + ProgressBarObject.Smooth := Value; +end; + +function TSplashProgressBar.GetSmoothReverse: Boolean; +begin + Result := ProgressBarObject.SmoothReverse; +end; + +procedure TSplashProgressBar.SetSmoothReverse(Value: Boolean); +begin + ProgressBarObject.SmoothReverse := Value; +end; + +function TSplashProgressBar.GetMarqueeInterval: Integer; +begin + Result := ProgressBarObject.MarqueeInterval; +end; + +procedure TSplashProgressBar.SetMarqueeInterval(Value: Integer); +begin + ProgressBarObject.MarqueeInterval := Value; +end; + +function TSplashProgressBar.GetStep: Integer; +begin + Result := ProgressBarObject.Step; +end; + +procedure TSplashProgressBar.SetStep(Value: Integer); +begin + ProgressBarObject.Step := Value; +end; + + { ---------------------------------------------------------------------------- TSplashImage ---------------------------------------------------------------------------- } constructor TSplashImage.Create; begin - FPicture := TPicture.Create; + ImageObject := TImage.Create(nil); + Picture := TPicture.Create; + ImageObject.Align := alClient; + ImageObject.Stretch := True; end; destructor TSplashImage.Destroy; begin - FPicture.Free; + //Picture.Free; Keine Ahrnung, wieso das hier automatisch wieder freigegeben wird (??) + ImageObject.Free; inherited; end; +function TSplashImage.GetVisible: Boolean; +begin + Result := ImageObject.Visible; +end; + +procedure TSplashImage.SetVisible(Value: Boolean); +begin + ImageObject.Visible := Value; +end; + +function TSplashImage.GetTransparent: Boolean; +begin + Result := ImageObject.Transparent; +end; + +procedure TSplashImage.SetTransparent(Value: Boolean); +begin + ImageObject.Transparent := Value; +end; + +function TSplashImage.GetPicture: TPicture; +begin + Result := ImageObject.Picture; +end; + +procedure TSplashImage.SetPicture(Value: TPicture); +begin + ImageObject.Picture.Assign(Value); +end; + { ---------------------------------------------------------------------------- TSplashTimer ---------------------------------------------------------------------------- } constructor TSplashTimer.Create; begin - //... + TimerObject := TTimer.Create(nil); + TimerObject.Enabled := False; end; destructor TSplashTimer.Destroy; begin - //... + TimerObject.Enabled := False; + TimerObject.Free; inherited; end; +procedure TSplashTimer.SetEnabled(Value: Boolean); +begin + FEnabled := Value; + if SplashScreenVisible = True then + begin + TimerObject.Enabled := Value; + end; +end; + +function TSplashTimer.GetInterval: Cardinal; +begin + Result := TimerObject.Interval; +end; + +procedure TSplashTimer.SetInterval(Value: Cardinal); +begin + TimerObject.Interval := Value; +end; + { ---------------------------------------------------------------------------- TSplashScreen ---------------------------------------------------------------------------- } @@ -458,22 +905,17 @@ begin FAbout := TComponentAbout.Create(SplashScreenComponent_Name,SplashScreenComponent_Version,SplashScreenComponent_Copyright,SplashScreenComponent_Author); FSplashForm := TSplashForm.Create; + FSplashForm.FormObject.OnShow := FormObjectShow; + FSplashForm.FormObject.OnHide := FormObjectHide; + FSplashTimer := TSplashTimer.Create; + FSplashTimer.TimerObject.OnTimer := TimerObjectTimer; FSplashProgressBar := TSplashProgressBar.Create; FSplashImage := TSplashImage.Create; FSplashTimer := TSplashTimer.Create; - - FormObject := TForm.Create(Self); - FormObject.OnShow := FormObjectShow; - FormObject.OnHide := FormObjectHide; - FormObject.Visible := False; - ProgressBarObject := TProgressBar.Create(Self); - ProgressBarObject.Parent := FormObject; - ImageObject := TImage.Create(Self); - ImageObject.Parent := FormObject; - TimerObject := TTimer.Create(Self); - TimerObject.OnTimer := TimerObjectTimer; - TimerObject.Enabled := False; - + { Parents richtig setzen } + SplashProgressBar.ProgressBarObject.Parent := SplashForm.FormObject; + SplashImage.ImageObject.Parent := SplashForm.FormObject; + { AnimationTimer... } AnimationTimerShow := TTimer.Create(Self); AnimationTimerShow.OnTimer := AnimationTimerShowTimer; AnimationTimerShow.Enabled := False; @@ -501,12 +943,10 @@ begin OnDestroy(Self); end; FAbout.Free; - FSplashForm.Free; FSplashProgressBar.Free; FSplashImage.Free; FSplashTimer.Free; - FormObject.Close; - FormObject.Free; + FSplashForm.Free; //ProgressBarObject.Free; _ //ImageObject.Free; | //TimerObject.Free; |____\ Automatisch @@ -517,23 +957,27 @@ end; procedure TSplashScreen.Show; begin - ApplyChanges; + SplashTimer.TimerObject.Enabled := SplashTimer.FEnabled; if Mode = ssmModal then begin - FormObject.ShowModal; + SplashForm.FormObject.ShowModal; end else begin - FormObject.Show; + SplashForm.FormObject.Show; end; if Animation = ssaShallow then begin - FormObject.AlphaBlend := True; - FormObject.AlphaBlendValue := 0; + SplashForm.FormObject.AlphaBlend := True; + SplashForm.FormObject.AlphaBlendValue := 0; AnimationTimerHide.Enabled := False; AnimationTimerShow.Enabled := True; end; FVisible := True; - FormObject.BringToFront; + SplashForm.FormObject.BringToFront; + SplashForm.SplashScreenVisible := True; + SplashProgressBar.SplashScreenVisible := True; + SplashImage.SplashScreenVisible := True; + SplashTimer.SplashScreenVisible := True; if Assigned(OnShow) then begin OnShow(Self); @@ -542,26 +986,48 @@ end; procedure TSplashScreen.Hide; begin - TimerObject.Enabled := False; + SplashTimer.TimerObject.Enabled := False; if Animation = ssaNone then begin - FormObject.Hide; + SplashForm.FormObject.Hide; end else begin if Animation = ssaShallow then begin - FormObject.AlphaBlend := True; + SplashForm.FormObject.AlphaBlend := True; AnimationTimerShow.Enabled := False; AnimationTimerHide.Enabled := True; end; end; FVisible := False; + SplashForm.SplashScreenVisible := False; + SplashProgressBar.SplashScreenVisible := False; + SplashImage.SplashScreenVisible := False; + SplashTimer.SplashScreenVisible := False; if Assigned(OnHide) then begin OnHide(Self); end; end; +procedure TSplashScreen.FormObjectShow(Sender: TObject); +begin + Visible := True; +end; + +procedure TSplashScreen.FormObjectHide(Sender: TObject); +begin + Visible := False; +end; + +procedure TSplashScreen.TimerObjectTimer(Sender: TObject); +begin + if Assigned(OnTimer) then + begin + OnTimer(Self); + end; +end; + procedure TSplashScreen.ApplyChanges; begin { "Refresh;" ist nicht public, deswegen hier eine Referenz. @@ -573,51 +1039,47 @@ end; procedure TSplashScreen.Refresh; begin { TSplashForm -> TForm } - FormObject.BorderStyle := SplashForm.BorderStyle; - FormObject.BorderIcons := SplashForm.BorderIcons; - FormObject.Left := SplashForm.Left; - FormObject.Top := SplashForm.Top; - FormObject.Width := SplashForm.Width; - FormObject.Height := SplashForm.Height; - FormObject.Align := SplashForm.Align; - FormObject.AlphaBlend := SplashForm.AlphaBlend; - FormObject.AlphaBlendValue := SplashForm.AlphaBlendValue; - FormObject.Caption := SplashForm.Caption; - FormObject.Color := SplashForm.Color; - FormObject.Enabled := SplashForm.Enabled; - FormObject.WindowState := SplashForm.WindowState; - FormObject.Position := SplashForm.Position; - FormObject.Cursor := SplashForm.Cursor; + SplashForm.FormObject.BorderStyle := SplashForm.BorderStyle; + SplashForm.FormObject.BorderIcons := SplashForm.BorderIcons; + SplashForm.FormObject.Left := SplashForm.Left; + SplashForm.FormObject.Top := SplashForm.Top; + SplashForm.FormObject.Width := SplashForm.Width; + SplashForm.FormObject.Height := SplashForm.Height; + SplashForm.FormObject.Align := SplashForm.Align; + SplashForm.FormObject.AlphaBlend := SplashForm.AlphaBlend; + SplashForm.FormObject.AlphaBlendValue := SplashForm.AlphaBlendValue; + SplashForm.FormObject.Caption := SplashForm.Caption; + SplashForm.FormObject.Color := SplashForm.Color; + SplashForm.FormObject.Enabled := SplashForm.Enabled; + SplashForm.FormObject.WindowState := SplashForm.WindowState; + SplashForm.FormObject.Position := SplashForm.Position; + SplashForm.FormObject.Cursor := SplashForm.Cursor; { TSplashProgressBar -> TProgressBar } - ProgressBarObject.Left := SplashProgressBar.Left; - ProgressBarObject.Top := SplashProgressBar.Top; - ProgressBarObject.Width := SplashProgressBar.Width; - ProgressBarObject.Height := SplashProgressBar.Height; - ProgressBarObject.Visible := SplashProgressBar.Visible; - ProgressBarObject.Position := SplashProgressBar.Position; - ProgressBarObject.Max := SplashProgressBar.Max; - ProgressBarObject.Min := SplashProgressBar.Min; - ProgressBarObject.Cursor := FormObject.Cursor; - ProgressBarObject.Align := SplashProgressBar.Align; - ProgressBarObject.BackgroundColor := SplashProgressBar.BackgroundColor; - ProgressBarObject.BarColor := SplashProgressBar.BarColor; - ProgressBarObject.State := SplashProgressBar.State; - ProgressBarObject.Style := SplashProgressBar.Style; - ProgressBarObject.Smooth := SplashProgressBar.Smooth; - ProgressBarObject.SmoothReverse := SplashProgressBar.SmoothReverse; - ProgressBarObject.MarqueeInterval := SplashProgressBar.MarqueeInterval; - ProgressBarObject.Step := SplashProgressBar.Step; + SplashProgressBar.ProgressBarObject.Left := SplashProgressBar.Left; + SplashProgressBar.ProgressBarObject.Top := SplashProgressBar.Top; + SplashProgressBar.ProgressBarObject.Width := SplashProgressBar.Width; + SplashProgressBar.ProgressBarObject.Height := SplashProgressBar.Height; + SplashProgressBar.ProgressBarObject.Visible := SplashProgressBar.Visible; + SplashProgressBar.ProgressBarObject.Position := SplashProgressBar.Position; + SplashProgressBar.ProgressBarObject.Max := SplashProgressBar.Max; + SplashProgressBar.ProgressBarObject.Min := SplashProgressBar.Min; + SplashProgressBar.ProgressBarObject.Cursor := SplashForm.FormObject.Cursor; + SplashProgressBar.ProgressBarObject.Align := SplashProgressBar.Align; + SplashProgressBar.ProgressBarObject.BackgroundColor := SplashProgressBar.BackgroundColor; + SplashProgressBar.ProgressBarObject.BarColor := SplashProgressBar.BarColor; + SplashProgressBar.ProgressBarObject.State := SplashProgressBar.State; + SplashProgressBar.ProgressBarObject.Style := SplashProgressBar.Style; + SplashProgressBar.ProgressBarObject.Smooth := SplashProgressBar.Smooth; + SplashProgressBar.ProgressBarObject.SmoothReverse := SplashProgressBar.SmoothReverse; + SplashProgressBar.ProgressBarObject.MarqueeInterval := SplashProgressBar.MarqueeInterval; + SplashProgressBar.ProgressBarObject.Step := SplashProgressBar.Step; { TSplashImage -> TImage } - ImageObject.Visible := SplashImage.Visible; - ImageObject.Transparent := SplashImage.Transparent; - ImageObject.Picture := SplashImage.Picture; + SplashImage.ImageObject.Visible := SplashImage.Visible; + SplashImage.ImageObject.Transparent := SplashImage.Transparent; + SplashImage.ImageObject.Picture := SplashImage.Picture; { TSplashTimer -> TTimer } - TimerObject.Enabled := SplashTimer.Enabled; - TimerObject.Interval := SplashTimer.Interval; - if Assigned(OnChange) then - begin - OnChange(Self); - end; + SplashTimer.TimerObject.Enabled := SplashTimer.Enabled; + SplashTimer.TimerObject.Interval := SplashTimer.Interval; end; procedure TSplashScreen.Reset; @@ -671,28 +1133,52 @@ procedure TSplashScreen.SetVisible(Value: Boolean); begin if Value = True then begin - Show; + if SplashForm.FormObject.Visible = False then + begin + Show; + end; end else begin - Hide; + if SplashForm.FormObject.Visible = True then + begin + Hide; + end; end; end; -procedure TSplashScreen.FormObjectShow(Sender: TObject); +procedure TSplashScreen.SetSplashForm(Value: TSplashForm); begin - //... -end; - -procedure TSplashScreen.FormObjectHide(Sender: TObject); -begin - //... -end; - -procedure TSplashScreen.TimerObjectTimer(Sender: TObject); -begin - if Assigned(OnTimer) then + FSplashForm.Assign(Value); + if Assigned(OnChange) then begin - OnTimer(Self); + OnChange(Self); + end; +end; + +procedure TSplashScreen.SetSplashProgressBar(Value: TSplashProgressBar); +begin + FSplashProgressBar.Assign(Value); + if Assigned(OnChange) then + begin + OnChange(Self); + end; +end; + +procedure TSplashScreen.SetSplashImage(Value: TSplashImage); +begin + FSplashImage.Assign(Value); + if Assigned(OnChange) then + begin + OnChange(Self); + end; +end; + +procedure TSplashScreen.SetSplashTimer(Value: TSplashTimer); +begin + FSplashTimer.Assign(Value); + if Assigned(OnChange) then + begin + OnChange(Self); end; end; @@ -700,19 +1186,19 @@ procedure TSplashScreen.AnimationTimerShowTimer(Sender: TObject); begin if Animation = ssaShallow then begin - if FormObject.AlphaBlendValue < SplashForm.AlphaBlendValue then + if SplashForm.FormObject.AlphaBlendValue < SplashForm.AlphaBlendValue then begin - if SplashForm.AlphaBlendValue - FormObject.AlphaBlendValue < AnimationSpeed then + if SplashForm.AlphaBlendValue - SplashForm.FormObject.AlphaBlendValue < AnimationSpeed then begin - FormObject.AlphaBlendValue := FormObject.AlphaBlendValue + (SplashForm.AlphaBlendValue - FormObject.AlphaBlendValue); + SplashForm.FormObject.AlphaBlendValue := SplashForm.FormObject.AlphaBlendValue + (SplashForm.AlphaBlendValue - SplashForm.FormObject.AlphaBlendValue); end else begin - FormObject.AlphaBlendValue := FormObject.AlphaBlendValue + AnimationSpeed; + SplashForm.FormObject.AlphaBlendValue := SplashForm.FormObject.AlphaBlendValue + AnimationSpeed; end; end else begin AnimationTimerShow.Enabled := False; - FormObject.AlphaBlend := SplashForm.AlphaBlend; + SplashForm.FormObject.AlphaBlend := SplashForm.AlphaBlend; end; end; end; @@ -721,20 +1207,20 @@ procedure TSplashScreen.AnimationTimerHideTimer(Sender: TObject); begin if Animation = ssaShallow then begin - if FormObject.AlphaBlendValue > 0 then + if SplashForm.FormObject.AlphaBlendValue > 0 then begin - if FormObject.AlphaBlendValue < AnimationSpeed then + if SplashForm.FormObject.AlphaBlendValue < AnimationSpeed then begin - FormObject.AlphaBlendValue := FormObject.AlphaBlendValue - FormObject.AlphaBlendValue; + SplashForm.FormObject.AlphaBlendValue := SplashForm.FormObject.AlphaBlendValue - SplashForm.FormObject.AlphaBlendValue; end else begin - FormObject.AlphaBlendValue := FormObject.AlphaBlendValue - AnimationSpeed; + SplashForm.FormObject.AlphaBlendValue := SplashForm.FormObject.AlphaBlendValue - AnimationSpeed; end; end else begin AnimationTimerHide.Enabled := False; - FormObject.AlphaBlend := SplashForm.AlphaBlend; - FormObject.Hide; + SplashForm.FormObject.AlphaBlend := SplashForm.AlphaBlend; + SplashForm.FormObject.Hide; end; end; end; @@ -757,7 +1243,10 @@ end; procedure TComponentManager.Update; begin - //... + if Assigned(OnUpdate) then + begin + OnUpdate(Self); + end; end; { ---------------------------------------------------------------------------- @@ -781,7 +1270,6 @@ end; procedure TProgressBarManager.Update; begin - inherited; if Assigned(Target) = False then begin Exit; @@ -802,10 +1290,7 @@ begin begin Target.Position := (Target.Max div 100) * SourceDownload.GetProgressPercent; end; - if Assigned(OnUpdate) then - begin - OnUpdate(Self); - end; + inherited; end; procedure TProgressBarManager.SetTarget(Value: TProgressBar); @@ -861,7 +1346,6 @@ end; procedure TListBoxManager.Update; begin - inherited; if Assigned(Target) = False then begin Exit; @@ -883,10 +1367,7 @@ begin FilteredList.Filter := SourceComboBox.Text; end; Target.Items.Assign(FilteredList.FilteredStrings); - if Assigned(OnUpdate) then - begin - OnUpdate(Self); - end; + inherited; end; procedure TListBoxManager.LoadList; @@ -957,14 +1438,21 @@ end; constructor TParamReference.Create; begin FFormat := TParamFormat.Create; + Connector := AConnector; end; destructor TParamReference.Destroy; begin + FConnector := nil; FFormat.Free; inherited; end; +procedure TParamReference.Update; +begin + //... +end; + { ---------------------------------------------------------------------------- TParamDefiner ---------------------------------------------------------------------------- } diff --git a/Source/uSysTools.pas b/Source/uSysTools.pas index 3234f59..3319c39 100644 --- a/Source/uSysTools.pas +++ b/Source/uSysTools.pas @@ -83,6 +83,11 @@ type function ArrayPos(const AValue: String; const AArray: array of String): Integer; overload; function ArrayPos(const AValue: Integer; const AArray: array of Integer): Integer; overload; function ArrayPos(const AValue: Extended; const AArray: array of Extended): Integer; overload; + { TComponent Laden/Speichern } + procedure SaveComponentToFile(const FileName: String; Component: TComponent); + procedure LoadComponentFromFile(const FileName: String; Component: TComponent); + procedure SaveComponentToStream(var Stream: TStream; Component: TComponent); + procedure LoadComponentFromStream(Stream: TStream; Component: TComponent); { Sonstige } function SecToTime(const Sec: Cardinal): TTime; function SystemLanguage: String; @@ -143,6 +148,40 @@ begin Result := (Ceil(Value) = Floor(Value)); end; +procedure SaveComponentToFile(const FileName: String; Component: TComponent); +var + FS: TFileStream; +begin + FS := TFileStream.Create(FileName,fmCreate); + try + FS.WriteComponentRes(Component.Name,Component); + finally + FS.Free; + end; +end; + +procedure LoadComponentFromFile(const FileName: String; Component: TComponent); +var + FS: TFileStream; +begin + FS := TFileStream.Create(FileName,fmOpenRead or fmShareDenyNone); + try + FS.ReadComponentRes(Component); + finally + FS.Free; + end; +end; + +procedure SaveComponentToStream(var Stream: TStream; Component: TComponent); +begin + Stream.WriteComponentRes(Component.Name,Component); +end; + +procedure LoadComponentFromStream(Stream: TStream; Component: TComponent); +begin + Stream.ReadComponentRes(Component); +end; + function SecToTime(const Sec: Cardinal): TTime; var TH, TM, TS: String; @@ -295,7 +334,6 @@ begin end; end; - function FontSizeToHeight(Size: Integer; PpI: Integer): Integer; begin Result := - Size * PpI div 72; diff --git a/Source/uWebCtrls.pas b/Source/uWebCtrls.pas index 1b775d9..3597934 100644 --- a/Source/uWebCtrls.pas +++ b/Source/uWebCtrls.pas @@ -65,8 +65,8 @@ type function GetProgressPercent: Byte; { Herunterladen } function GetText: String; - procedure SaveToFile(FileName: TFileName); - procedure SaveToStream(Stream: TStream); + procedure SaveToFile(const FileName: TFileName); + procedure SaveToStream(var Stream: TStream); published { Published-Deklarationen } { Ereignisse } @@ -316,12 +316,12 @@ begin Result := idHTTPObject.Get(Address); end; -procedure TDownload.SaveToFile(FileName: TFileName); +procedure TDownload.SaveToFile(const FileName: TFileName); var FS: TFileStream; begin Prepare; - FS := TFileStream.Create(FileName, fmCreate or fmShareDenyWrite); + FS := TFileStream.Create(FileName,fmCreate or fmShareDenyWrite); try idHTTPObject.Get(Address,FS); finally @@ -329,7 +329,7 @@ begin end; end; -procedure TDownload.SaveToStream(Stream: TStream); +procedure TDownload.SaveToStream(var Stream: TStream); begin Prepare; idHTTPObject.Get(Address,Stream);