diff --git a/components/tvplanit/examples/fulldemo/demomain.pas b/components/tvplanit/examples/fulldemo/demomain.pas index c18c7de83..d024a38b1 100644 --- a/components/tvplanit/examples/fulldemo/demomain.pas +++ b/components/tvplanit/examples/fulldemo/demomain.pas @@ -155,8 +155,8 @@ uses {$UNDEF UTF8_CALLS} {$IFDEF LCL} {$DEFINE UTF8_CALLS} - {$IF lcl_major=1 and (lcl_minor<6)} - {$UNDDEF UTF8_CALLS} + {$IF (lcl_major=1) and (lcl_minor<6)} + {$UNDEF UTF8_CALLS} {$ENDIF} {$ENDIF} diff --git a/components/tvplanit/examples/gadgets/unit1.lfm b/components/tvplanit/examples/gadgets/unit1.lfm index f4fbac654..ec7ffae82 100644 --- a/components/tvplanit/examples/gadgets/unit1.lfm +++ b/components/tvplanit/examples/gadgets/unit1.lfm @@ -28,7 +28,7 @@ object Form1: TForm1 Active = False Color = clForm ClockMode = cmClock - DigitalOptions.MilitaryTime = True + DigitalOptions.MilitaryTime = False DigitalOptions.OnColor = clLime DigitalOptions.OffColor = 930866 DigitalOptions.BgColor = clBlack @@ -57,11 +57,11 @@ object Form1: TForm1 object BtnStartStop: TButton Left = 351 Height = 51 - Top = 80 + Top = 189 Width = 99 Caption = 'Start' OnClick = BtnStartStopClick - TabOrder = 1 + TabOrder = 6 end object RgClockMode: TRadioGroup Left = 224 @@ -88,23 +88,10 @@ object Form1: TForm1 OnClick = RgClockModeClick TabOrder = 2 end - object EdCountDownTime: TTimeEdit - Left = 351 - Height = 23 - Top = 172 - Width = 99 - ButtonWidth = 23 - NumGlyphs = 1 - MaxLength = 0 - OnChange = EdCountDownTimeChange - TabOrder = 3 - Visible = False - Text = '00:30:00' - end object LblCountDownTime: TLabel Left = 351 Height = 15 - Top = 152 + Top = 72 Width = 98 Caption = 'Count-down time:' FocusControl = EdCountDownTime @@ -114,11 +101,11 @@ object Form1: TForm1 object CbNewClockFace: TCheckBox Left = 351 Height = 19 - Top = 221 + Top = 141 Width = 100 Caption = 'New clock face' OnChange = CbNewClockFaceChange - TabOrder = 4 + TabOrder = 5 end object LblElapsedTime: TLabel Left = 224 @@ -150,16 +137,26 @@ object Form1: TForm1 'Digital' ) OnClick = RgDisplayModeClick - TabOrder = 5 + TabOrder = 1 end object CbMilitaryTime: TCheckBox Left = 351 Height = 19 - Top = 208 + Top = 128 Width = 87 Caption = 'Military time' OnChange = CbMilitaryTimeChange - TabOrder = 6 + TabOrder = 4 + Visible = False + end + object EdCountDownTime: TEdit + Left = 351 + Height = 23 + Top = 92 + Width = 99 + OnChange = EdCountDownTimeChange + TabOrder = 3 + Text = '00:00:30' Visible = False end end diff --git a/components/tvplanit/examples/gadgets/unit1.pas b/components/tvplanit/examples/gadgets/unit1.pas index 7db4b5953..cd9cd2d7a 100644 --- a/components/tvplanit/examples/gadgets/unit1.pas +++ b/components/tvplanit/examples/gadgets/unit1.pas @@ -6,7 +6,7 @@ interface uses Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, - ExtCtrls, EditBtn, VpLEDLabel, VpClock; + ExtCtrls, VpLEDLabel, VpClock; type @@ -16,12 +16,12 @@ type BtnStartStop: TButton; CbNewClockFace: TCheckBox; CbMilitaryTime: TCheckBox; + EdCountDownTime: TEdit; LblCountDownTime: TLabel; LblElapsedTime: TLabel; RgDisplayMode: TRadioGroup; RgClockMode: TRadioGroup; VpClock1: TVpClock; - EdCountDownTime: TTimeEdit; VpLEDLabel1: TVpLEDLabel; procedure AnalogClockCountdownDone(Sender: TObject); procedure CbMilitaryTimeChange(Sender: TObject); @@ -109,14 +109,16 @@ begin end; procedure TForm1.EdCountDownTimeChange(Sender: TObject); +var + t: TTime; begin if VpClock1.ClockMode = cmCountDownTimer then - VpClock1.Time := EdCountDownTime.Time; + if TryStrToTime(EdCountdownTime.Text, t) then + VpClock1.Time := t; end; procedure TForm1.FormCreate(Sender: TObject); begin - EdCountDownTime.Time := StrToTime(EdCountDownTime.Text); CbMilitaryTime.Top := CbNewClockFace.Top; end; @@ -138,7 +140,7 @@ begin VpClock1.Time := 0; cmCountdownTimer: begin - DecodeTime(EdCountDownTime.Time, h,m,s,ms); + DecodeTime(StrToTime(EdCountDownTime.Text), h,m,s,ms); VpClock1.HourOffset := h; VpClock1.MinuteOffset := m; VpClock1.SecondOffset := s;