diff --git a/components/tvplanit/examples/fulldemo/demo.lpi b/components/tvplanit/examples/fulldemo/demo.lpi
index 617393a71..a7e7c2e71 100644
--- a/components/tvplanit/examples/fulldemo/demo.lpi
+++ b/components/tvplanit/examples/fulldemo/demo.lpi
@@ -39,7 +39,7 @@
-
+
@@ -63,6 +63,13 @@
+
+
+
+
+
+
+
diff --git a/components/tvplanit/examples/fulldemo/demo.lpr b/components/tvplanit/examples/fulldemo/demo.lpr
index 05674537a..5f7bdb17c 100644
--- a/components/tvplanit/examples/fulldemo/demo.lpr
+++ b/components/tvplanit/examples/fulldemo/demo.lpr
@@ -8,13 +8,14 @@ uses
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, demoMain, laz_visualplanit, LCLTranslator, DefaultTranslator,
- printer4lazarus;
+ printer4lazarus, demoDatamodule;
{$R *.res}
begin
RequireDerivedFormResource := True;
Application.Initialize;
+ Application.CreateForm(TDemoDM, DemoDM);
Application.CreateForm(TMainForm, MainForm);
Application.Run;
end.
diff --git a/components/tvplanit/examples/fulldemo/demomain.lfm b/components/tvplanit/examples/fulldemo/demomain.lfm
index 2fe916db5..539f9a5ba 100644
--- a/components/tvplanit/examples/fulldemo/demomain.lfm
+++ b/components/tvplanit/examples/fulldemo/demomain.lfm
@@ -1,7 +1,7 @@
object MainForm: TMainForm
- Left = 301
+ Left = 368
Height = 596
- Top = 177
+ Top = 134
Width = 959
Caption = 'Turbo Power VisualPlanIt Demo'
ClientHeight = 576
@@ -9,7 +9,7 @@ object MainForm: TMainForm
Menu = MainMenu1
OnCloseQuery = FormCloseQuery
OnCreate = FormCreate
- LCLVersion = '1.6.0.4'
+ LCLVersion = '1.7'
object Panel1: TPanel
Left = 125
Height = 576
@@ -77,7 +77,6 @@ object MainForm: TMainForm
Height = 197
Top = 331
Width = 333
- DataStore = VpBufDSDataStore1
ControlLink = VpControlLink1
Color = clWindow
Align = alBottom
@@ -118,7 +117,6 @@ object MainForm: TMainForm
Height = 284
Top = 42
Width = 333
- DataStore = VpBufDSDataStore1
ControlLink = VpControlLink1
Color = clWindow
Font.Height = -12
@@ -273,7 +271,6 @@ object MainForm: TMainForm
Height = 528
Top = 0
Width = 496
- DataStore = VpBufDSDataStore1
ControlLink = VpControlLink1
Color = clWindow
Font.Height = -12
@@ -341,7 +338,6 @@ object MainForm: TMainForm
Height = 496
Top = 36
Width = 853
- DataStore = VpBufDSDataStore1
ControlLink = VpControlLink1
Color = clWindow
Font.Height = -12
@@ -388,7 +384,6 @@ object MainForm: TMainForm
Height = 532
Top = 0
Width = 813
- DataStore = VpBufDSDataStore1
ControlLink = VpControlLink1
Color = clWindow
Align = alClient
@@ -436,7 +431,6 @@ object MainForm: TMainForm
Height = 23
Top = 24
Width = 323
- DataStore = VpBufDSDataStore1
Style = csDropDownList
end
end
@@ -689,7 +683,6 @@ object MainForm: TMainForm
Width = 5
end
object VpControlLink1: TVpControlLink
- DataStore = VpBufDSDataStore1
LocalizationFile = '../../source/vplocalize.xml'
Printer.BottomMargin = 5
Printer.DayStart = h_08
@@ -783,7 +776,6 @@ object MainForm: TMainForm
end
object VpResourceEditDialog1: TVpResourceEditDialog
Version = 'v1.04'
- DataStore = VpBufDSDataStore1
Options = []
Placement.Position = mpCenter
Placement.Top = 10
@@ -793,42 +785,6 @@ object MainForm: TMainForm
left = 312
top = 280
end
- object VpBufDSDataStore1: TVpBufDSDataStore
- CategoryColorMap.Category0.BackgroundColor = clSkyBlue
- CategoryColorMap.Category0.Color = clNavy
- CategoryColorMap.Category0.Description = 'Appointment'
- CategoryColorMap.Category1.BackgroundColor = 13290239
- CategoryColorMap.Category1.Color = clRed
- CategoryColorMap.Category1.Description = 'Urgent'
- CategoryColorMap.Category2.BackgroundColor = 16777175
- CategoryColorMap.Category2.Color = clTeal
- CategoryColorMap.Category2.Description = 'Meetings'
- CategoryColorMap.Category3.BackgroundColor = 11468799
- CategoryColorMap.Category3.Color = clYellow
- CategoryColorMap.Category3.Description = 'Travel'
- CategoryColorMap.Category4.BackgroundColor = 15332329
- CategoryColorMap.Category4.Color = clMoneyGreen
- CategoryColorMap.Category4.Description = 'Private'
- CategoryColorMap.Category5.Color = clTeal
- CategoryColorMap.Category5.Description = 'Category 5'
- CategoryColorMap.Category6.Color = clFuchsia
- CategoryColorMap.Category6.Description = 'Category 6'
- CategoryColorMap.Category7.Color = clOlive
- CategoryColorMap.Category7.Description = 'Category 7'
- CategoryColorMap.Category8.Color = clAqua
- CategoryColorMap.Category8.Description = 'Category 8'
- CategoryColorMap.Category9.Color = clMaroon
- CategoryColorMap.Category9.Description = 'Category 9'
- EnableEventTimer = True
- PlayEventSounds = True
- OnPlaySound = VpBufDSDataStore1PlaySound
- AutoConnect = True
- AutoCreate = True
- DayBuffer = 31
- Directory = 'data'
- left = 312
- top = 128
- end
object ImageList1: TImageList
Height = 32
Width = 32
@@ -2047,7 +2003,6 @@ object MainForm: TMainForm
end
object VpPrintPreviewDialog1: TVpPrintPreviewDialog
Version = 'v1.04'
- DataStore = VpBufDSDataStore1
BottomMargin = 0
ControlLink = VpControlLink1
EndDate = 42561.5151169907
@@ -2067,7 +2022,6 @@ object MainForm: TMainForm
end
object VpPrintFormatEditDialog1: TVpPrintFormatEditDialog
Version = 'v1.04'
- DataStore = VpBufDSDataStore1
ControlLink = VpControlLink1
Options = []
Placement.Position = mpCenter
diff --git a/components/tvplanit/examples/fulldemo/demomain.pas b/components/tvplanit/examples/fulldemo/demomain.pas
index e9260cf75..557e3fd71 100644
--- a/components/tvplanit/examples/fulldemo/demomain.pas
+++ b/components/tvplanit/examples/fulldemo/demomain.pas
@@ -10,9 +10,10 @@ uses
{$ENDIF}
Classes, SysUtils, FileUtil, PrintersDlgs, Forms, Controls, Graphics, Dialogs,
ExtCtrls, StdCtrls, ComCtrls, LCLTranslator, Menus, LCLVersion,
- VpBaseDS, VpDayView,
+// VpBufDS,
+ VpBaseDS, VpDayView,
VpWeekView, VpTaskList, VpAbout, VpContactGrid, VpMonthView, VpResEditDlg,
- VpContactButtons, VpBufDS, VpNavBar, VpData, VpPrtPrvDlg, VpPrtFmtDlg, Types,
+ VpContactButtons, VpNavBar, VpData, VpPrtPrvDlg, VpPrtFmtDlg, Types,
VpBase, VpCalendar;
type
@@ -75,7 +76,6 @@ type
Splitter2: TSplitter;
Splitter3: TSplitter;
DaysTrackBar: TTrackBar;
- VpBufDSDataStore1: TVpBufDSDataStore;
VpContactButtonBar1: TVpContactButtonBar;
VpContactGrid1: TVpContactGrid;
VpControlLink1: TVpControlLink;
@@ -118,11 +118,13 @@ type
const AWavFile: String; AMode: TVpPlaySoundMode);
procedure VpNavBar1ItemClick(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; Index: Integer);
+
private
{ private declarations }
FLang: String;
FActiveView: Integer;
FVisibleDays: Integer;
+// Datastore: TVpCustomDatastore;
procedure PopulateLanguages;
procedure PositionControls;
procedure SetActiveView(AValue: Integer);
@@ -169,6 +171,7 @@ uses
{$ENDIF}
IniFiles, Math, Printers,
VpMisc, VpPrtFmt,
+ demoDatamodule,
sound, ExVpRptSetup;
const
@@ -407,17 +410,52 @@ end;
procedure TMainForm.FormCreate(Sender: TObject);
var
lastRes: TVpResource;
- ds: TVpCustomDataStore;
begin
+ (*
+ Datastore := TVpBufDSDatastore.Create(self);
+
+ with Datastore as TVpBufDSDatastore do begin
+ CategoryColorMap.Category0.BackgroundColor := clSkyBlue;
+ CategoryColorMap.Category0.Color := clNavy;
+ CategoryColorMap.Category0.Description := 'Appointment';
+ CategoryColorMap.Category1.BackgroundColor := 13290239;
+ CategoryColorMap.Category1.Color := clRed;
+ CategoryColorMap.Category1.Description := 'Urgent';
+ CategoryColorMap.Category2.BackgroundColor := 16777175;
+ CategoryColorMap.Category2.Color := clTeal;
+ CategoryColorMap.Category2.Description := 'Meetings';
+ CategoryColorMap.Category3.BackgroundColor := 11468799;
+ CategoryColorMap.Category3.Color := clYellow;
+ CategoryColorMap.Category3.Description := 'Travel';
+ CategoryColorMap.Category4.BackgroundColor := 15332329;
+ CategoryColorMap.Category4.Color := clMoneyGreen;
+ CategoryColorMap.Category4.Description := 'Private';
+ EnableEventTimer := True;
+ PlayEventSounds := True;
+ OnPlaySound := @VpBufDSDataStore1PlaySound;
+ {$IFDEF WINDOWS}
+ MediaFolder := AppendPathDelim(SysUtils.GetEnvironmentVariable('SYSTEMROOT')) + 'media';
+ {$ENDIF}
+ DayBuffer := 31;
+ Directory := 'data';
+ Connected := true;
+ end;
+ VpControlLink1.Datastore := Datastore;
+ *)
+
+ // Establish connection of datastore (resides in a datamodule) to all
+ // dependent controls.
+ VpControlLink1.Datastore := DemoDM.VpBufDSDatastore1;
+
PopulateLanguages;
ReadIni;
- ds := VpControlLink1.Datastore;
- if ds.Resources.Count > 0 then
- begin
- lastRes := ds.Resources.Items[ds.Resources.Count-1];
- ds.ResourceID := lastRes.ResourceID;
- end;
+ with VpControlLink1.Datastore do
+ if Resources.Count > 0 then
+ begin
+ lastRes := Resources.Items[Resources.Count-1];
+ Resource := lastRes;
+ end;
end;
procedure TMainForm.MnuAboutClick(Sender: TObject);
diff --git a/components/tvplanit/examples/fulldemo/readme.txt b/components/tvplanit/examples/fulldemo/readme.txt
index 9fbc5609b..91cf42261 100644
--- a/components/tvplanit/examples/fulldemo/readme.txt
+++ b/components/tvplanit/examples/fulldemo/readme.txt
@@ -1,2 +1,7 @@
-This demo shows many of the possibilities of the Turbo Power VisualPlanIt package.
+This demo shows many of the possibilities of the Turbo Power VisualPlanIt
+package.
+
+In this example the datastore resides in a datamodule to hide the type of
+database connection from the main form.
+
It can also be used to test translations of strings.
diff --git a/components/tvplanit/languages/demo.de.po b/components/tvplanit/languages/demo.de.po
index 20ba60be1..467dc0af7 100644
--- a/components/tvplanit/languages/demo.de.po
+++ b/components/tvplanit/languages/demo.de.po
@@ -247,16 +247,6 @@ msgstr "Datei"
msgid "Help"
msgstr "Hilfe"
-#: tmainform.menuitem3.caption
-msgctxt "tmainform.menuitem3.caption"
-msgid "-"
-msgstr ""
-
-#: tmainform.menuitem4.caption
-msgctxt "tmainform.menuitem4.caption"
-msgid "-"
-msgstr ""
-
#: tmainform.mnuabout.caption
msgid "About Visual PlanIt"
msgstr "Über Visual PlanIt"
diff --git a/components/tvplanit/languages/demo.nl.po b/components/tvplanit/languages/demo.nl.po
index 27a94e17d..070292380 100644
--- a/components/tvplanit/languages/demo.nl.po
+++ b/components/tvplanit/languages/demo.nl.po
@@ -241,16 +241,6 @@ msgstr "Bestand"
msgid "Help"
msgstr "Help"
-#: tmainform.menuitem3.caption
-msgctxt "tmainform.menuitem3.caption"
-msgid "-"
-msgstr ""
-
-#: tmainform.menuitem4.caption
-msgctxt "tmainform.menuitem4.caption"
-msgid "-"
-msgstr ""
-
#: tmainform.mnuabout.caption
msgid "About Visual PlanIt"
msgstr "Over Visual PlanIt"
diff --git a/components/tvplanit/languages/demo.po b/components/tvplanit/languages/demo.po
index 384205643..ce487c7dc 100644
--- a/components/tvplanit/languages/demo.po
+++ b/components/tvplanit/languages/demo.po
@@ -236,16 +236,6 @@ msgstr ""
msgid "Help"
msgstr ""
-#: tmainform.menuitem3.caption
-msgctxt "TMAINFORM.MENUITEM3.CAPTION"
-msgid "-"
-msgstr ""
-
-#: tmainform.menuitem4.caption
-msgctxt "tmainform.menuitem4.caption"
-msgid "-"
-msgstr ""
-
#: tmainform.mnuabout.caption
msgid "About Visual PlanIt"
msgstr ""
diff --git a/components/tvplanit/languages/demo.ru.po b/components/tvplanit/languages/demo.ru.po
index d358f18e2..26ad6c92d 100644
--- a/components/tvplanit/languages/demo.ru.po
+++ b/components/tvplanit/languages/demo.ru.po
@@ -250,16 +250,6 @@ msgstr "Файл"
msgid "Help"
msgstr "Справка"
-#: tmainform.menuitem3.caption
-msgctxt "tmainform.menuitem3.caption"
-msgid "-"
-msgstr ""
-
-#: tmainform.menuitem4.caption
-msgctxt "tmainform.menuitem4.caption"
-msgid "-"
-msgstr ""
-
#: tmainform.mnuabout.caption
msgid "About Visual PlanIt"
msgstr "О Visual PlanIt"