diff --git a/applications/lazclock/clock_control.pas b/applications/lazclock/clock_control.pas new file mode 100644 index 000000000..dd949aa5e --- /dev/null +++ b/applications/lazclock/clock_control.pas @@ -0,0 +1,13 @@ +unit clock_control; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils; + +implementation + +end. + diff --git a/applications/lazclock/lazclock.ico b/applications/lazclock/lazclock.ico new file mode 100644 index 000000000..0341321b5 Binary files /dev/null and b/applications/lazclock/lazclock.ico differ diff --git a/applications/lazclock/lazclock.lpi b/applications/lazclock/lazclock.lpi new file mode 100644 index 000000000..663beaebf --- /dev/null +++ b/applications/lazclock/lazclock.lpi @@ -0,0 +1,95 @@ + + + + + + + + + + <ResourceType Value="res"/> + <UseXPManifest Value="True"/> + <Icon Value="0"/> + </General> + <i18n> + <EnableI18N LFM="False"/> + </i18n> + <VersionInfo> + <StringTable ProductVersion=""/> + </VersionInfo> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> + <ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + </local> + </RunParams> + <RequiredPackages Count="1"> + <Item1> + <PackageName Value="LCL"/> + </Item1> + </RequiredPackages> + <Units Count="3"> + <Unit0> + <Filename Value="lazclock.lpr"/> + <IsPartOfProject Value="True"/> + <UnitName Value="lazclock"/> + </Unit0> + <Unit1> + <Filename Value="mainform.pas"/> + <IsPartOfProject Value="True"/> + <ComponentName Value="Form1"/> + <ResourceBaseClass Value="Form"/> + <UnitName Value="mainform"/> + </Unit1> + <Unit2> + <Filename Value="clock_control.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="clock_control"/> + </Unit2> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="lazclock"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Linking> + <Options> + <Win32> + <GraphicApplication Value="True"/> + </Win32> + </Options> + </Linking> + <Other> + <CompilerMessages> + <MsgFileName Value=""/> + </CompilerMessages> + <CompilerPath Value="$(CompPath)"/> + </Other> + </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/applications/lazclock/lazclock.lpr b/applications/lazclock/lazclock.lpr new file mode 100644 index 000000000..58a428de7 --- /dev/null +++ b/applications/lazclock/lazclock.lpr @@ -0,0 +1,21 @@ +program lazclock; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Interfaces, // this includes the LCL widgetset + Forms, mainform, clock_control + { you can add units after this }; + +{$R *.res} + +begin + RequireDerivedFormResource := True; + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. + diff --git a/applications/lazclock/lazclock.res b/applications/lazclock/lazclock.res new file mode 100644 index 000000000..7c6cf3e4b Binary files /dev/null and b/applications/lazclock/lazclock.res differ diff --git a/applications/lazclock/mainform.lfm b/applications/lazclock/mainform.lfm new file mode 100644 index 000000000..47b81f65e --- /dev/null +++ b/applications/lazclock/mainform.lfm @@ -0,0 +1,83 @@ +object Form1: TForm1 + Left = 337 + Height = 444 + Top = 225 + Width = 400 + Caption = 'LazClock' + ClientHeight = 444 + ClientWidth = 400 + LCLVersion = '0.9.31' + object Notebook: TNotebook + Left = 0 + Height = 400 + Top = 44 + Width = 400 + PageIndex = 1 + Align = alBottom + TabOrder = 0 + TabStop = True + object Page1: TPage + end + object pageCronometer: TPage + object btnStart: TButton + Left = 24 + Height = 25 + Top = 68 + Width = 75 + Caption = 'btnStart' + OnClick = btnStartClick + TabOrder = 0 + end + object btnStop: TButton + Left = 24 + Height = 25 + Top = 100 + Width = 75 + Caption = 'btnStop' + OnClick = btnStopClick + TabOrder = 1 + end + object btnReset: TButton + Left = 24 + Height = 25 + Top = 132 + Width = 75 + Caption = 'btnReset' + OnClick = btnResetClick + TabOrder = 2 + end + object labelCronometer: TLabel + Left = 8 + Height = 65 + Top = -4 + Width = 387 + Caption = 'labelCronometer' + Font.Height = -53 + ParentColor = False + ParentFont = False + end + end + end + object btnCronometer: TButton + Left = 10 + Height = 25 + Top = 11 + Width = 75 + Caption = 'Cronometer' + OnClick = btnCronometerClick + TabOrder = 1 + end + object timerClock: TTimer + Enabled = False + OnTimer = timerClockTimer + left = 312 + top = 110 + end + object timerCronometer: TTimer + Enabled = False + Interval = 20 + OnTimer = timerCronometerTimer + left = 312 + top = 161 + end +end diff --git a/applications/lazclock/mainform.pas b/applications/lazclock/mainform.pas new file mode 100644 index 000000000..ac455bd7f --- /dev/null +++ b/applications/lazclock/mainform.pas @@ -0,0 +1,91 @@ +unit mainform; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, + ExtCtrls, DateUtils; + +type + + { TForm1 } + + TForm1 = class(TForm) + btnCronometer: TButton; + btnStart: TButton; + btnStop: TButton; + btnReset: TButton; + labelCronometer: TLabel; + Notebook: TNotebook; + Page1: TPage; + pageCronometer: TPage; + timerCronometer: TTimer; + timerClock: TTimer; + procedure btnCronometerClick(Sender: TObject); + procedure btnResetClick(Sender: TObject); + procedure btnStartClick(Sender: TObject); + procedure btnStopClick(Sender: TObject); + procedure timerClockTimer(Sender: TObject); + procedure timerCronometerTimer(Sender: TObject); + private + { private declarations } + public + { public declarations } + CronometerStarted: Boolean; + CronometerTime, CronometerLastUpdate: TTime; + end; + +var + Form1: TForm1; + +implementation + +{$R *.lfm} + +{ TForm1 } + +procedure TForm1.timerClockTimer(Sender: TObject); +begin + +end; + +procedure TForm1.timerCronometerTimer(Sender: TObject); +var + lNow: TDateTime; + lFormatSettings: TFormatSettings; +begin + lNow := Now(); + CronometerTime := CronometerTime + CronometerLastUpdate - lNow; + CronometerLastUpdate := lNow; + lFormatSettings := SysUtils.FormatSettings; + lFormatSettings.LongTimeFormat := 'hh:nn:ss:zzz'; + labelCronometer.Caption := SysUtils.TimeToStr(CronometerTime, lFormatSettings); +end; + +procedure TForm1.btnCronometerClick(Sender: TObject); +begin + Notebook.PageIndex := 1; +end; + +procedure TForm1.btnResetClick(Sender: TObject); +begin + CronometerTime := DateUtils.EncodeTimeInterval(0, 0, 0, 0); +end; + +procedure TForm1.btnStartClick(Sender: TObject); +begin + CronometerStarted := True; + timerCronometer.Enabled := True; + CronometerLastUpdate := Now(); +end; + +procedure TForm1.btnStopClick(Sender: TObject); +begin + CronometerStarted := False; + timerCronometer.Enabled := False; +end; + +end. + diff --git a/applications/lazclock/skins/Thumbs.db b/applications/lazclock/skins/Thumbs.db new file mode 100644 index 000000000..1e455d067 Binary files /dev/null and b/applications/lazclock/skins/Thumbs.db differ diff --git a/applications/lazclock/skins/wallclock1.PNG b/applications/lazclock/skins/wallclock1.PNG new file mode 100644 index 000000000..6ef2116f7 Binary files /dev/null and b/applications/lazclock/skins/wallclock1.PNG differ