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
This commit is contained in:
wp_xxyyzz
2016-07-06 08:24:17 +00:00
parent cea61bfbdf
commit 12c7635a0f
4 changed files with 203 additions and 0 deletions

View File

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="9"/>
<PathDelim Value="\"/>
<General>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="project1"/>
<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>

View File

@ -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.

View File

@ -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

View File

@ -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.