From d403f8aef431bdbdfd0856e5513f55935a58a699 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Thu, 15 Aug 2019 17:46:25 +0000 Subject: [PATCH] jvcllaz: Identify alarm as over-due (JvTimeFramework demo). git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7136 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../jvcllaz/examples/JvTimeFramework/JvTimeFrameDemo.lpi | 1 + components/jvcllaz/examples/JvTimeFramework/tfalarm.pas | 8 ++++++-- .../jvcllaz/examples/JvTimeFramework/tfapptedit.lfm | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/components/jvcllaz/examples/JvTimeFramework/JvTimeFrameDemo.lpi b/components/jvcllaz/examples/JvTimeFramework/JvTimeFrameDemo.lpi index 36b1fa0ee..3abd2db06 100644 --- a/components/jvcllaz/examples/JvTimeFramework/JvTimeFrameDemo.lpi +++ b/components/jvcllaz/examples/JvTimeFramework/JvTimeFrameDemo.lpi @@ -105,6 +105,7 @@ + diff --git a/components/jvcllaz/examples/JvTimeFramework/tfalarm.pas b/components/jvcllaz/examples/JvTimeFramework/tfalarm.pas index f2b4e3505..e6459e553 100644 --- a/components/jvcllaz/examples/JvTimeFramework/tfalarm.pas +++ b/components/jvcllaz/examples/JvTimeFramework/tfalarm.pas @@ -66,12 +66,16 @@ var deltaMins: Integer; begin EventLabel.Caption := AAppt.Description; + if AAppt.StartDate < Now() then begin + IsDueLabel.Caption := 'is OVERDUE: '; + TimeLabel.Caption := FormatDateTime('t', AAppt.StartTime); // 't' = ShortTimeFormat + end else if AAppt.StartDate = Date() then begin IsDueLabel.caption := 'is due at '; - TimeLabel.Caption := FormatDateTime(FormatSettings.ShortTimeFormat, AAppt.StartTime); + TimeLabel.Caption := FormatDateTime('t', AAppt.StartTime); end else begin IsDueLabel.Caption := 'is due on '; - TimeLabel.Caption := FormatDateTime('dddddd', AAppt.StartDateTime); + TimeLabel.Caption := FormatDateTime('dddddd', AAppt.StartDateTime); // LongDateFormat end; end; diff --git a/components/jvcllaz/examples/JvTimeFramework/tfapptedit.lfm b/components/jvcllaz/examples/JvTimeFramework/tfapptedit.lfm index c5f094204..d1abf9061 100644 --- a/components/jvcllaz/examples/JvTimeFramework/tfapptedit.lfm +++ b/components/jvcllaz/examples/JvTimeFramework/tfapptedit.lfm @@ -320,9 +320,9 @@ object ApptEdit: TApptEdit Height = 23 Top = 115 Width = 37 + Alignment = taRightJustify BorderSpacing.Left = 8 BorderSpacing.Bottom = 8 - ReadOnly = True TabOrder = 6 Text = '0' end