From 2a1891258d76592421372d3200453229765a3134 Mon Sep 17 00:00:00 2001 From: juha Date: Mon, 8 May 2017 12:36:51 +0000 Subject: [PATCH] DbEditMask example: Fix ShortDateFormat, it raised an exception. git-svn-id: trunk@54833 - --- examples/dbeditmask/Unit1.lfm | 16 ++++++++-------- examples/dbeditmask/Unit1.pas | 4 ++-- examples/dbeditmask/project1.lpi | 7 ++----- examples/dbeditmask/project1.res | Bin 1422 -> 1657 bytes 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/examples/dbeditmask/Unit1.lfm b/examples/dbeditmask/Unit1.lfm index 41ca220ed3..50b68a4a96 100644 --- a/examples/dbeditmask/Unit1.lfm +++ b/examples/dbeditmask/Unit1.lfm @@ -12,7 +12,7 @@ object Form1: TForm1 Font.Name = 'MS Sans Serif' OnCreate = FormCreate Position = poScreenCenter - LCLVersion = '1.5' + LCLVersion = '1.9.0.0' object Label3: TLabel Left = 8 Height = 13 @@ -68,7 +68,7 @@ object Form1: TForm1 end object DateEdit: TDBEdit Left = 8 - Height = 21 + Height = 19 Top = 32 Width = 246 CustomEditMask = True @@ -81,16 +81,16 @@ object Form1: TForm1 end object ShowLongDateCheckBox: TCheckBox Left = 270 - Height = 19 + Height = 21 Top = 32 - Width = 92 + Width = 112 Caption = 'Show Full Date' OnChange = ShowLongDateCheckBoxChange TabOrder = 3 end object IntEdit: TDBEdit Left = 8 - Height = 21 + Height = 19 Top = 80 Width = 246 CustomEditMask = True @@ -105,13 +105,13 @@ object Form1: TForm1 Left = 8 Height = 13 Top = 64 - Width = 44 + Width = 51 Caption = 'AInt Field' ParentColor = False end object DBEdit1: TDBEdit Left = 271 - Height = 21 + Height = 19 Top = 80 Width = 193 CustomEditMask = True @@ -126,7 +126,7 @@ object Form1: TForm1 Left = 270 Height = 13 Top = 64 - Width = 85 + Width = 100 Caption = 'AStr Field (Phone)' ParentColor = False end diff --git a/examples/dbeditmask/Unit1.pas b/examples/dbeditmask/Unit1.pas index 37a1bb042a..fd173fa2f4 100644 --- a/examples/dbeditmask/Unit1.pas +++ b/examples/dbeditmask/Unit1.pas @@ -52,7 +52,7 @@ uses procedure TForm1.FormCreate(Sender: TObject); begin - ShortDateFormat := 'd/M/yyyy'; + DefaultFormatSettings.ShortDateFormat := 'd/m/yyyy'; if not FileExistsUTF8(Dbf1.TableName) then begin Dbf1.FieldDefs.Clear; @@ -112,7 +112,7 @@ var begin DateField := Dbf1.FieldByName('ADate') as TDateTimeField; if ShowLongDateCheckBox.Checked then - DateField.DisplayFormat := LongDateFormat + DateField.DisplayFormat := DefaultFormatSettings.LongDateFormat else DateField.DisplayFormat := ''; end; diff --git a/examples/dbeditmask/project1.lpi b/examples/dbeditmask/project1.lpi index d01a99f03f..678c8be6db 100644 --- a/examples/dbeditmask/project1.lpi +++ b/examples/dbeditmask/project1.lpi @@ -1,7 +1,7 @@ - + @@ -9,9 +9,6 @@ - - - @@ -24,7 +21,7 @@ - + diff --git a/examples/dbeditmask/project1.res b/examples/dbeditmask/project1.res index e1df0e994f40ffa3fe25cf9b7348db6efe4ef698..bc23f8c77ed575e1c5a54800e9b3941dbf133309 100644 GIT binary patch delta 250 zcmeC<{>d{zfyt6>qSAkM$ASXC#N5=$8jLoZGa02=OEUBG z6e@Ca@`|m%;*%4ZWhT#K;;o0MD$mSI$uBPsPAw_P%u6qZsI*neC@Cqh($_Ce&PdHo zEY{1-OfJeV&QB}ROU}>L5BBxcH!?6V)elG2tYpW_rJ$f-lTwiBSe{svYUh@iQ=Dp} h59foVZS)})o1obY(hHMAayn2LBwC!Bo0L;&2LMHKRhs|+ delta 47 zcmey#)5kqQfys|`qSAl%$o$eG$AW^%8jLoq3K^+Ishd+6rC7La^b?DVQ*)DYD(wJs C