You've already forked lazarus-ccr
tvplanit: Initial commit of an inifile datastore (working only partially at the moment). Add a demo project.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4845 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -112,24 +112,48 @@ object MainForm: TMainForm
|
||||
RowHeadAttributes.MinuteFont.Height = -12
|
||||
RowHeadAttributes.Color = clBtnFace
|
||||
IconAttributes.AlarmBitmap.Data = {
|
||||
F6000000424DF600000000000000760000002800000010000000100000000100
|
||||
0400000000008000000000000000000000000000000000000000000000000000
|
||||
80000080000000808000800000008000800080800000C0C0C000808080000000
|
||||
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00300130000031
|
||||
00333310009090001333330097F0F7900333380970FFF07908333099FF0FFFF9
|
||||
90333090FFF0FF0090333099FFF0FFF99033380970F0FF790833330097F0F790
|
||||
0333000009999900000307780000008778030777703030777803308770803077
|
||||
8033338003303300833333333300033333333333333333333333
|
||||
76020000424D760200000000000036000000280000000C0000000C0000000100
|
||||
20000000000040020000C30E0000C30E00000000000000000000FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000
|
||||
00C6000000C6FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00000000C6000000FF000000FF000000C6FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF000000008D000000C6000000FF000000FF000000FF0000
|
||||
00FF000000FF000000FF000000FF000000FF000000C60000008DFFFFFF000000
|
||||
008D000000E2FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000
|
||||
00E20000008DFFFFFF00FFFFFF0000000055000000AAFFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00000000AA00000055FFFFFF00FFFFFF000000
|
||||
0055000000AAFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000
|
||||
00AA00000055FFFFFF00FFFFFF000000001C000000FFFFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00000000FF0000001CFFFFFF00FFFFFF00FFFF
|
||||
FF00000000FF0000001CFFFFFF00FFFFFF00FFFFFF00FFFFFF000000001C0000
|
||||
00FFFFFFFF00FFFFFF00FFFFFF00FFFFFF000000008D0000008DFFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF000000008D0000008DFFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF000000001C000000E200000055FFFFFF00FFFFFF0000000055000000E20000
|
||||
001CFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000001C000000E20000
|
||||
00E2000000C6000000E20000001CFFFFFF00FFFFFF00FFFFFF00
|
||||
}
|
||||
IconAttributes.RecurringBitmap.Data = {
|
||||
F6000000424DF600000000000000760000002800000010000000100000000100
|
||||
04000000000080000000C40E0000C40E00001000000010000000000000000000
|
||||
8000008000000080800080000000800080008080000080808000C0C0C0000000
|
||||
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00888888888888
|
||||
8888888888888888888888888888888888888888888888888888888888888888
|
||||
8888888078888888888888708888800000888808888888000088880888888880
|
||||
0088880888888808008888708888708880888887000078888888888888888888
|
||||
8888888888888888888888888888888888888888888888888888
|
||||
76020000424D760200000000000036000000280000000C0000000C0000000100
|
||||
20000000000040020000C30E0000C30E00000000000000000000FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF000000005500000038FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00000000C60000001C000000AA000000FF0000
|
||||
00C6000000AA000000FF000000AA0000001CFFFFFF00FFFFFF00FFFFFF000000
|
||||
00FF000000E20000008DFFFFFF00FFFFFF00FFFFFF00FFFFFF000000008D0000
|
||||
00E20000001CFFFFFF00FFFFFF00000000FF000000C0000000AAFFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF000000008D000000AAFFFFFF00FFFFFF000000
|
||||
00FF000000FF000000FF000000C6FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00000000FFFFFFFF00000000000000000000000000FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000AA00000038000000550000
|
||||
00C6FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000
|
||||
0000FFFFFF00FFFFFF00FFFFFF00000000FFFFFFFF00FFFFFF00FFFFFF00FFFF
|
||||
FF00FFFFFF00000000C6000000FF000000FF000000FFFFFFFF00FFFFFF000000
|
||||
00AA0000008DFFFFFF00FFFFFF00FFFFFF000000000000000000000000EC0000
|
||||
00DD000000FFFFFFFF00FFFFFF000000001C000000E20000008DFFFFFF00FFFF
|
||||
FF0000000000000000000000008D000000E2000000FFFFFFFF00FFFFFF00FFFF
|
||||
FF000000001C000000AA000000FF000000C6000000AA000000FF000000AA0000
|
||||
001C000000C6FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000
|
||||
005500000038FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00
|
||||
}
|
||||
ShowResourceName = True
|
||||
LineColor = clGray
|
||||
|
81
components/tvplanit/examples/inidatastore/project1.lpi
Normal file
81
components/tvplanit/examples/inidatastore/project1.lpi
Normal file
@ -0,0 +1,81 @@
|
||||
<?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"/>
|
||||
</General>
|
||||
<VersionInfo>
|
||||
<StringTable ProductVersion=""/>
|
||||
</VersionInfo>
|
||||
<BuildModes Count="1">
|
||||
<Item1 Name="Default" Default="True"/>
|
||||
</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>
|
20
components/tvplanit/examples/inidatastore/project1.lpr
Normal file
20
components/tvplanit/examples/inidatastore/project1.lpr
Normal file
@ -0,0 +1,20 @@
|
||||
program project1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
Forms, Unit1, laz_visualplanit;
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
RequireDerivedFormResource := True;
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end.
|
||||
|
303
components/tvplanit/examples/inidatastore/unit1.lfm
Normal file
303
components/tvplanit/examples/inidatastore/unit1.lfm
Normal file
@ -0,0 +1,303 @@
|
||||
object Form1: TForm1
|
||||
Left = 225
|
||||
Height = 686
|
||||
Top = 155
|
||||
Width = 980
|
||||
Caption = 'Form1'
|
||||
ClientHeight = 686
|
||||
ClientWidth = 980
|
||||
OnCreate = FormCreate
|
||||
LCLVersion = '1.7'
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Height = 34
|
||||
Top = 0
|
||||
Width = 980
|
||||
Align = alTop
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 34
|
||||
ClientWidth = 980
|
||||
TabOrder = 0
|
||||
object VpResourceCombo1: TVpResourceCombo
|
||||
Left = 8
|
||||
Height = 23
|
||||
Top = 5
|
||||
Width = 208
|
||||
DataStore = VpIniDatastore1
|
||||
Style = csDropDownList
|
||||
end
|
||||
object BtnNewRes: TButton
|
||||
Left = 222
|
||||
Height = 25
|
||||
Top = 4
|
||||
Width = 99
|
||||
Caption = 'New resource'
|
||||
OnClick = BtnNewResClick
|
||||
TabOrder = 1
|
||||
end
|
||||
object BtnEditRes: TButton
|
||||
Left = 328
|
||||
Height = 25
|
||||
Top = 4
|
||||
Width = 96
|
||||
Caption = 'Edit resource'
|
||||
OnClick = BtnEditResClick
|
||||
TabOrder = 2
|
||||
end
|
||||
end
|
||||
object PageControl1: TPageControl
|
||||
Left = 0
|
||||
Height = 652
|
||||
Top = 34
|
||||
Width = 980
|
||||
ActivePage = TabSheet1
|
||||
Align = alClient
|
||||
TabIndex = 0
|
||||
TabOrder = 1
|
||||
object TabSheet1: TTabSheet
|
||||
Caption = 'Events and tasks'
|
||||
ClientHeight = 624
|
||||
ClientWidth = 972
|
||||
object VpDayView1: TVpDayView
|
||||
Left = 0
|
||||
Height = 624
|
||||
Top = 0
|
||||
Width = 301
|
||||
DataStore = VpIniDatastore1
|
||||
ControlLink = VpControlLink1
|
||||
Color = clWindow
|
||||
Align = alLeft
|
||||
ReadOnly = False
|
||||
TabStop = True
|
||||
TabOrder = 0
|
||||
AllDayEventAttributes.BackgroundColor = clBtnShadow
|
||||
AllDayEventAttributes.EventBorderColor = cl3DDkShadow
|
||||
AllDayEventAttributes.EventBackgroundColor = clBtnFace
|
||||
ShowEventTimes = False
|
||||
DrawingStyle = dsFlat
|
||||
TimeSlotColors.Active = clWhite
|
||||
TimeSlotColors.Inactive = 8454143
|
||||
TimeSlotColors.Holiday = 16744703
|
||||
TimeSlotColors.Weekday = clWhite
|
||||
TimeSlotColors.Weekend = 16777088
|
||||
TimeSlotColors.ActiveRange.RangeBegin = h_00
|
||||
TimeSlotColors.ActiveRange.RangeEnd = h_00
|
||||
HeadAttributes.Font.Height = -13
|
||||
HeadAttributes.Color = clBtnFace
|
||||
RowHeadAttributes.HourFont.Height = -24
|
||||
RowHeadAttributes.MinuteFont.Height = -12
|
||||
RowHeadAttributes.Color = clBtnFace
|
||||
ShowResourceName = True
|
||||
LineColor = clGray
|
||||
GutterWidth = 7
|
||||
DateLabelFormat = 'dddd, mmmm dd, yyyy'
|
||||
Granularity = gr30Min
|
||||
DefaultTopHour = h_07
|
||||
TimeFormat = tf12Hour
|
||||
end
|
||||
object Panel2: TPanel
|
||||
Left = 306
|
||||
Height = 624
|
||||
Top = 0
|
||||
Width = 386
|
||||
Align = alLeft
|
||||
BevelOuter = bvNone
|
||||
Caption = 'Panel2'
|
||||
ClientHeight = 624
|
||||
ClientWidth = 386
|
||||
TabOrder = 1
|
||||
object VpWeekView1: TVpWeekView
|
||||
Left = 0
|
||||
Height = 378
|
||||
Top = 0
|
||||
Width = 386
|
||||
DataStore = VpIniDatastore1
|
||||
ControlLink = VpControlLink1
|
||||
Color = clWindow
|
||||
AllDayEventAttributes.BackgroundColor = clWindow
|
||||
AllDayEventAttributes.EventBorderColor = clGray
|
||||
AllDayEventAttributes.EventBackgroundColor = clBtnFace
|
||||
DateLabelFormat = 'dddd, mmmm dd, yyyy'
|
||||
DayHeadAttributes.Color = clBtnFace
|
||||
DayHeadAttributes.DateFormat = 'dddd mmmm, dd'
|
||||
DayHeadAttributes.Font.Height = -13
|
||||
DayHeadAttributes.Font.Name = 'Tahoma'
|
||||
DayHeadAttributes.Bordered = True
|
||||
DrawingStyle = dsFlat
|
||||
HeadAttributes.Color = clBtnFace
|
||||
LineColor = clGray
|
||||
TimeFormat = tf12Hour
|
||||
ShowEventTime = True
|
||||
WeekStartsOn = dtMonday
|
||||
Align = alClient
|
||||
TabStop = True
|
||||
TabOrder = 0
|
||||
end
|
||||
object VpMonthView1: TVpMonthView
|
||||
Left = 0
|
||||
Height = 241
|
||||
Top = 383
|
||||
Width = 386
|
||||
DataStore = VpIniDatastore1
|
||||
ControlLink = VpControlLink1
|
||||
Color = clWindow
|
||||
Align = alBottom
|
||||
TabStop = True
|
||||
TabOrder = 1
|
||||
KBNavigation = True
|
||||
DateLabelFormat = 'mmmm yyyy'
|
||||
DayHeadAttributes.Color = clBtnFace
|
||||
DayHeadAttributes.Font.Height = -13
|
||||
DayHeadAttributes.Font.Name = 'Tahoma'
|
||||
DayNameStyle = dsShort
|
||||
DrawingStyle = dsFlat
|
||||
EventDayStyle = []
|
||||
LineColor = clGray
|
||||
TimeFormat = tf12Hour
|
||||
OffDayColor = clSilver
|
||||
SelectedDayColor = clRed
|
||||
ShowEvents = True
|
||||
ShowEventTime = False
|
||||
WeekStartsOn = dtSunday
|
||||
end
|
||||
object Splitter2: TSplitter
|
||||
Cursor = crVSplit
|
||||
Left = 0
|
||||
Height = 5
|
||||
Top = 378
|
||||
Width = 386
|
||||
Align = alBottom
|
||||
ResizeAnchor = akBottom
|
||||
end
|
||||
end
|
||||
object VpTaskList1: TVpTaskList
|
||||
Left = 697
|
||||
Height = 624
|
||||
Top = 0
|
||||
Width = 275
|
||||
DataStore = VpIniDatastore1
|
||||
ControlLink = VpControlLink1
|
||||
Color = clWindow
|
||||
Align = alClient
|
||||
TabStop = True
|
||||
TabOrder = 2
|
||||
ReadOnly = False
|
||||
DisplayOptions.CheckBGColor = clWindow
|
||||
DisplayOptions.CheckColor = cl3DDkShadow
|
||||
DisplayOptions.CheckStyle = csCheck
|
||||
DisplayOptions.DueDateFormat = 'dd.MM.yyyy'
|
||||
DisplayOptions.ShowCompletedTasks = False
|
||||
DisplayOptions.ShowAll = False
|
||||
DisplayOptions.ShowDueDate = True
|
||||
DisplayOptions.OverdueColor = clRed
|
||||
DisplayOptions.NormalColor = clBlack
|
||||
DisplayOptions.CompletedColor = clGray
|
||||
LineColor = clGray
|
||||
MaxVisibleTasks = 250
|
||||
TaskHeadAttributes.Color = clSilver
|
||||
DrawingStyle = dsFlat
|
||||
ShowResourceName = True
|
||||
end
|
||||
object Splitter1: TSplitter
|
||||
Left = 692
|
||||
Height = 624
|
||||
Top = 0
|
||||
Width = 5
|
||||
end
|
||||
object Splitter3: TSplitter
|
||||
Left = 301
|
||||
Height = 624
|
||||
Top = 0
|
||||
Width = 5
|
||||
end
|
||||
end
|
||||
object TabSheet2: TTabSheet
|
||||
Caption = 'Contacts'
|
||||
ClientHeight = 594
|
||||
ClientWidth = 928
|
||||
object VpContactButtonBar1: TVpContactButtonBar
|
||||
Left = 0
|
||||
Height = 594
|
||||
Top = 0
|
||||
Width = 40
|
||||
DrawingStyle = dsFlat
|
||||
RadioStyle = False
|
||||
Align = alLeft
|
||||
end
|
||||
object VpContactGrid1: TVpContactGrid
|
||||
Left = 40
|
||||
Height = 594
|
||||
Top = 0
|
||||
Width = 888
|
||||
DataStore = VpIniDatastore1
|
||||
ControlLink = VpControlLink1
|
||||
Color = clWindow
|
||||
Align = alClient
|
||||
TabStop = True
|
||||
TabOrder = 1
|
||||
AllowInPlaceEditing = True
|
||||
BarWidth = 3
|
||||
BarColor = clSilver
|
||||
ColumnWidth = 200
|
||||
ContactHeadAttributes.Color = clSilver
|
||||
ContactHeadAttributes.Bordered = True
|
||||
DrawingStyle = dsFlat
|
||||
end
|
||||
end
|
||||
end
|
||||
object VpControlLink1: TVpControlLink
|
||||
DataStore = VpIniDatastore1
|
||||
Printer.BottomMargin = 0
|
||||
Printer.DayStart = h_08
|
||||
Printer.DayEnd = h_05
|
||||
Printer.Granularity = gr30Min
|
||||
Printer.LeftMargin = 0
|
||||
Printer.MarginUnits = imAbsolutePixel
|
||||
Printer.PrintFormats = <>
|
||||
Printer.RightMargin = 0
|
||||
Printer.TopMargin = 0
|
||||
left = 136
|
||||
top = 264
|
||||
end
|
||||
object VpResourceEditDialog1: TVpResourceEditDialog
|
||||
Version = 'v1.04'
|
||||
DataStore = VpIniDatastore1
|
||||
Options = []
|
||||
Placement.Position = mpCenter
|
||||
Placement.Top = 10
|
||||
Placement.Left = 10
|
||||
Placement.Height = 250
|
||||
Placement.Width = 400
|
||||
left = 136
|
||||
top = 335
|
||||
end
|
||||
object VpIniDatastore1: TVpIniDatastore
|
||||
CategoryColorMap.Category0.Color = clNavy
|
||||
CategoryColorMap.Category0.Description = 'Category 0'
|
||||
CategoryColorMap.Category1.Color = clRed
|
||||
CategoryColorMap.Category1.Description = 'Category 1'
|
||||
CategoryColorMap.Category2.Color = clYellow
|
||||
CategoryColorMap.Category2.Description = 'Category 2'
|
||||
CategoryColorMap.Category3.Color = clLime
|
||||
CategoryColorMap.Category3.Description = 'Category 3'
|
||||
CategoryColorMap.Category4.Color = clPurple
|
||||
CategoryColorMap.Category4.Description = 'Category 4'
|
||||
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
|
||||
AutoConnect = True
|
||||
Connected = True
|
||||
FileName = 'data.ini'
|
||||
left = 140
|
||||
top = 200
|
||||
end
|
||||
end
|
89
components/tvplanit/examples/inidatastore/unit1.pas
Normal file
89
components/tvplanit/examples/inidatastore/unit1.pas
Normal file
@ -0,0 +1,89 @@
|
||||
unit Unit1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
|
||||
StdCtrls, ComCtrls, VpBaseDS, VpDayView, VpWeekView, VpTaskList,
|
||||
VpContactGrid, VpMonthView, VpResEditDlg, VpContactButtons, VpIniDs;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
BtnNewRes: TButton;
|
||||
BtnEditRes: TButton;
|
||||
PageControl1: TPageControl;
|
||||
Panel1: TPanel;
|
||||
Panel2: TPanel;
|
||||
Splitter1: TSplitter;
|
||||
Splitter2: TSplitter;
|
||||
Splitter3: TSplitter;
|
||||
TabSheet1: TTabSheet;
|
||||
TabSheet2: TTabSheet;
|
||||
VpContactButtonBar1: TVpContactButtonBar;
|
||||
VpContactGrid1: TVpContactGrid;
|
||||
VpControlLink1: TVpControlLink;
|
||||
VpDayView1: TVpDayView;
|
||||
VpIniDatastore1: TVpIniDatastore;
|
||||
VpMonthView1: TVpMonthView;
|
||||
VpResourceCombo1: TVpResourceCombo;
|
||||
VpResourceEditDialog1: TVpResourceEditDialog;
|
||||
VpTaskList1: TVpTaskList;
|
||||
VpWeekView1: TVpWeekView;
|
||||
procedure BtnNewResClick(Sender: TObject);
|
||||
procedure BtnEditResClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
private
|
||||
{ private declarations }
|
||||
public
|
||||
{ public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
uses
|
||||
LazFileUtils,
|
||||
VpData;
|
||||
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
// Adds a new resource
|
||||
procedure TForm1.BtnNewResClick(Sender: TObject);
|
||||
begin
|
||||
VpResourceEditDialog1.AddNewResource;
|
||||
end;
|
||||
|
||||
// Edits the currently selected resource
|
||||
procedure TForm1.BtnEditResClick(Sender: TObject);
|
||||
begin
|
||||
// Open the resource editor dialog, everything is done here.
|
||||
VpResourceEditDialog1.Execute;
|
||||
end;
|
||||
|
||||
// Load the last resource.
|
||||
procedure TForm1.FormCreate(Sender: TObject);
|
||||
var
|
||||
lastRes: TVpResource;
|
||||
datastore: TVpCustomDatastore;
|
||||
begin
|
||||
datastore := VpControlLink1.Datastore;
|
||||
if datastore.Resources.Count > 0 then
|
||||
begin
|
||||
lastRes := datastore.Resources.Items[datastore.Resources.Count-1];
|
||||
datastore.ResourceID := lastRes.ResourceID;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
|
Reference in New Issue
Block a user