From 82e258bdb7f4ff91ec9324ea715cf2669d43f229 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Wed, 29 Jun 2016 13:55:10 +0000 Subject: [PATCH] tvplanit: Call notification when City-state-zip format is changed. Some improvements in "demo" projects. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4867 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/tvplanit/examples/demo/demomain.lfm | 6 +++++- components/tvplanit/examples/demo/demomain.lrt | 1 + components/tvplanit/examples/demo/demomain.pas | 8 ++++++++ components/tvplanit/languages/demo.de.po | 6 +++++- components/tvplanit/languages/demo.po | 4 ++++ components/tvplanit/source/vpbaseds.pas | 6 ++++-- 6 files changed, 27 insertions(+), 4 deletions(-) diff --git a/components/tvplanit/examples/demo/demomain.lfm b/components/tvplanit/examples/demo/demomain.lfm index 2d65b0184..e71bc757e 100644 --- a/components/tvplanit/examples/demo/demomain.lfm +++ b/components/tvplanit/examples/demo/demomain.lfm @@ -486,9 +486,11 @@ object MainForm: TMainForm TabOrder = 4 end object LblAddressBuilder: TLabel + AnchorSideTop.Control = CbAddressBuilder + AnchorSideTop.Side = asrCenter Left = 16 Height = 15 - Top = 149 + Top = 148 Width = 82 Caption = 'Address builder' ParentColor = False @@ -499,6 +501,7 @@ object MainForm: TMainForm Top = 144 Width = 172 ItemHeight = 15 + ItemIndex = 0 Items.Strings = ( '(default)' '@ZIP @CITY' @@ -508,6 +511,7 @@ object MainForm: TMainForm OnChange = CbAddressBuilderChange Style = csDropDownList TabOrder = 5 + Text = '(default)' end end end diff --git a/components/tvplanit/examples/demo/demomain.lrt b/components/tvplanit/examples/demo/demomain.lrt index e4b933b3d..9c0cf3dca 100644 --- a/components/tvplanit/examples/demo/demomain.lrt +++ b/components/tvplanit/examples/demo/demomain.lrt @@ -18,6 +18,7 @@ TMAINFORM.LBLFIRSTDAYOFWEEK.CAPTION=First day of week TMAINFORM.CBALLOWINPLACEEDITING.CAPTION=Allow inplace editing TMAINFORM.CB3D.CAPTION=3d display mode TMAINFORM.LBLADDRESSBUILDER.CAPTION=Address builder +TMAINFORM.CBADDRESSBUILDER.TEXT=(default) TMAINFORM.TITLELBL.CAPTION=TitleLbl TMAINFORM.MENUITEM1.CAPTION=File TMAINFORM.MNUQUIT.CAPTION=Quit diff --git a/components/tvplanit/examples/demo/demomain.pas b/components/tvplanit/examples/demo/demomain.pas index 46228efac..ba5934963 100644 --- a/components/tvplanit/examples/demo/demomain.pas +++ b/components/tvplanit/examples/demo/demomain.pas @@ -467,6 +467,11 @@ begin DaysTrackbarChange(nil); end; + VpControlLink1.CityStateZipFormat := ini.ReadString('Settings', 'CityStateZip', ''); + if VpControlLink1.CityStateZipFormat = '' then + CbAddressBuilder.ItemIndex := 0 else + CbAddressBuilder.ItemIndex := CbAddressBuilder.Items.Indexof(VpControlLink1.CityStateZipFormat); + CbAllowInplaceEditing.Checked := ini.ReadBool('Settings', 'AllowInplaceEditing', CbAllowInplaceEditing.Checked); CbAllowInplaceEditingChange(nil); @@ -497,6 +502,7 @@ begin ini.WriteInteger('Settings', 'TimeFormat', ord(VpDayView1.TimeFormat)); ini.WriteInteger('Settings', 'Granularity', ord(VpDayView1.Granularity)); ini.WriteInteger('Settings', 'FirstDayOfWeek', ord(VpWeekView1.WeekStartsOn)); + ini.WriteString('Settings', 'CityStateZip', VpControlLink1.CityStateZipFormat); ini.WriteInteger('Settings', 'VisibleDays', FVisibleDays); ini.WriteBool('Settings', 'AllTasks', VpTaskList1.DisplayOptions.ShowAll); ini.WriteBool('Settings', 'AllowInplaceEditing', CbAllowInplaceEditing.Checked); @@ -631,6 +637,8 @@ begin LblTimeFormat.Left := CbTimeFormat.Left - 8 - GetLabelWidth(LblTimeFormat); CbFirstDayOfWeek.Left := CbLanguages.Left; LblFirstDayOfWeek.Left := CbFirstDayOfWeek.Left - 8 - GetLabelWidth(LblFirstDayOfWeek); + CbAddressBuilder.Left := CbLanguages.Left; + LblAddressBuilder.Left := CbAddressBuilder.Left - 8 - GetLabelWidth(LblAddressBuilder); CbAllowInplaceEditing.Left := CbLanguages.Left + CbLanguages.Width + 32; Cb3D.Left := CbAllowInplaceEditing.Left; RbHideCompletedTasks.Left := RbAllTasks.Left + RbAllTasks.Width + 48; diff --git a/components/tvplanit/languages/demo.de.po b/components/tvplanit/languages/demo.de.po index 1f8c26d0e..2e455a26d 100644 --- a/components/tvplanit/languages/demo.de.po +++ b/components/tvplanit/languages/demo.de.po @@ -147,6 +147,10 @@ msgstr "Turbo Power VisualPlanIt Demo" #: tmainform.cb3d.caption msgid "3d display mode" +msgstr "3D-Anzeige" + +#: tmainform.cbaddressbuilder.text +msgid "(default)" msgstr "" #: tmainform.cballowinplaceediting.caption @@ -159,7 +163,7 @@ msgstr "30 Min" #: tmainform.lbladdressbuilder.caption msgid "Address builder" -msgstr "" +msgstr "Aufbau der Adresse:" #: tmainform.lblfirstdayofweek.caption msgid "First day of week" diff --git a/components/tvplanit/languages/demo.po b/components/tvplanit/languages/demo.po index 82e944eba..d925865d2 100644 --- a/components/tvplanit/languages/demo.po +++ b/components/tvplanit/languages/demo.po @@ -138,6 +138,10 @@ msgstr "" msgid "3d display mode" msgstr "" +#: tmainform.cbaddressbuilder.text +msgid "(default)" +msgstr "" + #: tmainform.cballowinplaceediting.caption msgid "Allow inplace editing" msgstr "" diff --git a/components/tvplanit/source/vpbaseds.pas b/components/tvplanit/source/vpbaseds.pas index de68aaf4b..d648035ae 100644 --- a/components/tvplanit/source/vpbaseds.pas +++ b/components/tvplanit/source/vpbaseds.pas @@ -1342,8 +1342,10 @@ end; procedure TVpControlLink.SetCityStateZipFormat(const Value: String); begin - if FCityStateZipFormat <> Value then - FCityStateZipFormat := Value + if FCityStateZipFormat <> Value then begin + FCityStateZipFormat := Value; + Notify(self, neInvalidate, 0); + end; end; procedure TVpControlLink.SetDataStore(const Value: TVpCustomDataStore);