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} {$UNDEF UTF8_CALLS}
{$IFDEF LCL} {$IFDEF LCL}
{$DEFINE UTF8_CALLS} {$DEFINE UTF8_CALLS}
{$IF lcl_major=1 and (lcl_minor<6)} {$IF (lcl_major=1) and (lcl_minor<6)}
{$UNDDEF UTF8_CALLS} {$UNDEF UTF8_CALLS}
{$ENDIF} {$ENDIF}
{$ENDIF} {$ENDIF}

View File

@ -28,7 +28,7 @@ object Form1: TForm1
Active = False Active = False
Color = clForm Color = clForm
ClockMode = cmClock ClockMode = cmClock
DigitalOptions.MilitaryTime = True DigitalOptions.MilitaryTime = False
DigitalOptions.OnColor = clLime DigitalOptions.OnColor = clLime
DigitalOptions.OffColor = 930866 DigitalOptions.OffColor = 930866
DigitalOptions.BgColor = clBlack DigitalOptions.BgColor = clBlack
@ -57,11 +57,11 @@ object Form1: TForm1
object BtnStartStop: TButton object BtnStartStop: TButton
Left = 351 Left = 351
Height = 51 Height = 51
Top = 80 Top = 189
Width = 99 Width = 99
Caption = 'Start' Caption = 'Start'
OnClick = BtnStartStopClick OnClick = BtnStartStopClick
TabOrder = 1 TabOrder = 6
end end
object RgClockMode: TRadioGroup object RgClockMode: TRadioGroup
Left = 224 Left = 224
@ -88,23 +88,10 @@ object Form1: TForm1
OnClick = RgClockModeClick OnClick = RgClockModeClick
TabOrder = 2 TabOrder = 2
end 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 object LblCountDownTime: TLabel
Left = 351 Left = 351
Height = 15 Height = 15
Top = 152 Top = 72
Width = 98 Width = 98
Caption = 'Count-down time:' Caption = 'Count-down time:'
FocusControl = EdCountDownTime FocusControl = EdCountDownTime
@ -114,11 +101,11 @@ object Form1: TForm1
object CbNewClockFace: TCheckBox object CbNewClockFace: TCheckBox
Left = 351 Left = 351
Height = 19 Height = 19
Top = 221 Top = 141
Width = 100 Width = 100
Caption = 'New clock face' Caption = 'New clock face'
OnChange = CbNewClockFaceChange OnChange = CbNewClockFaceChange
TabOrder = 4 TabOrder = 5
end end
object LblElapsedTime: TLabel object LblElapsedTime: TLabel
Left = 224 Left = 224
@ -150,16 +137,26 @@ object Form1: TForm1
'Digital' 'Digital'
) )
OnClick = RgDisplayModeClick OnClick = RgDisplayModeClick
TabOrder = 5 TabOrder = 1
end end
object CbMilitaryTime: TCheckBox object CbMilitaryTime: TCheckBox
Left = 351 Left = 351
Height = 19 Height = 19
Top = 208 Top = 128
Width = 87 Width = 87
Caption = 'Military time' Caption = 'Military time'
OnChange = CbMilitaryTimeChange 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 Visible = False
end end
end end

View File

@ -6,7 +6,7 @@ interface
uses uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
ExtCtrls, EditBtn, VpLEDLabel, VpClock; ExtCtrls, VpLEDLabel, VpClock;
type type
@ -16,12 +16,12 @@ type
BtnStartStop: TButton; BtnStartStop: TButton;
CbNewClockFace: TCheckBox; CbNewClockFace: TCheckBox;
CbMilitaryTime: TCheckBox; CbMilitaryTime: TCheckBox;
EdCountDownTime: TEdit;
LblCountDownTime: TLabel; LblCountDownTime: TLabel;
LblElapsedTime: TLabel; LblElapsedTime: TLabel;
RgDisplayMode: TRadioGroup; RgDisplayMode: TRadioGroup;
RgClockMode: TRadioGroup; RgClockMode: TRadioGroup;
VpClock1: TVpClock; VpClock1: TVpClock;
EdCountDownTime: TTimeEdit;
VpLEDLabel1: TVpLEDLabel; VpLEDLabel1: TVpLEDLabel;
procedure AnalogClockCountdownDone(Sender: TObject); procedure AnalogClockCountdownDone(Sender: TObject);
procedure CbMilitaryTimeChange(Sender: TObject); procedure CbMilitaryTimeChange(Sender: TObject);
@ -109,14 +109,16 @@ begin
end; end;
procedure TForm1.EdCountDownTimeChange(Sender: TObject); procedure TForm1.EdCountDownTimeChange(Sender: TObject);
var
t: TTime;
begin begin
if VpClock1.ClockMode = cmCountDownTimer then if VpClock1.ClockMode = cmCountDownTimer then
VpClock1.Time := EdCountDownTime.Time; if TryStrToTime(EdCountdownTime.Text, t) then
VpClock1.Time := t;
end; end;
procedure TForm1.FormCreate(Sender: TObject); procedure TForm1.FormCreate(Sender: TObject);
begin begin
EdCountDownTime.Time := StrToTime(EdCountDownTime.Text);
CbMilitaryTime.Top := CbNewClockFace.Top; CbMilitaryTime.Top := CbNewClockFace.Top;
end; end;
@ -138,7 +140,7 @@ begin
VpClock1.Time := 0; VpClock1.Time := 0;
cmCountdownTimer: cmCountdownTimer:
begin begin
DecodeTime(EdCountDownTime.Time, h,m,s,ms); DecodeTime(StrToTime(EdCountDownTime.Text), h,m,s,ms);
VpClock1.HourOffset := h; VpClock1.HourOffset := h;
VpClock1.MinuteOffset := m; VpClock1.MinuteOffset := m;
VpClock1.SecondOffset := s; VpClock1.SecondOffset := s;