tvplanit: Fix gadgets demo for Laz 1.4.4.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5056 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-07-31 11:55:04 +00:00
parent 3771d2c3bb
commit 710725dd66
3 changed files with 28 additions and 29 deletions

View File

@ -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}

View File

@ -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

View File

@ -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;