From 9dbb1764b91c369b35440f2b3df10342de325655 Mon Sep 17 00:00:00 2001 From: gbamber Date: Wed, 14 Dec 2016 14:56:19 +0000 Subject: [PATCH] Changed folder structure git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5492 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../aboutlongtimerunit.pas | 1248 ++++++++--------- .../demo/longtimerdemo.ico | Bin .../demo/longtimerdemo.lpi | 326 ++--- .../demo/longtimerdemo.lpr | 42 +- .../latest_stable/demo/longtimerdemo.lps | 229 +++ .../demo/longtimerdemo.res | Bin .../{ => latest_stable}/demo/umainform.lfm | 374 ++--- .../{ => latest_stable}/demo/umainform.pas | 0 .../longtimer/{ => latest_stable}/license.lrs | 0 .../locale/aboutlongtimerunit.po | 0 .../{ => latest_stable}/longtimer_icon.lrs | 134 +- .../{ => latest_stable}/longtimerpackage.lpk | 0 .../{ => latest_stable}/longtimerpackage.pas | 44 +- .../longtimer/{ => latest_stable}/readme.txt | 54 +- .../{ => latest_stable}/ulongtimer.pas | 0 15 files changed, 1340 insertions(+), 1111 deletions(-) rename components/longtimer/{ => latest_stable}/aboutlongtimerunit.pas (97%) rename components/longtimer/{ => latest_stable}/demo/longtimerdemo.ico (100%) rename components/longtimer/{ => latest_stable}/demo/longtimerdemo.lpi (96%) rename components/longtimer/{ => latest_stable}/demo/longtimerdemo.lpr (94%) create mode 100644 components/longtimer/latest_stable/demo/longtimerdemo.lps rename components/longtimer/{ => latest_stable}/demo/longtimerdemo.res (100%) rename components/longtimer/{ => latest_stable}/demo/umainform.lfm (95%) rename components/longtimer/{ => latest_stable}/demo/umainform.pas (100%) rename components/longtimer/{ => latest_stable}/license.lrs (100%) rename components/longtimer/{ => latest_stable}/locale/aboutlongtimerunit.po (100%) rename components/longtimer/{ => latest_stable}/longtimer_icon.lrs (98%) rename components/longtimer/{ => latest_stable}/longtimerpackage.lpk (100%) rename components/longtimer/{ => latest_stable}/longtimerpackage.pas (95%) rename components/longtimer/{ => latest_stable}/readme.txt (95%) rename components/longtimer/{ => latest_stable}/ulongtimer.pas (100%) diff --git a/components/longtimer/aboutlongtimerunit.pas b/components/longtimer/latest_stable/aboutlongtimerunit.pas similarity index 97% rename from components/longtimer/aboutlongtimerunit.pas rename to components/longtimer/latest_stable/aboutlongtimerunit.pas index 206e725d2..c24905a6d 100644 --- a/components/longtimer/aboutlongtimerunit.pas +++ b/components/longtimer/latest_stable/aboutlongtimerunit.pas @@ -1,624 +1,624 @@ -{ TAboutComponent and TAboutBox Component License - - Copyright (C) 2014 Gordon Bamber minesadorada@charcodelvalle.com - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License - for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -} - -// Change the name of this unit and its PAS file to be unique to your component -// Unit Aboutunit -unit AboutLongTimerunit; - -{$mode objfpc}{$H+} - -interface - -uses - Classes, Controls, Dialogs, Forms, Graphics, LResources, SysUtils, - ExtCtrls, StdCtrls, StrUtils,Buttons,PropEdits; -const - C_DEFAULTLICENSEFORMWIDTH = 500; - C_DEFAULTLICENSEFORMWIDTH_LINUX = C_DEFAULTLICENSEFORMWIDTH + 100; - C_DEFAULTLICENSEFORMHEIGHT = 400; - C_DEFAULTLICENSEFORMHEIGHT_LINUX = C_DEFAULTLICENSEFORMHEIGHT + 50; - -type - TLicenseType = (abNone, abGPL, abLGPL, abMIT, abModifiedGPL, abProprietry); - tAboutBox=Class; // Forward declaration - // Do Search/Replace to change all instances of TAboutComonent - // to TAbout - TAboutLongTimer = class(TCustomIdleTimer) - // This class can descend from any component class (TGraphicControl etc - private - { Private declarations } - fAboutBox: tAboutBox; - procedure SetMyComponentName(Const Avalue:String); - procedure SetAboutBoxWidth(Const AValue:Integer); - procedure SetAboutBoxHeight(Const AValue:Integer); - procedure SetAboutBoxDescription(Const AValue:String); - procedure SetAboutBoxFontName(Const AValue:String); - procedure SetAboutBoxFontSize(Const AValue:Integer); - procedure SetAboutBoxBitmap(Const AValue:TBitmap); - procedure SetAboutBoxBackgroundColor(Const AValue:TColor); - procedure SetAboutBoxTitle(Const AValue:String); - - procedure SetAboutBoxVersion(Const AValue:String); - procedure SetAboutBoxAuthorname(Const AValue:String); - procedure SetAboutBoxOrganisation(Const AValue:String); - procedure SetAboutBoxAuthorEmail(Const AValue:String); - procedure SetAboutBoxBackgroundResourceName(Const AValue:String); - procedure SetAboutBoxLicenseType(Const AValue:String); - procedure SetAboutBoxStretchBackgroundImage(Const AValue:Boolean); - protected - { Protected declarations } - public - { Public declarations } - constructor Create(AOwner: TComponent); override; // Constructor must be public - destructor Destroy; override; // Destructor must be public - - // Set these (hidden) properties in your inherited component's Create procedure - property AboutBoxComponentName:String write SetMyComponentName; - property AboutBoxWidth:Integer write SetAboutBoxWidth; - property AboutBoxHeight:Integer write SetAboutBoxHeight; - property AboutBoxDescription:String write SetAboutBoxDescription; - property AboutBoxFontName:String write SetAboutBoxFontName; - property AboutBoxFontSize:Integer write SetAboutBoxFontSize; - property AboutBoxBackgroundColor:TColor write SetAboutBoxBackgroundColor; - property AboutBoxTitle:String write SetAboutBoxTitle; - - property AboutBoxVersion:String write SetAboutBoxVersion; - property AboutBoxAuthorname:String write SetAboutBoxAuthorname; - property AboutBoxOrganisation:String write SetAboutBoxOrganisation; - property AboutBoxAuthorEmail:String write SetAboutBoxAuthorEmail; - property AboutBoxLicenseType:String write SetAboutBoxLicenseType; - property AboutBoxBackgroundResourceName:String write SetAboutBoxBackgroundResourceName; - property AboutBoxStretchBackgroundImage:Boolean write SetAboutBoxStretchBackgroundImage; - published - // The clickable 'About' property will automaticcally appear in any component - // descended from TAboutLongTimer - - // About this component... - property About: tAboutBox read fAboutBox write fAboutBox; - end; - TAboutbox = class(TComponent) - private - { Private declarations } - fDialog: TForm; - fBackgroundbitmap: TBitMap; - fBackgroundResourceName:String; - fDescription: TStrings; - fDialogTitle, fVersion, fAuthorname, fAuthorEmail, fOrganisation, - fComponentName: string; - fDialogHeight, fDialogWidth: integer; - fStretchBackground: boolean; - fFont: TFont; - fColor: TColor; - fLicenseType: TLicenseType; - procedure SetBackgroundBitmap(const AValue: TBitMap); - procedure SetDescriptionStrings(const AValue: TStrings); - procedure SetFont(const AValue: TFont); - procedure ShowLicense(Sender: TObject); - procedure SetDialogTitle(Const AValue:String); - protected - { Protected declarations } - public - { Public declarations } - procedure ShowDialog; - constructor Create(AOwner: TComponent); override; - destructor Destroy; override; - published - { Published declarations } - // Set these properties in your component Constructor method - property BackGround: TBitMap read fBackgroundbitmap write SetBackgroundBitmap; - property BackgroundResourceName:String read fBackgroundResourceName write fBackgroundResourceName; - property Description: TStrings read fDescription write SetDescriptionStrings; - property Title: string read fDialogTitle write SetDialogTitle; - property Height: integer read fDialogHeight write fDialogHeight; - property Width: integer read fDialogWidth write fDialogWidth; - property Font: TFont read fFont write SetFont; - property BackGroundColor: TColor read fColor write fColor; - property StretchBackground: boolean read fStretchBackground - write fStretchBackground default False; - property Version: string read fVersion write fVersion; - property Authorname: string read fAuthorname write fAuthorname; - property Organisation: string read fOrganisation write fOrganisation; - property AuthorEmail: string read fAuthorEmail write fAuthorEmail; - property ComponentName: string read fComponentName write fComponentName; - property LicenseType: TLicenseType read fLicenseType write fLicenseType; - end; - - // Declaration for the 'About' property editor - TAboutPropertyEditor = class(TClassPropertyEditor) - public - procedure Edit; override; - function GetAttributes: TPropertyAttributes; override; - end; - -procedure Register; - -{For i8n if required} -resourcestring - rs_Componentname='Component name'; - rs_About='About'; - rs_License='License'; - rs_By='By'; - rs_For='For'; - rs_DatafileMissing='Resource datafile license.lrs is missing'; - rs_LicenseTextError='There is something wrong with the Licence text'; - rs_AboutBoxError = 'Subcomponent TAboutBox Error'; - - -implementation - -{ TABoutBox} - -constructor TAboutbox.Create(AOwner: TComponent); -begin - inherited Create(AOwner); - fBackgroundbitmap := TBitMap.Create; - fDescription := TStringList.Create; - fFont := TFont.Create; - fColor := clDefault; - fLicenseType := abNone; - fComponentName:=rs_Componentname; - fDialogTitle:=rs_About + ' ' + fComponentName; - - fDialogWidth:=320; - fDialogHeight:=280; - fVersion:='1.0.0.0'; - fLicenseType:=abNone; -end; - -destructor TAboutbox.Destroy; -begin - FreeAndNil(fFont); - FreeAndNil(fDescription); - FreeAndNil(fBackgroundbitmap); - inherited Destroy; -end; -procedure TAboutbox.SetDialogTitle(Const AValue:String); -begin - if AnsiContainsText(fDialogTitle, rs_About) then - fDialogTitle := AValue - else - fDialogTitle := rs_About + ' ' + Avalue; -end; - -procedure TAboutbox.ShowDialog; -var - OKbutton, LicenseButton: TBitBtn; - lbl_Description: TLabel; - img_BackGround: TImage; - sz: string; - iCount: integer; - r:TLResource; -begin - fDialog := TForm.CreateNew(nil); - try //.. finally FreeAndNil everything - with fDialog do - begin - // Set Dialog properties - position := poScreenCenter; - borderstyle := bsToolWindow; - Caption := fDialogTitle; - formstyle := fsSystemStayOnTop; - color := fColor; - font := fFont; - if (fDialogHeight > 0) then - Height := fDialogHeight - else - Height := 240; - if (fDialogWidth > 0) then - Width := fDialogWidth - else - Width := 320; - - // Create a background image - img_BackGround := Timage.Create(fDialog); - with img_BackGround do - // Set img_BackGround properties - begin - Align := alClient; - Stretch := fStretchBackground; - // Bitmap assigned? - if Assigned(fBackgroundbitmap) then - Picture.Assign(fBackgroundbitmap); - // Resource file? - r := LazarusResources.Find(fBackgroundResourceName); - if r <> nil then - img_BackGround.Picture.LoadFromLazarusResource(fBackgroundResourceName); - SendToBack; - parent := fDialog; - end; - - // Create a BitBtn button - okbutton := TBitBtn.Create(fDialog); - // Set BitBtn properties - with okButton do - begin - Kind := bkClose; - left := (fDialog.Width div 2) - Width div 2; - top := fDialog.Height - Height - 10; - ParentFont:=False; - parent := fDialog; - end; - - // Create a License Button - LicenseButton := TBitBtn.Create(fDialog); - if (fLicenseType <> abNone) then - // Put it on the right - begin - LicenseButton.Top := OKButton.Top; - LicenseButton.Caption := rs_License + '...'; - LicenseButton.left := Width - LicenseButton.Width - 10; - LicenseButton.OnClick := @ShowLicense; - LicenseButton.ParentFont:=False; - LicenseButton.Parent := fDialog; - end; - - - // Create a label control - lbl_Description := Tlabel.Create(fDialog); - // Set label properties - with lbl_Description do - begin - left := 8; - Top := 30; - Width := fDialog.Width - 8; - Height := fDialog.Height - 30; - Autosize := False; - ParentFont := True; - Alignment := taCenter; - end; - - // Build up Label text - sz := ''; - // Component name - if fComponentName <> '' then - sz += fComponentName + LineEnding; - // Author name (+Email) - if fAuthorname <> '' then - sz += rs_By + ': ' + fAuthorname + LineEnding; - if fAuthorEmail <> '' then - sz += ' (' + fAuthorEmail + ')' + LineEnding - else - sz += LineEnding; - - sz += LineEnding; - - // Version - if fVersion <> '' then - sz += 'Version: ' + fVersion + LineEnding; - // License - case fLicenseType of - abGPL: sz += rs_License + ': GPL' + LineEnding; - abLGPL: sz += rs_License + ': LGPL' + LineEnding; - abMIT: sz += rs_License + ': M.I.T.' + LineEnding; - abModifiedGPL: sz += rs_License + ': Modified GPL' + LineEnding; - abProprietry: sz += rs_License + ': Proprietry' + LineEnding; - end; - if fOrganisation <> '' then - sz += rs_For + ': ' + fOrganisation + LineEnding; - if fDescription.Count > 0 then - begin - sz += LineEnding; - for iCount := 1 to fDescription.Count do - sz += fDescription[iCount - 1] + LineEnding; - end; - - lbl_Description.Caption := sz; - lbl_Description.parent := fDialog; - // Display the dialog modally - ShowModal; - end; - finally - // Free all resources - FreeAndNil(img_BackGround); - FreeAndNil(lbl_Description); - FreeAndNil(LicenseButton); - FreeAndNil(okbutton); - end; -end; - -procedure TAboutbox.ShowLicense(Sender: TObject); -// Triggered by License button Click -var - sLicenseString: string; - theList: TStringList; - f: integer; - LicenceForm: TForm; - lblText: TLabel; - closebuttton: TBitBtn; - r: TLResource; - szLicenseFile: string; -begin - // Quit early? - if fLicenseType = abNone then - Exit; - - // Set to resource name in license.lrs - case fLicenseType of - abNone: szLicenseFile := ''; - abGPL: szLicenseFile := 'gpl.txt'; - abLGPL: szLicenseFile := 'lgpl.txt'; - abMIT: szLicenseFile := 'mit.txt'; - abModifiedgpl: szLicenseFile := 'modifiedgpl.txt'; - end; - - - // Use a string list to split the text file into lines - theList := TStringList.Create; - // Create a window, label and close button on-the-fly - LicenceForm := TForm.Create(nil); - lblText := TLabel.Create(LicenceForm); - closebuttton := TBitBtn.Create(LicenceForm); - // Load up the text into variable 'sLicenseString' - sLicenseString := LineEnding + LineEnding + fComponentName + LineEnding; - try - try - begin - // Load license text from resource string - r := LazarusResources.Find(szLicenseFile); - if r = nil then - raise Exception.Create(rs_DatafileMissing); - thelist.Add(r.Value); - for f := 0 to TheList.Count - 1 do - sLicenseString += TheList[f] + LineEnding; - end; - except - On e: Exception do - MessageDlg(rs_AboutBoxError, - rs_LicenseTextError, mtError, [mbOK], 0); - end; - - // Replace boilerplate text if possible - sLicenseString := AnsiReplaceText(sLicenseString, '', -{$I %DATE%} - ); - sLicenseString := AnsiReplaceText(sLicenseString, '', fAuthorname); - sLicenseString := AnsiReplaceText(sLicenseString, '', - '(' + fAuthorEmail + ')'); - sLicenseString := AnsiReplaceText(sLicenseString, '', - fOrganisation); - - // Make up the form window and controls - with LicenceForm do - begin - // Form - {$IFDEF WINDOWS} - // More compact GUI? - Width := C_DEFAULTLICENSEFORMWIDTH; - Height := C_DEFAULTLICENSEFORMHEIGHT; - {$ELSE WINDOWS} - Width := C_DEFAULTLICENSEFORMWIDTH_LINUX; - Height := C_DEFAULTLICENSEFORMHEIGHT_LINUX; - {$ENDIF} - // autosize:=true; - // If you enable autosize, the button placement goes awry! - - // The Modified GPL has an extra clause - if (szLicenseFile = 'modifiedgpl.txt') or - (Pos('As a special exception', sLicenseString) > 0) then - Height := Height + 100; - position := poScreenCenter; - borderstyle := bsToolWindow; - Caption := fComponentName + ': Licensing'; - formstyle := fsSystemStayOnTop; - - // Label - lblText.Align := alClient; - lblText.Alignment := taCenter; - lblText.Caption := sLicenseString; - lblText.Parent := LicenceForm; - - // Close Button - closebuttton.Kind := bkClose; - closebuttton.left := (Width div 2) - closebuttton.Width div 2; - closebuttton.top := Height - closebuttton.Height - 10; - closebuttton.parent := LicenceForm; - // Show modally over the existing modal form - PopupParent := TForm(Sender); - ShowModal; - end; - finally - // Free up all component created resources from memory - FreeAndNil(theList); - FreeAndNil(lblText); - FreeAndNil(closebuttton); - FreeAndNil(LicenceForm); - end; -end; - -procedure TAboutbox.SetBackgroundBitmap(const AValue: TBitMap); -begin - if Assigned(AValue) then - fBackgroundbitmap.Assign(AValue); -end; - -procedure TAboutbox.SetDescriptionStrings(const AValue: TStrings); -begin - if Assigned(AValue) then - fDescription.Assign(Avalue); -end; - -procedure TAboutbox.SetFont(const AValue: TFont); -begin - if Assigned(AValue) then - fFont.Assign(AValue); -end; - -{ TAboutLongTimer } - -procedure Register; -begin - RegisterPropertyEditor(TypeInfo(TAboutbox), - TAboutLongTimer, 'About', TAboutPropertyEditor); -end; - -procedure TAboutPropertyEditor.Edit; -// Communicate with the component properties -Var - AAboutBox:TAboutBox; -begin - AAboutBox:=TAboutBox(GetObjectValue(TAboutBox)); - AABoutBox.ShowDialog; -end; - -function TAboutPropertyEditor.GetAttributes: TPropertyAttributes; - // Show the ellipsis -begin - Result := [paDialog, paReadOnly]; -end; - -// Sets for AboutBox dialog properties -procedure TAboutLongTimer.SetMyComponentName(Const Avalue:String); -begin - fAboutBox.ComponentName:=AValue; - fAboutBox.Title:=AValue; -end; -procedure TAboutLongTimer.SetAboutBoxWidth(Const AValue:Integer); -begin - fAboutBox.Width:=Avalue; -end; -procedure TAboutLongTimer.SetAboutBoxHeight(Const AValue:Integer); -begin - fAboutBox.Height:=Avalue; -end; -procedure TAboutLongTimer.SetAboutBoxDescription(Const AValue:String); -begin - fAboutBox.Description.Clear; - fAboutBox.Description.Add(AValue); -end; -procedure TAboutLongTimer.SetAboutBoxFontName(Const AValue:String); -begin - fAboutBox.Font.Name:=AValue; -end; -procedure TAboutLongTimer.SetAboutBoxFontSize(Const AValue:Integer); -begin - if (AValue > 6) then fAboutBox.Font.Size:=AValue; -end; -procedure TAboutLongTimer.SetAboutBoxTitle(Const AValue:String); -begin - fAboutBox.Title:=AValue; -end; -procedure TAboutLongTimer.SetAboutBoxBitmap(Const AValue:TBitmap); -begin - If Assigned(Avalue) then fAboutBox.Assign(AValue); -end; -procedure TAboutLongTimer.SetAboutBoxBackgroundColor(Const AValue:TColor); -begin - fAboutBox.BackGroundColor:=AValue;; -end; -procedure TAboutLongTimer.SetAboutBoxVersion(Const AValue:String); -begin - fAboutBox.Version:=AValue; -end; -procedure TAboutLongTimer.SetAboutBoxAuthorname(Const AValue:String); -begin - fAboutBox.Authorname:=AValue; -end; -procedure TAboutLongTimer.SetAboutBoxOrganisation(Const AValue:String); -begin - fAboutBox.Organisation:=AValue; -end; -procedure TAboutLongTimer.SetAboutBoxAuthorEmail(Const AValue:String); -begin - fAboutBox.AuthorEmail:=AValue; -end; -procedure TAboutLongTimer.SetAboutBoxBackgroundResourceName(Const AValue:String); -begin - fAboutBox.BackgroundResourceName:=AValue; -end; -procedure TAboutLongTimer.SetAboutBoxLicenseType(Const AValue:string); -begin - Case Upcase(AValue) of - 'GPL':fAboutBox.LicenseType:=abGPL; - 'LGPL':fAboutBox.LicenseType:=abLGPL; - 'MIT':fAboutBox.LicenseType:=abMIT; - 'MODIFIEDGPL':fAboutBox.LicenseType:=abModifiedGPL; - 'PROPRIETRY':fAboutBox.LicenseType:=abProprietry; - else - fAboutBox.LicenseType:=abNone; - end; -end; -procedure TAboutLongTimer.SetAboutBoxStretchBackgroundImage(Const AValue:Boolean); -begin - fAboutBox.StretchBackground:=AValue; -end; - -// End Sets - -constructor TAboutLongTimer.Create(AOwner: TComponent); -var - TempImage: TPicture; - r:TLResource; -begin - // Inherit default properties - inherited Create(AOwner); - // Use tAboutBox as a subcomponent - fAboutBox := tAboutBox.Create(nil); - with fAboutBox do - begin - SetSubComponent(True); // Tell the IDE to store the modified properties - // Default of TAboutLongTimer values override TAbouBox.Create defaults - ComponentName := 'TAboutLongTimer'; - Description.Add('This is to demonstrate'); //TStrings - Description.Add('the use of TAboutLongTimer'); //TStrings - Description.Add('Set its properties in your Constructor'); //TStrings - Width := 320; //Integer - Height := 280; //Integer - // Set any Font properties or subproperties here - // Font.Name := 'Arial'; - Font.Color := clNavy; - Font.Size:=10; - // BackGroundColor shows if no BackGround image is set - BackGroundColor := clWindow; - Version := '1.0.0.0'; - AuthorName := 'Gordon Bamber'; - AuthorEmail := 'minesadorada@charcodelvalle.com'; - Organisation := 'Public Domain'; - - //Types available: abNone, abGPL, abLGPL, abMIT, abModifiedGPL, abProprietry - LicenseType := abLGPL; - - // BackGround image is optional - // It must be in a resouce file in the initialization section - - //== How to set a background image to your About dialog -- - // The BackGround property is a TBitmap - // Use a Temporary TPicture to load a JPG. - // NOTE a PNG file will create an error when your component is used in an application! - r := LazarusResources.Find(fAboutBox.BackgroundResourceName); - if r <> nil then - begin - TempImage := TPicture.Create; - // .lrs file is in the initialization section - TempImage.LoadFromLazarusResource(fAboutBox.BackgroundResourceName); - BackGround.Assign(TempImage.Bitmap); - TempImage.Free; - StretchBackground := fAboutBox.StretchBackground; //Boolean - end; -end; -end; - -destructor TAboutLongTimer.Destroy; -begin - FreeAndNil(fAboutBox); - inherited Destroy; -end; -initialization -{$I license.lrs} - -end. +{ TAboutComponent and TAboutBox Component License + + Copyright (C) 2014 Gordon Bamber minesadorada@charcodelvalle.com + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License + for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +} + +// Change the name of this unit and its PAS file to be unique to your component +// Unit Aboutunit +unit AboutLongTimerunit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, Controls, Dialogs, Forms, Graphics, LResources, SysUtils, + ExtCtrls, StdCtrls, StrUtils,Buttons,PropEdits; +const + C_DEFAULTLICENSEFORMWIDTH = 500; + C_DEFAULTLICENSEFORMWIDTH_LINUX = C_DEFAULTLICENSEFORMWIDTH + 100; + C_DEFAULTLICENSEFORMHEIGHT = 400; + C_DEFAULTLICENSEFORMHEIGHT_LINUX = C_DEFAULTLICENSEFORMHEIGHT + 50; + +type + TLicenseType = (abNone, abGPL, abLGPL, abMIT, abModifiedGPL, abProprietry); + tAboutBox=Class; // Forward declaration + // Do Search/Replace to change all instances of TAboutComonent + // to TAbout + TAboutLongTimer = class(TCustomIdleTimer) + // This class can descend from any component class (TGraphicControl etc + private + { Private declarations } + fAboutBox: tAboutBox; + procedure SetMyComponentName(Const Avalue:String); + procedure SetAboutBoxWidth(Const AValue:Integer); + procedure SetAboutBoxHeight(Const AValue:Integer); + procedure SetAboutBoxDescription(Const AValue:String); + procedure SetAboutBoxFontName(Const AValue:String); + procedure SetAboutBoxFontSize(Const AValue:Integer); + procedure SetAboutBoxBitmap(Const AValue:TBitmap); + procedure SetAboutBoxBackgroundColor(Const AValue:TColor); + procedure SetAboutBoxTitle(Const AValue:String); + + procedure SetAboutBoxVersion(Const AValue:String); + procedure SetAboutBoxAuthorname(Const AValue:String); + procedure SetAboutBoxOrganisation(Const AValue:String); + procedure SetAboutBoxAuthorEmail(Const AValue:String); + procedure SetAboutBoxBackgroundResourceName(Const AValue:String); + procedure SetAboutBoxLicenseType(Const AValue:String); + procedure SetAboutBoxStretchBackgroundImage(Const AValue:Boolean); + protected + { Protected declarations } + public + { Public declarations } + constructor Create(AOwner: TComponent); override; // Constructor must be public + destructor Destroy; override; // Destructor must be public + + // Set these (hidden) properties in your inherited component's Create procedure + property AboutBoxComponentName:String write SetMyComponentName; + property AboutBoxWidth:Integer write SetAboutBoxWidth; + property AboutBoxHeight:Integer write SetAboutBoxHeight; + property AboutBoxDescription:String write SetAboutBoxDescription; + property AboutBoxFontName:String write SetAboutBoxFontName; + property AboutBoxFontSize:Integer write SetAboutBoxFontSize; + property AboutBoxBackgroundColor:TColor write SetAboutBoxBackgroundColor; + property AboutBoxTitle:String write SetAboutBoxTitle; + + property AboutBoxVersion:String write SetAboutBoxVersion; + property AboutBoxAuthorname:String write SetAboutBoxAuthorname; + property AboutBoxOrganisation:String write SetAboutBoxOrganisation; + property AboutBoxAuthorEmail:String write SetAboutBoxAuthorEmail; + property AboutBoxLicenseType:String write SetAboutBoxLicenseType; + property AboutBoxBackgroundResourceName:String write SetAboutBoxBackgroundResourceName; + property AboutBoxStretchBackgroundImage:Boolean write SetAboutBoxStretchBackgroundImage; + published + // The clickable 'About' property will automaticcally appear in any component + // descended from TAboutLongTimer + + // About this component... + property About: tAboutBox read fAboutBox write fAboutBox; + end; + TAboutbox = class(TComponent) + private + { Private declarations } + fDialog: TForm; + fBackgroundbitmap: TBitMap; + fBackgroundResourceName:String; + fDescription: TStrings; + fDialogTitle, fVersion, fAuthorname, fAuthorEmail, fOrganisation, + fComponentName: string; + fDialogHeight, fDialogWidth: integer; + fStretchBackground: boolean; + fFont: TFont; + fColor: TColor; + fLicenseType: TLicenseType; + procedure SetBackgroundBitmap(const AValue: TBitMap); + procedure SetDescriptionStrings(const AValue: TStrings); + procedure SetFont(const AValue: TFont); + procedure ShowLicense(Sender: TObject); + procedure SetDialogTitle(Const AValue:String); + protected + { Protected declarations } + public + { Public declarations } + procedure ShowDialog; + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + published + { Published declarations } + // Set these properties in your component Constructor method + property BackGround: TBitMap read fBackgroundbitmap write SetBackgroundBitmap; + property BackgroundResourceName:String read fBackgroundResourceName write fBackgroundResourceName; + property Description: TStrings read fDescription write SetDescriptionStrings; + property Title: string read fDialogTitle write SetDialogTitle; + property Height: integer read fDialogHeight write fDialogHeight; + property Width: integer read fDialogWidth write fDialogWidth; + property Font: TFont read fFont write SetFont; + property BackGroundColor: TColor read fColor write fColor; + property StretchBackground: boolean read fStretchBackground + write fStretchBackground default False; + property Version: string read fVersion write fVersion; + property Authorname: string read fAuthorname write fAuthorname; + property Organisation: string read fOrganisation write fOrganisation; + property AuthorEmail: string read fAuthorEmail write fAuthorEmail; + property ComponentName: string read fComponentName write fComponentName; + property LicenseType: TLicenseType read fLicenseType write fLicenseType; + end; + + // Declaration for the 'About' property editor + TAboutPropertyEditor = class(TClassPropertyEditor) + public + procedure Edit; override; + function GetAttributes: TPropertyAttributes; override; + end; + +procedure Register; + +{For i8n if required} +resourcestring + rs_Componentname='Component name'; + rs_About='About'; + rs_License='License'; + rs_By='By'; + rs_For='For'; + rs_DatafileMissing='Resource datafile license.lrs is missing'; + rs_LicenseTextError='There is something wrong with the Licence text'; + rs_AboutBoxError = 'Subcomponent TAboutBox Error'; + + +implementation + +{ TABoutBox} + +constructor TAboutbox.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + fBackgroundbitmap := TBitMap.Create; + fDescription := TStringList.Create; + fFont := TFont.Create; + fColor := clDefault; + fLicenseType := abNone; + fComponentName:=rs_Componentname; + fDialogTitle:=rs_About + ' ' + fComponentName; + + fDialogWidth:=320; + fDialogHeight:=280; + fVersion:='1.0.0.0'; + fLicenseType:=abNone; +end; + +destructor TAboutbox.Destroy; +begin + FreeAndNil(fFont); + FreeAndNil(fDescription); + FreeAndNil(fBackgroundbitmap); + inherited Destroy; +end; +procedure TAboutbox.SetDialogTitle(Const AValue:String); +begin + if AnsiContainsText(fDialogTitle, rs_About) then + fDialogTitle := AValue + else + fDialogTitle := rs_About + ' ' + Avalue; +end; + +procedure TAboutbox.ShowDialog; +var + OKbutton, LicenseButton: TBitBtn; + lbl_Description: TLabel; + img_BackGround: TImage; + sz: string; + iCount: integer; + r:TLResource; +begin + fDialog := TForm.CreateNew(nil); + try //.. finally FreeAndNil everything + with fDialog do + begin + // Set Dialog properties + position := poScreenCenter; + borderstyle := bsToolWindow; + Caption := fDialogTitle; + formstyle := fsSystemStayOnTop; + color := fColor; + font := fFont; + if (fDialogHeight > 0) then + Height := fDialogHeight + else + Height := 240; + if (fDialogWidth > 0) then + Width := fDialogWidth + else + Width := 320; + + // Create a background image + img_BackGround := Timage.Create(fDialog); + with img_BackGround do + // Set img_BackGround properties + begin + Align := alClient; + Stretch := fStretchBackground; + // Bitmap assigned? + if Assigned(fBackgroundbitmap) then + Picture.Assign(fBackgroundbitmap); + // Resource file? + r := LazarusResources.Find(fBackgroundResourceName); + if r <> nil then + img_BackGround.Picture.LoadFromLazarusResource(fBackgroundResourceName); + SendToBack; + parent := fDialog; + end; + + // Create a BitBtn button + okbutton := TBitBtn.Create(fDialog); + // Set BitBtn properties + with okButton do + begin + Kind := bkClose; + left := (fDialog.Width div 2) - Width div 2; + top := fDialog.Height - Height - 10; + ParentFont:=False; + parent := fDialog; + end; + + // Create a License Button + LicenseButton := TBitBtn.Create(fDialog); + if (fLicenseType <> abNone) then + // Put it on the right + begin + LicenseButton.Top := OKButton.Top; + LicenseButton.Caption := rs_License + '...'; + LicenseButton.left := Width - LicenseButton.Width - 10; + LicenseButton.OnClick := @ShowLicense; + LicenseButton.ParentFont:=False; + LicenseButton.Parent := fDialog; + end; + + + // Create a label control + lbl_Description := Tlabel.Create(fDialog); + // Set label properties + with lbl_Description do + begin + left := 8; + Top := 30; + Width := fDialog.Width - 8; + Height := fDialog.Height - 30; + Autosize := False; + ParentFont := True; + Alignment := taCenter; + end; + + // Build up Label text + sz := ''; + // Component name + if fComponentName <> '' then + sz += fComponentName + LineEnding; + // Author name (+Email) + if fAuthorname <> '' then + sz += rs_By + ': ' + fAuthorname + LineEnding; + if fAuthorEmail <> '' then + sz += ' (' + fAuthorEmail + ')' + LineEnding + else + sz += LineEnding; + + sz += LineEnding; + + // Version + if fVersion <> '' then + sz += 'Version: ' + fVersion + LineEnding; + // License + case fLicenseType of + abGPL: sz += rs_License + ': GPL' + LineEnding; + abLGPL: sz += rs_License + ': LGPL' + LineEnding; + abMIT: sz += rs_License + ': M.I.T.' + LineEnding; + abModifiedGPL: sz += rs_License + ': Modified GPL' + LineEnding; + abProprietry: sz += rs_License + ': Proprietry' + LineEnding; + end; + if fOrganisation <> '' then + sz += rs_For + ': ' + fOrganisation + LineEnding; + if fDescription.Count > 0 then + begin + sz += LineEnding; + for iCount := 1 to fDescription.Count do + sz += fDescription[iCount - 1] + LineEnding; + end; + + lbl_Description.Caption := sz; + lbl_Description.parent := fDialog; + // Display the dialog modally + ShowModal; + end; + finally + // Free all resources + FreeAndNil(img_BackGround); + FreeAndNil(lbl_Description); + FreeAndNil(LicenseButton); + FreeAndNil(okbutton); + end; +end; + +procedure TAboutbox.ShowLicense(Sender: TObject); +// Triggered by License button Click +var + sLicenseString: string; + theList: TStringList; + f: integer; + LicenceForm: TForm; + lblText: TLabel; + closebuttton: TBitBtn; + r: TLResource; + szLicenseFile: string; +begin + // Quit early? + if fLicenseType = abNone then + Exit; + + // Set to resource name in license.lrs + case fLicenseType of + abNone: szLicenseFile := ''; + abGPL: szLicenseFile := 'gpl.txt'; + abLGPL: szLicenseFile := 'lgpl.txt'; + abMIT: szLicenseFile := 'mit.txt'; + abModifiedgpl: szLicenseFile := 'modifiedgpl.txt'; + end; + + + // Use a string list to split the text file into lines + theList := TStringList.Create; + // Create a window, label and close button on-the-fly + LicenceForm := TForm.Create(nil); + lblText := TLabel.Create(LicenceForm); + closebuttton := TBitBtn.Create(LicenceForm); + // Load up the text into variable 'sLicenseString' + sLicenseString := LineEnding + LineEnding + fComponentName + LineEnding; + try + try + begin + // Load license text from resource string + r := LazarusResources.Find(szLicenseFile); + if r = nil then + raise Exception.Create(rs_DatafileMissing); + thelist.Add(r.Value); + for f := 0 to TheList.Count - 1 do + sLicenseString += TheList[f] + LineEnding; + end; + except + On e: Exception do + MessageDlg(rs_AboutBoxError, + rs_LicenseTextError, mtError, [mbOK], 0); + end; + + // Replace boilerplate text if possible + sLicenseString := AnsiReplaceText(sLicenseString, '', +{$I %DATE%} + ); + sLicenseString := AnsiReplaceText(sLicenseString, '', fAuthorname); + sLicenseString := AnsiReplaceText(sLicenseString, '', + '(' + fAuthorEmail + ')'); + sLicenseString := AnsiReplaceText(sLicenseString, '', + fOrganisation); + + // Make up the form window and controls + with LicenceForm do + begin + // Form + {$IFDEF WINDOWS} + // More compact GUI? + Width := C_DEFAULTLICENSEFORMWIDTH; + Height := C_DEFAULTLICENSEFORMHEIGHT; + {$ELSE WINDOWS} + Width := C_DEFAULTLICENSEFORMWIDTH_LINUX; + Height := C_DEFAULTLICENSEFORMHEIGHT_LINUX; + {$ENDIF} + // autosize:=true; + // If you enable autosize, the button placement goes awry! + + // The Modified GPL has an extra clause + if (szLicenseFile = 'modifiedgpl.txt') or + (Pos('As a special exception', sLicenseString) > 0) then + Height := Height + 100; + position := poScreenCenter; + borderstyle := bsToolWindow; + Caption := fComponentName + ': Licensing'; + formstyle := fsSystemStayOnTop; + + // Label + lblText.Align := alClient; + lblText.Alignment := taCenter; + lblText.Caption := sLicenseString; + lblText.Parent := LicenceForm; + + // Close Button + closebuttton.Kind := bkClose; + closebuttton.left := (Width div 2) - closebuttton.Width div 2; + closebuttton.top := Height - closebuttton.Height - 10; + closebuttton.parent := LicenceForm; + // Show modally over the existing modal form + PopupParent := TForm(Sender); + ShowModal; + end; + finally + // Free up all component created resources from memory + FreeAndNil(theList); + FreeAndNil(lblText); + FreeAndNil(closebuttton); + FreeAndNil(LicenceForm); + end; +end; + +procedure TAboutbox.SetBackgroundBitmap(const AValue: TBitMap); +begin + if Assigned(AValue) then + fBackgroundbitmap.Assign(AValue); +end; + +procedure TAboutbox.SetDescriptionStrings(const AValue: TStrings); +begin + if Assigned(AValue) then + fDescription.Assign(Avalue); +end; + +procedure TAboutbox.SetFont(const AValue: TFont); +begin + if Assigned(AValue) then + fFont.Assign(AValue); +end; + +{ TAboutLongTimer } + +procedure Register; +begin + RegisterPropertyEditor(TypeInfo(TAboutbox), + TAboutLongTimer, 'About', TAboutPropertyEditor); +end; + +procedure TAboutPropertyEditor.Edit; +// Communicate with the component properties +Var + AAboutBox:TAboutBox; +begin + AAboutBox:=TAboutBox(GetObjectValue(TAboutBox)); + AABoutBox.ShowDialog; +end; + +function TAboutPropertyEditor.GetAttributes: TPropertyAttributes; + // Show the ellipsis +begin + Result := [paDialog, paReadOnly]; +end; + +// Sets for AboutBox dialog properties +procedure TAboutLongTimer.SetMyComponentName(Const Avalue:String); +begin + fAboutBox.ComponentName:=AValue; + fAboutBox.Title:=AValue; +end; +procedure TAboutLongTimer.SetAboutBoxWidth(Const AValue:Integer); +begin + fAboutBox.Width:=Avalue; +end; +procedure TAboutLongTimer.SetAboutBoxHeight(Const AValue:Integer); +begin + fAboutBox.Height:=Avalue; +end; +procedure TAboutLongTimer.SetAboutBoxDescription(Const AValue:String); +begin + fAboutBox.Description.Clear; + fAboutBox.Description.Add(AValue); +end; +procedure TAboutLongTimer.SetAboutBoxFontName(Const AValue:String); +begin + fAboutBox.Font.Name:=AValue; +end; +procedure TAboutLongTimer.SetAboutBoxFontSize(Const AValue:Integer); +begin + if (AValue > 6) then fAboutBox.Font.Size:=AValue; +end; +procedure TAboutLongTimer.SetAboutBoxTitle(Const AValue:String); +begin + fAboutBox.Title:=AValue; +end; +procedure TAboutLongTimer.SetAboutBoxBitmap(Const AValue:TBitmap); +begin + If Assigned(Avalue) then fAboutBox.Assign(AValue); +end; +procedure TAboutLongTimer.SetAboutBoxBackgroundColor(Const AValue:TColor); +begin + fAboutBox.BackGroundColor:=AValue;; +end; +procedure TAboutLongTimer.SetAboutBoxVersion(Const AValue:String); +begin + fAboutBox.Version:=AValue; +end; +procedure TAboutLongTimer.SetAboutBoxAuthorname(Const AValue:String); +begin + fAboutBox.Authorname:=AValue; +end; +procedure TAboutLongTimer.SetAboutBoxOrganisation(Const AValue:String); +begin + fAboutBox.Organisation:=AValue; +end; +procedure TAboutLongTimer.SetAboutBoxAuthorEmail(Const AValue:String); +begin + fAboutBox.AuthorEmail:=AValue; +end; +procedure TAboutLongTimer.SetAboutBoxBackgroundResourceName(Const AValue:String); +begin + fAboutBox.BackgroundResourceName:=AValue; +end; +procedure TAboutLongTimer.SetAboutBoxLicenseType(Const AValue:string); +begin + Case Upcase(AValue) of + 'GPL':fAboutBox.LicenseType:=abGPL; + 'LGPL':fAboutBox.LicenseType:=abLGPL; + 'MIT':fAboutBox.LicenseType:=abMIT; + 'MODIFIEDGPL':fAboutBox.LicenseType:=abModifiedGPL; + 'PROPRIETRY':fAboutBox.LicenseType:=abProprietry; + else + fAboutBox.LicenseType:=abNone; + end; +end; +procedure TAboutLongTimer.SetAboutBoxStretchBackgroundImage(Const AValue:Boolean); +begin + fAboutBox.StretchBackground:=AValue; +end; + +// End Sets + +constructor TAboutLongTimer.Create(AOwner: TComponent); +var + TempImage: TPicture; + r:TLResource; +begin + // Inherit default properties + inherited Create(AOwner); + // Use tAboutBox as a subcomponent + fAboutBox := tAboutBox.Create(nil); + with fAboutBox do + begin + SetSubComponent(True); // Tell the IDE to store the modified properties + // Default of TAboutLongTimer values override TAbouBox.Create defaults + ComponentName := 'TAboutLongTimer'; + Description.Add('This is to demonstrate'); //TStrings + Description.Add('the use of TAboutLongTimer'); //TStrings + Description.Add('Set its properties in your Constructor'); //TStrings + Width := 320; //Integer + Height := 280; //Integer + // Set any Font properties or subproperties here + // Font.Name := 'Arial'; + Font.Color := clNavy; + Font.Size:=10; + // BackGroundColor shows if no BackGround image is set + BackGroundColor := clWindow; + Version := '1.0.0.0'; + AuthorName := 'Gordon Bamber'; + AuthorEmail := 'minesadorada@charcodelvalle.com'; + Organisation := 'Public Domain'; + + //Types available: abNone, abGPL, abLGPL, abMIT, abModifiedGPL, abProprietry + LicenseType := abLGPL; + + // BackGround image is optional + // It must be in a resouce file in the initialization section + + //== How to set a background image to your About dialog -- + // The BackGround property is a TBitmap + // Use a Temporary TPicture to load a JPG. + // NOTE a PNG file will create an error when your component is used in an application! + r := LazarusResources.Find(fAboutBox.BackgroundResourceName); + if r <> nil then + begin + TempImage := TPicture.Create; + // .lrs file is in the initialization section + TempImage.LoadFromLazarusResource(fAboutBox.BackgroundResourceName); + BackGround.Assign(TempImage.Bitmap); + TempImage.Free; + StretchBackground := fAboutBox.StretchBackground; //Boolean + end; +end; +end; + +destructor TAboutLongTimer.Destroy; +begin + FreeAndNil(fAboutBox); + inherited Destroy; +end; +initialization +{$I license.lrs} + +end. diff --git a/components/longtimer/demo/longtimerdemo.ico b/components/longtimer/latest_stable/demo/longtimerdemo.ico similarity index 100% rename from components/longtimer/demo/longtimerdemo.ico rename to components/longtimer/latest_stable/demo/longtimerdemo.ico diff --git a/components/longtimer/demo/longtimerdemo.lpi b/components/longtimer/latest_stable/demo/longtimerdemo.lpi similarity index 96% rename from components/longtimer/demo/longtimerdemo.lpi rename to components/longtimer/latest_stable/demo/longtimerdemo.lpi index a62e0b35a..2cadc6c85 100644 --- a/components/longtimer/demo/longtimerdemo.lpi +++ b/components/longtimer/latest_stable/demo/longtimerdemo.lpi @@ -1,163 +1,163 @@ - - - - - - - - - - <ResourceType Value="res"/> - <UseXPManifest Value="True"/> - <XPManifest> - <DpiAware Value="True"/> - <ExecutionLevel Value="1"/> - <UIAccess Value="True"/> - </XPManifest> - <Icon Value="0"/> - </General> - <i18n> - <EnableI18N LFM="False"/> - </i18n> - <VersionInfo> - <StringTable ProductVersion=""/> - </VersionInfo> - <BuildModes Count="3"> - <Item1 Name="Default" Default="True"/> - <Item2 Name="Debug"> - <CompilerOptions> - <Version Value="11"/> - <PathDelim Value="\"/> - <Target> - <Filename Value="project1"/> - </Target> - <SearchPaths> - <IncludeFiles Value="$(ProjOutDir)"/> - <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> - </SearchPaths> - <Parsing> - <SyntaxOptions> - <IncludeAssertionCode Value="True"/> - </SyntaxOptions> - </Parsing> - <CodeGeneration> - <Checks> - <IOChecks Value="True"/> - <RangeChecks Value="True"/> - <OverflowChecks Value="True"/> - <StackChecks Value="True"/> - </Checks> - </CodeGeneration> - <Linking> - <Debugging> - <DebugInfoType Value="dsDwarf2Set"/> - <UseHeaptrc Value="True"/> - <UseExternalDbgSyms Value="True"/> - </Debugging> - <Options> - <Win32> - <GraphicApplication Value="True"/> - </Win32> - </Options> - </Linking> - <Other> - <CustomOptions Value="-dDEBUG"/> - </Other> - </CompilerOptions> - </Item2> - <Item3 Name="Release"> - <CompilerOptions> - <Version Value="11"/> - <PathDelim Value="\"/> - <Target> - <Filename Value="longtimerdemo"/> - </Target> - <SearchPaths> - <IncludeFiles Value="$(ProjOutDir)"/> - <OtherUnitFiles Value="."/> - <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> - </SearchPaths> - <CodeGeneration> - <SmartLinkUnit Value="True"/> - <Optimizations> - <OptimizationLevel Value="3"/> - </Optimizations> - </CodeGeneration> - <Linking> - <Debugging> - <GenerateDebugInfo Value="False"/> - </Debugging> - <LinkSmart Value="True"/> - <Options> - <Win32> - <GraphicApplication Value="True"/> - </Win32> - </Options> - </Linking> - </CompilerOptions> - </Item3> - </BuildModes> - <PublishOptions> - <Version Value="2"/> - </PublishOptions> - <RunParams> - <local> - <FormatVersion Value="1"/> - </local> - </RunParams> - <RequiredPackages Count="2"> - <Item1> - <PackageName Value="longtimerpackage"/> - <MinVersion Release="1" Valid="True"/> - </Item1> - <Item2> - <PackageName Value="LCL"/> - </Item2> - </RequiredPackages> - <Units Count="2"> - <Unit0> - <Filename Value="longtimerdemo.lpr"/> - <IsPartOfProject Value="True"/> - </Unit0> - <Unit1> - <Filename Value="umainform.pas"/> - <IsPartOfProject Value="True"/> - <ComponentName Value="mainform"/> - <HasResources Value="True"/> - <ResourceBaseClass Value="Form"/> - <UnitName Value="umainform"/> - </Unit1> - </Units> - </ProjectOptions> - <CompilerOptions> - <Version Value="11"/> - <PathDelim Value="\"/> - <Target> - <Filename Value="project1"/> - </Target> - <SearchPaths> - <IncludeFiles Value="$(ProjOutDir)"/> - <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> - </SearchPaths> - <Linking> - <Options> - <Win32> - <GraphicApplication Value="True"/> - </Win32> - </Options> - </Linking> - </CompilerOptions> - <Debugging> - <Exceptions Count="3"> - <Item1> - <Name Value="EAbort"/> - </Item1> - <Item2> - <Name Value="ECodetoolError"/> - </Item2> - <Item3> - <Name Value="EFOpenError"/> - </Item3> - </Exceptions> - </Debugging> -</CONFIG> +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectOptions> + <Version Value="9"/> + <PathDelim Value="\"/> + <General> + <SessionStorage Value="InProjectDir"/> + <MainUnit Value="0"/> + <Title Value="LongTimer Demo"/> + <ResourceType Value="res"/> + <UseXPManifest Value="True"/> + <XPManifest> + <DpiAware Value="True"/> + <ExecutionLevel Value="1"/> + <UIAccess Value="True"/> + </XPManifest> + <Icon Value="0"/> + </General> + <i18n> + <EnableI18N LFM="False"/> + </i18n> + <VersionInfo> + <StringTable ProductVersion=""/> + </VersionInfo> + <BuildModes Count="3"> + <Item1 Name="Default" Default="True"/> + <Item2 Name="Debug"> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="project1"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Parsing> + <SyntaxOptions> + <IncludeAssertionCode Value="True"/> + </SyntaxOptions> + </Parsing> + <CodeGeneration> + <Checks> + <IOChecks Value="True"/> + <RangeChecks Value="True"/> + <OverflowChecks Value="True"/> + <StackChecks Value="True"/> + </Checks> + </CodeGeneration> + <Linking> + <Debugging> + <DebugInfoType Value="dsDwarf2Set"/> + <UseHeaptrc Value="True"/> + <UseExternalDbgSyms Value="True"/> + </Debugging> + <Options> + <Win32> + <GraphicApplication Value="True"/> + </Win32> + </Options> + </Linking> + <Other> + <CustomOptions Value="-dDEBUG"/> + </Other> + </CompilerOptions> + </Item2> + <Item3 Name="Release"> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="longtimerdemo"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <OtherUnitFiles Value="."/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <CodeGeneration> + <SmartLinkUnit Value="True"/> + <Optimizations> + <OptimizationLevel Value="3"/> + </Optimizations> + </CodeGeneration> + <Linking> + <Debugging> + <GenerateDebugInfo Value="False"/> + </Debugging> + <LinkSmart Value="True"/> + <Options> + <Win32> + <GraphicApplication Value="True"/> + </Win32> + </Options> + </Linking> + </CompilerOptions> + </Item3> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + </local> + </RunParams> + <RequiredPackages Count="2"> + <Item1> + <PackageName Value="longtimerpackage"/> + <MinVersion Release="1" Valid="True"/> + </Item1> + <Item2> + <PackageName Value="LCL"/> + </Item2> + </RequiredPackages> + <Units Count="2"> + <Unit0> + <Filename Value="longtimerdemo.lpr"/> + <IsPartOfProject Value="True"/> + </Unit0> + <Unit1> + <Filename Value="umainform.pas"/> + <IsPartOfProject Value="True"/> + <ComponentName Value="mainform"/> + <HasResources Value="True"/> + <ResourceBaseClass Value="Form"/> + <UnitName Value="umainform"/> + </Unit1> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="project1"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Linking> + <Options> + <Win32> + <GraphicApplication Value="True"/> + </Win32> + </Options> + </Linking> + </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/components/longtimer/demo/longtimerdemo.lpr b/components/longtimer/latest_stable/demo/longtimerdemo.lpr similarity index 94% rename from components/longtimer/demo/longtimerdemo.lpr rename to components/longtimer/latest_stable/demo/longtimerdemo.lpr index 83e411f62..a5adda16f 100644 --- a/components/longtimer/demo/longtimerdemo.lpr +++ b/components/longtimer/latest_stable/demo/longtimerdemo.lpr @@ -1,21 +1,21 @@ -program longtimerdemo; - -{$mode objfpc}{$H+} - -uses - {$IFDEF UNIX}{$IFDEF UseCThreads} - cthreads, - {$ENDIF}{$ENDIF} - Interfaces, // this includes the LCL widgetset - Forms, umainform; - -{$R *.res} - -begin - Application.Title:='LongTimer Demo'; - RequireDerivedFormResource := True; - Application.Initialize; - Application.CreateForm(Tmainform, mainform); - Application.Run; -end. - +program longtimerdemo; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Interfaces, // this includes the LCL widgetset + Forms, umainform; + +{$R *.res} + +begin + Application.Title:='LongTimer Demo'; + RequireDerivedFormResource := True; + Application.Initialize; + Application.CreateForm(Tmainform, mainform); + Application.Run; +end. + diff --git a/components/longtimer/latest_stable/demo/longtimerdemo.lps b/components/longtimer/latest_stable/demo/longtimerdemo.lps new file mode 100644 index 000000000..759d4e18e --- /dev/null +++ b/components/longtimer/latest_stable/demo/longtimerdemo.lps @@ -0,0 +1,229 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectSession> + <PathDelim Value="\"/> + <Version Value="9"/> + <BuildModes Active="Release"/> + <Units Count="13"> + <Unit0> + <Filename Value="longtimerdemo.lpr"/> + <IsPartOfProject Value="True"/> + <EditorIndex Value="-1"/> + <CursorPos X="83" Y="6"/> + <UsageCount Value="76"/> + </Unit0> + <Unit1> + <Filename Value="umainform.pas"/> + <IsPartOfProject Value="True"/> + <ComponentName Value="mainform"/> + <HasResources Value="True"/> + <ResourceBaseClass Value="Form"/> + <UnitName Value="umainform"/> + <IsVisibleTab Value="True"/> + <TopLine Value="88"/> + <CursorPos X="39" Y="92"/> + <UsageCount Value="76"/> + <Loaded Value="True"/> + <LoadedDesigner Value="True"/> + </Unit1> + <Unit2> + <Filename Value="..\ulongtimer.pas"/> + <UnitName Value="uLongTimer"/> + <EditorIndex Value="1"/> + <TopLine Value="138"/> + <CursorPos X="33" Y="151"/> + <UsageCount Value="37"/> + <Loaded Value="True"/> + </Unit2> + <Unit3> + <Filename Value="D:\Lazarus32_production\lcl\extctrls.pp"/> + <TopLine Value="184"/> + <CursorPos X="65" Y="203"/> + <UsageCount Value="25"/> + </Unit3> + <Unit4> + <Filename Value="D:\Lazarus32_production\lcl\customtimer.pas"/> + <CursorPos X="25" Y="42"/> + <UsageCount Value="25"/> + </Unit4> + <Unit5> + <Filename Value="D:\Lazarus32_production\fpc\2.6.4\source\rtl\objpas\dateutils.pp"/> + <CursorPos X="18"/> + <UsageCount Value="6"/> + </Unit5> + <Unit6> + <Filename Value="D:\Lazarus32_production\fpc\2.6.4\source\rtl\objpas\dateutil.pp"/> + <CursorPos X="13"/> + <UsageCount Value="6"/> + </Unit6> + <Unit7> + <Filename Value="D:\Lazarus32_production\fpc\2.6.4\source\rtl\objpas\dateutil.inc"/> + <TopLine Value="263"/> + <CursorPos X="22" Y="89"/> + <UsageCount Value="25"/> + </Unit7> + <Unit8> + <Filename Value="..\aboutlongtimerunit.pas"/> + <UnitName Value="AboutLongTimerunit"/> + <EditorIndex Value="3"/> + <TopLine Value="28"/> + <CursorPos X="43" Y="42"/> + <UsageCount Value="22"/> + <Loaded Value="True"/> + </Unit8> + <Unit9> + <Filename Value="C:\codetyphon\typhon\lcl\extctrls.pp"/> + <UnitName Value="ExtCtrls"/> + <EditorIndex Value="4"/> + <TopLine Value="156"/> + <CursorPos X="31" Y="181"/> + <UsageCount Value="10"/> + <Loaded Value="True"/> + </Unit9> + <Unit10> + <Filename Value="C:\codetyphon\typhon\lcl\customtimer.pas"/> + <UnitName Value="CustomTimer"/> + <EditorIndex Value="5"/> + <TopLine Value="23"/> + <CursorPos X="41" Y="39"/> + <UsageCount Value="10"/> + <Loaded Value="True"/> + </Unit10> + <Unit11> + <Filename Value="C:\codetyphon\fpcsrc\packages\rtl-objpas\src\inc\dateutils.pp"/> + <EditorIndex Value="-1"/> + <CursorPos X="17"/> + <UsageCount Value="10"/> + </Unit11> + <Unit12> + <Filename Value="C:\codetyphon\fpcsrc\packages\rtl-objpas\src\inc\dateutil.inc"/> + <EditorIndex Value="2"/> + <TopLine Value="1453"/> + <CursorPos X="3" Y="1473"/> + <UsageCount Value="10"/> + <Loaded Value="True"/> + </Unit12> + </Units> + <CustomDefines Count="1"> + <Define0 Value="DEBUG"/> + </CustomDefines> + <JumpHistory Count="29" HistoryIndex="28"> + <Position1> + <Filename Value="..\ulongtimer.pas"/> + <Caret Line="93" Column="35" TopLine="83"/> + </Position1> + <Position2> + <Filename Value="umainform.pas"/> + <Caret Line="110" Column="14" TopLine="69"/> + </Position2> + <Position3> + <Filename Value="umainform.pas"/> + <Caret Line="175" Column="3" TopLine="138"/> + </Position3> + <Position4> + <Filename Value="umainform.pas"/> + <Caret Line="92" Column="13" TopLine="62"/> + </Position4> + <Position5> + <Filename Value="..\ulongtimer.pas"/> + <Caret Line="33" Column="13" TopLine="31"/> + </Position5> + <Position6> + <Filename Value="..\ulongtimer.pas"/> + <Caret Line="192" Column="31" TopLine="154"/> + </Position6> + <Position7> + <Filename Value="umainform.pas"/> + <Caret Line="93" Column="38" TopLine="50"/> + </Position7> + <Position8> + <Filename Value="umainform.pas"/> + <Caret Line="88" Column="50" TopLine="65"/> + </Position8> + <Position9> + <Filename Value="umainform.pas"/> + <Caret Line="91" TopLine="61"/> + </Position9> + <Position10> + <Filename Value="umainform.pas"/> + <Caret Line="93" TopLine="63"/> + </Position10> + <Position11> + <Filename Value="..\ulongtimer.pas"/> + <Caret Line="169" Column="41" TopLine="147"/> + </Position11> + <Position12> + <Filename Value="umainform.pas"/> + <Caret Line="140" Column="11" TopLine="83"/> + </Position12> + <Position13> + <Filename Value="..\ulongtimer.pas"/> + <Caret Line="130" TopLine="118"/> + </Position13> + <Position14> + <Filename Value="..\ulongtimer.pas"/> + <Caret Line="82" Column="8" TopLine="49"/> + </Position14> + <Position15> + <Filename Value="..\ulongtimer.pas"/> + <Caret Line="123" Column="22" TopLine="92"/> + </Position15> + <Position16> + <Filename Value="..\ulongtimer.pas"/> + <Caret Line="57" TopLine="51"/> + </Position16> + <Position17> + <Filename Value="..\ulongtimer.pas"/> + <Caret Line="123" Column="24" TopLine="88"/> + </Position17> + <Position18> + <Filename Value="..\ulongtimer.pas"/> + <Caret Line="82" Column="91" TopLine="55"/> + </Position18> + <Position19> + <Filename Value="..\aboutlongtimerunit.pas"/> + <Caret Line="42" Column="43" TopLine="28"/> + </Position19> + <Position20> + <Filename Value="..\ulongtimer.pas"/> + <Caret Line="57" Column="3" TopLine="52"/> + </Position20> + <Position21> + <Filename Value="..\ulongtimer.pas"/> + <Caret Line="82" Column="37" TopLine="61"/> + </Position21> + <Position22> + <Filename Value="..\ulongtimer.pas"/> + <Caret Line="66" Column="5" TopLine="50"/> + </Position22> + <Position23> + <Filename Value="C:\codetyphon\typhon\lcl\extctrls.pp"/> + <Caret Line="181" Column="31" TopLine="156"/> + </Position23> + <Position24> + <Filename Value="..\ulongtimer.pas"/> + <Caret Line="82" Column="67" TopLine="58"/> + </Position24> + <Position25> + <Filename Value="..\ulongtimer.pas"/> + <Caret Line="66" Column="51" TopLine="44"/> + </Position25> + <Position26> + <Filename Value="..\ulongtimer.pas"/> + <Caret Line="124" Column="13" TopLine="84"/> + </Position26> + <Position27> + <Filename Value="..\ulongtimer.pas"/> + <Caret Line="154" Column="35" TopLine="147"/> + </Position27> + <Position28> + <Filename Value="..\ulongtimer.pas"/> + <Caret Line="50" Column="78" TopLine="28"/> + </Position28> + <Position29> + <Filename Value="..\ulongtimer.pas"/> + <Caret Line="165" Column="18" TopLine="142"/> + </Position29> + </JumpHistory> + </ProjectSession> +</CONFIG> diff --git a/components/longtimer/demo/longtimerdemo.res b/components/longtimer/latest_stable/demo/longtimerdemo.res similarity index 100% rename from components/longtimer/demo/longtimerdemo.res rename to components/longtimer/latest_stable/demo/longtimerdemo.res diff --git a/components/longtimer/demo/umainform.lfm b/components/longtimer/latest_stable/demo/umainform.lfm similarity index 95% rename from components/longtimer/demo/umainform.lfm rename to components/longtimer/latest_stable/demo/umainform.lfm index 966fc678e..0c95cfc71 100644 --- a/components/longtimer/demo/umainform.lfm +++ b/components/longtimer/latest_stable/demo/umainform.lfm @@ -1,187 +1,187 @@ -object mainform: Tmainform - Left = 1050 - Height = 264 - Top = 186 - Width = 437 - BorderIcons = [biSystemMenu, biMinimize] - BorderStyle = bsSingle - Caption = 'Application Title' - ClientHeight = 264 - ClientWidth = 437 - DefaultMonitor = dmPrimary - OnCreate = FormCreate - Position = poScreenCenter - LCLVersion = '1.3' - object cmd_Close: TBitBtn - Left = 104 - Height = 30 - Top = 224 - Width = 75 - DefaultCaption = True - Kind = bkClose - ModalResult = 11 - TabOrder = 0 - end - object memo_ReportTimerEvent: TMemo - Left = 192 - Height = 240 - Top = 8 - Width = 232 - Lines.Strings = ( - 'Memo1' - ) - ReadOnly = True - ScrollBars = ssAutoVertical - TabOrder = 1 - end - object cmd_StopTimer: TButton - Left = 16 - Height = 25 - Top = 197 - Width = 75 - Caption = 'Stop Timer' - OnClick = cmd_StopTimerClick - TabOrder = 2 - end - object cmd_StartTimer: TButton - Left = 104 - Height = 25 - Top = 197 - Width = 75 - Caption = 'Start Timer' - OnClick = cmd_StartTimerClick - TabOrder = 3 - end - object crp_SetTimer: TGroupBox - Left = 8 - Height = 176 - Top = 8 - Width = 184 - Caption = 'Set up LongTimer' - ClientHeight = 156 - ClientWidth = 180 - TabOrder = 4 - object Label1: TLabel - Left = 16 - Height = 15 - Top = 16 - Width = 28 - Caption = 'Every' - ParentColor = False - end - object cmb_IntervalType: TComboBox - Left = 72 - Height = 23 - Top = 16 - Width = 100 - ItemHeight = 15 - ItemIndex = 0 - Items.Strings = ( - 'Day' - 'Week' - 'Month' - ) - OnChange = cmb_IntervalTypeChange - Style = csDropDownList - TabOrder = 0 - Text = 'Day' - end - object Label3: TLabel - Left = 0 - Height = 15 - Top = 48 - Width = 61 - Caption = 'Day or Date' - ParentColor = False - end - object cmb_weekordate: TComboBox - Left = 72 - Height = 23 - Top = 44 - Width = 100 - Enabled = False - ItemHeight = 15 - OnChange = cmb_weekordateChange - Style = csDropDownList - TabOrder = 1 - end - object Label2: TLabel - Left = 0 - Height = 15 - Top = 88 - Width = 61 - Caption = 'Time (24hr)' - ParentColor = False - end - object cmb_Daily24Hour: TComboBox - Left = 72 - Height = 23 - Top = 88 - Width = 100 - ItemHeight = 15 - ItemIndex = 0 - Items.Strings = ( - 'Midnight' - ) - OnChange = cmb_Daily24HourChange - Style = csDropDownList - TabOrder = 2 - Text = 'Midnight' - end - object cmb_SampleInterval: TComboBox - Left = 48 - Height = 23 - Top = 128 - Width = 124 - ItemHeight = 15 - OnChange = cmb_SampleIntervalChange - Style = csDropDownList - TabOrder = 3 - end - object Label4: TLabel - Left = 0 - Height = 15 - Top = 128 - Width = 39 - Caption = 'Sample' - ParentColor = False - end - end - object cmd_clearmemo: TBitBtn - Left = 16 - Height = 30 - Top = 224 - Width = 75 - Caption = 'Clear' - Kind = bkCancel - ModalResult = 2 - OnClick = cmd_clearmemoClick - TabOrder = 5 - end - object LongTimer1: TLongTimer - About.Description.Strings = ( - 'LongTimer is a descendent of TIdleTimer'#13#10'and shares its properties and methods.'#13#10#13#10'Additional properties affect when the'#13#10'OnTimer event is fired.'#13#10#13#10'With LongTimer, the OnTimer event'#13#10'will be fired only ONCE - every time'#13#10'the interval that you set is reached.' - ) - About.Title = 'About TLongTimer Component' - About.Height = 380 - About.Width = 320 - About.Font.Color = clNavy - About.Font.Height = -13 - About.BackGroundColor = clWindow - About.Version = '0.0.1' - About.Authorname = 'Gordon Bamber' - About.Organisation = 'Public Domain' - About.AuthorEmail = 'minesadorada@charcodelvalle.com' - About.ComponentName = 'TLongTimer' - About.LicenseType = abLGPL - Enabled = False - OnTimer = LongTimer1Timer - OnStartTimer = LongTimer1StartTimer - OnStopTimer = LongTimer1StopTimer - Daily24Hour = 0 - WeeklyDay = lt3Wednesday - OnSample = LongTimer1Sample - left = 8 - top = 8 - end -end +object mainform: Tmainform + Left = 1050 + Height = 264 + Top = 186 + Width = 437 + BorderIcons = [biSystemMenu, biMinimize] + BorderStyle = bsSingle + Caption = 'Application Title' + ClientHeight = 264 + ClientWidth = 437 + DefaultMonitor = dmPrimary + OnCreate = FormCreate + Position = poScreenCenter + LCLVersion = '1.3' + object cmd_Close: TBitBtn + Left = 104 + Height = 30 + Top = 224 + Width = 75 + DefaultCaption = True + Kind = bkClose + ModalResult = 11 + TabOrder = 0 + end + object memo_ReportTimerEvent: TMemo + Left = 192 + Height = 240 + Top = 8 + Width = 232 + Lines.Strings = ( + 'Memo1' + ) + ReadOnly = True + ScrollBars = ssAutoVertical + TabOrder = 1 + end + object cmd_StopTimer: TButton + Left = 16 + Height = 25 + Top = 197 + Width = 75 + Caption = 'Stop Timer' + OnClick = cmd_StopTimerClick + TabOrder = 2 + end + object cmd_StartTimer: TButton + Left = 104 + Height = 25 + Top = 197 + Width = 75 + Caption = 'Start Timer' + OnClick = cmd_StartTimerClick + TabOrder = 3 + end + object crp_SetTimer: TGroupBox + Left = 8 + Height = 176 + Top = 8 + Width = 184 + Caption = 'Set up LongTimer' + ClientHeight = 156 + ClientWidth = 180 + TabOrder = 4 + object Label1: TLabel + Left = 16 + Height = 15 + Top = 16 + Width = 28 + Caption = 'Every' + ParentColor = False + end + object cmb_IntervalType: TComboBox + Left = 72 + Height = 23 + Top = 16 + Width = 100 + ItemHeight = 15 + ItemIndex = 0 + Items.Strings = ( + 'Day' + 'Week' + 'Month' + ) + OnChange = cmb_IntervalTypeChange + Style = csDropDownList + TabOrder = 0 + Text = 'Day' + end + object Label3: TLabel + Left = 0 + Height = 15 + Top = 48 + Width = 61 + Caption = 'Day or Date' + ParentColor = False + end + object cmb_weekordate: TComboBox + Left = 72 + Height = 23 + Top = 44 + Width = 100 + Enabled = False + ItemHeight = 15 + OnChange = cmb_weekordateChange + Style = csDropDownList + TabOrder = 1 + end + object Label2: TLabel + Left = 0 + Height = 15 + Top = 88 + Width = 61 + Caption = 'Time (24hr)' + ParentColor = False + end + object cmb_Daily24Hour: TComboBox + Left = 72 + Height = 23 + Top = 88 + Width = 100 + ItemHeight = 15 + ItemIndex = 0 + Items.Strings = ( + 'Midnight' + ) + OnChange = cmb_Daily24HourChange + Style = csDropDownList + TabOrder = 2 + Text = 'Midnight' + end + object cmb_SampleInterval: TComboBox + Left = 48 + Height = 23 + Top = 128 + Width = 124 + ItemHeight = 15 + OnChange = cmb_SampleIntervalChange + Style = csDropDownList + TabOrder = 3 + end + object Label4: TLabel + Left = 0 + Height = 15 + Top = 128 + Width = 39 + Caption = 'Sample' + ParentColor = False + end + end + object cmd_clearmemo: TBitBtn + Left = 16 + Height = 30 + Top = 224 + Width = 75 + Caption = 'Clear' + Kind = bkCancel + ModalResult = 2 + OnClick = cmd_clearmemoClick + TabOrder = 5 + end + object LongTimer1: TLongTimer + About.Description.Strings = ( + 'LongTimer is a descendent of TIdleTimer'#13#10'and shares its properties and methods.'#13#10#13#10'Additional properties affect when the'#13#10'OnTimer event is fired.'#13#10#13#10'With LongTimer, the OnTimer event'#13#10'will be fired only ONCE - every time'#13#10'the interval that you set is reached.' + ) + About.Title = 'About TLongTimer Component' + About.Height = 380 + About.Width = 320 + About.Font.Color = clNavy + About.Font.Height = -13 + About.BackGroundColor = clWindow + About.Version = '0.0.1' + About.Authorname = 'Gordon Bamber' + About.Organisation = 'Public Domain' + About.AuthorEmail = 'minesadorada@charcodelvalle.com' + About.ComponentName = 'TLongTimer' + About.LicenseType = abLGPL + Enabled = False + OnTimer = LongTimer1Timer + OnStartTimer = LongTimer1StartTimer + OnStopTimer = LongTimer1StopTimer + Daily24Hour = 0 + WeeklyDay = lt3Wednesday + OnSample = LongTimer1Sample + left = 8 + top = 8 + end +end diff --git a/components/longtimer/demo/umainform.pas b/components/longtimer/latest_stable/demo/umainform.pas similarity index 100% rename from components/longtimer/demo/umainform.pas rename to components/longtimer/latest_stable/demo/umainform.pas diff --git a/components/longtimer/license.lrs b/components/longtimer/latest_stable/license.lrs similarity index 100% rename from components/longtimer/license.lrs rename to components/longtimer/latest_stable/license.lrs diff --git a/components/longtimer/locale/aboutlongtimerunit.po b/components/longtimer/latest_stable/locale/aboutlongtimerunit.po similarity index 100% rename from components/longtimer/locale/aboutlongtimerunit.po rename to components/longtimer/latest_stable/locale/aboutlongtimerunit.po diff --git a/components/longtimer/longtimer_icon.lrs b/components/longtimer/latest_stable/longtimer_icon.lrs similarity index 98% rename from components/longtimer/longtimer_icon.lrs rename to components/longtimer/latest_stable/longtimer_icon.lrs index 0ec881385..9f2224182 100644 --- a/components/longtimer/longtimer_icon.lrs +++ b/components/longtimer/latest_stable/longtimer_icon.lrs @@ -1,67 +1,67 @@ -LazarusResources.Add('TLongTimer','PNG',[ - #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#6#0#0#0#224'w='#248#0 - +#0#0#25'tEXtSoftware'#0'Adobe ImageReadyq'#201'e<'#0#0#5#231'IDATx'#218'|U[o' - +#19'G'#20'>k'#175#215#235#248#134#29#187#142's''IC'#154#2#9#13'i('#168#180#9 - +#180#226'!EP'#209#130#4'R'#145#170#2#17#229#165#15#136#159#208#167#170#15'}@' - +'H'#208#150#10')'#136'('#20'T'#169'E'#4#25'(D'#13#151'D'#9#196#9'qc''N|#'#247 - +#216#142'/'#241#238#246#156#245#218#4'J;'#210#209#206#206#156#243'}3g'#190'3' - +#195'H'#146#4#231'N'#168#128'Z'#149'C'#5#26'5'#252#171#173#10#0#21#231'%'#208 - +#7#165#183#233'?^'#204#12'O~'#201#252#167#175'7"'#202#253'cgE`_'#153'w'#136 - +#18#180#226#183#26#205#140#182#132'6'#142#230#146#0'"'#248#149#9#176'?'#252 - +#127#190#144#245#149#155'L'#160'Q3'#200',]'#17#212#166#153#234#230#246#22'gM' - +'S'#21#167'3'#25'c'#139'3K}='#151#221'~'#247#192#167#156#129#25#175#2'(%'#255 - +#176#1#182'L'#134#196#234#242#250'-'#206#150#221#7#235#13#235#236#230'tb9'#26 - +#250#251#177'w'#236#225'o;'#1#22#237#136#249#25#249'2'#148#162#159#191'V'#151 - +#242'z'#227#183#205#31#157'8\R]'#13#233'h'#20'F'#159#14#206#247#186'zB'#155 - +#161#202'Z'#164#181#243#197#156'Cgb'#13#28#5'-gb'#233'`:'#146#8#167'f'#146'C' - +#224#157#223#222#186#219'Y'#183#177#193#202#25#141#16#24#31#135#135'7'#207'^' - +'J'#198#163'g'#190#248'A'#152#150'w'#144'\'#149#14#212'7'#180#181#20#22';a.0' - +'%'#221#189'u;0'#253'xl'#249'`'#229#158'JC\'#173#247#14#140'B_d'#8#226'HLMo4' - +#242#133#14#7#223'XW'#7'5'#250'j'#211#229#206'?&'#199#155'|+;w}X'#130#24'L' - +#21'b'#245#223#249#245#0#186'~'#159'%H'#195'V'#13#207#23#143#14#245'B'#223 - +#159'O'#2#170#9'!'#217'Qw'#176'6'#226#241#177#189#211#211#160#223#187#23#202 - +'v'#237#2';'#2'R'#155#25#29#133#200#173'['#208'{'#253':'#188'UV'#166#239'x' - +#243'P'#237#143#15'~'#159#232'z'#222#21'hy'#127'S'#169#22#177#8#147'|e'#249 - +#164'3P'#194'k2:'#239#168'w>48'#31'='#186'aO%'#129#251#236'v('#186'p'#1'J' - +#142#31#135#226#166'&'#24#25#27#3#141'^/'#247'i'#140#230'|6'#27'D<^'#150'b(' - +#150'0'#8#139'0'#215#16'H'#139'Rz9'#241#240#190'''|'#170#161'}'#253#226'T' - +#144#157',*'#2#203#233#211#160'6'#155#193'b0'#200'+'#239#127#244'(/7'#26#163 - +'9'#235#153'30'#229't'#194'b '#204#158'j'#252'd=a'#16#22'a'#230#9#4#17#6#238 - +#222'y2]'#174#178'j'#204#162#134#31#11#6#193#216#209#1#146'F'#3','#203'BF'#16 - +' '#145'NC*'#149#146#191'd4Fs'#162'Z'#13#230#147''''#193#19#8#128'Y'#165#227 - +#9#131#176#8'3O'#128'B'#186'8'#225#13#134'>('#174#183#249'='#30#224#219#219#1 - +'L& '#133'%'#17'lznN'#182#145#145#145'|'#159#140#230#200'G'#192#221#152#246 - +#237#131')'#175#23'>('#219'd#,'#194#204#215'A'#173#155#153'`'#19#208'_Zfk' - +#153#138#142#128#166#185#153#138')[(*'#21'X0'#239#5'<'#15#241'x'#28'j0'#29 - +#185#150'\]'#133#169#217'Y'#153'D'#215#210#2'+W'#175'BY'#237'f'#221';.'#166 - +'?'#163#131#137'<A'#149'['#246#175'0'#170#10'8!'#147#1'UI'#9#8'R'#150#194'i' - +#181#2#207'f'#11#158#8'@'#146#242#4#26'$'#151#148#127#22'c'#18#152'B'#147'v' - +#29'W'#238#131#138#151'*Y'#200#246#181#18'0'#192'a'#222#5#134#201#7#230#192 - +'?nm'#133#182#182'6'#248'|'#255'~'#208#227#142'r'#166#211#233#160'a'#219'6' - +#216#129';'#224'8'#14#196','#158#246'%'#130'L'#182'?'#151#142#197#146':'#163 - +#177' '#249#252'9'#164'QE'#202#189'#'#183#206'+W'#224#240#161'Cp'#169#179#243 - +#165#203'k'#22#139'O'#194#131'fgf@g'#177'@zy9'#137'xs'#175'#'#152#140'E"1}aa' - +#129#228'vC'#2's-'#210#1#138'"'#168#233#28'P'#239#4'N'#223'\'#163#185#8#166 - +#133#206#137#27#30#6#30'cb~'#127#12#241'&s>'#178#138'R'#164#22'I'#186'='#229 - +'v'#135#13'X\'#220#189'{`'#196#179#160'4'#173'f2/'#180#191#6'\'#190#154#21 - +#159'BL'#169#232'r'#129#1#9#166#6#7#195#132#149'RR,'#19'$'#137#4#160'/'#20#12 - +'>'#139#135#195'Q='#230#210't'#237#26#24#241'<H'#243#242#193#190#198'h'#206 - +#138#234'2'#160'zt('#235#152#215#27'%'#12#194'J'#174#221'A2k'#241#132' '#156 - +#31'p'#185'|'#172'V'#155#209#226'}'#243'Fw7'#240#152#2#134#14']9'#143#156#209 - +#152#1'ejG'#31#6#175#16#138#25#184'q'#195'G'#24#132#149'#'#144#175#235#159 - +#208'9'#255#15#240#141#179#188#252#216#187#237#237'U'#8#194#138'X'#177'Z'#188 - +#232'T'#141#141#192'8'#28'Y'#175'H'#4#196#193'AH'#245#244#0#131'*'#146#24'&' - +#243#160#171#203#27#242#251#207'!'#210'w9m'#28'El'#153#128'VC'#247'd'#3'n' - +#151#211'jy'#173'Z}'#174#149'a'#182'nok+'#183'm'#216#160#23'P'#255#226#194#2 - +'H++'#217'U'#160'<U'#133#133#160#198#180#204#186#221#241#222#155'7'#253'.Iz' - +#148#18#132'c'#233'T*9'#152'L'#194#168'|CH/'#158'L'#26#160#210#179#25#141#245 - +#248#241#251'VVb'#139#221#221#229'%'#14'Gm'#205#198#141'6kee'#129#222#233#228 - +'p5'#16#159#155'K/<}'#186#226#25#26#154#13'D"'#158'n'#179'y'#242'YA'#193'<' - +#198#213#207#166'R'#253#201'5B'#200#239#128#10#147#204'l6'#239'U'#169'T['#22 - +#22#22'.'#22#227#252'v|'#135#223#3#216#129#149'S'#129'^v'#165'6f'#18#184#136 - +#191#0#238#247#2#140#132#0'D'#139#197'rD'#20#197#129#165#165#165#235'$02im' - +#138'H'#133#244#144'ce~'#149'H$~Q'#156'R/D&'#255#11#138'0h'#231#156'bZ'#197 - +'X'#140'='#130#177'g'#233'MB[|'#149'@G'#175#161#18'$*'#150'QLPL'#22#144'B' - +#162'^c'#172'2'#198'('#139#137#211#194#8#251#31#1#6#0#3#163#244#222'9'#250 - ,#193'9'#0#0#0#0'IEND'#174'B`'#130 -]); +LazarusResources.Add('TLongTimer','PNG',[ + #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#6#0#0#0#224'w='#248#0 + +#0#0#25'tEXtSoftware'#0'Adobe ImageReadyq'#201'e<'#0#0#5#231'IDATx'#218'|U[o' + +#19'G'#20'>k'#175#215#235#248#134#29#187#142's''IC'#154#2#9#13'i('#168#180#9 + +#180#226'!EP'#209#130#4'R'#145#170#2#17#229#165#15#136#159#208#167#170#15'}@' + +'H'#208#150#10')'#136'('#20'T'#169'E'#4#25'(D'#13#151'D'#9#196#9'qc''N|#'#247 + +#216#142'/'#241#238#246#156#245#218#4'J;'#210#209#206#206#156#243'}3g'#190'3' + +#195'H'#146#4#231'N'#168#128'Z'#149'C'#5#26'5'#252#171#173#10#0#21#231'%'#208 + +#7#165#183#233'?^'#204#12'O~'#201#252#167#175'7"'#202#253'cgE`_'#153'w'#136 + +#18#180#226#183#26#205#140#182#132'6'#142#230#146#0'"'#248#149#9#176'?'#252 + +#127#190#144#245#149#155'L'#160'Q3'#200',]'#17#212#166#153#234#230#246#22'gM' + +'S'#21#167'3'#25'c'#139'3K}='#151#221'~'#247#192#167#156#129#25#175#2'(%'#255 + +#176#1#182'L'#134#196#234#242#250'-'#206#150#221#7#235#13#235#236#230'tb9'#26 + +#250#251#177'w'#236#225'o;'#1#22#237#136#249#25#249'2'#148#162#159#191'V'#151 + +#242'z'#227#183#205#31#157'8\R]'#13#233'h'#20'F'#159#14#206#247#186'zB'#155 + +#161#202'Z'#164#181#243#197#156'Cgb'#13#28#5'-gb'#233'`:'#146#8#167'f'#146'C' + +#224#157#223#222#186#219'Y'#183#177#193#202#25#141#16#24#31#135#135'7'#207'^' + +'J'#198#163'g'#190#248'A'#152#150'w'#144'\'#149#14#212'7'#180#181#20#22';a.0' + +'%'#221#189'u;0'#253'xl'#249'`'#229#158'JC\'#173#247#14#140'B_d'#8#226'HLMo4' + +#242#133#14#7#223'XW'#7'5'#250'j'#211#229#206'?&'#199#155'|+;w}X'#130#24'L' + +#21'b'#245#223#249#245#0#186'~'#159'%H'#195'V'#13#207#23#143#14#245'B'#223 + +#159'O'#2#170#9'!'#217'Qw'#176'6'#226#241#177#189#211#211#160#223#187#23#202 + +'v'#237#2';'#2'R'#155#25#29#133#200#173'['#208'{'#253':'#188'UV'#166#239'x' + +#243'P'#237#143#15'~'#159#232'z'#222#21'hy'#127'S'#169#22#177#8#147'|e'#249 + +#164'3P'#194'k2:'#239#168'w>48'#31'='#186'aO%'#129#251#236'v('#186'p'#1'J' + +#142#31#135#226#166'&'#24#25#27#3#141'^/'#247'i'#140#230'|6'#27'D<^'#150'b(' + +#150'0'#8#139'0'#215#16'H'#139'Rz9'#241#240#190'''|'#170#161'}'#253#226'T' + +#144#157',*'#2#203#233#211#160'6'#155#193'b0'#200'+'#239#127#244'(/7'#26#163 + +'9'#235#153'30'#229't'#194'b '#204#158'j'#252'd=a'#16#22'a'#230#9#4#17#6#238 + +#222'y2]'#174#178'j'#204#162#134#31#11#6#193#216#209#1#146'F'#3','#203'BF'#16 + +' '#145'NC*'#149#146#191'd4Fs'#162'Z'#13#230#147''''#193#19#8#128'Y'#165#227 + +#9#131#176#8'3O'#128'B'#186'8'#225#13#134'>('#174#183#249'='#30#224#219#219#1 + +'L& '#133'%'#17'lznN'#182#145#145#145'|'#159#140#230#200'G'#192#221#152#246 + +#237#131')'#175#23'>('#219'd#,'#194#204#215'A'#173#155#153'`'#19#208'_Zfk' + +#153#138#142#128#166#185#153#138')[(*'#21'X0'#239#5'<'#15#241'x'#28'j0'#29 + +#185#150'\]'#133#169#217'Y'#153'D'#215#210#2'+W'#175'BY'#237'f'#221';.'#166 + +'?'#163#131#137'<A'#149'['#246#175'0'#170#10'8!'#147#1'UI'#9#8'R'#150#194'i' + +#181#2#207'f'#11#158#8'@'#146#242#4#26'$'#151#148#127#22'c'#18#152'B'#147'v' + +#29'W'#238#131#138#151'*Y'#200#246#181#18'0'#192'a'#222#5#134#201#7#230#192 + +'?nm'#133#182#182'6'#248'|'#255'~'#208#227#142'r'#166#211#233#160'a'#219'6' + +#216#129';'#224'8'#14#196','#158#246'%'#130'L'#182'?'#151#142#197#146':'#163 + +#177' '#249#252'9'#164'QE'#202#189'#'#183#206'+W'#224#240#161'Cp'#169#179#243 + +#165#203'k'#22#139'O'#194#131'fgf@g'#177'@zy9'#137'xs'#175'#'#152#140'E"1}aa' + +#129#228'vC'#2's-'#210#1#138'"'#168#233#28'P'#239#4'N'#223'\'#163#185#8#166 + +#133#206#137#27#30#6#30'cb~'#127#12#241'&s>'#178#138'R'#164#22'I'#186'='#229 + +'v'#135#13'X\'#220#189'{`'#196#179#160'4'#173'f2/'#180#191#6'\'#190#154#21 + +#159'BL'#169#232'r'#129#1#9#166#6#7#195#132#149'RR,'#19'$'#137#4#160'/'#20#12 + +'>'#139#135#195'Q='#230#210't'#237#26#24#241'<H'#243#242#193#190#198'h'#206 + +#138#234'2'#160'zt('#235#152#215#27'%'#12#194'J'#174#221'A2k'#241#132' '#156 + +#31'p'#185'|'#172'V'#155#209#226'}'#243'Fw7'#240#152#2#134#14']9'#143#156#209 + +#152#1'ejG'#31#6#175#16#138#25#184'q'#195'G'#24#132#149'#'#144#175#235#159 + +#208'9'#255#15#240#141#179#188#252#216#187#237#237'U'#8#194#138'X'#177'Z'#188 + +#232'T'#141#141#192'8'#28'Y'#175'H'#4#196#193'AH'#245#244#0#131'*'#146#24'&' + +#243#160#171#203#27#242#251#207'!'#210'w9m'#28'El'#153#128'VC'#247'd'#3'n' + +#151#211'jy'#173'Z}'#174#149'a'#182'nok+'#183'm'#216#160#23'P'#255#226#194#2 + +'H++'#217'U'#160'<U'#133#133#160#198#180#204#186#221#241#222#155'7'#253'.Iz' + +#148#18#132'c'#233'T*9'#152'L'#194#168'|CH/'#158'L'#26#160#210#179#25#141#245 + +#248#241#251'VVb'#139#221#221#229'%'#14'Gm'#205#198#141'6kee'#129#222#233#228 + +'p5'#16#159#155'K/<}'#186#226#25#26#154#13'D"'#158'n'#179'y'#242'YA'#193'<' + +#198#213#207#166'R'#253#201'5B'#200#239#128#10#147#204'l6'#239'U'#169'T['#22 + +#22#22'.'#22#227#252'v|'#135#223#3#216#129#149'S'#129'^v'#165'6f'#18#184#136 + +#191#0#238#247#2#140#132#0'D'#139#197'rD'#20#197#129#165#165#165#235'$02im' + +#138'H'#133#244#144'ce~'#149'H$~Q'#156'R/D&'#255#11#138'0h'#231#156'bZ'#197 + +'X'#140'='#130#177'g'#233'MB[|'#149'@G'#175#161#18'$*'#150'QLPL'#22#144'B' + +#162'^c'#172'2'#198'('#139#137#211#194#8#251#31#1#6#0#3#163#244#222'9'#250 + ,#193'9'#0#0#0#0'IEND'#174'B`'#130 +]); diff --git a/components/longtimer/longtimerpackage.lpk b/components/longtimer/latest_stable/longtimerpackage.lpk similarity index 100% rename from components/longtimer/longtimerpackage.lpk rename to components/longtimer/latest_stable/longtimerpackage.lpk diff --git a/components/longtimer/longtimerpackage.pas b/components/longtimer/latest_stable/longtimerpackage.pas similarity index 95% rename from components/longtimer/longtimerpackage.pas rename to components/longtimer/latest_stable/longtimerpackage.pas index 155cb8bfb..c7de17f71 100644 --- a/components/longtimer/longtimerpackage.pas +++ b/components/longtimer/latest_stable/longtimerpackage.pas @@ -1,22 +1,22 @@ -{ This file was automatically created by Lazarus. Do not edit! - This source is only used to compile and install the package. - } - -unit longtimerpackage; - -interface - -uses - uLongTimer, AboutLongTimerunit, LazarusPackageIntf; - -implementation - -procedure Register; -begin - RegisterUnit('uLongTimer', @uLongTimer.Register); - RegisterUnit('AboutLongTimerunit', @AboutLongTimerunit.Register); -end; - -initialization - RegisterPackage('longtimerpackage', @Register); -end. +{ This file was automatically created by Lazarus. Do not edit! + This source is only used to compile and install the package. + } + +unit longtimerpackage; + +interface + +uses + uLongTimer, AboutLongTimerunit, LazarusPackageIntf; + +implementation + +procedure Register; +begin + RegisterUnit('uLongTimer', @uLongTimer.Register); + RegisterUnit('AboutLongTimerunit', @AboutLongTimerunit.Register); +end; + +initialization + RegisterPackage('longtimerpackage', @Register); +end. diff --git a/components/longtimer/readme.txt b/components/longtimer/latest_stable/readme.txt similarity index 95% rename from components/longtimer/readme.txt rename to components/longtimer/latest_stable/readme.txt index 13d8773e1..a60072251 100644 --- a/components/longtimer/readme.txt +++ b/components/longtimer/latest_stable/readme.txt @@ -1,28 +1,28 @@ -Summary -======= - -TLongTimer is a descendent of TIdleTimer with all of its properties and methods EXCEPT the property Inteval. - -Additional properties set the Interval to: - -Daily - at a set hour -Weekly - at a set Day (e.g. Monday) and Hour -Monthly - at a set date (e.g. 5th of the month) and Hour - -Demo application is included - -License: LGPL - -Author 'minesadorada' on the FreePascal.Org forum - -Suggested uses -============== -In a TrayIcon application to do periodical reminders, updates or alarms - -Version -======= -Lazarus 1.x and FPC 2.6.x - -OS -== +Summary +======= + +TLongTimer is a descendent of TIdleTimer with all of its properties and methods EXCEPT the property Inteval. + +Additional properties set the Interval to: + +Daily - at a set hour +Weekly - at a set Day (e.g. Monday) and Hour +Monthly - at a set date (e.g. 5th of the month) and Hour + +Demo application is included + +License: LGPL + +Author 'minesadorada' on the FreePascal.Org forum + +Suggested uses +============== +In a TrayIcon application to do periodical reminders, updates or alarms + +Version +======= +Lazarus 1.x and FPC 2.6.x + +OS +== Written with Win32 but should be cross-platform \ No newline at end of file diff --git a/components/longtimer/ulongtimer.pas b/components/longtimer/latest_stable/ulongtimer.pas similarity index 100% rename from components/longtimer/ulongtimer.pas rename to components/longtimer/latest_stable/ulongtimer.pas