From 8f77fac067d2d8577eb9fecc77f5acc760bf11d6 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sat, 30 Dec 2023 19:12:13 +0000 Subject: [PATCH] tvplanit: Set version number to 1.8.3 for next OPM release. Fix ICal import ignoring taskdialog's Cancel git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9112 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../tvplanit/examples/fulldemo/demomain.pas | 2 +- components/tvplanit/laz_visualplanit.lpk | 7 +++- .../tvplanit/laz_visualplanit_design.lpk | 2 +- components/tvplanit/laz_visualplanit_zeos.lpk | 2 +- .../tvplanit/laz_visualplanit_zeos_design.lpk | 2 +- .../tvplanit/source/addons/zeos/vpzeosds.pas | 5 ++- components/tvplanit/source/design/vpnabed.pas | 3 +- components/tvplanit/source/vpbase.pas | 6 +-- components/tvplanit/source/vpbaseds.pas | 5 ++- components/tvplanit/source/vpbufds.pas | 3 +- .../tvplanit/source/vpcalendarpainter.pas | 3 +- components/tvplanit/source/vpcanvasutils.pas | 4 +- .../tvplanit/source/vpcontactgridpainter.pas | 2 +- components/tvplanit/source/vpdata.pas | 4 +- components/tvplanit/source/vpdayview.pas | 9 +++-- components/tvplanit/source/vpevnteditdlg.pas | 3 +- components/tvplanit/source/vpganttview.pas | 2 - components/tvplanit/source/vpical.pas | 5 ++- .../tvplanit/source/vpimportpreview.pas | 37 ++++++++++++------- .../source/vpimportpreview_icalevent.pas | 32 ++++++++++------ .../source/vpimportpreview_icaltask.lfm | 2 +- .../source/vpimportpreview_icaltask.pas | 10 ++--- .../tvplanit/source/vpimportpreview_vcard.pas | 10 ++--- components/tvplanit/source/vpmisc.pas | 4 +- components/tvplanit/source/vpmonthview.pas | 5 ++- components/tvplanit/source/vpprtfmtcbox.pas | 1 - components/tvplanit/source/vpprtprv.pas | 3 +- .../tvplanit/source/vptasklistpainter.pas | 6 +-- components/tvplanit/source/vpweekview.pas | 5 ++- components/tvplanit/source/vpxmlds.pas | 3 +- 30 files changed, 112 insertions(+), 75 deletions(-) diff --git a/components/tvplanit/examples/fulldemo/demomain.pas b/components/tvplanit/examples/fulldemo/demomain.pas index 5ecb6dec2..8b3492b48 100644 --- a/components/tvplanit/examples/fulldemo/demomain.pas +++ b/components/tvplanit/examples/fulldemo/demomain.pas @@ -894,7 +894,7 @@ var w: Integer; begin // Settings page - w := {%H-}MaxValue([ + w := MaxValue([ GetLabelWidth(LblLanguage), GetLabelWidth(LblTimeFormat), GetLabelWidth(LblFirstDayOfWeek), diff --git a/components/tvplanit/laz_visualplanit.lpk b/components/tvplanit/laz_visualplanit.lpk index aaa1bec89..42aa66ba5 100644 --- a/components/tvplanit/laz_visualplanit.lpk +++ b/components/tvplanit/laz_visualplanit.lpk @@ -17,6 +17,11 @@ + + + + + @@ -31,7 +36,7 @@ The Initial Developer of the Original Code is TurboPower Software. Portions created by TurboPower Software Inc. are Copyright (C) 2002 TurboPower Software Inc. All Rights Reserved. Contributor(s): "/> - + diff --git a/components/tvplanit/laz_visualplanit_design.lpk b/components/tvplanit/laz_visualplanit_design.lpk index 550822ba2..f5ef5cf84 100644 --- a/components/tvplanit/laz_visualplanit_design.lpk +++ b/components/tvplanit/laz_visualplanit_design.lpk @@ -27,7 +27,7 @@ The Initial Developer of the Original Code is TurboPower Software. Portions created by TurboPower Software Inc. are Copyright (C) 2002 TurboPower Software Inc. All Rights Reserved. Contributor(s): "/> - + diff --git a/components/tvplanit/laz_visualplanit_zeos.lpk b/components/tvplanit/laz_visualplanit_zeos.lpk index e0e214c95..2eb236445 100644 --- a/components/tvplanit/laz_visualplanit_zeos.lpk +++ b/components/tvplanit/laz_visualplanit_zeos.lpk @@ -18,7 +18,7 @@ Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. "/> - + diff --git a/components/tvplanit/laz_visualplanit_zeos_design.lpk b/components/tvplanit/laz_visualplanit_zeos_design.lpk index 63681bd7d..7251bc47c 100644 --- a/components/tvplanit/laz_visualplanit_zeos_design.lpk +++ b/components/tvplanit/laz_visualplanit_zeos_design.lpk @@ -15,7 +15,7 @@ - + diff --git a/components/tvplanit/source/addons/zeos/vpzeosds.pas b/components/tvplanit/source/addons/zeos/vpzeosds.pas index 2d7285d06..cdb636328 100644 --- a/components/tvplanit/source/addons/zeos/vpzeosds.pas +++ b/components/tvplanit/source/addons/zeos/vpzeosds.pas @@ -55,7 +55,7 @@ type public constructor Create(AOwner: TComponent); override; procedure CreateTables; - function GetNextID({%H-}TableName: string): integer; override; + function GetNextID(TableName: string): integer; override; property ResourceTable; property EventsTable; @@ -76,7 +76,7 @@ implementation uses LazFileUtils, ZAbstractDataset, - VpConst, VpException; + VpConst, VpException, VpMisc; { TVpZeosDatastore } @@ -497,6 +497,7 @@ end; autoincrement fields. } function TVpZeosDatastore.GetNextID(TableName: string): integer; begin + Unused(TableName); Result := -1; end; diff --git a/components/tvplanit/source/design/vpnabed.pas b/components/tvplanit/source/design/vpnabed.pas index f6b825872..b52eb66d4 100644 --- a/components/tvplanit/source/design/vpnabed.pas +++ b/components/tvplanit/source/design/vpnabed.pas @@ -143,7 +143,8 @@ implementation uses PropEditUtils, IDEWindowIntf, StrUtils, ImgList, - {%H-}VpConst, VpMisc; + {%H-}VpConst, // needed for {$IF VP_LCL_SCALING ...} + VpMisc; const ITEMS_MARGIN = 2; diff --git a/components/tvplanit/source/vpbase.pas b/components/tvplanit/source/vpbase.pas index 0cafc25f2..030103329 100644 --- a/components/tvplanit/source/vpbase.pas +++ b/components/tvplanit/source/vpbase.pas @@ -457,7 +457,7 @@ type TVpHintWindow = class(THintWindow) public - function CalcHintRect({%H-}MaxWidth: Integer; const AHint: String; + function CalcHintRect(MaxWidth: Integer; const AHint: String; AData: pointer): TRect; override; end; @@ -1105,9 +1105,9 @@ end; { TVpHintWindow } function TVpHintWindow.CalcHintRect(MaxWidth: Integer; const AHint: String; - AData: pointer): TRect; + AData: Pointer): TRect; begin - Result := inherited CalcHintRect(MAX_HINT_WIDTH, AHint, AData); + Result := inherited CalcHintRect(MaxWidth, AHint, AData); end; diff --git a/components/tvplanit/source/vpbaseds.pas b/components/tvplanit/source/vpbaseds.pas index 0d99f3425..f909cba41 100644 --- a/components/tvplanit/source/vpbaseds.pas +++ b/components/tvplanit/source/vpbaseds.pas @@ -956,18 +956,21 @@ procedure TVpCustomDataStore.InternalPurgeContacts(Res: TVpResource); begin // Must be overridden by descendants to remove the contacts of the given // resource from the external storage + Unused(Res); end; procedure TVpCustomDataStore.InternalPurgeEvents(Res: TVpResource); begin // Must be overridden by descendants to remove the events of the given // resource from the external storage + Unused(Res); end; procedure TVpCustomDataStore.InternalPurgeTasks(Res: TVpResource); begin // Must be overridden by descendants to remove the tasks of the given // resource from the external storage + Unused(Res); end; procedure TVpCustomDataStore.PurgeResource(Res: TVpResource); @@ -1717,7 +1720,7 @@ procedure TVpControlLink.SetCityStateZipFormat(const Value: String); begin if FCityStateZipFormat <> Value then begin FCityStateZipFormat := Value; - Notify(self, neInvalidate, 0{%H-}); + Notify(self, neInvalidate, 0); end; end; diff --git a/components/tvplanit/source/vpbufds.pas b/components/tvplanit/source/vpbufds.pas index 2a7a24230..a84794ca0 100644 --- a/components/tvplanit/source/vpbufds.pas +++ b/components/tvplanit/source/vpbufds.pas @@ -18,7 +18,7 @@ uses type TBufDataset = class(BufDataset.TBufDataset) protected - procedure LoadBlobIntoBuffer({%H-}FieldDef: TFieldDef;{%H-}ABlobBuf: PBufBlobField); override; + procedure LoadBlobIntoBuffer(FieldDef: TFieldDef; ABlobBuf: PBufBlobField); override; end; {$ENDIF} @@ -90,6 +90,7 @@ procedure TBufDataset.LoadBlobIntoBuffer(FieldDef: TFieldDef; ABlobBuf: PBufBlob begin // We just want to avoid the compiler warning. // TVpBufDSDataStore does not use BLOBs anyway. + Unused(FieldDef, ABlobBuf); end; diff --git a/components/tvplanit/source/vpcalendarpainter.pas b/components/tvplanit/source/vpcalendarpainter.pas index f812f0e21..e51479b8d 100644 --- a/components/tvplanit/source/vpcalendarpainter.pas +++ b/components/tvplanit/source/vpcalendarpainter.pas @@ -56,7 +56,8 @@ implementation uses LazUtf8, - {%H-}VpConst, VpCanvasUtils; + {%H-}VpConst, // needed for {$IF VP_SCALING...} + VpCanvasUtils; type TVpCalendarOpener = class(TVpCustomCalendar); diff --git a/components/tvplanit/source/vpcanvasutils.pas b/components/tvplanit/source/vpcanvasutils.pas index 361e4c3de..d595d32bf 100644 --- a/components/tvplanit/source/vpcanvasutils.pas +++ b/components/tvplanit/source/vpcanvasutils.pas @@ -768,7 +768,8 @@ begin if not Assigned(FCanvas) then raise EVpCanvasError.Create(RSNoCanvas); - FillChar(LF{%H-}, SizeOf(LF), #0); + LF := Default(TLogFont); + FillChar(LF, SizeOf(LF), #0); LF.lfHeight := FCanvas.Font.Height; LF.lfWidth := 0; case Angle of @@ -1696,6 +1697,7 @@ begin try bmp.SetSize(10, 10); bmp.Canvas.Font.Assign(ACanvas.Font); + Metrics := Default(TTextMetric); GetTextMetrics(bmp.Canvas.Handle, Metrics); Result := Metrics.tmAveCharWidth; finally diff --git a/components/tvplanit/source/vpcontactgridpainter.pas b/components/tvplanit/source/vpcontactgridpainter.pas index 5fb4b4b57..8166d1bf1 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) {%H-}+ FScaledTextMargin * 2; + FAnchorMargin := round(Scale * MARGIN + FScaledTextMargin * 2); numCols := FContactGrid.PrintNumColumns; if DisplayOnly and (numCols > 0) then diff --git a/components/tvplanit/source/vpdata.pas b/components/tvplanit/source/vpdata.pas index fc28563f2..10b51b4db 100644 --- a/components/tvplanit/source/vpdata.pas +++ b/components/tvplanit/source/vpdata.pas @@ -506,7 +506,7 @@ type function GetContact(Index: Integer): TVpContact; function Last:TVpContact; function ImportVCardFile(const AFileName: String; const APreview: Boolean = false; - {%H-}ADefaultCategory: Integer = -1): TVpContactArr; + ADefaultCategory: Integer = -1): TVpContactArr; procedure ExportVCardFile(const AFileName: String; const AContacts: TVpContactArr); procedure Sort; @@ -3136,6 +3136,8 @@ var datastore: TVpCustomDatastore; previewForm: TVpImportPreviewVCardForm; begin + Unused(ADefaultCategory); + Result := nil; SetLength(Result, BLOCK_SIZE); contactCounter := 0; diff --git a/components/tvplanit/source/vpdayview.pas b/components/tvplanit/source/vpdayview.pas index 9a7c3099d..a9f9cebe8 100644 --- a/components/tvplanit/source/vpdayview.pas +++ b/components/tvplanit/source/vpdayview.pas @@ -1564,7 +1564,8 @@ end; procedure TVpDayView.DoStartDrag(var DragObject: TDragObject); {$IFDEF LCL} var - P, HotSpot: TPoint; + P: TPoint = (X:0; Y:0); + HotSpot: TPoint; EventName: string; {$ENDIF} begin @@ -1578,7 +1579,7 @@ begin {$IFDEF LCL} EventName := FActiveEvent.Description; - GetCursorPos(P{%H-}); + GetCursorPos(P); P := TVpDayView(Self).ScreenToClient(P); HotSpot := Point(P.X - Self.dvActiveEventRec.Left, P.Y - Self.dvActiveEventRec.Top); @@ -2744,7 +2745,9 @@ procedure TVpDayView.VpDayViewInit(Data: PtrInt); procedure TVpDayView.VpDayViewInit(var Msg: TMessage); {$ENDIF} begin - {$IFNDEF LCL} + {$IFDEF LCL} + Unused(Data); + {$ELSE} Unused(Msg); {$ENDIF} diff --git a/components/tvplanit/source/vpevnteditdlg.pas b/components/tvplanit/source/vpevnteditdlg.pas index 9a40538e3..231d7bc74 100644 --- a/components/tvplanit/source/vpevnteditdlg.pas +++ b/components/tvplanit/source/vpevnteditdlg.pas @@ -142,7 +142,7 @@ type CIVerifying: Boolean; {$IFDEF NEW_TIME_EDIT} procedure AcceptStartTimeHandler(Sender: TObject; var ATime: TDateTime; - var {%H-}AcceptTime: Boolean); + var AcceptTime: Boolean); {$ENDIF} procedure PopLists; procedure PositionControls; @@ -229,6 +229,7 @@ begin enddt := StartDate.Date + ATime + dt; EndDate.Date := trunc(enddt); EndTime.Time := frac(enddt); + AcceptTime := true; end; {$ENDIF} diff --git a/components/tvplanit/source/vpganttview.pas b/components/tvplanit/source/vpganttview.pas index bb4bffa30..17605da49 100644 --- a/components/tvplanit/source/vpganttview.pas +++ b/components/tvplanit/source/vpganttview.pas @@ -555,7 +555,6 @@ function TVpGanttEventList.FindFirstRecurrence(AEvent: TVpEvent; out AStart, AEnd: TDateTime): Boolean; var delta: Double; - d: TDateTime; eventYear, eventMonth, eventDay: Word; startYear, startMonth, startDay: Word; begin @@ -1564,7 +1563,6 @@ procedure TVpGanttView.KeyDown(var Key: Word; Shift: TShiftState); var P: TPoint; OneDay: Integer; - c: Integer; begin inherited; diff --git a/components/tvplanit/source/vpical.pas b/components/tvplanit/source/vpical.pas index 9a97a722d..8a37b67a2 100644 --- a/components/tvplanit/source/vpical.pas +++ b/components/tvplanit/source/vpical.pas @@ -21,7 +21,7 @@ type FCalendar: TVpICalendar; FChecked: Boolean; protected - procedure SaveToStrings(const {%H-}AList: TStrings); virtual; + procedure SaveToStrings(const AList: TStrings); virtual; public constructor Create(ACalendar: TVpICalendar); virtual; function FindItem(AKey: String): TVpICalItem; @@ -195,7 +195,7 @@ type implementation uses - VpConst, VpBase; + VpConst, VpMisc, VpBase; const DATE_FORMAT = 'yyyymmdd'; @@ -358,6 +358,7 @@ end; procedure TVpICalEntry.SaveToStrings(const AList: TStrings); begin + Unused(AList); end; diff --git a/components/tvplanit/source/vpimportpreview.pas b/components/tvplanit/source/vpimportpreview.pas index 4a19fb673..024f42cdb 100644 --- a/components/tvplanit/source/vpimportpreview.pas +++ b/components/tvplanit/source/vpimportpreview.pas @@ -28,12 +28,12 @@ type ButtonPanel: TPanel; procedure FormShow(Sender: TObject); procedure GridDrawCell(Sender: TObject; aCol, aRow: Integer; aRect: TRect; - {%H-}aState: TGridDrawState); - procedure GridGetCheckboxState(Sender: TObject; {%H-}ACol, ARow: Integer; + aState: TGridDrawState); + procedure GridGetCheckboxState(Sender: TObject; ACol, ARow: Integer; var Value: TCheckboxState); - procedure GridPrepareCanvas({%H-}sender: TObject; aCol, {%H-}aRow: Integer; - {%H-}aState: TGridDrawState); - procedure GridSetCheckboxState(Sender: TObject; {%H-}ACol, ARow: Integer; + procedure GridPrepareCanvas(Sender: TObject; aCol, aRow: Integer; + aState: TGridDrawState); + procedure GridSetCheckboxState(Sender: TObject; ACol, ARow: Integer; const Value: TCheckboxState); private FDatastore: TVpCustomDatastore; @@ -45,15 +45,15 @@ type FCol0CheckState: TCheckboxState; FLockCheckState: Integer; procedure CalcRowHeights; - function GetCellText({%H-}ACol, {%H-}ARow: Integer): String; virtual; + function GetCellText(ACol, ARow: Integer): String; virtual; procedure PrepareItems; virtual; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; - procedure CheckItem({%H-}ARow: Integer; {%H-}AChecked: Boolean); virtual; + procedure CheckItem(ARow: Integer; AChecked: Boolean); virtual; function Execute: Boolean; - function IsChecked({%H-}ARow: Integer): Boolean; virtual; + function IsChecked(ARow: Integer): Boolean; virtual; property Datastore: TVpCustomDatastore read FDatastore write SetDatastore; property Grid: TVpImportGrid read FGrid; @@ -68,7 +68,7 @@ implementation uses Themes, - VpSR; + VpSR, VpMisc; { TVpImportGrid } @@ -217,14 +217,17 @@ end; procedure TVpImportPreviewForm.CheckItem(ARow: Integer; AChecked: Boolean); var r: Integer; - allcheckstate, cbs: TCheckboxState; + allcheckstate: TCheckboxState = cbUnchecked; + cbs: TCheckboxState = cbUnchecked; begin + Unused(AChecked); + if ARow > 0 then begin - Grid.GetCheckboxState(0, 1, allcheckstate{%H-}); + Grid.GetCheckboxState(0, 1, allcheckstate); for r := 2 to Grid.RowCount-1 do begin - Grid.GetCheckboxState(0, r, cbs{%H-}); + Grid.GetCheckboxState(0, r, cbs); if cbs <> allcheckstate then begin FCol0Checkstate := cbGrayed; @@ -244,6 +247,7 @@ end; To be overridden by ancestors. } function TVpImportPreviewForm.GetCellText(ACol, ARow: Integer): String; begin + Unused(ACol, ARow); Result := ''; end; @@ -253,6 +257,8 @@ var s: String; R: TRect; begin + Unused(AState); + R := ARect; if (ACol = 0) and (ARow = 0) then Grid.DrawCellCheckboxBitmaps(aCol, aRow, R) @@ -275,6 +281,8 @@ end; procedure TVpImportPreviewForm.GridGetCheckboxState(Sender: TObject; ACol, ARow: Integer; var Value: TCheckboxState); begin + Unused(ACol); + if (ARow = 0) and (ACol = 0) then Value := FCol0CheckState else @@ -287,11 +295,13 @@ begin end; end; -procedure TVpImportPreviewForm.GridPrepareCanvas(sender: TObject; aCol, +procedure TVpImportPreviewForm.GridPrepareCanvas(Sender: TObject; aCol, aRow: Integer; aState: TGridDrawState); var ts: TTextStyle; begin + Unused(Sender, ARow, AState); + if ACol = 1 then begin ts := Grid.Canvas.TextStyle; @@ -326,6 +336,7 @@ end; To be overridden by ancestors. } function TVpImportPreviewForm.IsChecked(ARow: Integer): Boolean; begin + Unused(ARow); Result := false; end; diff --git a/components/tvplanit/source/vpimportpreview_icalevent.pas b/components/tvplanit/source/vpimportpreview_icalevent.pas index c031ed029..51aa0270e 100644 --- a/components/tvplanit/source/vpimportpreview_icalevent.pas +++ b/components/tvplanit/source/vpimportpreview_icalevent.pas @@ -6,7 +6,7 @@ interface uses LCLVersion, Classes, SysUtils, Forms, Controls, Graphics, Dialogs, - VpData, VpBaseDS, VpImportPreview, VpICal, Grids, StdCtrls, Spin; + VpData, VpBaseDS, VpImportPreview, VpICal, Grids, StdCtrls; type @@ -20,10 +20,8 @@ type rbOpenEndDuration4Hrs: TRadioButton; procedure btnExecuteClick(Sender: TObject); procedure FormActivate(Sender: TObject); - procedure GridGetEditText(Sender: TObject; {%H-}ACol, {%H-}ARow: Integer; - var Value: string); - procedure GridSetEditText(Sender: TObject; {%H-}ACol, {%H-}ARow: Integer; - const Value: string); + procedure GridGetEditText(Sender: TObject; ACol, ARow: Integer; var Value: string); + procedure GridSetEditText(Sender: TObject; ACol, ARow: Integer; const Value: string); private FActivated: Boolean; FCalendar: TVpICalendar; @@ -35,7 +33,7 @@ type {$IF LCL_FullVersion >= 3990000} private FCanCloseTaskDialog: Boolean; - procedure OpenEndEventsDialog; + function OpenEndEventsDialog: Boolean; procedure OpenendEventsDialogButtonClicked(Sender: TObject; AModalResult: TModalResult; var ACanClose: Boolean); procedure OpenEndEventsDialogRadioButtonClicked(Sender: TObject); @@ -61,7 +59,7 @@ implementation {$R *.lfm} uses - VpSR, VpConst; + VpSR, VpConst, VpMisc; constructor TVPImportPreviewICalEventForm.Create(AOwner: TComponent); begin @@ -213,6 +211,7 @@ procedure TVpImportPreviewICalEventForm.GridGetEditText(Sender: TObject; ACol, var event: TVpICalEvent; begin + Unused(ACol, ARow); event := TVpICalEvent(FItems[Grid.Row - Grid.FixedRows]); if event <> nil then Value := Grid.Columns[2].PickList[event.PickedCategory]; @@ -223,7 +222,11 @@ begin if FCalendar.ContainsOpenEndEvents then begin {$IF LCL_FullVersion >= 3990000} - OpenEndEventsDialog; + if not OpenEndEventsDialog then + begin + ModalResult := mrNone; + exit; + end; {$ELSE} if not (rbOpenEndDuration30mins.Checked or rbOpenEndDuration1Hr.Checked or rbOpenEndDuration2Hrs.Checked or rbOpenEndDuration4Hrs.Checked) then @@ -232,6 +235,7 @@ begin ModalResult := mrNone; exit; end; + if rbOpenEndDuration30mins.Checked then FCalendar.FixOpenEndEvents(0.5/24) else if rbOpenEndDuration1Hr.Checked then @@ -266,6 +270,7 @@ procedure TVpImportPreviewICalEventForm.GridSetEditText(Sender: TObject; ACol, var event: TVpICalEvent; begin + Unused(ACol, ARow); event := TVpICalEvent(FItems[Grid.Row - Grid.FixedRows]); if event <> nil then event.PickedCategory := Grid.Columns[2].PickList.IndexOf(Value);; @@ -284,12 +289,13 @@ begin end; {$IF LCL_FullVersion >= 3990000} -procedure TVpImportPreviewICalEventForm.OpenendEventsDialog; +function TVpImportPreviewICalEventForm.OpenendEventsDialog: Boolean; const DURATIONS: array[0..3] of Double = (0.5/24, 1.0/24, 2.0/24, 4.0/24); var dlg: TTaskDialog; begin + Result := True; dlg := TTaskDialog.Create(nil); try dlg.Caption := RSImportICalendarEvents; @@ -304,7 +310,9 @@ begin dlg.Flags := dlg.Flags + [tfNoDefaultRadioButton]; dlg.Execute; if dlg.ModalResult = mrOK then - FCalendar.FixOpenEndEvents(DURATIONS[dlg.RadioButton.Index]); + FCalendar.FixOpenEndEvents(DURATIONS[dlg.RadioButton.Index]) + else + Result := false; finally dlg.Free; end; @@ -312,9 +320,9 @@ end; procedure TVpImportPreviewICalEventForm.OpenendEventsDialogButtonClicked( Sender: TObject; AModalResult: TModalResult; var ACanClose: Boolean); -var - i: Integer; begin + Unused(Sender); + if AModalResult = mrCancel then exit; diff --git a/components/tvplanit/source/vpimportpreview_icaltask.lfm b/components/tvplanit/source/vpimportpreview_icaltask.lfm index de4a8cef2..617374d73 100644 --- a/components/tvplanit/source/vpimportpreview_icaltask.lfm +++ b/components/tvplanit/source/vpimportpreview_icaltask.lfm @@ -9,7 +9,7 @@ inherited VpImportPreviewICalTaskForm: TVpImportPreviewICalTaskForm Width = 655 ClientWidth = 655 inherited btnExecute: TButton - Left = 439 + Left = 433 end inherited btnCancel: TButton Left = 580 diff --git a/components/tvplanit/source/vpimportpreview_icaltask.pas b/components/tvplanit/source/vpimportpreview_icaltask.pas index dcdf1e881..496c1f777 100644 --- a/components/tvplanit/source/vpimportpreview_icaltask.pas +++ b/components/tvplanit/source/vpimportpreview_icaltask.pas @@ -13,10 +13,8 @@ type { TVpImportPreviewICalTaskForm } TVpImportPreviewICalTaskForm = class(TVpImportPreviewForm) - procedure GridGetEditText(Sender: TObject; {%H-}ACol, {%H-}ARow: Integer; - var Value: string); - procedure GridSetEditText(Sender: TObject; {%H-}ACol, ARow: Integer; - const Value: string); + procedure GridGetEditText(Sender: TObject; ACol, ARow: Integer; var Value: string); + procedure GridSetEditText(Sender: TObject; ACol, ARow: Integer; const Value: string); private FCalendar: TVpICalendar; FDefaultCategory: String; @@ -45,7 +43,7 @@ implementation {$R *.lfm} uses - VpSR, VpConst; + VpSR, VpConst, VpMisc; constructor TVPImportPreviewICalTaskForm.Create(AOwner: TComponent); begin @@ -92,6 +90,7 @@ procedure TVpImportPreviewICalTaskForm.GridGetEditText(Sender: TObject; ACol, var task: TVpICalToDo; begin + Unused(ARow, ACol); task := TVpICalToDo(FItems[Grid.Row - Grid.FixedRows]); if task <> nil then Value := Grid.Columns[2].PickList[task.PickedCategory]; @@ -102,6 +101,7 @@ procedure TVpImportPreviewICalTaskForm.GridSetEditText(Sender: TObject; ACol, var task: TVpICalToDo; begin + Unused(ARow, ACol); task:= TVpICalToDo(FItems[Grid.Row - Grid.FixedRows]); if task <> nil then task.PickedCategory := Grid.Columns[2].PickList.IndexOf(Value);; diff --git a/components/tvplanit/source/vpimportpreview_vcard.pas b/components/tvplanit/source/vpimportpreview_vcard.pas index 7cac76012..1bbc42d6f 100644 --- a/components/tvplanit/source/vpimportpreview_vcard.pas +++ b/components/tvplanit/source/vpimportpreview_vcard.pas @@ -13,10 +13,8 @@ type { TVpImportPreviewVCardForm } TVpImportPreviewVCardForm = class(TVpImportPreviewForm) - procedure GridGetEditText(Sender: TObject; {%H-}ACol, {%H-}ARow: Integer; - var Value: string); - procedure GridSetEditText(Sender: TObject; {%H-}ACol, {%H-}ARow: Integer; - const Value: string); + procedure GridGetEditText(Sender: TObject; ACol, ARow: Integer; var Value: string); + procedure GridSetEditText(Sender: TObject; ACol, ARow: Integer; const Value: string); private FVCards: TVpVCards; FDefaultCategory: String; @@ -43,7 +41,7 @@ implementation {$R *.lfm} uses - VpSR; + VpSR, VpMisc; constructor TVPImportPreviewVCardForm.Create(AOwner: TComponent); begin @@ -114,6 +112,7 @@ procedure TVpImportPreviewVCardForm.GridGetEditText(Sender: TObject; ACol, var card: TVpVCard; begin + Unused(ACol, ARow); card := TVpVCard(FItems[Grid.Row - Grid.FixedRows]); if card <> nil then Value := Grid.Columns[2].PickList[card.PickedCategory]; @@ -124,6 +123,7 @@ procedure TVpImportPreviewVCardForm.GridSetEditText(Sender: TObject; ACol, var card: TVpVCard; begin + Unused(ARow, ACol); card := TVpVCard(FItems[Grid.Row - Grid.FixedRows]); if card <> nil then card.PickedCategory := Grid.Columns[2].PickList.IndexOf(Value);; diff --git a/components/tvplanit/source/vpmisc.pas b/components/tvplanit/source/vpmisc.pas index 82e1ff26c..467721e42 100644 --- a/components/tvplanit/source/vpmisc.pas +++ b/components/tvplanit/source/vpmisc.pas @@ -212,7 +212,7 @@ procedure ScaleImg(AImage: TCustomBitmap; ANewWidth, ANewHeight: Integer); function GetScrollbarHeight: Integer; function GetScrollbarWidth: Integer; -procedure FixLabels({%H-}AForm: TCustomForm); +procedure FixLabels(AForm: TCustomForm); function Between(x, min, max: Integer): Boolean; @@ -1335,6 +1335,8 @@ begin for i := 0 to AForm.ControlCount-1 do if AForm.Controls[i] is TLabel then TLabel(AForm.Controls[i]).Transparent := true; + {$ELSE} + Unused(AForm); {$IFEND} end; diff --git a/components/tvplanit/source/vpmonthview.pas b/components/tvplanit/source/vpmonthview.pas index 67bb85e81..3bbc8f0d6 100644 --- a/components/tvplanit/source/vpmonthview.pas +++ b/components/tvplanit/source/vpmonthview.pas @@ -990,7 +990,8 @@ end; procedure TVpMonthView.DoStartDrag(var DragObject: TDragObject); {$IFDEF LCL} var - P, HotSpot: TPoint; + P: TPoint = (X:0; Y:0); + HotSpot: TPoint; EventName: string; {$ENDIF} begin @@ -999,7 +1000,7 @@ begin if mvActiveEvent <> nil then begin {$IFDEF LCL} - GetCursorPos(P{%H-}); + GetCursorPos(P); P := TVpMonthView(Self).ScreenToClient(P); EventName := mvActiveEvent.Description; HotSpot := Point(P.X - Self.mvActiveEventRec.Left, P.Y - Self.mvActiveEventRec.Top); diff --git a/components/tvplanit/source/vpprtfmtcbox.pas b/components/tvplanit/source/vpprtfmtcbox.pas index b94c1349a..6a7365bca 100644 --- a/components/tvplanit/source/vpprtfmtcbox.pas +++ b/components/tvplanit/source/vpprtfmtcbox.pas @@ -34,7 +34,6 @@ interface uses {$IFDEF LCL} - LMessages, LCLProc,LCLType,LCLIntf, {$ELSE} Windows, Messages, {$ENDIF} diff --git a/components/tvplanit/source/vpprtprv.pas b/components/tvplanit/source/vpprtprv.pas index 7c240d726..bbda54817 100644 --- a/components/tvplanit/source/vpprtprv.pas +++ b/components/tvplanit/source/vpprtprv.pas @@ -710,7 +710,8 @@ var lContact: Integer; lLastPage: Boolean; begin - Unused(EndDate); + Unused(StartDate, EndDate); + if FPageInfo.Count = 0 then raise Exception.Create('No pages to print'); diff --git a/components/tvplanit/source/vptasklistpainter.pas b/components/tvplanit/source/vptasklistpainter.pas index 4b8f7da25..3015b43ba 100644 --- a/components/tvplanit/source/vptasklistpainter.pas +++ b/components/tvplanit/source/vptasklistpainter.pas @@ -94,18 +94,14 @@ var dx, dy: Integer; tm: Integer; // Scaled text margin; d2: Integer; // 2*Scale - {%H-}d1px, {%H-}d2px, d3px: Integer; + d3px: Integer; begin tm := FScaledTextMargin; {$IF VP_LCL_SCALING > 0} - d1px := FTasklist.Scale96ToFont(1); - d2px := FTasklist.Scale96ToFont(2); d3px := FTasklist.Scale96ToFont(3); {$ELSE} tm := ScaleY(FTaskList.Textmargin, DesigntimeDPI); - d1px := ScaleY(1, DesigntimeDPI); - d2px := ScaleY(2, DesigntimeDPI); d3px := ScaleY(3, DesigntimeDPI); {$IFEND} diff --git a/components/tvplanit/source/vpweekview.pas b/components/tvplanit/source/vpweekview.pas index 10c55363c..4fe02dc32 100644 --- a/components/tvplanit/source/vpweekview.pas +++ b/components/tvplanit/source/vpweekview.pas @@ -1110,7 +1110,8 @@ end; procedure TVpWeekView.DoStartDrag(var DragObject: TDragObject); {$IFDEF LCL} var - P, HotSpot: TPoint; + P: TPoint = (X:0; Y:0); + HotSpot: TPoint; EventName: string; {$ENDIF} begin @@ -1119,7 +1120,7 @@ begin if FActiveEvent <> nil then begin {$IFDEF LCL} - GetCursorPos(P{%H-}); + GetCursorPos(P); P := TVpWeekView(Self).ScreenToClient(P); EventName := FActiveEvent.Description; HotSpot := Point(P.X - Self.wvActiveEventRec.Left, P.Y - Self.wvActiveEventRec.Top); diff --git a/components/tvplanit/source/vpxmlds.pas b/components/tvplanit/source/vpxmlds.pas index 11e86e061..4bc24a898 100644 --- a/components/tvplanit/source/vpxmlds.pas +++ b/components/tvplanit/source/vpxmlds.pas @@ -299,7 +299,6 @@ var i: Integer; node: TDOMNode; appending: Boolean; - {%H-}nodename: String; begin L := TStringList.Create; try @@ -1488,7 +1487,7 @@ end; procedure TVpXmlDatastore.WriteResources(ADoc: TDOMDocument; AParentNode: TDOMNode); var i, n: Integer; - node, resroot, resnode, child, txt: TDOMNode; + resroot, resnode, child, txt: TDOMNode; res: TVpResource; begin resRoot := ADoc.CreateElement('Resources');