diff --git a/components/tvplanit/examples/demo/demomain.lfm b/components/tvplanit/examples/demo/demomain.lfm index ea5551372..934a25b3c 100644 --- a/components/tvplanit/examples/demo/demomain.lfm +++ b/components/tvplanit/examples/demo/demomain.lfm @@ -25,9 +25,9 @@ object MainForm: TMainForm Height = 532 Top = 48 Width = 780 - ActivePage = TabSettings + ActivePage = TabEvents Align = alClient - TabIndex = 4 + TabIndex = 0 TabOrder = 0 object TabEvents: TTabSheet Caption = 'Events' @@ -431,6 +431,15 @@ object MainForm: TMainForm State = cbChecked TabOrder = 3 end + object Cb3D: TCheckBox + Left = 349 + Height = 19 + Top = 64 + Width = 107 + Caption = '3d display mode' + OnChange = Cb3DChange + TabOrder = 4 + end end end object HeaderPanel: TPanel diff --git a/components/tvplanit/examples/demo/demomain.lrt b/components/tvplanit/examples/demo/demomain.lrt index 76e44642d..c866c4574 100644 --- a/components/tvplanit/examples/demo/demomain.lrt +++ b/components/tvplanit/examples/demo/demomain.lrt @@ -16,6 +16,7 @@ TMAINFORM.LBLLANGUAGE.CAPTION=Language TMAINFORM.LBLTIMEFORMAT.CAPTION=Time format TMAINFORM.LBLFIRSTDAYOFWEEK.CAPTION=First day of week TMAINFORM.CBALLOWINPLACEEDITING.CAPTION=Allow inplace editing +TMAINFORM.CB3D.CAPTION=3d display mode 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 6ef1a2633..986207f5d 100644 --- a/components/tvplanit/examples/demo/demomain.pas +++ b/components/tvplanit/examples/demo/demomain.pas @@ -23,6 +23,7 @@ type CbTimeFormat: TComboBox; CbFirstDayOfWeek: TComboBox; CbAllowInplaceEditing: TCheckBox; + Cb3D: TCheckBox; Img: TImage; ImageList1: TImageList; LblFirstDayOfWeek: TLabel; @@ -69,6 +70,7 @@ type procedure BtnDeleteResClick(Sender: TObject); procedure BtnNewResClick(Sender: TObject); procedure BtnEditResClick(Sender: TObject); + procedure Cb3DChange(Sender: TObject); procedure CbAllowInplaceEditingChange(Sender: TObject); procedure CbFirstDayOfWeekChange(Sender: TObject); procedure CbGranularityChange(Sender: TObject); @@ -237,6 +239,18 @@ begin VpResourceEditDialog1.AddNewResource; end; +procedure TMainForm.Cb3DChange(Sender: TObject); +var + ds: TVpDrawingStyle; +begin + if Cb3D.Checked then ds := ds3d else ds := dsFlat; + VpTaskList1.DrawingStyle := ds; + VpContactGrid1.DrawingStyle := ds; + VpDayView1.DrawingStyle := ds; + VpWeekView1.DrawingStyle := ds; + VpMonthView1.DrawingStyle := ds; +end; + procedure TMainForm.CbAllowInplaceEditingChange(Sender: TObject); begin VpContactGrid1.AllowInplaceEditing := CbAllowInplaceEditing.Checked; @@ -601,6 +615,7 @@ begin CbFirstDayOfWeek.Left := CbLanguages.Left; LblFirstDayOfWeek.Left := CbFirstDayOfWeek.Left - 8 - GetLabelWidth(LblFirstDayOfWeek); CbAllowInplaceEditing.Left := CbLanguages.Left + CbLanguages.Width + 32; + Cb3D.Left := CbAllowInplaceEditing.Left; RbHideCompletedTasks.Left := RbAllTasks.Left + RbAllTasks.Width + 48; // Next settings work correctly only for Windows. diff --git a/components/tvplanit/languages/demo.de.po b/components/tvplanit/languages/demo.de.po index ee615fda7..cd452a3d6 100644 --- a/components/tvplanit/languages/demo.de.po +++ b/components/tvplanit/languages/demo.de.po @@ -145,6 +145,10 @@ msgstr "Neu" msgid "Turbo Power VisualPlanIt Demo" msgstr "Turbo Power VisualPlanIt Demo" +#: tmainform.cb3d.caption +msgid "3d display mode" +msgstr "" + #: tmainform.cballowinplaceediting.caption msgid "Allow inplace editing" msgstr "Editieren an Ort und Stelle erlauben" @@ -241,3 +245,4 @@ msgstr "Aufgaben" #: tmainform.titlelbl.caption msgid "TitleLbl" msgstr "" + diff --git a/components/tvplanit/languages/demo.po b/components/tvplanit/languages/demo.po index 4deaa6812..1811ea273 100644 --- a/components/tvplanit/languages/demo.po +++ b/components/tvplanit/languages/demo.po @@ -134,6 +134,10 @@ msgstr "" msgid "Turbo Power VisualPlanIt Demo" msgstr "" +#: tmainform.cb3d.caption +msgid "3d display mode" +msgstr "" + #: tmainform.cballowinplaceediting.caption msgid "Allow inplace editing" msgstr "" diff --git a/components/tvplanit/source/vpmisc.pas b/components/tvplanit/source/vpmisc.pas index 13900a87f..43ea6f8fd 100644 --- a/components/tvplanit/source/vpmisc.pas +++ b/components/tvplanit/source/vpmisc.pas @@ -127,6 +127,8 @@ function GetLineDuration(Granularity: TVpGranularity): Double; function GetLabelWidth(ALabel: TLabel): Integer; +function SameDate(dt1, dt2: TDateTime): Boolean; + implementation uses @@ -605,4 +607,9 @@ begin canvas.Free; end; +function SameDate(dt1, dt2: TDateTime): Boolean; +begin + Result := trunc(dt1) = trunc(dt2); +end; + end.