From 12c7635a0f7620b446eea635cfa5ea01e27c6db3 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Wed, 6 Jul 2016 08:24:17 +0000 Subject: [PATCH] tvplanit: Add demo project "runtime" which works without installing the package. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4922 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../tvplanit/examples/runtime/project1.lpi | 85 +++++++++++++++++++ .../tvplanit/examples/runtime/project1.lpr | 21 +++++ .../tvplanit/examples/runtime/unit1.lfm | 19 +++++ .../tvplanit/examples/runtime/unit1.pas | 78 +++++++++++++++++ 4 files changed, 203 insertions(+) create mode 100644 components/tvplanit/examples/runtime/project1.lpi create mode 100644 components/tvplanit/examples/runtime/project1.lpr create mode 100644 components/tvplanit/examples/runtime/unit1.lfm create mode 100644 components/tvplanit/examples/runtime/unit1.pas diff --git a/components/tvplanit/examples/runtime/project1.lpi b/components/tvplanit/examples/runtime/project1.lpi new file mode 100644 index 000000000..2779a31cc --- /dev/null +++ b/components/tvplanit/examples/runtime/project1.lpi @@ -0,0 +1,85 @@ + + + + + + + + + + <ResourceType Value="res"/> + <UseXPManifest Value="True"/> + <Icon Value="0"/> + </General> + <VersionInfo> + <StringTable ProductVersion=""/> + </VersionInfo> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + <SharedMatrixOptions Count="1"> + <Item1 ID="251604278977" Modes="Default" Value="-gw2"/> + </SharedMatrixOptions> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + </local> + </RunParams> + <RequiredPackages Count="2"> + <Item1> + <PackageName Value="laz_visualplanit"/> + </Item1> + <Item2> + <PackageName Value="LCL"/> + </Item2> + </RequiredPackages> + <Units Count="2"> + <Unit0> + <Filename Value="project1.lpr"/> + <IsPartOfProject Value="True"/> + </Unit0> + <Unit1> + <Filename Value="unit1.pas"/> + <IsPartOfProject Value="True"/> + <ComponentName Value="Form1"/> + <HasResources Value="True"/> + <ResourceBaseClass Value="Form"/> + <UnitName Value="Unit1"/> + </Unit1> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="project1"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Linking> + <Options> + <Win32> + <GraphicApplication Value="True"/> + </Win32> + </Options> + </Linking> + </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/components/tvplanit/examples/runtime/project1.lpr b/components/tvplanit/examples/runtime/project1.lpr new file mode 100644 index 000000000..b78ee9b89 --- /dev/null +++ b/components/tvplanit/examples/runtime/project1.lpr @@ -0,0 +1,21 @@ +program project1; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Interfaces, // this includes the LCL widgetset + Forms, Unit1, laz_visualplanit + { you can add units after this }; + +{$R *.res} + +begin + RequireDerivedFormResource := True; + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. + diff --git a/components/tvplanit/examples/runtime/unit1.lfm b/components/tvplanit/examples/runtime/unit1.lfm new file mode 100644 index 000000000..e20e19d24 --- /dev/null +++ b/components/tvplanit/examples/runtime/unit1.lfm @@ -0,0 +1,19 @@ +object Form1: TForm1 + Left = 262 + Height = 441 + Top = 155 + Width = 934 + Caption = 'Form1' + ClientHeight = 441 + ClientWidth = 934 + OnCreate = FormCreate + LCLVersion = '1.7' + object Panel1: TPanel + Left = 0 + Height = 42 + Top = 0 + Width = 934 + Align = alTop + TabOrder = 0 + end +end diff --git a/components/tvplanit/examples/runtime/unit1.pas b/components/tvplanit/examples/runtime/unit1.pas new file mode 100644 index 000000000..e484eb8b4 --- /dev/null +++ b/components/tvplanit/examples/runtime/unit1.pas @@ -0,0 +1,78 @@ +unit Unit1; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, + VpBaseDS, VpBufDS, VpDayView, VpWeekView, VpMonthView; + +type + + { TForm1 } + + TForm1 = class(TForm) + Panel1: TPanel; + procedure FormCreate(Sender: TObject); + private + { private declarations } + Datastore: TVpBufDSDatastore; + ControlLink: TVpControlLink; + WeekView: TVpWeekView; + DayView: TVpDayView; + MonthView: TVpMonthView; + combo: TVpResourceCombo; + public + { public declarations } + end; + +var + Form1: TForm1; + +implementation + +{$R *.lfm} + +{ TForm1 } + +procedure TForm1.FormCreate(Sender: TObject); +begin + ControlLink := TVpControlLink.Create(self); + + Datastore := TVpBufDSDatastore.Create(self); + Datastore.Directory := '.'; + Datastore.AutoCreate := true; + Datastore.Connected := true; + + DayView := TVpDayview.Create(self); + DayView.Parent := self; + DayView.Align := alLeft; + DayView.ControlLink := ControlLink; + DayView.Datastore := Datastore; + + WeekView := TVpWeekView.Create(self); + WeekView.Parent := self; + Weekview.Align := alClient; + WeekView.ControlLink := ControlLink; + WeekView.Datastore := Datastore; + + MonthView := TVpMonthView.Create(self); + MonthView.Parent := self; + MonthView.Align := alRight; + MonthView.ControlLink := ControlLink; + MonthView.Datastore := Datastore; + + Combo := TVpResourceCombo.Create(Self); + Combo.Parent := Panel1; + Combo.Left := 8; + Combo.Top := 8; + Combo.Width := 200; + Combo.Datastore := Datastore; + + if Datastore.Resources.Count > 0 then + Datastore.ResourceID := Datastore.Resources.Items[0].ResourceID; +end; + +end. +