TvPlanIt: Update gadgets sample project with TVpClock.Hold property.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8223 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2022-03-22 22:56:02 +00:00
parent 94a03d681b
commit fd89462d0c
3 changed files with 88 additions and 48 deletions

View File

@ -14,6 +14,7 @@ type
TForm1 = class(TForm)
BtnStartStop: TButton;
BtnPauseResume: TButton;
CbNewClockFace: TCheckBox;
CbMilitaryTime: TCheckBox;
EdCountDownTime: TEdit;
@ -25,6 +26,7 @@ type
VpClock: TVpClock;
VpLEDLabel1: TVpLEDLabel;
procedure AnalogClockCountdownDone(Sender: TObject);
procedure BtnPauseResumeClick(Sender: TObject);
procedure BtnStartStopClick(Sender: TObject);
procedure CbMilitaryTimeChange(Sender: TObject);
procedure CbNewClockFaceChange(Sender: TObject);
@ -57,6 +59,15 @@ begin
ShowMessage('Countdown finished.');
end;
procedure TForm1.BtnPauseResumeClick(Sender: TObject);
begin
VpClock.Hold := not VpClock.Hold;
if VpClock.Hold then
BtnPauseResume.Caption := 'Resume'
else
BtnPauseResume.Caption := 'Pause';
end;
procedure TForm1.VpClockTimeChange(Sender: TObject);
begin
LblElapsedTime.Caption := Format('Elapsed: %d hrs, %d min, %d sec', [
@ -77,8 +88,13 @@ begin
VpClock.Active := willStart;
if VpClock.Active then
BtnStartStop.Caption := 'Stop' else
BtnStartStop.Caption := 'Stop'
else
BtnStartStop.Caption := 'Start';
BtnPauseResume.Caption := 'Pause';
BtnPauseResume.Visible := VpClock.Active and
(TVpClockMode(RgClockMode.ItemIndex) in [cmTimer, cmCountdownTimer])
end;
procedure TForm1.CbMilitaryTimeChange(Sender: TObject);
@ -158,8 +174,10 @@ begin
VpClock.SecondOffset := s;
end;
end;
BtnPauseResume.Hide;
EdCountDownTime.Visible := VpClock.ClockMode = cmCountDownTimer;
LblCountDownTime.Visible := EdCountDownTime.Visible;
VpClock.DigitalOptions.MilitaryTime := CbMilitaryTime.Checked;
end;
procedure TForm1.RgDisplayModeClick(Sender: TObject);