diff --git a/components/tvplanit/examples/fulldemo/demomain.lfm b/components/tvplanit/examples/fulldemo/demomain.lfm index 107909f87..6ff75aff6 100644 --- a/components/tvplanit/examples/fulldemo/demomain.lfm +++ b/components/tvplanit/examples/fulldemo/demomain.lfm @@ -721,41 +721,41 @@ object MainForm: TMainForm DrawingStyle = dsCoolTab FolderCollection = < item - Version = 'v1.7.0' + Version = 'v1.8.0' Caption = 'Planner' Enabled = True FolderType = ftDefault ItemCollection = < item - Version = 'v1.7.0' + Version = 'v1.8.0' Caption = 'Events' IconIndex = 0 Name = 'NIEvents' Tag = 0 end item - Version = 'v1.7.0' + Version = 'v1.8.0' Caption = 'Month view' IconIndex = 5 Name = 'NIEventsByMonth' Tag = 0 end item - Version = 'v1.7.0' + Version = 'v1.8.0' Caption = 'Week view' IconIndex = 4 Name = 'NIEventsByWeek' Tag = 0 end item - Version = 'v1.7.0' + Version = 'v1.8.0' Caption = 'Day view' IconIndex = 3 Name = 'NIEventsByDay' Tag = 0 end item - Version = 'v1.7.0' + Version = 'v1.8.0' Caption = 'Tasks' Description = 'Show tasks' IconIndex = 1 @@ -763,7 +763,7 @@ object MainForm: TMainForm Tag = 0 end item - Version = 'v1.7.0' + Version = 'v1.8.0' Caption = 'Contacts' Description = 'Show address book' IconIndex = 2 @@ -775,20 +775,20 @@ object MainForm: TMainForm Tag = 0 end item - Version = 'v1.7.0' + Version = 'v1.8.0' Caption = 'Maintenance' Enabled = True FolderType = ftDefault ItemCollection = < item - Version = 'v1.7.0' + Version = 'v1.8.0' Caption = 'Resources' IconIndex = 7 Name = 'NIResources' Tag = 0 end item - Version = 'v1.7.0' + Version = 'v1.8.0' Caption = 'Settings' IconIndex = 8 Name = 'NISettings' @@ -825,12 +825,12 @@ object MainForm: TMainForm Printer.MarginUnits = imPercent Printer.PrintFormats = < item - Version = 'v1.7.0' + Version = 'v1.8.0' DayInc = 0 DayIncUnits = duDay Elements = < item - Version = 'v1.7.0' + Version = 'v1.8.0' Caption.Caption = 'Current week' Caption.Font.Style = [fsItalic] DayOffset = 0 @@ -845,12 +845,12 @@ object MainForm: TMainForm FormatName = 'Events of current week (Day view)' end item - Version = 'v1.7.0' + Version = 'v1.8.0' DayInc = 0 DayIncUnits = duWeek Elements = < item - Version = 'v1.7.0' + Version = 'v1.8.0' DayOffset = 0 DayOffsetUnits = duDay ElementName = 'WeekView' @@ -864,12 +864,12 @@ object MainForm: TMainForm FormatName = 'Events of current week (Week view)' end item - Version = 'v1.7.0' + Version = 'v1.8.0' DayInc = 0 DayIncUnits = duDay Elements = < item - Version = 'v1.7.0' + Version = 'v1.8.0' DayOffset = 0 DayOffsetUnits = duWeek ElementName = 'TaskList' @@ -883,12 +883,12 @@ object MainForm: TMainForm FormatName = 'Tasks of current week' end item - Version = 'v1.7.0' + Version = 'v1.8.0' DayInc = 0 DayIncUnits = duDay Elements = < item - Version = 'v1.7.0' + Version = 'v1.8.0' DayOffset = 0 DayOffsetUnits = duDay ElementName = 'TaskList' @@ -903,12 +903,12 @@ object MainForm: TMainForm FormatName = 'Tasks of current week (landscape)' end item - Version = 'v1.7.0' + Version = 'v1.8.0' DayInc = 1 DayIncUnits = duWeek Elements = < item - Version = 'v1.7.0' + Version = 'v1.8.0' DayOffset = 0 DayOffsetUnits = duDay ElementName = 'WeekView' @@ -928,7 +928,7 @@ object MainForm: TMainForm Top = 200 end object VpResourceEditDialog1: TVpResourceEditDialog - Version = 'v1.7.0' + Version = 'v1.8.0' Options = [] Placement.Position = mpCenter Placement.Top = 10 @@ -1350,7 +1350,7 @@ object MainForm: TMainForm Top = 344 end object VpPrintPreviewDialog1: TVpPrintPreviewDialog - Version = 'v1.7.0' + Version = 'v1.8.0' ControlLink = VpControlLink1 EndDate = 42561.5151169907 MarginUnits = imPercent @@ -1365,7 +1365,7 @@ object MainForm: TMainForm Top = 432 end object VpPrintFormatEditDialog1: TVpPrintFormatEditDialog - Version = 'v1.7.0' + Version = 'v1.8.0' ControlLink = VpControlLink1 Options = [] Placement.Position = mpCenter diff --git a/components/tvplanit/examples/fulldemo/demomain.pas b/components/tvplanit/examples/fulldemo/demomain.pas index 61403dfc7..5ecb6dec2 100644 --- a/components/tvplanit/examples/fulldemo/demomain.pas +++ b/components/tvplanit/examples/fulldemo/demomain.pas @@ -881,8 +881,7 @@ begin end; CbLanguages.Items.Assign(po); -// SetLanguage(lang); - SetLanguage(GetDefaultLang); + SetLanguage(lang); finally po.Free; diff --git a/components/tvplanit/source/vpbasepainter.pas b/components/tvplanit/source/vpbasepainter.pas index 0faa14352..5f7785d1e 100644 --- a/components/tvplanit/source/vpbasepainter.pas +++ b/components/tvplanit/source/vpbasepainter.pas @@ -3,7 +3,7 @@ unit VpBasePainter; interface uses - Classes, Types, Graphics, LCLType, + LCLIntf, Classes, Types, Graphics, LCLType, VPBase; type @@ -49,7 +49,6 @@ type implementation uses - LCLIntf, VpCanvasUtils; { TBasePainter } diff --git a/components/tvplanit/source/vpcalendarpainter.pas b/components/tvplanit/source/vpcalendarpainter.pas index 8194074a8..f812f0e21 100644 --- a/components/tvplanit/source/vpcalendarpainter.pas +++ b/components/tvplanit/source/vpcalendarpainter.pas @@ -5,7 +5,7 @@ unit VpCalendarPainter; interface uses - SysUtils, Classes, Types, Graphics, Controls, + LCLIntf, SysUtils, Classes, Types, Graphics, Controls, VpBase, VpMisc, VpBasePainter, VpCalendar; type @@ -55,7 +55,7 @@ type implementation uses - LCLProc, LCLIntf, LazUtf8, + LazUtf8, {%H-}VpConst, VpCanvasUtils; type diff --git a/components/tvplanit/source/vpcontactgridpainter.pas b/components/tvplanit/source/vpcontactgridpainter.pas index e7fd0b475..5fb4b4b57 100644 --- a/components/tvplanit/source/vpcontactgridpainter.pas +++ b/components/tvplanit/source/vpcontactgridpainter.pas @@ -886,7 +886,7 @@ var begin inherited; FScaledTextMargin := round(FContactGrid.TextMargin * Scale); - FAnchorMargin := round(Scale * MARGIN) + FScaledTextMargin * 2; + FAnchorMargin := round(Scale * MARGIN) {%H-}+ FScaledTextMargin * 2; numCols := FContactGrid.PrintNumColumns; if DisplayOnly and (numCols > 0) then diff --git a/components/tvplanit/source/vpimportpreview.lfm b/components/tvplanit/source/vpimportpreview.lfm index 95f852170..eb5a96a25 100644 --- a/components/tvplanit/source/vpimportpreview.lfm +++ b/components/tvplanit/source/vpimportpreview.lfm @@ -7,6 +7,7 @@ object VpImportPreviewForm: TVpImportPreviewForm ClientHeight = 295 ClientWidth = 634 OnShow = FormShow + LCLVersion = '2.3.0.0' object ButtonPanel: TPanel Left = 6 Height = 25 diff --git a/components/tvplanit/source/vpimportpreview.pas b/components/tvplanit/source/vpimportpreview.pas index d4f775d8b..fff5edcc3 100644 --- a/components/tvplanit/source/vpimportpreview.pas +++ b/components/tvplanit/source/vpimportpreview.pas @@ -5,7 +5,7 @@ unit VpImportPreview; interface uses - Classes, SysUtils, Graphics, Types, + LCLIntf, LCLType, LCLVersion, Classes, SysUtils, Graphics, Types, Forms, Controls, Dialogs, Grids, ExtCtrls, StdCtrls, VpBaseDS; type @@ -67,7 +67,7 @@ implementation {$R *.lfm} uses - LCLIntf, LCLType, Themes, + Themes, VpSR; { TVpImportGrid } @@ -97,7 +97,11 @@ begin begin R := CellRect(cell.X, cell.Y); details := ThemeServices.GetElementDetails(tbCheckBoxCheckedNormal); + {$IF LCL_FullVersion >= 2030000} + lSize := ThemeServices.GetDetailSizeForPPI(Details, Font.PixelsPerInch); + {$ELSE} lSize := ThemeServices.GetDetailSize(Details); + {$ENDIF} lSize.cx := MulDiv(lSize.cx, Font.PixelsPerInch, Screen.PixelsPerInch); lSize.cy := MulDiv(lSize.cy, Font.PixelsPerInch, Screen.PixelsPerInch); OffsetRect(R, (R.Left+R.Right-lSize.CX) div 2, (R.Top+R.Bottom-lSize.CY) div 2); diff --git a/components/tvplanit/source/vpmisc.pas b/components/tvplanit/source/vpmisc.pas index d6c94b338..4cdcd21d5 100644 --- a/components/tvplanit/source/vpmisc.pas +++ b/components/tvplanit/source/vpmisc.pas @@ -39,7 +39,7 @@ uses {$ELSE} Windows, Consts, Messages, {$ENDIF} - SysUtils, Graphics, Types, Classes, Controls, StdCtrls, ExtCtrls, Buttons, Forms, Menus, + SysUtils, Graphics, Classes, Controls, StdCtrls, ExtCtrls, Buttons, Forms, Menus, VpBase, VpData, VpConst; type @@ -1064,7 +1064,7 @@ begin end; { Returns the coordinate of the control's bottom boundary } -function Bottomof(AControl: TControl): Integer; +function BottomOf(AControl: TControl): Integer; begin Result := AControl.Top + AControl.Height; end; @@ -1072,8 +1072,12 @@ end; { Moves a rectangle ARect by ADelta.x in x, and by ADelta.y in y direction } function MoveRect(const ARect: TRect; const ADelta: TPoint): TRect; begin - Result := ARect; - OffsetRect(Result, ADelta.x, ADelta.y); + Result := Rect( + ARect.Left + ADelta.X, + ARect.Top + ADelta.Y, + ARect.Right + ADelta.X, + ARect.Bottom + ADelta.Y + ); end; { Replaces embedded C-style line endings (\n) by FPC line endings (#13#10, #13, diff --git a/components/tvplanit/source/vpxbase.pas b/components/tvplanit/source/vpxbase.pas index 64803621c..d92eec934 100644 --- a/components/tvplanit/source/vpxbase.pas +++ b/components/tvplanit/source/vpxbase.pas @@ -34,9 +34,6 @@ interface uses Classes, - {$IFDEF LCL} - LazUTF8Classes, - {$ENDIF} VpBase; @@ -58,16 +55,6 @@ type procedure SetPointer(Ptr: Pointer; Size: Longint); end; - {$IFDEF LCL} - TVpFileStream = class(TFileStreamUTF8) - {$ELSE} - TVpFileStream = class(TFileStream) - {$ENDIF} - FFileName: string; - public - constructor CreateEx(Mode: Word; const FileName: string); - property Filename: string read FFileName; - end; { Utility methods } function VpPos(const aSubStr, aString: DOMString): Integer; @@ -671,11 +658,4 @@ begin // inherited SetPointer(Ptr); end; -{===TVpFileStream====================================================} -constructor TVpFileStream.CreateEx(Mode : Word; const FileName : string); -begin - inherited Create(FileName, Mode); - FFileName := FileName; -end; - end. diff --git a/components/tvplanit/source/vpxparsr.pas b/components/tvplanit/source/vpxparsr.pas index b4b198df1..f43f40ccb 100644 --- a/components/tvplanit/source/vpxparsr.pas +++ b/components/tvplanit/source/vpxparsr.pas @@ -892,7 +892,7 @@ end; function TVpParser.LoadDataSource(sSrcName: string; oErrors: TStringList): Boolean; var - aFileStream: TVpFileStream; + aFileStream: TFileStream; begin begin { Must be a local or network file. Eliminate file:// prefix. } @@ -902,7 +902,7 @@ begin if FileExists(sSrcName) then begin FCurrentPath := ExtractFilePath(sSrcName); {the stream and filter are destroyed after the document is parsed} - aFileStream := TVpFileStream.CreateEx(fmOpenRead, sSrcName); + aFileStream := TFileStream.Create(sSrcName, fmOpenRead); aFileStream.Position := 0; Result := True; end else begin