TvPlanIt: Activate dayview drag-and-drop in the examples/datastores demos.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8175 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2021-12-13 21:56:17 +00:00
parent aedf5ffcc0
commit e584f4c869
18 changed files with 217 additions and 193 deletions

View File

@ -64,6 +64,9 @@
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf2Set"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>

View File

@ -8,7 +8,7 @@ object Form1: TForm1
ClientWidth = 980
OnCreate = FormCreate
OnDestroy = FormDestroy
LCLVersion = '1.9.0.0'
LCLVersion = '2.3.0.0'
object Panel1: TPanel
Left = 0
Height = 33
@ -68,9 +68,9 @@ object Form1: TForm1
Height = 653
Top = 33
Width = 980
ActivePage = TabSheet3
ActivePage = TabSheet1
Align = alClient
TabIndex = 2
TabIndex = 0
TabOrder = 1
OnChange = PageControl1Change
object TabSheet1: TTabSheet
@ -92,6 +92,7 @@ object Form1: TForm1
AllDayEventAttributes.BackgroundColor = clBtnShadow
AllDayEventAttributes.EventBorderColor = cl3DDkShadow
AllDayEventAttributes.EventBackgroundColor = clBtnFace
AllowDragAndDrop = True
ShowEventTimes = False
DrawingStyle = dsFlat
TimeSlotColors.Active = clWhite
@ -234,11 +235,11 @@ object Form1: TForm1
end
object TabSheet2: TTabSheet
Caption = 'Contacts'
ClientHeight = 624
ClientHeight = 625
ClientWidth = 972
object VpContactButtonBar1: TVpContactButtonBar
Left = 0
Height = 624
Height = 625
Top = 0
Width = 40
DrawingStyle = dsFlat
@ -247,7 +248,7 @@ object Form1: TForm1
end
object VpContactGrid1: TVpContactGrid
Left = 40
Height = 624
Height = 625
Top = 0
Width = 932
DataStore = VpFlexDataStore1
@ -344,17 +345,13 @@ object Form1: TForm1
end
object VpControlLink1: TVpControlLink
DataStore = VpFlexDataStore1
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 = 168
Left = 136
Top = 168
end
object VpResourceEditDialog1: TVpResourceEditDialog
Version = 'v1.12'
@ -365,8 +362,8 @@ object Form1: TForm1
Placement.Left = 10
Placement.Height = 250
Placement.Width = 400
left = 136
top = 232
Left = 136
Top = 232
end
object VpFlexDataStore1: TVpFlexDataStore
CategoryColorMap.Category0.Color = clNavy
@ -402,8 +399,8 @@ object Form1: TForm1
DataSources.TasksDataSource = DsTasks
ResourceID = 0
OnCreateTable = VpFlexDataStore1CreateTable
left = 136
top = 101
Left = 136
Top = 101
ResourceFieldMappings = (
'ResourceID'
'ResourceID'
@ -591,23 +588,23 @@ object Form1: TForm1
end
object DsResources: TDataSource
DataSet = QryResources
left = 240
top = 428
Left = 240
Top = 428
end
object DsContacts: TDataSource
DataSet = QryContacts
left = 240
top = 496
Left = 240
Top = 496
end
object DsEvents: TDataSource
DataSet = QryEvents
left = 240
top = 560
Left = 240
Top = 560
end
object DsTasks: TDataSource
DataSet = QryTasks
left = 240
top = 621
Left = 240
Top = 621
end
object QryResources: TSQLQuery
PacketRecords = -1
@ -722,9 +719,10 @@ object Form1: TForm1
)
Options = [sqoKeepOpenOnCommit, sqoAutoApplyUpdates, sqoAutoCommit]
Params = <>
Macros = <>
UsePrimaryKeyAsKey = False
left = 136
top = 428
Left = 136
Top = 428
end
object QryContacts: TSQLQuery
PacketRecords = -1
@ -1065,9 +1063,10 @@ object Form1: TForm1
)
Options = [sqoKeepOpenOnCommit, sqoAutoApplyUpdates, sqoAutoCommit]
Params = <>
Macros = <>
UsePrimaryKeyAsKey = False
left = 136
top = 496
Left = 136
Top = 496
end
object QryEvents: TSQLQuery
PacketRecords = -1
@ -1196,9 +1195,10 @@ object Form1: TForm1
)
Options = [sqoKeepOpenOnCommit, sqoAutoApplyUpdates, sqoAutoCommit]
Params = <>
Macros = <>
UsePrimaryKeyAsKey = False
left = 136
top = 560
Left = 136
Top = 560
end
object QryTasks: TSQLQuery
PacketRecords = -1
@ -1283,9 +1283,10 @@ object Form1: TForm1
)
Options = [sqoKeepOpenOnCommit, sqoAutoApplyUpdates, sqoAutoCommit]
Params = <>
Macros = <>
UsePrimaryKeyAsKey = False
left = 136
top = 621
Left = 136
Top = 621
end
object ODBCConnection1: TODBCConnection
Connected = False
@ -1296,15 +1297,15 @@ object Form1: TForm1
)
Transaction = SQLTransaction1
Driver = 'Microsoft Access Driver (*.mdb)'
left = 136
top = 304
Left = 136
Top = 304
end
object SQLTransaction1: TSQLTransaction
Active = False
Action = caCommitRetaining
Database = ODBCConnection1
left = 136
top = 368
Left = 136
Top = 368
end
object QryAllResources: TSQLQuery
PacketRecords = -1
@ -1407,10 +1408,11 @@ object Form1: TForm1
)
Options = [sqoKeepOpenOnCommit, sqoAutoCommit]
Params = <>
Macros = <>
UpdateMode = upWhereAll
UsePrimaryKeyAsKey = False
left = 531
top = 171
Left = 531
Top = 171
end
object QryAllContacts: TSQLQuery
PacketRecords = -1
@ -1602,10 +1604,11 @@ object Form1: TForm1
)
Options = [sqoKeepOpenOnCommit, sqoAutoCommit]
Params = <>
Macros = <>
UpdateMode = upWhereAll
UsePrimaryKeyAsKey = False
left = 531
top = 225
Left = 531
Top = 225
end
object QryAllEvents: TSQLQuery
PacketRecords = -1
@ -1620,10 +1623,11 @@ object Form1: TForm1
)
Options = [sqoKeepOpenOnCommit, sqoAutoCommit]
Params = <>
Macros = <>
UpdateMode = upWhereAll
UsePrimaryKeyAsKey = False
left = 531
top = 285
Left = 531
Top = 285
end
object QryAllTasks: TSQLQuery
PacketRecords = -1
@ -1638,29 +1642,30 @@ object Form1: TForm1
)
Options = [sqoKeepOpenOnCommit, sqoAutoCommit]
Params = <>
Macros = <>
UpdateMode = upWhereAll
UsePrimaryKeyAsKey = False
left = 531
top = 352
Left = 531
Top = 352
end
object DsAllResources: TDataSource
DataSet = QryAllResources
left = 627
top = 171
Left = 627
Top = 171
end
object DsAllContacts: TDataSource
DataSet = QryAllContacts
left = 630
top = 225
Left = 630
Top = 225
end
object DsAllEvents: TDataSource
DataSet = QryAllEvents
left = 625
top = 285
Left = 625
Top = 285
end
object DsAllTasks: TDataSource
DataSet = QryAllTasks
left = 627
top = 352
Left = 627
Top = 352
end
end

View File

@ -65,6 +65,9 @@
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf2Set"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>

View File

@ -1,14 +1,14 @@
object Form1: TForm1
Left = 344
Left = 497
Height = 686
Top = 169
Top = 161
Width = 910
Caption = 'Form1'
ClientHeight = 686
ClientWidth = 910
OnCreate = FormCreate
OnDestroy = FormDestroy
LCLVersion = '1.6.4.0'
LCLVersion = '2.3.0.0'
object Panel1: TPanel
Left = 0
Height = 33
@ -91,6 +91,7 @@ object Form1: TForm1
AllDayEventAttributes.BackgroundColor = clBtnShadow
AllDayEventAttributes.EventBorderColor = cl3DDkShadow
AllDayEventAttributes.EventBackgroundColor = clBtnFace
AllowDragAndDrop = True
ShowEventTimes = False
DrawingStyle = dsFlat
TimeSlotColors.Active = clWhite
@ -161,7 +162,6 @@ object Form1: TForm1
Align = alBottom
TabStop = True
TabOrder = 1
KBNavigation = True
DateLabelFormat = 'mmmm yyyy'
DayHeadAttributes.Font.Height = -13
DayHeadAttributes.Font.Name = 'Tahoma'
@ -170,6 +170,7 @@ object Form1: TForm1
DrawingStyle = dsFlat
EventDayStyle = []
HeadAttributes.Color = clBtnFace
KBNavigation = True
OffDayColor = clSilver
SelectedDayColor = clRed
ShowEvents = True
@ -233,11 +234,11 @@ object Form1: TForm1
end
object TabSheet2: TTabSheet
Caption = 'Contacts'
ClientHeight = 624
ClientWidth = 972
ClientHeight = 625
ClientWidth = 902
object VpContactButtonBar1: TVpContactButtonBar
Left = 0
Height = 624
Height = 625
Top = 0
Width = 40
DrawingStyle = dsFlat
@ -246,9 +247,9 @@ object Form1: TForm1
end
object VpContactGrid1: TVpContactGrid
Left = 40
Height = 624
Height = 625
Top = 0
Width = 932
Width = 862
DataStore = VpFlexDataStore1
ControlLink = VpControlLink1
Color = clWindow
@ -267,20 +268,16 @@ object Form1: TForm1
end
object VpControlLink1: TVpControlLink
DataStore = VpFlexDataStore1
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 = 168
Left = 136
Top = 168
end
object VpResourceEditDialog1: TVpResourceEditDialog
Version = 'v1.05'
Version = 'v1.12'
DataStore = VpFlexDataStore1
Options = []
Placement.Position = mpCenter
@ -288,8 +285,8 @@ object Form1: TForm1
Placement.Left = 10
Placement.Height = 250
Placement.Width = 400
left = 136
top = 232
Left = 136
Top = 232
end
object VpFlexDataStore1: TVpFlexDataStore
CategoryColorMap.Category0.Color = clNavy
@ -324,8 +321,8 @@ object Form1: TForm1
DataSources.ContactsDataSource = DsContacts
DataSources.TasksDataSource = DsTasks
ResourceID = 0
left = 136
top = 101
Left = 136
Top = 101
ResourceFieldMappings = (
'ResourceID'
'ResourceID'
@ -517,23 +514,23 @@ object Form1: TForm1
end
object DsResources: TDataSource
DataSet = QryResources
left = 240
top = 428
Left = 240
Top = 428
end
object DsContacts: TDataSource
DataSet = QryContacts
left = 240
top = 496
Left = 240
Top = 496
end
object DsEvents: TDataSource
DataSet = QryEvents
left = 240
top = 560
Left = 240
Top = 560
end
object DsTasks: TDataSource
DataSet = QryTasks
left = 240
top = 621
Left = 240
Top = 621
end
object QryResources: TSQLQuery
PacketRecords = -1
@ -577,8 +574,9 @@ object Form1: TForm1
''
)
Params = <>
left = 136
top = 428
Macros = <>
Left = 136
Top = 428
end
object QryContacts: TSQLQuery
PacketRecords = -1
@ -771,8 +769,9 @@ object Form1: TForm1
''
)
Params = <>
left = 136
top = 496
Macros = <>
Left = 136
Top = 496
end
object QryEvents: TSQLQuery
PacketRecords = -1
@ -878,8 +877,9 @@ object Form1: TForm1
''
)
Params = <>
left = 136
top = 560
Macros = <>
Left = 136
Top = 560
end
object QryTasks: TSQLQuery
PacketRecords = -1
@ -948,23 +948,24 @@ object Form1: TForm1
''
)
Params = <>
left = 136
top = 621
Macros = <>
Left = 136
Top = 621
end
object SQLTransaction1: TSQLTransaction
Active = False
Action = caCommitRetaining
Database = SQLite3Connection1
Options = []
left = 136
top = 368
Left = 136
Top = 368
end
object SQLite3Connection1: TSQLite3Connection
Connected = False
LoginPrompt = False
KeepConnection = False
Transaction = SQLTransaction1
Options = []
left = 136
top = 312
AlwaysUseBigint = False
Left = 136
Top = 312
end
end

View File

@ -103,7 +103,7 @@ end;
procedure TForm1.CreateDB(AFileName: String);
begin
SQLite3Connection1.Close; // Ensure the connection is closed when we start
// Create the database and the tables
try
SQLite3Connection1.DatabaseName := AFileName;
@ -285,7 +285,13 @@ begin
// Transaction
SQLTransaction1.DataBase := Sqlite3Connection1;
SQLTransaction1.Action := caCommitRetaining;
QryResources.Options := QryResources.Options + [sqoAutoApplyUpdates];
QryEvents.Options := QryEvents.Options + [sqoAutoApplyUpdates];
QryTasks.Options := QryTasks.Options + [sqoAutoApplyUpdates];
QryContacts.Options := QryContacts.Options + [sqoAutoApplyUpdates];
if not FileExists(AppendPathDelim(Application.Location) + DB_NAME) then
CreateDB(AppendPathDelim(Application.Location) + DB_NAME);