tvplanit: Less hints and warnings. Cosmetic changes.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4941 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz 2016-07-12 18:00:32 +00:00
parent 6517dc0e2e
commit d616eba746
39 changed files with 427 additions and 399 deletions

View File

@ -106,7 +106,7 @@ uses
const const
TURBO_LINK_URL = 'http://sourceforge.net/projects/tpvplanit/'; TURBO_LINK_URL = 'http://sourceforge.net/projects/tpvplanit/';
HELP_URL = 'http://sourceforge.net/forum/forum.php?forum_id=241880'; HELP_URL = 'http://sourceforge.net/forum/forum.php?forum_id=241880';
NEWS_SPECIFIC_URL = 'news://news.turbopower.com/turbopower.public.support.visualplanit'; {%H-}NEWS_SPECIFIC_URL = 'news://news.turbopower.com/turbopower.public.support.visualplanit';
GENERAL_DISCUSSION_URL = 'http://sourceforge.net/forum/forum.php?forum_id=241879'; GENERAL_DISCUSSION_URL = 'http://sourceforge.net/forum/forum.php?forum_id=241879';

View File

@ -35,13 +35,12 @@ interface
uses uses
{$IFDEF LCL} {$IFDEF LCL}
LMessages, LCLProc, LCLType, LCLIntf, LResources, LCLProc, LCLType, LCLIntf, LResources,
{$ELSE} {$ELSE}
Windows, Messages, Windows, Messages,
{$ENDIF} {$ENDIF}
SysUtils, Classes, Graphics, Controls, Forms, Dialogs, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
VpDlg, VpData, ExtCtrls, StdCtrls, VpBase, VpEvntEditDlg, VpBaseDS, VpConst, VpDlg, VpData, ExtCtrls, StdCtrls, VpEvntEditDlg, VpBaseDS, VpConst;
VpMisc;
type type
{ forward declarations } { forward declarations }
@ -65,8 +64,7 @@ type
procedure SnoozeBtnClick(Sender: TObject); procedure SnoozeBtnClick(Sender: TObject);
procedure DismissBtnClick(Sender: TObject); procedure DismissBtnClick(Sender: TObject);
procedure OpenItemBtnClick(Sender: TObject); procedure OpenItemBtnClick(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word; procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
Shift: TShiftState);
procedure FormShow(Sender: TObject); procedure FormShow(Sender: TObject);
private private
SnoozeDelay: TDateTime; SnoozeDelay: TDateTime;
@ -104,7 +102,7 @@ implementation
{$ENDIF} {$ENDIF}
uses uses
StrUtils, VpSR; StrUtils, VpMisc, VpSR;
{ TVpNotificationDialog } { TVpNotificationDialog }
@ -285,6 +283,7 @@ end;
procedure TAlarmNotifyForm.FormKeyDown(Sender: TObject; var Key: Word; procedure TAlarmNotifyForm.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState); Shift: TShiftState);
begin begin
Unused(Shift);
if Key = VK_ESCAPE then begin if Key = VK_ESCAPE then begin
CalcSnooze; CalcSnooze;
Close; Close;

View File

@ -38,12 +38,12 @@ uses
{$ELSE} {$ELSE}
Windows, Messages. Windows, Messages.
{$ENDIF} {$ENDIF}
Classes, Graphics, Controls, Dialogs, Forms, StdCtrls, ExtCtrls, SysUtils, Classes, Graphics, Controls, Dialogs, Forms, ExtCtrls, SysUtils,
VpConst, VpSR; VpConst, VpSR;
const const
{Message base} {Message base}
Vp_First = WM_USER; //$7DF0; {Sets base for all Vp messages} Vp_First = WM_USER; // $7DF0; {Sets base for all Vp messages}
const const
{Custom message types} {Custom message types}
@ -99,13 +99,13 @@ type
AMode: TVpPlaySoundMode) of object; AMode: TVpPlaySoundMode) of object;
{ XML exceptions } { XML exceptions }
EXML = class (Exception); EXML = class(Exception);
EVpStreamError = class(EXML) EVpStreamError = class(EXML)
private private
seFilePos : Longint; seFilePos : Longint;
public public
constructor CreateError(const FilePos: Longint; const Reason: DOMString); constructor CreateError(const FilePos: Longint; const Reason: string);
property FilePos: Longint read seFilePos; property FilePos: Longint read seFilePos;
end; end;
@ -115,7 +115,7 @@ type
feLine: Longint; feLine: Longint;
feLinePos: Longint; feLinePos: Longint;
public public
constructor CreateError(const FilePos, Line, LinePos: Longint; const Reason: DOMString); constructor CreateError(const FilePos, Line, LinePos: Longint; const Reason: string);
property Reason : DOMString read feReason; property Reason : DOMString read feReason;
property Line: Longint read feLine; property Line: Longint read feLine;
property LinePos: Longint read feLinePos; property LinePos: Longint read feLinePos;
@ -123,7 +123,7 @@ type
EVpParserError = class(EVpFilterError) EVpParserError = class(EVpFilterError)
public public
constructor CreateError(Line, LinePos: Longint; const Reason: DOMString); constructor CreateError(Line, LinePos: Longint; const Reason: String);
end; end;
{ implements the Version property with its associated design time About box } { implements the Version property with its associated design time About box }
@ -238,7 +238,7 @@ type
FOwner: TObject; FOwner: TObject;
procedure Changed; override; procedure Changed; override;
public public
constructor Create(AOwner: TObject); virtual; constructor Create(AOwner: TObject); virtual; reintroduce;
property Owner: TObject read FOwner write FOwner; property Owner: TObject read FOwner write FOwner;
end; end;
@ -358,24 +358,25 @@ implementation
{$R vpbase.res} {$R vpbase.res}
{$IFNDEF LCL}
uses uses
CommCtrl; {$IFNDEF LCL}
CommCtrl,
{$ENDIF} {$ENDIF}
VpMisc;
{ EAdStreamError } { EAdStreamError }
constructor EVpStreamError.CreateError(const FilePos: Integer; constructor EVpStreamError.CreateError(const FilePos: Integer;
const Reason: DOMString); const Reason: String);
begin begin
inherited Create (Reason); inherited Create(Reason);
seFilePos := FilePos; seFilePos := FilePos;
end; end;
{ EAdFilterError } { EAdFilterError }
constructor EVpFilterError.CreateError(const FilePos, Line, LinePos: Integer; constructor EVpFilterError.CreateError(const FilePos, Line, LinePos: Integer;
const Reason: DOMString); const Reason: string);
begin begin
inherited CreateError(FilePos, Reason); inherited CreateError(FilePos, Reason);
feLine := Line; feLine := Line;
@ -386,7 +387,7 @@ end;
{ EAdParserError } { EAdParserError }
constructor EVpParserError.CreateError(Line, LinePos: Integer; constructor EVpParserError.CreateError(Line, LinePos: Integer;
const Reason: DOMString); const Reason: String);
begin begin
inherited CreateError(FilePos, Line, LinePos, Reason); inherited CreateError(FilePos, Line, LinePos, Reason);
end; end;
@ -423,7 +424,8 @@ end;
procedure TVpCustomControl.SetVersion(const Value: string); procedure TVpCustomControl.SetVersion(const Value: string);
begin begin
// This method left intentionally blank. // This method left intentionally blank.
Unused(Value);
end; end;
{=====} {=====}
@ -574,6 +576,7 @@ end;
procedure TVpCollectionItem.SetVersion(const Value: String); procedure TVpCollectionItem.SetVersion(const Value: String);
begin begin
Unused(Value);
end; end;
{=====} {=====}
@ -621,6 +624,7 @@ end;
procedure TVpComponent.SetVersion(const Value: string); procedure TVpComponent.SetVersion(const Value: string);
begin begin
// This method left intentionally blank. // This method left intentionally blank.
Unused(Value);
end; end;
{=====} {=====}

View File

@ -40,7 +40,7 @@ uses
Windows, Messages, Windows, Messages,
{$ENDIF} {$ENDIF}
Classes, Dialogs, SysUtils, Graphics, Controls, StdCtrls, ExtCtrls, Classes, Dialogs, SysUtils, Graphics, Controls, StdCtrls, ExtCtrls,
VpBase, VpData, Forms, VpPrtFmt, VpLocalize, VpException; VpBase, VpData, Forms, VpPrtFmt, VpLocalize;
type type
TVpResourceUpdate = (ruOnChange, ruOnExit, ruOnDropDownClose); TVpResourceUpdate = (ruOnChange, ruOnExit, ruOnDropDownClose);
@ -138,18 +138,18 @@ type
TVpResourceCombo = class(TCustomComboBox) TVpResourceCombo = class(TCustomComboBox)
protected {private} protected {private}
FDataStore : TVpCustomDataStore; FDataStore: TVpCustomDataStore;
{internal variables} {internal variables}
rcLoading : Boolean; rcLoading: Boolean;
OldItemIndex : Integer; OldItemIndex: Integer;
FResourceUpdateStyle : TVpResourceUpdate; FResourceUpdateStyle: TVpResourceUpdate;
procedure VpDataStoreChanged (var Msg: {$IFDEF DELPHI}TMessage{$ELSE}TLMessage{$ENDIF}); message Vp_DataStoreChanged; procedure VpDataStoreChanged(var Msg: {$IFDEF DELPHI}TMessage{$ELSE}TLMessage{$ENDIF}); message Vp_DataStoreChanged;
procedure SetDataStore (const Value : TVpCustomDataStore); procedure SetDataStore(const Value: TVpCustomDataStore);
function GetAbout : string; function GetAbout: string;
procedure SetAbout (const Value : string); procedure SetAbout(const Value: string);
procedure SetResourceUpdateStyle (const v : TVpResourceUpdate); procedure SetResourceUpdateStyle(const v: TVpResourceUpdate);
procedure ResourceChanged (Sender : TObject); procedure ResourceChanged(Sender: TObject);
procedure LoadItems; procedure LoadItems;
{$IFNDEF LCL} {$IFNDEF LCL}
procedure CNCommand (var Msg: TWMCommand); message CN_COMMAND; procedure CNCommand (var Msg: TWMCommand); message CN_COMMAND;
@ -405,9 +405,6 @@ uses
(*****************************************************************************) (*****************************************************************************)
{ TVpCustomDataStore } { TVpCustomDataStore }
type
ProtectedTComponent = class(TComponent);
constructor TVpCustomDataStore.Create(AOwner: TComponent); constructor TVpCustomDataStore.Create(AOwner: TComponent);
var var
I: Integer; I: Integer;
@ -811,7 +808,8 @@ end;
{ - Added} { - Added}
procedure TVpCustomDataStore.PurgeResource(Res: TVpResource); procedure TVpCustomDataStore.PurgeResource(Res: TVpResource);
begin begin
Unused(Res);
if not Loading then if not Loading then
NotifyDependents; NotifyDependents;
end; end;
@ -953,6 +951,7 @@ end;
procedure TVpResourceCombo.VpDataStoreChanged(var Msg: {$IFDEF DELPHI}TMessage{$ELSE}TLMessage{$ENDIF}); procedure TVpResourceCombo.VpDataStoreChanged(var Msg: {$IFDEF DELPHI}TMessage{$ELSE}TLMessage{$ENDIF});
begin begin
Unused(Msg);
LoadItems; LoadItems;
end; end;
{=====} {=====}
@ -1006,6 +1005,7 @@ end;
procedure TVpResourceCombo.SetAbout(const Value: string); procedure TVpResourceCombo.SetAbout(const Value: string);
begin begin
Unused(Value);
//Empty on purpose //Empty on purpose
end; end;
{=====} {=====}
@ -1179,14 +1179,16 @@ begin
end; end;
{=====} {=====}
procedure TVpLinkableControl.CMEnter(var Msg : {$IFDEF DELPHI}TMessage{$ELSE}TLMessage{$ENDIF}); procedure TVpLinkableControl.CMEnter(var Msg: {$IFDEF DELPHI}TMessage{$ELSE}TLMessage{$ENDIF});
begin begin
Unused(Msg);
invalidate; invalidate;
end; end;
{=====} {=====}
procedure TVpLinkableControl.CMExit(var Msg : {$IFDEF DELPHI}TMessage{$ELSE}TLMessage{$ENDIF}); procedure TVpLinkableControl.CMExit(var Msg: {$IFDEF DELPHI}TMessage{$ELSE}TLMessage{$ENDIF});
begin begin
Unused(Msg);
invalidate; invalidate;
end; end;
{=====} {=====}

View File

@ -70,7 +70,7 @@ const
(clBlack, clBlack, clAqua, clGray, clBlack, clNavy, clBlack), (clBlack, clBlack, clAqua, clGray, clBlack, clNavy, clBlack),
(clRed, clRed, clFuchsia, clGray, clBlue, clTeal, clBlack) (clRed, clRed, clFuchsia, clGray, clBlue, clTeal, clBlack)
); );
calDefWeekStarts = dtSunday;{ default start of the week } calDefWeekStarts = dtSunday; { default start of the week }
type type
TVpCalColors = class(TPersistent) TVpCalColors = class(TPersistent)
@ -197,7 +197,7 @@ type
procedure calRebuildCalArray(ADate: TDateTime); procedure calRebuildCalArray(ADate: TDateTime);
{-recalculate the contents of the calendar array} {-recalculate the contents of the calendar array}
procedure CalculateSizes(WorkCanvas: TCanvas; Angle: TVpRotationAngle; procedure CalculateSizes(WorkCanvas: TCanvas; Angle: TVpRotationAngle;
Rect: TRect; var Row: TRowArray; var Col: TColArray; DisplayOnly: Boolean); Rect: TRect; out Row: TRowArray; out Col: TColArray; DisplayOnly: Boolean);
procedure calRecalcSize (DisplayOnly: Boolean); procedure calRecalcSize (DisplayOnly: Boolean);
{-calcualte new sizes for rows and columns} {-calcualte new sizes for rows and columns}
@ -573,7 +573,7 @@ end;
{=====} {=====}
procedure TVpCustomCalendar.CalculateSizes(WorkCanvas: TCanvas; procedure TVpCustomCalendar.CalculateSizes(WorkCanvas: TCanvas;
Angle: TVpRotationAngle; Rect: TRect; var Row: TRowArray; var Col: TColArray; Angle: TVpRotationAngle; Rect: TRect; out Row: TRowArray; out Col: TColArray;
DisplayOnly: Boolean); DisplayOnly: Boolean);
{-calcualte new sizes for rows and columns} {-calcualte new sizes for rows and columns}
var var

View File

@ -223,14 +223,14 @@ begin
{get the day name} {get the day name}
if cdoShortNames in FCalendar.Options then begin if cdoShortNames in FCalendar.Options then begin
if FCalendar.DayNameWidth < 1 then if FCalendar.DayNameWidth < 1 then
S := ShortDayNames[Ord(DOW)+1] S := DefaultFormatSettings.ShortDayNames[Ord(DOW)+1]
else else
S := Copy(ShortDayNames[Ord(DOW)+1], 1, FCalendar.DayNameWidth) S := Copy(DefaultFormatSettings.ShortDayNames[Ord(DOW)+1], 1, FCalendar.DayNameWidth)
end else begin end else begin
if FCalendar.DayNameWidth < 1 then if FCalendar.DayNameWidth < 1 then
S := LongDayNames[Ord(DOW)+1] S := DefaultFormatSettings.LongDayNames[Ord(DOW)+1]
else else
S := Copy(LongDayNames[Ord(DOW)+1], 1, FCalendar.DayNameWidth) S := Copy(DefaultFormatSettings.LongDayNames[Ord(DOW)+1], 1, FCalendar.DayNameWidth)
end; end;
{$IF FPC_FULLVERSION < 30000} {$IF FPC_FULLVERSION < 30000}
S := SysToUTF8(S); S := SysToUTF8(S);

View File

@ -83,7 +83,7 @@ interface
uses uses
{$IFDEF LCL} {$IFDEF LCL}
LMessages, LCLProc, LCLType, LCLIntf, FileUtil, LCLProc, LCLType, LCLIntf, FileUtil,
{$ELSE} {$ELSE}
Windows, //Messages, Windows, //Messages,
{$ENDIF} {$ENDIF}
@ -725,7 +725,7 @@ begin
if not Assigned(FCanvas) then if not Assigned(FCanvas) then
raise EVpCanvasError.Create(RSNoCanvas); raise EVpCanvasError.Create(RSNoCanvas);
FillChar(LF, SizeOf(LF), #0); FillChar(LF{%H-}, SizeOf(LF), #0);
LF.lfHeight := FCanvas.Font.Height; LF.lfHeight := FCanvas.Font.Height;
LF.lfWidth := 0; LF.lfWidth := 0;
case Angle of case Angle of
@ -759,6 +759,7 @@ begin
OldFont := TFont.Create; OldFont := TFont.Create;
try try
OldFont.Assign(FCanvas.Font); OldFont.Assign(FCanvas.Font);
// Create new font to use. // Create new font to use.
FCanvas.Font.Handle := CreateFontIndirect(LF); FCanvas.Font.Handle := CreateFontIndirect(LF);
@ -880,6 +881,9 @@ end;
procedure TVpExCanvas.BrushCopy(const Dest: TRect; Bitmap: TBitmap; procedure TVpExCanvas.BrushCopy(const Dest: TRect; Bitmap: TBitmap;
const Source: TRect; AColor: TColor); const Source: TRect; AColor: TColor);
begin begin
Unused(Dest, Bitmap);
Unused(Source, AColor);
if not Assigned(FCanvas) then if not Assigned(FCanvas) then
raise EVpCanvasError.Create(RSNoCanvas); raise EVpCanvasError.Create(RSNoCanvas);
@ -1157,6 +1161,8 @@ end;
procedure TVpExCanvas.TextRect(ARect: TRect; X, Y: Integer; const Text: string); procedure TVpExCanvas.TextRect(ARect: TRect; X, Y: Integer; const Text: string);
begin begin
Unused(ARect, X, Y);
Unused(Text);
if not Assigned(FCanvas) then if not Assigned(FCanvas) then
raise EVpCanvasError.Create(RSNoCanvas); raise EVpCanvasError.Create(RSNoCanvas);
end; end;
@ -1583,7 +1589,7 @@ begin
DC := GetDC(0); DC := GetDC(0);
SavedFontHandle := SelectObject(DC, ACanvas.Font.Handle); SavedFontHandle := SelectObject(DC, ACanvas.Font.Handle);
try try
GetTextMetrics(DC, Metrics); GetTextMetrics(DC, Metrics{%H-});
Result := Metrics.tmAveCharWidth; Result := Metrics.tmAveCharWidth;
finally finally
SelectObject(DC, SavedFontHandle); SelectObject(DC, SavedFontHandle);

View File

@ -40,7 +40,7 @@ uses
Windows, Messages, Windows, Messages,
{$ENDIF} {$ENDIF}
Classes, Controls, Dialogs, Forms, Graphics, Menus,Math, Classes, Controls, Dialogs, Forms, Graphics, Menus,Math,
SysUtils, VpBase, VpMisc, VpLEDLabel, VpTimerPool; SysUtils, VpBase, VpLEDLabel, VpTimerPool;
type type
TVpPercent = 0..100; TVpPercent = 0..100;
@ -207,8 +207,8 @@ type
procedure ckHandOptionChange(Sender : TObject); procedure ckHandOptionChange(Sender : TObject);
procedure ckDigitalOptionChange(Sender : TObject); procedure ckDigitalOptionChange(Sender : TObject);
procedure SizeDigitalDisplay; procedure SizeDigitalDisplay;
procedure ckTimerEvent(Sender : TObject; Handle : Integer; procedure ckTimerEvent(Sender: TObject; Handle: Integer; Interval: Cardinal;
Interval : Cardinal; ElapsedTime : LongInt); ElapsedTime: LongInt);
procedure DoOnHourChange; procedure DoOnHourChange;
procedure DoOnMinuteChange; procedure DoOnMinuteChange;
procedure DoOnSecondChange; procedure DoOnSecondChange;
@ -216,12 +216,12 @@ type
procedure PaintHands(ACanvas : TCanvas); procedure PaintHands(ACanvas : TCanvas);
{windows message methods} {windows message methods}
{$IFDEF LCL} {$IFDEF LCL}
procedure WMResize (var Msg: TLMSize); message LM_SIZE; procedure WMResize (var Msg: TLMSize); message LM_SIZE;
procedure WMEraseBkgnd (var Msg : TLMEraseBkgnd); message LM_ERASEBKGND; procedure WMEraseBkgnd (var Msg: TLMEraseBkgnd); message LM_ERASEBKGND;
{$ELSE} {$ELSE}
procedure WMResize (var Msg: TWMSize); message WM_SIZE; procedure WMResize (var Msg: TWMSize); message WM_SIZE;
procedure WMEraseBkgnd (var Msg : TWMEraseBkgnd); message WM_ERASEBKGND; procedure WMEraseBkgnd (var Msg: TWMEraseBkgnd); message WM_ERASEBKGND;
procedure WMGetDlgCode (var Msg : TWMGetDlgCode); message WM_GETDLGCODE; procedure WMGetDlgCode (var Msg: TWMGetDlgCode); message WM_GETDLGCODE;
{$ENDIF} {$ENDIF}
protected protected
procedure Loaded; override; procedure Loaded; override;
@ -300,7 +300,7 @@ type
implementation implementation
uses uses
VpConst; VpConst, VpMisc;
const const
ckDToR = (Pi / 180); ckDToR = (Pi / 180);
@ -660,12 +660,14 @@ begin
end; end;
{=====} {=====}
procedure TVpCustomClock.ckTimerEvent(Sender : TObject; Handle : Integer; procedure TVpCustomClock.ckTimerEvent(Sender: TObject; Handle: Integer;
Interval : Cardinal; ElapsedTime : LongInt); Interval: Cardinal; ElapsedTime: LongInt);
var var
Hour, Minute, Second, MSecond : Word; Hour, Minute, Second, MSecond : Word;
C, D : Integer; C, D : Integer;
begin begin
Unused(Handle, Interval);
if FClockMode = cmClock then begin if FClockMode = cmClock then begin
{Clock} {Clock}
DecodeTime(Now, Hour, Minute, Second, MSecond); DecodeTime(Now, Hour, Minute, Second, MSecond);
@ -678,7 +680,8 @@ begin
Inc(C, 24); Inc(C, 24);
Hour := C; Hour := C;
SetTime(EncodeTime(Hour, Minute, Second, MSecond)); SetTime(EncodeTime(Hour, Minute, Second, MSecond));
end else if FClockMode = cmTimer then begin end else
if FClockMode = cmTimer then begin
{Count Up Timer} {Count Up Timer}
SetTime(ckConvertMsToDateTime(ElapsedTime)); SetTime(ckConvertMsToDateTime(ElapsedTime));
end else begin end else begin
@ -923,7 +926,7 @@ var
MinuteHandLen : Integer; MinuteHandLen : Integer;
SecondHandLen : Integer; SecondHandLen : Integer;
procedure RotatePoint(OldPoint : TPoint; var NewPoint : TPoint); procedure RotatePoint(OldPoint: TPoint; out NewPoint: TPoint);
begin begin
OldPoint.X := OldPoint.X - HalfWidth; OldPoint.X := OldPoint.X - HalfWidth;
OldPoint.Y := OldPoint.Y - HalfHeight; OldPoint.Y := OldPoint.Y - HalfHeight;
@ -1350,6 +1353,8 @@ procedure TVpCustomClock.WMResize(var Msg: TWMSize);
procedure TVpCustomClock.WMResize(var Msg: TLMSize); procedure TVpCustomClock.WMResize(var Msg: TLMSize);
{$ENDIF} {$ENDIF}
begin begin
Unused(Msg);
if DisplayMode = dmDigital then begin if DisplayMode = dmDigital then begin
Width := ckLEDDisplay.Width; Width := ckLEDDisplay.Width;
Height := ckLEDDisplay.Height; Height := ckLEDDisplay.Height;

View File

@ -41,7 +41,7 @@ uses
SysUtils, SysUtils,
{$IFDEF VERSION6} Variants, {$ENDIF} {$IFDEF VERSION6} Variants, {$ENDIF}
Classes, Graphics, Controls, Forms, Dialogs, VpData, ExtCtrls, StdCtrls, Classes, Graphics, Controls, Forms, Dialogs, VpData, ExtCtrls, StdCtrls,
VpException, VpMisc, VpBase, VpSR, VpDlg, VpBaseDS, ComCtrls, EditBtn, Types; VpException, VpMisc, VpBase, VpSR, VpDlg, VpBaseDS, ComCtrls, EditBtn;
type type
{ forward declarations } { forward declarations }
@ -634,6 +634,7 @@ end;
procedure TContactEditForm.FormKeyDown(Sender: TObject; var Key: Word; procedure TContactEditForm.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState); Shift: TShiftState);
begin begin
Unused(Shift);
if Key = VK_ESCAPE then begin if Key = VK_ESCAPE then begin
ReturnCode := rtAbandon; ReturnCode := rtAbandon;
Close; Close;

View File

@ -38,7 +38,7 @@ uses
{$ELSE} {$ELSE}
Windows, Messages, Windows, Messages,
{$ENDIF} {$ENDIF}
Classes, Graphics, Controls, ComCtrls, ExtCtrls, StdCtrls, Classes, Graphics, Controls, ExtCtrls, StdCtrls,
VpBase, VpBaseDS, VpMisc, VpData, VpConst, VpSR, VpCanvasUtils, Menus; VpBase, VpBaseDS, VpMisc, VpData, VpConst, VpSR, VpCanvasUtils, Menus;
const const
@ -214,8 +214,8 @@ type
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
procedure LoadLanguage; procedure LoadLanguage;
procedure LinkHandler(Sender: TComponent; procedure LinkHandler(Sender: TComponent; NotificationType: TVpNotificationType;
NotificationType: TVpNotificationType; const Value: Variant); override; const Value: Variant); override;
function GetCityStateZipFormat: String; function GetCityStateZipFormat: String;
function GetControlType : TVpItemType; override; function GetControlType : TVpItemType; override;
procedure DeleteActiveContact(Verify: Boolean); procedure DeleteActiveContact(Verify: Boolean);
@ -266,7 +266,7 @@ type
implementation implementation
uses uses
SysUtils, Math, Forms, Dialogs, VpContactEditDlg, VpContactGridPainter; SysUtils, Forms, Dialogs, VpContactEditDlg, VpContactGridPainter;
(*****************************************************************************) (*****************************************************************************)
@ -489,6 +489,7 @@ end;
procedure TVpContactGrid.LinkHandler(Sender: TComponent; procedure TVpContactGrid.LinkHandler(Sender: TComponent;
NotificationType: TVpNotificationType; const Value: Variant); NotificationType: TVpNotificationType; const Value: Variant);
begin begin
Unused(Value);
case NotificationType of case NotificationType of
neDataStoreChange : Invalidate; neDataStoreChange : Invalidate;
neInvalidate : Invalidate; neInvalidate : Invalidate;
@ -2154,6 +2155,7 @@ procedure TVpContactGrid.WMKillFocus(var Msg : TWMKillFocus);
procedure TVpContactGrid.WMKillFocus(var Msg : TLMKillFocus); procedure TVpContactGrid.WMKillFocus(var Msg : TLMKillFocus);
{$ENDIF} {$ENDIF}
begin begin
Unused(Msg);
if Assigned(cgInplaceEditor) and not cgInplaceEditor.Visible then if Assigned(cgInplaceEditor) and not cgInplaceEditor.Visible then
Invalidate; Invalidate;
end; end;

View File

@ -35,12 +35,12 @@ interface
uses uses
{$IFDEF LCL} {$IFDEF LCL}
LMessages,LCLProc,LCLType,LCLIntf, LCLProc, LCLType, LCLIntf,
{$ELSE} {$ELSE}
Windows, Windows,
{$ENDIF} {$ENDIF}
Buttons, Classes, Controls, Forms, Graphics, Menus, Messages, Buttons, Classes, Controls, Forms, Graphics, Menus, StdCtrls, SysUtils,
StdCtrls, SysUtils, VpBase, VpCalendar, VpConst, VpEdPop, VpMisc; VpCalendar, VpConst, VpEdPop, VpMisc;
type type
TVpDateOrder = (doMDY, doDMY, doYMD); TVpDateOrder = (doMDY, doDMY, doYMD);
@ -375,6 +375,8 @@ var
P : TPoint; P : TPoint;
I : Integer; I : Integer;
begin begin
Unused(Button, Shift);
P := Point(X,Y); P := Point(X,Y);
if not PtInRect(Calendar.ClientRect, P) then if not PtInRect(Calendar.ClientRect, P) then
PopUpClose(Sender); PopUpClose(Sender);
@ -393,8 +395,10 @@ end;
procedure TVpCustomDateEdit.PopupOpen; procedure TVpCustomDateEdit.PopupOpen;
var var
P : TPoint; P: TPoint;
MeasureFrom : TPoint; {$IFNDEF LCL}
MeasureFrom: TPoint;
{$ENDIF}
begin begin
inherited PopupOpen; inherited PopupOpen;
@ -436,7 +440,9 @@ begin
Calendar.Colors.Assign(FPopupCalColors); Calendar.Colors.Assign(FPopupCalColors);
{determine the proper position} {determine the proper position}
P := Point (Left, Top + Height + 2); P := Point (Left, Top + Height + 2);
MeasureFrom := Point (0, 0); {$IFNDEF LCL}
MeasureFrom := Point(0, 0);
{$ENDIF}
if Assigned (Parent) and (not (Parent is TForm)) then begin if Assigned (Parent) and (not (Parent is TForm)) then begin
P.x := P.x + Parent.Left; P.x := P.x + Parent.Left;
P.y := P.y + Parent.Top; P.y := P.y + Parent.Top;
@ -467,6 +473,8 @@ end;
procedure TVpCustomDateEdit.PopupDateChange(Sender : TObject; Date : TDateTime); procedure TVpCustomDateEdit.PopupDateChange(Sender : TObject; Date : TDateTime);
begin begin
Unused(Date);
{get the current value} {get the current value}
SetDate(Calendar.Date); SetDate(Calendar.Date);
Modified := True; Modified := True;

View File

@ -1198,7 +1198,8 @@ function TVpDayView.dvCalcVisibleLines(RenderHeight, ColHeadHeight, RowHeight: I
Scale: Extended; StartLine, StopLine: Integer): Integer; Scale: Extended; StartLine, StopLine: Integer): Integer;
var var
vertical: integer; vertical: integer;
d, m: Integer; // d = result of "div", m = result of "mod" d: Integer = 0; // d = result of "div"
m: Integer = 0; // m = result of "mod"
begin begin
if StartLine < 0 then if StartLine < 0 then
StartLine := TopLine; StartLine := TopLine;

View File

@ -38,7 +38,7 @@ uses
Windows, Windows,
{$ENDIF} {$ENDIF}
Classes, Dialogs, SysUtils, Db, Classes, Dialogs, SysUtils, Db,
VpBase, VpData, VpSR, VpBaseDS, VpConst, VpException; VpBase, VpData, VpBaseDS, VpConst, VpException;
type type
TVpCustomDBDataStore = class(TVpCustomDataStore) TVpCustomDBDataStore = class(TVpCustomDataStore)

View File

@ -38,7 +38,7 @@ uses
Controls, Controls,
{$ELSE} {$ELSE}
{$ENDIF} {$ENDIF}
Classes, Forms, Graphics, VpBase, VpBaseDS, VpData, VpConst, VpSR; Classes, Forms, Graphics, VpBase, VpBaseDS, VpConst, VpSR;
type type
TVpDialogPosition = (mpCenter, mpCenterTop, mpCustom); TVpDialogPosition = (mpCenter, mpCenterTop, mpCustom);
@ -93,6 +93,9 @@ type
implementation implementation
uses
VpMisc;
constructor TVpBaseDialog.Create(AOwner : TComponent); constructor TVpBaseDialog.Create(AOwner : TComponent);
var var
I: integer; I: integer;
@ -154,6 +157,7 @@ end;
procedure TVpBaseDialog.SetVersion(const Value: string); procedure TVpBaseDialog.SetVersion(const Value: string);
begin begin
Unused(Value);
// This method left intentionally blank. // This method left intentionally blank.
end; end;
{=====} {=====}

View File

@ -34,14 +34,14 @@ interface
uses uses
{$IFDEF LCL} {$IFDEF LCL}
LMessages,LCLProc,LCLType,LCLIntf, LCLProc,LCLType,LCLIntf,
{$ELSE} {$ELSE}
Windows, Windows, Messages,
{$ENDIF} {$ENDIF}
Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, TypInfo, ExtCtrls, StdCtrls, TypInfo, ExtCtrls,
VpPrtFmt, VpBase, VpBaseDS, VpDBDS,{ VpBDEDS,} VpPrtPrv, Buttons, VpPrtFmt, VpBase, VpBaseDS, VpPrtPrv, Buttons,
VpException, VpSR; VpException, VpSR;
const const
@ -240,18 +240,11 @@ var
begin begin
if IsDirty then begin if IsDirty then begin
Rslt := DirtyPrompt; Rslt := DirtyPrompt;
case Rslt of
{ case Rslt of ID_YES : DoSave;
ID_YES: begin ID_NO : ; // nothing
DoSave; ID_CANCEL : Exit;
end; end;
ID_NO: begin
// nothing
end;
ID_CANCEL: Exit;
end;}
end; end;
if OpenDialog1.Execute then begin if OpenDialog1.Execute then begin
@ -315,19 +308,17 @@ var
begin begin
if IsDirty then begin if IsDirty then begin
Rslt := DirtyPrompt; Rslt := DirtyPrompt;
case Rslt of
{ case Rslt of ID_YES:
ID_YES: begin begin
DoSave; DoSave;
DoNewFile;
end;
ID_NO:
DoNewFile; DoNewFile;
end; ID_CANCEL:
Exit;
ID_NO: begin end;
DoNewFile;
end;
ID_CANCEL: Exit;
end;}
end end
else else
DoNewFile; DoNewFile;
@ -543,24 +534,21 @@ var
begin begin
if IsDirty then begin if IsDirty then begin
Rslt := DirtyPrompt; Rslt := DirtyPrompt;
case Rslt of
{ case Rslt of ID_YES:
ID_YES: begin begin
DoSave; DoSave;
CanClose := True;
end;
ID_NO:
CanClose := True; CanClose := True;
end; ID_CANCEL:
begin
ID_NO: begin CanClose := False;
CanClose := True; Exit;
end; end;
end;
ID_CANCEL: begin end else
CanClose := False;
Exit;
end;
end; }
end
else
CanClose := True; CanClose := True;
end; end;
{=====} {=====}
@ -608,6 +596,7 @@ end;
procedure TfrmPrnFormat.lbElementsMouseDown(Sender: TObject; procedure TfrmPrnFormat.lbElementsMouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer); Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin begin
Unused(Button, Shift);
LastX := X; LastX := X;
LastY := Y; LastY := Y;
DragItem := (Sender as TListBox).ItemAtPos(Point(LastX, LastY), True); DragItem := (Sender as TListBox).ItemAtPos(Point(LastX, LastY), True);
@ -633,6 +622,7 @@ procedure TfrmPrnFormat.lbElementsDragOver(Sender, Source: TObject; X,Y: Integer
var var
lb: TListBox; lb: TListBox;
begin begin
Unused(State);
lb := (Source as TListBox); lb := (Source as TListBox);
lb.Canvas.DrawFocusRect(lb.ItemRect(lb.ItemAtPos(Point(LastX, LastY), True))); lb.Canvas.DrawFocusRect(lb.ItemRect(lb.ItemAtPos(Point(LastX, LastY), True)));
lb.Canvas.DrawFocusRect(lb.ItemRect(lb.ItemAtPos(Point(X, Y), True))); lb.Canvas.DrawFocusRect(lb.ItemRect(lb.ItemAtPos(Point(X, Y), True)));
@ -659,11 +649,8 @@ end;
procedure TfrmPrnFormat.SetCaptions; procedure TfrmPrnFormat.SetCaptions;
var var
cnv: TControlCanvas; cnv: TControlCanvas;
i, w: Integer; w: Integer;
wPrv: Integer;
begin begin
wPrv := PrintPreview.Width;
Caption := RSPrintFormatDesigner; Caption := RSPrintFormatDesigner;
LblFormats.Caption := RSFormats; LblFormats.Caption := RSFormats;
LblElements.Caption := RSElements; LblElements.Caption := RSElements;

View File

@ -35,12 +35,12 @@ interface
uses uses
{$IFDEF LCL} {$IFDEF LCL}
LMessages,LCLProc,LCLType,LCLIntf, LCLProc, LCLType, LCLIntf,
{$ELSE} {$ELSE}
Windows, Windows,
{$ENDIF} {$ENDIF}
Buttons, Classes, Controls, ExtCtrls, Forms, Graphics, Menus, Buttons, Classes, Controls, ExtCtrls, Forms, Graphics, Menus,
Messages, StdCtrls, SysUtils, VpBase, VpConst; StdCtrls, SysUtils, VpConst;
type type
TVpEdButton = class(TBitBtn) TVpEdButton = class(TBitBtn)
@ -57,8 +57,8 @@ type
FShowButton : Boolean; FShowButton : Boolean;
function GetVersion : string; function GetVersion : string;
procedure SetShowButton(Value : Boolean); procedure SetShowButton(Value: Boolean);
procedure SetVersion(const Value : string); procedure SetVersion(const Value: string);
{internal methods} {internal methods}
function GetButtonWidth : Integer; function GetButtonWidth : Integer;
@ -208,6 +208,7 @@ end;
procedure TVpEdPopup.SetVersion(const Value : string); procedure TVpEdPopup.SetVersion(const Value : string);
begin begin
Unused(Value);
// Leave empty // Leave empty
end; end;
{=====} {=====}

View File

@ -279,6 +279,8 @@ var
Name: string; Name: string;
ColorRect: TRect; ColorRect: TRect;
begin begin
Unused(Control, State);
Category.Canvas.FillRect(ARect); Category.Canvas.FillRect(ARect);
Color := CatColorMap.GetCategory(Index).Color; Color := CatColorMap.GetCategory(Index).Color;
@ -483,9 +485,9 @@ begin
end; end;
{=====} {=====}
{ Inc or Dec AlarmAdvance according to which button was pressed }
procedure TDlgEventEdit.AdvanceUpDownClick(Sender: TObject; Button: TUDBtnType); procedure TDlgEventEdit.AdvanceUpDownClick(Sender: TObject; Button: TUDBtnType);
begin begin
{ Inc or Dec AlarmAdvance according to which button was pressed }
{ case Button of { case Button of
btNext: btNext:
AlarmAdvance.Text := IntToStr(StrToIntDef(AlarmAdvance.Text, 0) + 1); AlarmAdvance.Text := IntToStr(StrToIntDef(AlarmAdvance.Text, 0) + 1);

View File

@ -39,7 +39,7 @@ uses
{$ELSE} {$ELSE}
Windows, Windows,
{$ENDIF} {$ENDIF}
Classes, SysUtils, VpConst, VpSR; Classes, SysUtils, VpSR;
type type
{*** Base Vp exeption class ***} {*** Base Vp exeption class ***}

View File

@ -45,7 +45,7 @@ uses
{$IFDEF VERSION6} DesignIntf, DesignEditors, {$ELSE} DsgnIntf, {$ENDIF}, DBTables, {$IFDEF VERSION6} DesignIntf, DesignEditors, {$ELSE} DsgnIntf, {$ENDIF}, DBTables,
{$ENDIF} {$ENDIF}
{$ENDIF} {RUNTIMETEST} {$ENDIF} {RUNTIMETEST}
ExtCtrls, StdCtrls, Db, VpData, VpFlxDS, ComCtrls, Buttons; ExtCtrls, StdCtrls, Db, VpFlxDS, ComCtrls, Buttons;
type type
@ -115,7 +115,7 @@ implementation
{$ENDIF} {$ENDIF}
uses uses
vpConst; vpConst, VpMisc;
{$IFDEF RUNTIMETEST} {$IFDEF RUNTIMETEST}
{ Runtime test } { Runtime test }
@ -481,6 +481,7 @@ end;
procedure TfrmFieldMapper.DatasetFieldLBKeyPress(Sender: TObject; procedure TfrmFieldMapper.DatasetFieldLBKeyPress(Sender: TObject;
var Key: Char); var Key: Char);
begin begin
Unused(Key);
DbFieldSelected(sender); DbFieldSelected(sender);
end; end;
{=====} {=====}
@ -494,6 +495,7 @@ end;
procedure TfrmFieldMapper.VPFieldLBKeyPress(Sender: TObject; procedure TfrmFieldMapper.VPFieldLBKeyPress(Sender: TObject;
var Key: Char); var Key: Char);
begin begin
Unused(Key);
VpFieldSelected(Sender); VpFieldSelected(Sender);
end; end;
{=====} {=====}
@ -597,6 +599,7 @@ end;
procedure TfrmFieldMapper.FieldMappingsLBKeyPress(Sender: TObject; procedure TfrmFieldMapper.FieldMappingsLBKeyPress(Sender: TObject;
var Key: Char); var Key: Char);
begin begin
Unused(Key);
FieldMappingsLBClick(Sender); FieldMappingsLBClick(Sender);
end; end;
{=====} {=====}
@ -604,6 +607,7 @@ end;
procedure TfrmFieldMapper.FormClose(Sender: TObject; procedure TfrmFieldMapper.FormClose(Sender: TObject;
var Action: TCloseAction); var Action: TCloseAction);
begin begin
Unused(Action);
{reset all datasets to their original active status} {reset all datasets to their original active status}
if ResDS <> nil then if ResDS <> nil then
ResDS.Active := DSResActive; ResDS.Active := DSResActive;

View File

@ -39,7 +39,7 @@ uses
{$ELSE} {$ELSE}
Windows, Messages, Windows, Messages,
{$ENDIF} {$ENDIF}
Classes, Controls, Graphics, SysUtils, VpBase; Classes, Controls, Graphics, SysUtils;
type type
TSegmentSize = 2..10; TSegmentSize = 2..10;
@ -54,7 +54,7 @@ type
FSize : TSegmentSize; FSize : TSegmentSize;
lbDrawBmp : TBitmap; lbDrawBmp : TBitmap;
procedure CMTextChanged(var Message: {$IFDEF LCL}TLMessage{$ELSE}TMessage{$ENDIF}); message CM_TEXTCHANGED; procedure CMTextChanged(var Message: {$IFDEF LCL}TLMessage{$ELSE}TMessage{$ENDIF}); message CM_TEXTCHANGED;
procedure Initialize(var Points: array of TPoint); procedure Initialize(out Points: array of TPoint);
function NewOffset(xOry: char; OldOffset: Integer): Integer; function NewOffset(xOry: char; OldOffset: Integer): Integer;
procedure ProcessCaption(Points: array of TPoint); procedure ProcessCaption(Points: array of TPoint);
procedure PaintSegment(Segment: Integer; Color: TColor; procedure PaintSegment(Segment: Integer; Color: TColor;
@ -135,7 +135,7 @@ type
implementation implementation
uses uses
VpConst; VpConst, VpMisc;
{ LED Segment Map } { LED Segment Map }
{ } { }
@ -275,9 +275,10 @@ begin
end; end;
{=====} {=====}
procedure TVpCustomLEDLabel.SetAbout(const Value : string); procedure TVpCustomLEDLabel.SetAbout(const Value: string);
begin begin
{Leave empty} {Leave empty}
Unused(Value);
end; end;
{=====} {=====}
@ -288,9 +289,9 @@ begin
end; end;
{=====} {=====}
procedure TVpCustomLEDLabel.Initialize(var Points: array of TPoint); procedure TVpCustomLEDLabel.Initialize(out Points: array of TPoint);
var var
I : Integer; I: Integer;
begin begin
for I := 0 to MAX_POINTS do begin for I := 0 to MAX_POINTS do begin
Points[i].X := DigitPoints[i].X * (FSize - 1); Points[i].X := DigitPoints[i].X * (FSize - 1);

View File

@ -39,51 +39,48 @@ uses
{$IFDEF LCL} {$IFDEF LCL}
LCLProc, LCLType, LCLIntf, LazFileUtils, LCLProc, LCLType, LCLIntf, LazFileUtils,
{$ENDIF} {$ENDIF}
Classes, Dialogs,SysUtils, Graphics, StdCtrls, Forms, Classes, Dialogs,SysUtils, Graphics, Forms,
VpBase, VpMisc, VpData, VpXParsr, VpPrtFmt; { For TVpAttributes } VpBase, VpMisc, VpXParsr, VpPrtFmt; { For TVpAttributes }
type type
TVpLocalizeLanguage = class; TVpLocalizeLanguage = class;
TVpLocalizeLanguageItem = class (TVpCollectionItem) TVpLocalizeLanguageItem = class(TVpCollectionItem)
private private
FCollection : TVpLocalizeLanguage; FCollection: TVpLocalizeLanguage;
FLanguageID : Integer; FLanguageID: Integer;
FSubLanguageID : Integer; FSubLanguageID: Integer;
FName : string; FName: string;
protected
public public
constructor Create (Collection : TCollection); override; constructor Create(Collection: TCollection); override;
destructor Destroy; override; destructor Destroy; override;
published published
property Collection : TVpLocalizeLanguage read FCollection write FCollection; property Collection: TVpLocalizeLanguage read FCollection write FCollection;
property LanguageID : Integer read FLanguageID write FLanguageID; property LanguageID: Integer read FLanguageID write FLanguageID;
property Name : string read FName write FName; property Name: string read FName write FName;
property SubLanguageID : Integer read FSubLanguageID write FSubLanguageID; property SubLanguageID: Integer read FSubLanguageID write FSubLanguageID;
end; end;
TVpLocalizeLanguage = class (TCollection) TVpLocalizeLanguage = class(TCollection)
private private
FOwner : TPersistent; FOwner: TPersistent;
protected protected
function GetItem (Index : Integer) : TVpLocalizeLanguageItem; function GetItem(Index: Integer): TVpLocalizeLanguageItem;
function GetOwner : TPersistent; override; function GetOwner : TPersistent; override;
procedure SetItem (Index : Integer; Value : TVpLocalizeLanguageItem); procedure SetItem(Index: Integer; Value: TVpLocalizeLanguageItem);
public public
constructor Create (AOwner : TPersistent); constructor Create (AOwner : TPersistent);
{$IFNDEF VERSION5} {$IFNDEF VERSION5}
procedure Delete (Item : integer); procedure Delete (Item : integer);
{$ENDIF} {$ENDIF}
function HasLanguage (ALanguage : Integer) : Integer; function HasLanguage(ALanguage: Integer) : Integer;
function HasSubLanguage (ALanguage : Integer; function HasSubLanguage(ALanguage : Integer; ASubLanguage: Integer): Integer;
ASubLanguage : Integer) : Integer;
property Items[Index : Integer] : TVpLocalizeLanguageItem property Items[Index: Integer]: TVpLocalizeLanguageItem read GetItem write SetItem;
read GetItem write SetItem;
end; end;
TVpLocalizeStates = class; TVpLocalizeStates = class;
@ -205,37 +202,27 @@ type
FElementIndex : Integer; FElementIndex : Integer;
protected protected
procedure xmlLocalizeAttribute (oOwner : TObject; procedure xmlLocalizeAttribute(oOwner: TObject; sName, sValue: DOMString; bSpecified: Boolean);
sName, procedure xmlLocalizeEndElement(oOwner: TObject; sValue: DOMString);
sValue : DOMString; procedure xmlLocalizeStartElement(oOwner: TObject; sValue: DOMString);
bSpecified : Boolean);
procedure xmlLocalizeEndElement (oOwner : TObject;
sValue : DOMString);
procedure xmlLocalizeStartElement (oOwner : TObject;
sValue : DOMString);
public public
constructor Create; constructor Create;
destructor Destroy; override; destructor Destroy; override;
procedure CountriesByLanguage (ALanguage : Integer; procedure CountriesByLanguage(ALanguage: Integer; AStrings: TStrings);
AStrings : TStrings); procedure CountriesBySubLanguage(ALanguage: Integer; ASubLanguage: Integer;
procedure CountriesBySubLanguage (ALanguage : Integer; AStrings: TStrings);
ASubLanguage : Integer; function CountryNameToIndex(ACountry: string): Integer;
AStrings : TStrings); procedure CountriesToTStrings(AStrings: TStrings);
function CountryNameToIndex (ACountry : string) : Integer; function GetCurrentCountry: Integer;
procedure CountriesToTStrings (AStrings : TStrings); function GetCountryByLanguage(ALanguage: Integer): Integer;
function GetCurrentCountry : Integer; function GetCountryBySubLanguage(ALanguage: Integer; ASubLanguage: Integer): Integer;
function GetCountryByLanguage (ALanguage : Integer) : Integer; procedure LoadFromFile(const FileName: string; const Append: Boolean);
function GetCountryBySubLanguage (ALanguage : Integer; function StateNameToIndex(ACountry: Integer; AState: string): Integer;
ASubLanguage : Integer) : Integer; procedure StatesToTStrings (ACountry: Integer; AStrings: TStrings);
procedure LoadFromFile (const FileName : string;
const Append : Boolean);
function StateNameToIndex (ACountry : Integer;
AState : string) : Integer;
procedure StatesToTStrings (ACountry : Integer;
AStrings : TStrings);
published published
property Countries : TVpLocalizeCountry read FCountries write FCountries; property Countries: TVpLocalizeCountry read FCountries write FCountries;
end; end;
@ -243,14 +230,16 @@ type
implementation implementation
constructor TVpLocalizeLanguageItem.Create (Collection : TCollection); { TVpLocalizeLanguageItem }
begin
inherited Create (Collection);
FCollection := TVpLocalizeLanguage.Create (TVpLocalizeLanguage (Collection).FOwner);
FLanguageID := -1; constructor TVpLocalizeLanguageItem.Create(Collection: TCollection);
begin
inherited Create(Collection);
FCollection := TVpLocalizeLanguage.Create(TVpLocalizeLanguage(Collection).FOwner);
FLanguageID := -1;
FSubLanguageID := -1; FSubLanguageID := -1;
FName := ''; FName := '';
end; end;
destructor TVpLocalizeLanguageItem.Destroy; destructor TVpLocalizeLanguageItem.Destroy;
@ -260,9 +249,12 @@ begin
inherited Destroy; inherited Destroy;
end; end;
constructor TVpLocalizeLanguage.Create(AOwner : TPersistent);
{ TVpLocalizeLanguage }
constructor TVpLocalizeLanguage.Create(AOwner: TPersistent);
begin begin
inherited Create (TVpLocalizeLanguageItem); inherited Create(TVpLocalizeLanguageItem);
FOwner := AOwner; FOwner := AOwner;
end; end;
{=====} {=====}
@ -275,22 +267,21 @@ end;
{=====} {=====}
{$ENDIF} {$ENDIF}
function TVpLocalizeLanguage.GetItem (Index : Integer) : TVpLocalizeLanguageItem; function TVpLocalizeLanguage.GetItem(Index: Integer): TVpLocalizeLanguageItem;
begin begin
Result := TVpLocalizeLanguageItem (inherited GetItem (Index)); Result := TVpLocalizeLanguageItem(inherited GetItem(Index));
end; end;
{=====} {=====}
function TVpLocalizeLanguage.GetOwner : TPersistent; function TVpLocalizeLanguage.GetOwner: TPersistent;
begin begin
Result := FOwner; Result := FOwner;
end; end;
{=====} {=====}
function TVpLocalizeLanguage.HasLanguage (ALanguage : Integer) : Integer; function TVpLocalizeLanguage.HasLanguage (ALanguage: Integer): Integer;
var var
i : Integer; i: Integer;
begin begin
Result := -1; Result := -1;
for i := 0 to Count - 1 do for i := 0 to Count - 1 do
@ -300,24 +291,23 @@ begin
end; end;
end; end;
function TVpLocalizeLanguage.HasSubLanguage (ALanguage : Integer; function TVpLocalizeLanguage.HasSubLanguage(ALanguage: Integer;
ASubLanguage : Integer) : Integer; ASubLanguage: Integer): Integer;
var var
i : Integer; i: Integer;
begin begin
Result := -1; Result := -1;
for i := 0 to Count - 1 do for i := 0 to Count - 1 do
if (Items[i].LanguageID = ALanguage) and if (Items[i].LanguageID = ALanguage) and (Items[i].SubLanguageID = ASubLanguage) then
(Items[i].SubLanguageID = ASubLanguage) then begin begin
Result := i; Result := i;
Break; Break;
end; end;
end; end;
procedure TVpLocalizeLanguage.SetItem (Index : Integer; Value : TVpLocalizeLanguageItem); procedure TVpLocalizeLanguage.SetItem(Index: Integer; Value: TVpLocalizeLanguageItem);
begin begin
inherited SetItem (Index, Value); inherited SetItem(Index, Value);
end; end;
{=====} {=====}
@ -411,9 +401,9 @@ begin
inherited Destroy; inherited Destroy;
end; end;
constructor TVpLocalizeCountry.Create(AOwner : TPersistent); constructor TVpLocalizeCountry.Create(AOwner: TPersistent);
begin begin
inherited Create (TVpLocalizeCountryItem); inherited Create(TVpLocalizeCountryItem);
FOwner := AOwner; FOwner := AOwner;
end; end;
{=====} {=====}
@ -555,7 +545,6 @@ end;
function TVpLocalization.GetCountryByLanguage (ALanguage : Integer) : Integer; function TVpLocalization.GetCountryByLanguage (ALanguage : Integer) : Integer;
var var
i : Integer; i : Integer;
begin begin
Result := -1; Result := -1;
for i := 0 to Countries.Count - 1 do for i := 0 to Countries.Count - 1 do
@ -641,14 +630,13 @@ begin
AStrings.Add (FCountries.Items[ACountry].States.Items[i].Name); AStrings.Add (FCountries.Items[ACountry].States.Items[i].Name);
end; end;
procedure TVpLocalization.xmlLocalizeAttribute (oOwner : TObject; procedure TVpLocalization.xmlLocalizeAttribute(oOwner: TObject;
sName, sName, sValue: DOMString; bSpecified: Boolean);
sValue : DOMString;
bSpecified : Boolean);
var var
Item : TVpAttributeItem; Item : TVpAttributeItem;
begin begin
Item := TVpAttributeItem (FAttributes.Add); Unused(oOwner, bSpecified);
Item := TVpAttributeItem(FAttributes.Add);
Item.Name := sName; Item.Name := sName;
Item.Value := sValue; Item.Value := sValue;
end; end;
@ -656,8 +644,9 @@ end;
procedure TVpLocalization.xmlLocalizeEndElement (oOwner : TObject; procedure TVpLocalization.xmlLocalizeEndElement (oOwner : TObject;
sValue : DOMString); sValue : DOMString);
begin begin
if (sValue = 'Country') or (sValue = 'Countries') or Unused(oOwner);
(sValue = 'AddressDefinition') then begin if (sValue = 'Country') or (sValue = 'Countries') or (sValue = 'AddressDefinition') then
begin
FLoadingIndex := -1; FLoadingIndex := -1;
FElementIndex := -1; FElementIndex := -1;
end else if sValue = 'State' then end else if sValue = 'State' then
@ -665,27 +654,27 @@ begin
FAttributes.Clear; FAttributes.Clear;
end; end;
procedure TVpLocalization.xmlLocalizeStartElement (oOwner : TObject; procedure TVpLocalization.xmlLocalizeStartElement(oOwner: TObject; sValue: DOMString);
sValue : DOMString);
function GetBooleanValue (AString : string; function GetBooleanValue(AString: string; ADefault: Boolean): Boolean;
ADefault : Boolean) : Boolean;
begin begin
Result := ADefault; Result := ADefault;
AString := LowerCase (AString); AString := LowerCase (AString);
if (AString = 't') or (AString = 'true') or (AString = '1') or if (AString = 't') or (AString = 'true') or (AString = '1') or
(AString = 'on') or (AString = 'yes') then (AString = 'on') or (AString = 'yes')
then
Result := True Result := True
else if (AString= 'f') or (AString = 'false') or (AString = '0') or else
(AString = 'off') or (AString = 'no') then if (AString= 'f') or (AString = 'false') or (AString = '0') or
(AString = 'off') or (AString = 'no')
then
Result := False; Result := False;
end; end;
function GetIntegerValue (AString : string; function GetIntegerValue(AString: string; ADefault: Integer): Integer;
ADefault : Integer) : Integer;
begin begin
try try
Result := StrToInt (AString); Result := StrToInt(AString);
except on EConvertError do except on EConvertError do
Result := ADefault; Result := ADefault;
end; end;
@ -698,20 +687,21 @@ var
NewLanguage : TVpLocalizeLanguageItem; NewLanguage : TVpLocalizeLanguageItem;
begin begin
Unused(oOwner);
if sValue = 'Countries' then begin if sValue = 'Countries' then begin
FLoadingIndex := -1; FLoadingIndex := -1;
FElementIndex := -1; FElementIndex := -1;
end else
end else if sValue = 'Country' then begin if sValue = 'Country' then begin
NewItem := TVpLocalizeCountryItem (FCountries.Add); NewItem := TVpLocalizeCountryItem (FCountries.Add);
FLoadingIndex := NewItem.Index; FLoadingIndex := NewItem.Index;
for i := 0 to FAttributes.Count - 1 do begin for i := 0 to FAttributes.Count - 1 do begin
if (FAttributes.Items[i].Name = 'Name') and if (FAttributes.Items[i].Name = 'Name') and (Fattributes.Items[i].Value <> '') then
(Fattributes.Items[i].Value <> '') then
NewItem.Name := FAttributes.Items[i].Value; NewItem.Name := FAttributes.Items[i].Value;
end end
end else
end else if sValue = 'State' then begin if sValue = 'State' then begin
if FLoadingIndex < 0 then if FLoadingIndex < 0 then
Exit; Exit;
for i := 0 to FAttributes.Count - 1 do begin for i := 0 to FAttributes.Count - 1 do begin
@ -725,10 +715,10 @@ begin
GetBooleanValue (FAttributes.Items[i].Value, False) GetBooleanValue (FAttributes.Items[i].Value, False)
else if FAttributes.Items[i].Name = 'Visible' then else if FAttributes.Items[i].Name = 'Visible' then
FCountries.Items[FLoadingIndex].StatesVisible := FCountries.Items[FLoadingIndex].StatesVisible :=
GetBooleanValue (FAttributes.Items[i].Value, True); GetBooleanValue(FAttributes.Items[i].Value, True);
end; end;
end else
end else if sValue = 'Address1' then begin if sValue = 'Address1' then begin
if FLoadingIndex < 0 then if FLoadingIndex < 0 then
Exit; Exit;
for i := 0 to FAttributes.Count - 1 do begin for i := 0 to FAttributes.Count - 1 do begin
@ -736,10 +726,10 @@ begin
FCountries.Items[FLoadingIndex].Address1Caption := FAttributes.Items[i].Value FCountries.Items[FLoadingIndex].Address1Caption := FAttributes.Items[i].Value
else if FAttributes.Items[i].Name = 'Visible' then else if FAttributes.Items[i].Name = 'Visible' then
FCountries.Items[FLoadingIndex].Address1Visible := FCountries.Items[FLoadingIndex].Address1Visible :=
GetBooleanValue (FAttributes.Items[i].Value, True); GetBooleanValue(FAttributes.Items[i].Value, True);
end; end;
end else
end else if sValue = 'Address2' then begin if sValue = 'Address2' then begin
if FLoadingIndex < 0 then if FLoadingIndex < 0 then
Exit; Exit;
for i := 0 to FAttributes.Count - 1 do begin for i := 0 to FAttributes.Count - 1 do begin
@ -747,10 +737,10 @@ begin
FCountries.Items[FLoadingIndex].Address2Caption := FAttributes.Items[i].Value FCountries.Items[FLoadingIndex].Address2Caption := FAttributes.Items[i].Value
else if FAttributes.Items[i].Name = 'Visible' then else if FAttributes.Items[i].Name = 'Visible' then
FCountries.Items[FLoadingIndex].Address2Visible := FCountries.Items[FLoadingIndex].Address2Visible :=
GetBooleanValue (FAttributes.Items[i].Value, True); GetBooleanValue(FAttributes.Items[i].Value, True);
end; end;
end else
end else if sValue = 'Address3' then begin if sValue = 'Address3' then begin
if FLoadingIndex < 0 then if FLoadingIndex < 0 then
Exit; Exit;
for i := 0 to FAttributes.Count - 1 do begin for i := 0 to FAttributes.Count - 1 do begin
@ -758,10 +748,10 @@ begin
FCountries.Items[FLoadingIndex].Address3Caption := FAttributes.Items[i].Value FCountries.Items[FLoadingIndex].Address3Caption := FAttributes.Items[i].Value
else if FAttributes.Items[i].Name = 'Visible' then else if FAttributes.Items[i].Name = 'Visible' then
FCountries.Items[FLoadingIndex].Address3Visible := FCountries.Items[FLoadingIndex].Address3Visible :=
GetBooleanValue (FAttributes.Items[i].Value, True); GetBooleanValue(FAttributes.Items[i].Value, True);
end; end;
end else
end else if sValue = 'Address4' then begin if sValue = 'Address4' then begin
if FLoadingIndex < 0 then if FLoadingIndex < 0 then
Exit; Exit;
for i := 0 to FAttributes.Count - 1 do begin for i := 0 to FAttributes.Count - 1 do begin
@ -769,10 +759,10 @@ begin
FCountries.Items[FLoadingIndex].Address4Caption := FAttributes.Items[i].Value FCountries.Items[FLoadingIndex].Address4Caption := FAttributes.Items[i].Value
else if FAttributes.Items[i].Name = 'Visible' then else if FAttributes.Items[i].Name = 'Visible' then
FCountries.Items[FLoadingIndex].Address4Visible := FCountries.Items[FLoadingIndex].Address4Visible :=
GetBooleanValue (FAttributes.Items[i].Value, False); GetBooleanValue(FAttributes.Items[i].Value, False);
end; end;
end else
end else if sValue = 'City' then begin if sValue = 'City' then begin
if FLoadingIndex < 0 then if FLoadingIndex < 0 then
Exit; Exit;
for i := 0 to FAttributes.Count - 1 do begin for i := 0 to FAttributes.Count - 1 do begin
@ -780,10 +770,10 @@ begin
FCountries.Items[FLoadingIndex].CityCaption := FAttributes.Items[i].Value FCountries.Items[FLoadingIndex].CityCaption := FAttributes.Items[i].Value
else if FAttributes.Items[i].Name = 'Visible' then else if FAttributes.Items[i].Name = 'Visible' then
FCountries.Items[FLoadingIndex].CityVisible := FCountries.Items[FLoadingIndex].CityVisible :=
GetBooleanValue (FAttributes.Items[i].Value, True); GetBooleanValue(FAttributes.Items[i].Value, True);
end; end;
end else
end else if sValue = 'Zipcode' then begin if sValue = 'Zipcode' then begin
if FLoadingIndex < 0 then if FLoadingIndex < 0 then
Exit; Exit;
for i := 0 to FAttributes.Count - 1 do begin for i := 0 to FAttributes.Count - 1 do begin
@ -791,10 +781,10 @@ begin
FCountries.Items[FLoadingIndex].ZipCaption := FAttributes.Items[i].Value FCountries.Items[FLoadingIndex].ZipCaption := FAttributes.Items[i].Value
else if FAttributes.Items[i].Name = 'Visible' then else if FAttributes.Items[i].Name = 'Visible' then
FCountries.Items[FLoadingIndex].ZipVisible := FCountries.Items[FLoadingIndex].ZipVisible :=
GetBooleanValue (FAttributes.Items[i].Value, True); GetBooleanValue(FAttributes.Items[i].Value, True);
end; end;
end else
end else if sValue = 'LegalValue' then begin if sValue = 'LegalValue' then begin
if FLoadingIndex < 0 then if FLoadingIndex < 0 then
Exit; Exit;
NewElement := TVpLocalizeStatesItem (FCountries.Items[FLoadingIndex].States.Add); NewElement := TVpLocalizeStatesItem (FCountries.Items[FLoadingIndex].States.Add);
@ -805,7 +795,8 @@ begin
else if FAttributes.Items[i].Name = 'Value' then else if FAttributes.Items[i].Name = 'Value' then
NewElement.Abbr := FAttributes.Items[i].Value; NewElement.Abbr := FAttributes.Items[i].Value;
end; end;
end else if sValue = 'Language' then begin end else
if sValue = 'Language' then begin
if FLoadingIndex < 0 then if FLoadingIndex < 0 then
Exit; Exit;
NewLanguage := TVpLocalizeLanguageItem (FCountries.Items[FLoadingIndex].Languages.Add); NewLanguage := TVpLocalizeLanguageItem (FCountries.Items[FLoadingIndex].Languages.Add);
@ -819,7 +810,6 @@ begin
end; end;
end; end;
FAttributes.Clear; FAttributes.Clear;
end; end;

View File

@ -63,7 +63,7 @@ function DaysInMonth(Year, Month : Integer) : Integer;
{-return the number of days in the specified month of a given year} {-return the number of days in the specified month of a given year}
function DefaultEpoch : Integer; function DefaultEpoch : Integer;
{-return the current century} {-return the current century}
function GetLeftButton : Byte; //function GetLeftButton : Byte;
procedure GetRGB(Clr : TColor; var IR, IG, IB : Byte); procedure GetRGB(Clr : TColor; var IR, IG, IB : Byte);
function IsLeapYear(Year : Integer) : Boolean; function IsLeapYear(Year : Integer) : Boolean;
function GetStartOfWeek(Date: TDateTime; StartOn: TVpDayType): TDateTime; function GetStartOfWeek(Date: TDateTime; StartOn: TVpDayType): TDateTime;
@ -348,13 +348,13 @@ begin
Result := (ThisYear div 100) * 100; Result := (ThisYear div 100) * 100;
end; end;
{=====} {=====}
(*
function GetLeftButton : Byte; function GetLeftButton : Byte;
const const
RLButton : array[Boolean] of Word = (VK_LBUTTON, VK_RBUTTON); RLButton : array[Boolean] of Word = (VK_LBUTTON, VK_RBUTTON);
begin begin
//TODO: Result := RLButton[GetSystemMetrics(SM_SWAPBUTTON) <> 0]; //TODO: Result := RLButton[GetSystemMetrics(SM_SWAPBUTTON) <> 0];
end; end; *)
{=====} {=====}
procedure GetRGB(Clr : TColor; var IR, IG, IB : Byte); procedure GetRGB(Clr : TColor; var IR, IG, IB : Byte);
@ -591,7 +591,12 @@ end;
function GetRealFontHeight(AFont: TFont): Integer; function GetRealFontHeight(AFont: TFont): Integer;
begin begin
if AFont.Size = 0 then if AFont.Size = 0 then
Result := GetFontData(AFont.Handle).Height else {$IFDEF LCL}
Result := GetFontData(AFont.Reference.Handle).Height
{$ELSE}
Result := GetFontData(AFont.Handle).Height
{$ENDIF}
else
Result := AFont.Height; Result := AFont.Height;
end; end;

View File

@ -770,8 +770,6 @@ procedure TVpMonthView.WMRButtonDown(var Msg : TWMRButtonDown);
{$ELSE} {$ELSE}
procedure TVpMonthView.WMRButtonDown(var Msg : TLMRButtonDown); procedure TVpMonthView.WMRButtonDown(var Msg : TLMRButtonDown);
{$ENDIF} {$ENDIF}
var
ClientOrigin : TPoint;
begin begin
inherited; inherited;
@ -780,7 +778,6 @@ begin
SetFocus; SetFocus;
if FRightClickChangeDate then if FRightClickChangeDate then
mvSetDateByCoord (Point (Msg.XPos, Msg.YPos)); mvSetDateByCoord (Point (Msg.XPos, Msg.YPos));
ClientOrigin := GetClientOrigin;
end; end;
end; end;
{=====} {=====}

View File

@ -35,7 +35,7 @@ interface
uses uses
{$IFDEF LCL} {$IFDEF LCL}
LMessages, LCLProc, LCLType, LCLIntf, LCLProc, LCLType, LCLIntf,
{$ELSE} {$ELSE}
Windows, Messages, Windows, Messages,
{$ENDIF} {$ENDIF}
@ -144,6 +144,9 @@ implementation
{$R *.DFM} {$R *.DFM}
{$ENDIF} {$ENDIF}
uses
VpMisc;
{$IFDEF VERSION6} {$IFDEF VERSION6}
procedure EditNavBar(Designer : TIDesigner; Bar : TVpNavBar); procedure EditNavBar(Designer : TIDesigner; Bar : TVpNavBar);
{$ELSE} {$ELSE}
@ -199,6 +202,7 @@ end;
procedure TfrmNavBarEd.FormClose(Sender: TObject; procedure TfrmNavBarEd.FormClose(Sender: TObject;
var Action: TCloseAction); var Action: TCloseAction);
begin begin
Unused(Action);
RefreshTimer.Free; RefreshTimer.Free;
Release; Release;
end; end;
@ -335,6 +339,7 @@ end;
procedure TfrmNavBarEd.lbItemsMeasureItem(Control: TWinControl; procedure TfrmNavBarEd.lbItemsMeasureItem(Control: TWinControl;
Index: Integer; var Height: Integer); Index: Integer; var Height: Integer);
begin begin
Unused(Control, Index);
if (Bar.Images <> nil) then if (Bar.Images <> nil) then
Height := Bar.Images.Height + 4; Height := Bar.Images.Height + 4;
end; end;
@ -343,6 +348,7 @@ end;
procedure TfrmNavBarEd.lbItemsDrawItem(Control: TWinControl; procedure TfrmNavBarEd.lbItemsDrawItem(Control: TWinControl;
Index: Integer; Rect: TRect; State: TOwnerDrawState); Index: Integer; Rect: TRect; State: TOwnerDrawState);
begin begin
Unused(State);
with TListBox(Control).Canvas do with TListBox(Control).Canvas do
FillRect(Rect); FillRect(Rect);
if (Bar.Images <> nil) if (Bar.Images <> nil)
@ -364,6 +370,7 @@ end;
procedure TfrmNavBarEd.lbImagesDrawItem(Control: TWinControl; procedure TfrmNavBarEd.lbImagesDrawItem(Control: TWinControl;
Index: Integer; Rect: TRect; State: TOwnerDrawState); Index: Integer; Rect: TRect; State: TOwnerDrawState);
begin begin
Unused(State);
with TListBox(Control).Canvas do with TListBox(Control).Canvas do
FillRect(Rect); FillRect(Rect);
if (Bar.Images <> nil) then if (Bar.Images <> nil) then

View File

@ -263,7 +263,7 @@ type
procedure nabFontChanged(Sender: TObject); procedure nabFontChanged(Sender: TObject);
procedure nabGetEditorCaption(var Caption: string); procedure nabGetEditorCaption(var Caption: string);
function nabGetFolderArea(Index: Integer): TRect; function nabGetFolderArea(Index: Integer): TRect;
procedure nabGetHitTest(X, Y: Integer; var FolderIndex: Integer; var ItemIndex: Integer); procedure nabGetHitTest(X, Y: Integer; out FolderIndex, ItemIndex: Integer);
procedure nabImagesChanged(Sender: TObject); procedure nabImagesChanged(Sender: TObject);
procedure nabRecalcDisplayNames; procedure nabRecalcDisplayNames;
procedure nabScrollDownBtnClick(Sender: TObject); procedure nabScrollDownBtnClick(Sender: TObject);
@ -284,8 +284,8 @@ type
procedure WMNCHitTest(var Msg: TWMNCHitTest); message WM_NCHITTEST; procedure WMNCHitTest(var Msg: TWMNCHitTest); message WM_NCHITTEST;
procedure WMSetCursor(var Msg: TWMSetCursor); message WM_SETCURSOR; procedure WMSetCursor(var Msg: TWMSetCursor); message WM_SETCURSOR;
{$ELSE} {$ELSE}
procedure CMFontChanged(var Message: TLMessage); message CM_FONTCHANGED; procedure CMFontChanged(var Msg: TLMessage); message CM_FONTCHANGED;
procedure CMParentColorChanged(var Message: TLMessage); message CM_PARENTCOLORCHANGED; procedure CMParentColorChanged(var Msg: TLMessage); message CM_PARENTCOLORCHANGED;
{windows message response methods} {windows message response methods}
procedure WMEraseBkGnd(var Msg: TLMEraseBkGnd); message LM_ERASEBKGND; procedure WMEraseBkGnd(var Msg: TLMEraseBkGnd); message LM_ERASEBKGND;
procedure WMNCHitTest(var Msg: TLMNCHitTest); message LM_NCHITTEST; procedure WMNCHitTest(var Msg: TLMNCHitTest); message LM_NCHITTEST;
@ -673,6 +673,8 @@ var
I: Integer; I: Integer;
C: TControl; C: TControl;
begin begin
Unused(Root);
inherited GetChildren(Proc, Self); inherited GetChildren(Proc, Self);
for I := 0 to ControlCount - 1 do begin for I := 0 to ControlCount - 1 do begin
C := Controls[I]; C := Controls[I];
@ -956,8 +958,8 @@ end;
{===== TVpNavBar ================================================} {===== TVpNavBar ================================================}
constructor TVpCustomNavBar.Create(AOwner: TComponent); constructor TVpCustomNavBar.Create(AOwner: TComponent);
var {var
HSnd: THandle; HSnd: THandle; }
begin begin
inherited Create(AOwner); inherited Create(AOwner);
@ -1105,6 +1107,8 @@ end;
procedure TVpCustomNavBar.FolderChanged(FolderIndex: Integer); procedure TVpCustomNavBar.FolderChanged(FolderIndex: Integer);
begin begin
Unused(FolderIndex);
Invalidate; Invalidate;
if not (csDestroying in ComponentState) then if not (csDestroying in ComponentState) then
RecreateWnd{$IFDEF LCL}(self){$ENDIF}; RecreateWnd{$IFDEF LCL}(self){$ENDIF};
@ -1119,13 +1123,14 @@ end;
{$ENDIF} {$ENDIF}
{=====} {=====}
procedure TVpCustomNavBar.CMFontChanged(var Message: {$IFDEF LCL}TLMessage{$ELSE}TMessage{$ENDIF}); procedure TVpCustomNavBar.CMFontChanged(var Msg: {$IFDEF LCL}TLMessage{$ELSE}TMessage{$ENDIF});
begin begin
Unused(Msg);
nabRecalcDisplayNames; nabRecalcDisplayNames;
end; end;
{=====} {=====}
procedure TVpCustomNavBar.CMParentColorChanged(var Message: {$IFDEF LCL}TLMessage{$ELSE}TMessage{$ENDIF}); procedure TVpCustomNavBar.CMParentColorChanged(var Msg: {$IFDEF LCL}TLMessage{$ELSE}TMessage{$ENDIF});
begin begin
inherited; inherited;
if ParentColor then if ParentColor then
@ -1169,6 +1174,7 @@ procedure TVpCustomNavBar.GetChildren(Proc: TGetChildProc; Root: TComponent);
var var
I: Integer; I: Integer;
begin begin
Unused(Root);
for I := 0 to FContainers.Count - 1 do for I := 0 to FContainers.Count - 1 do
Proc(TComponent(FContainers[I])); Proc(TComponent(FContainers[I]));
end; end;
@ -1226,6 +1232,7 @@ end;
procedure TVpCustomNavBar.DoMouseOverItem(X, Y, ItemIndex: Integer); procedure TVpCustomNavBar.DoMouseOverItem(X, Y, ItemIndex: Integer);
begin begin
Unused(ItemIndex);
if Assigned(FOnMouseOverItem) then if Assigned(FOnMouseOverItem) then
FOnMouseOverItem(Self, Folders[ActiveFolder].Items[GetItemAt(X, Y)]); FOnMouseOverItem(Self, Folders[ActiveFolder].Items[GetItemAt(X, Y)]);
end; end;
@ -1692,8 +1699,8 @@ begin
end; end;
{=====} {=====}
procedure TVpCustomNavBar.nabGetHitTest(X, Y: Integer; var FolderIndex: Integer; procedure TVpCustomNavBar.nabGetHitTest(X, Y: Integer;
var ItemIndex: Integer); out FolderIndex, ItemIndex: Integer);
var var
I: Integer; I: Integer;
Item: TVpNavBtnItem; Item: TVpNavBtnItem;
@ -1738,6 +1745,8 @@ function TVpCustomNavBar.nabGetFolderArea(Index: Integer): TRect;
var var
I : Integer; I : Integer;
begin begin
Unused(Index);
Result := ClientRect; Result := ClientRect;
for I := 0 to ActiveFolder do for I := 0 to ActiveFolder do
Inc(Result.Top, FButtonHeight); Inc(Result.Top, FButtonHeight);
@ -1810,9 +1819,11 @@ end;
procedure TVpCustomNavBar.nabTimerEvent(Sender: TObject; Handle: Integer; procedure TVpCustomNavBar.nabTimerEvent(Sender: TObject; Handle: Integer;
Interval: Cardinal; ElapsedTime: LongInt); Interval: Cardinal; ElapsedTime: LongInt);
var var
Pt: TPoint; Pt: TPoint = (x:0; y:0);
Form: TCustomForm; Form: TCustomForm;
begin begin
Unused(Handle, Interval, ElapsedTime);
GetCursorPos(Pt); GetCursorPos(Pt);
Pt := ScreenToClient(Pt); Pt := ScreenToClient(Pt);
if not PtInRect(ClientRect, Pt) then begin if not PtInRect(ClientRect, Pt) then begin
@ -2058,8 +2069,8 @@ var
Flags: Integer; Flags: Integer;
MyRect: TRect; MyRect: TRect;
TR: TRect; TR: TRect;
ContainerRect: TRect; // ContainerRect: TRect;
FolderType: TVpFolderType; // FolderType: TVpFolderType;
BkColor: TColor; BkColor: TColor;
Folder: TVpNavFolder; Folder: TVpNavFolder;
Item: TVpNavBtnItem; Item: TVpNavBtnItem;

View File

@ -90,19 +90,22 @@ interface
uses uses
{$IFDEF LCL} {$IFDEF LCL}
LMessages, LCLProc, LCLType, LCLIntf, LCLProc, LCLType, LCLIntf,
{$ELSE} {$ELSE}
Windows, Windows,
{$ENDIF} {$ENDIF}
Classes, Dialogs, SysUtils, Graphics, StdCtrls, Forms, Printers, Classes, Dialogs, SysUtils, Graphics, Forms, Printers,
VpBase, VpMisc, VpData, VpXParsr, VpCanvasUtils, VpSR, VpException; VpBase, VpData, VpXParsr, VpCanvasUtils, VpSR, VpException;
type type
TVpChangeVar = (cvRemove, cvIgnore, cvChange); TVpChangeVar = (cvRemove, cvIgnore, cvChange);
TVpDayUnits = (duDay, duWeek, duMonth, duYear); TVpDayUnits = (duDay, duWeek, duMonth, duYear);
TVpShapeType = (ustRectangle, ustTopLine, ustBottomLine,
ustLeftLine, ustRightLine, ustTLToBRLine, TVpShapeType = (
ustBLToTRLine, ustEllipse); ustRectangle, ustTopLine, ustBottomLine, ustLeftLine, ustRightLine,
ustTLToBRLine, ustBLToTRLine, ustEllipse
);
TVpWatcher = record TVpWatcher = record
Handle: THandle; Handle: THandle;
@ -447,8 +450,7 @@ uses
{$IFDEF LCL} {$IFDEF LCL}
DateUtils, DateUtils,
{$ENDIF} {$ENDIF}
VpConst, VpBaseDS, VpPrtFmtCBox, VpPrtPrv, VpDayView, VpWeekView, VpMonthView, VpConst, VpMisc, VpBaseDS, VpPrtFmtCBox;
VpCalendar, VpTaskList, VpContactGrid;
function XMLizeString(const s: string): string; function XMLizeString(const s: string): string;
var var
@ -557,6 +559,8 @@ var
OldPen: TPen; OldPen: TPen;
OldBrush: TBrush; OldBrush: TBrush;
begin begin
Unused(Angle, Viewport);
OldPen := TPen.Create; OldPen := TPen.Create;
try try
OldBrush := TBrush.Create; OldBrush := TBrush.Create;
@ -949,6 +953,8 @@ procedure TVpPrintFormatElement.NotifyAll(Item: TCollectionItem);
var var
Notifier: TPersistent; Notifier: TPersistent;
begin begin
Unused(Item);
if not Assigned (FOwner) then if not Assigned (FOwner) then
Exit; Exit;
@ -1172,6 +1178,8 @@ end;
procedure TVpPrintFormat.NotifyAll(Item: TCollectionItem); procedure TVpPrintFormat.NotifyAll(Item: TCollectionItem);
begin begin
Unused(Item);
if not Assigned(FOwner) then if not Assigned(FOwner) then
Exit; Exit;
@ -1736,7 +1744,6 @@ var
HeightInPixels: Integer; HeightInPixels: Integer;
PixelsPerInchX: Integer; PixelsPerInchX: Integer;
PixelsPerInchY: Integer; PixelsPerInchY: Integer;
Scale: Extended;
procedure GetMeasurements; procedure GetMeasurements;
begin begin
@ -1750,8 +1757,6 @@ var
PixelsPerInchX := GetDeviceCaps(APrinter.Canvas.Handle, LOGPIXELSX); PixelsPerInchX := GetDeviceCaps(APrinter.Canvas.Handle, LOGPIXELSX);
PixelsPerInchY := GetDeviceCaps(APrinter.Canvas.Handle, LOGPIXELSY); PixelsPerInchY := GetDeviceCaps(APrinter.Canvas.Handle, LOGPIXELSY);
Scale := PixelsPerInchY / Screen.PixelsPerInch;
end; end;
procedure CalculateMargins; procedure CalculateMargins;
@ -1919,7 +1924,6 @@ var
HeightInPixels: Integer; HeightInPixels: Integer;
PixelsPerInchX: Integer; PixelsPerInchX: Integer;
PixelsPerInchY: Integer; PixelsPerInchY: Integer;
Scale: Extended;
procedure GetMeasurements; procedure GetMeasurements;
begin begin
@ -1928,8 +1932,6 @@ var
PixelsPerInchX := GetDeviceCaps(ACanvas.Handle, LOGPIXELSX); PixelsPerInchX := GetDeviceCaps(ACanvas.Handle, LOGPIXELSX);
PixelsPerInchY := GetDeviceCaps(ACanvas.Handle, LOGPIXELSY); PixelsPerInchY := GetDeviceCaps(ACanvas.Handle, LOGPIXELSY);
Scale := PixelsPerInchY / Screen.PixelsPerInch;
end; end;
procedure CalculateMargins; procedure CalculateMargins;
@ -2462,6 +2464,8 @@ procedure TVpPrinter.xmlPrintFormatAttribute(oOwner: TObject;
var var
Item: TVpAttributeItem; Item: TVpAttributeItem;
begin begin
Unused(oOwner, bSpecified);
Item := TVpAttributeItem(FAttributes.Add); Item := TVpAttributeItem(FAttributes.Add);
Item.Name := sName; Item.Name := sName;
Item.Value := sValue; Item.Value := sValue;
@ -2471,6 +2475,7 @@ end;
procedure TVpPrinter.xmlPrintFormatEndElement(oOwner: TObject; procedure TVpPrinter.xmlPrintFormatEndElement(oOwner: TObject;
sValue: DOMString); sValue: DOMString);
begin begin
Unused(oOwner);
if (sValue = 'PrintFormat') or (sValue = 'VpPrintFormats') then begin if (sValue = 'PrintFormat') or (sValue = 'VpPrintFormats') then begin
FLoadingIndex := -1; FLoadingIndex := -1;
FElementIndex := -1; FElementIndex := -1;
@ -2487,8 +2492,8 @@ var
NewItem: TVpPrintFormatItem; NewItem: TVpPrintFormatItem;
NewElement: TVpPrintFormatElementItem; NewElement: TVpPrintFormatElementItem;
attr: TVpAttributeItem; attr: TVpAttributeItem;
elem: TVpPrintFormatItem;
begin begin
Unused(oOwner);
if sValue = 'VpPrintFormats' then begin if sValue = 'VpPrintFormats' then begin
FLoadingIndex := -1; FLoadingIndex := -1;
FElementIndex := -1; FElementIndex := -1;

View File

@ -56,12 +56,12 @@ type
function GetAbout : string; function GetAbout : string;
procedure Loaded; override; procedure Loaded; override;
procedure Notification (AComponent: TComponent; Operation: TOperation); override; procedure Notification (AComponent: TComponent; Operation: TOperation); override;
procedure SetAbout (const Value : string); procedure SetAbout(const Value: string);
procedure SetControlLink (const v : TVpControlLink); procedure SetControlLink(const v: TVpControlLink);
procedure VpPrintFormatChanged (var Msg: {$IFDEF DELPHI}TMessage{$ELSE}TLMessage{$ENDIF}); message Vp_PrintFormatChanged; procedure VpPrintFormatChanged(var Msg: {$IFDEF DELPHI}TMessage{$ELSE}TLMessage{$ENDIF}); message Vp_PrintFormatChanged;
public public
constructor Create (AOwner : TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
procedure UpdateItems; procedure UpdateItems;
@ -69,9 +69,8 @@ type
property Style; property Style;
published published
property Version : string read GetAbout write SetAbout stored False; property Version: string read GetAbout write SetAbout stored False;
property ControlLink : TVpControlLink property ControlLink: TVpControlLink read FControlLink write SetControlLink;
read FControlLink write SetControlLink;
property Cursor; property Cursor;
property DragCursor; property DragCursor;
@ -121,11 +120,14 @@ function SearchControlLink (const C : TComponent) : TVpControlLink;
implementation implementation
function SearchControlLink (const C : TComponent) : TVpControlLink; uses
VpMisc;
function FindControlLink (const C : TComponent) : TVpControlLink; function SearchControlLink(const C: TComponent): TVpControlLink;
function FindControlLink (const C: TComponent): TVpControlLink;
var var
I : Integer; I: Integer;
begin begin
Result := nil; Result := nil;
if not Assigned (C) then if not Assigned (C) then
@ -148,21 +150,21 @@ begin
Result := FindControlLink (C); Result := FindControlLink (C);
end; end;
constructor TVpPrintFormatComboBox.Create (AOwner : TComponent); constructor TVpPrintFormatComboBox.Create(AOwner: TComponent);
begin begin
inherited Create (AOwner); inherited Create(AOwner);
Style := csDropDownList; Style := csDropDownList;
Sorted := True; Sorted := True;
FControlLink := SearchControlLink (Owner); FControlLink := SearchControlLink(Owner);
UpdateItems; UpdateItems;
end; end;
destructor TVpPrintFormatComboBox.Destroy; destructor TVpPrintFormatComboBox.Destroy;
begin begin
if (HandleAllocated) and (Assigned (FControlLink)) then if HandleAllocated and Assigned(FControlLink) then
FControlLink.Printer.DeregisterWatcher (Handle); FControlLink.Printer.DeregisterWatcher(Handle);
inherited Destroy; inherited Destroy;
end; end;
@ -219,6 +221,7 @@ end;
procedure TVpPrintFormatComboBox.SetAbout(const Value: string); procedure TVpPrintFormatComboBox.SetAbout(const Value: string);
begin begin
//Empty on purpose //Empty on purpose
Unused(Value);
end; end;
procedure TVpPrintFormatComboBox.SetControlLink (const v : TVpControlLink); procedure TVpPrintFormatComboBox.SetControlLink (const v : TVpControlLink);
@ -235,14 +238,14 @@ end;
procedure TVpPrintFormatComboBox.VpPrintFormatChanged(var Msg: {$IFDEF DELPHI}TMessage{$ELSE}TLMessage{$ENDIF}); procedure TVpPrintFormatComboBox.VpPrintFormatChanged(var Msg: {$IFDEF DELPHI}TMessage{$ELSE}TLMessage{$ENDIF});
begin begin
Unused(Msg);
UpdateItems; UpdateItems;
end; end;
procedure TVpPrintFormatComboBox.UpdateItems; procedure TVpPrintFormatComboBox.UpdateItems;
var var
i : Integer; i: Integer;
Ctr : Integer; Ctr: Integer;
begin begin
if not Assigned (FControlLink) then if not Assigned (FControlLink) then
Exit; Exit;

View File

@ -34,15 +34,13 @@ interface
uses uses
{$IFDEF LCL} {$IFDEF LCL}
LMessages,LCLProc,LCLType,LCLIntf, LCLProc, LCLType, LCLIntf,
{$ELSE} {$ELSE}
Windows, Windows, Messages,
{$ENDIF} {$ENDIF}
Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, TypInfo, ExtCtrls, TypInfo, ExtCtrls,
VpBase, VpBaseDS, VpDlg, VpPrtFmtCBox, VpEdFmtLst;
VpPrtFmt, VpBase, VpBaseDS, VpDlg, VpDBDS,{ VpBDEDS,} VpPrtPrv, VpPrtFmtCBox,
VpEdFmtLst;
type type

View File

@ -52,8 +52,8 @@ uses
{$ELSE} {$ELSE}
DsgnIntf, DsgnIntf,
{$ENDIF} {$ENDIF}
StdCtrls, ExtCtrls, Buttons, ExtCtrls, Buttons,
VpSR, VpBase, VpBaseDS, VpEdFmtLst; VpSR, VpBaseDS, VpEdFmtLst;
type type
TVpPrtFmtPropertyEditor = class(TComponentEditor) TVpPrtFmtPropertyEditor = class(TComponentEditor)

View File

@ -34,14 +34,14 @@ interface
uses uses
{$IFDEF LCL} {$IFDEF LCL}
LMessages, LCLProc, LCLType, LCLIntf, LResources, LCLProc, LCLType, LCLIntf, LResources,
{$ELSE} {$ELSE}
Windows, Messages, Windows, Messages,
{$ENDIF} {$ENDIF}
SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls,
Buttons, Printers, ImgList, ComCtrls, ToolWin, ActnList, Buttons, Printers, ComCtrls, ActnList,
{$IFDEF VERSION6} Variants, {$ENDIF} {$IFDEF VERSION6} Variants, {$ENDIF}
VpMisc, VpBase, VpException, VpData, VpPrtPrv, VpSR, VpBaseDS, VpDlg, VpMisc, VpBase, VpData, VpPrtPrv, VpSR, VpBaseDS, VpDlg,
VpPrtFmtCBox; VpPrtFmtCBox;
type type
@ -379,6 +379,8 @@ end;
procedure TfrmPrintPreview.actMainUpdate(Action: TBasicAction; procedure TfrmPrintPreview.actMainUpdate(Action: TBasicAction;
var Handled: Boolean); var Handled: Boolean);
begin begin
Unused(Action, Handled);
if VpPrintPreview1.IsFirstPage then begin if VpPrintPreview1.IsFirstPage then begin
actFirstPage.Enabled := False; actFirstPage.Enabled := False;
actPrevPage.Enabled := False; actPrevPage.Enabled := False;
@ -405,6 +407,8 @@ end;
procedure TfrmPrintPreview.FormKeyDown(Sender: TObject; var Key: Word; procedure TfrmPrintPreview.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState); Shift: TShiftState);
begin begin
Unused(Shift);
if Key = VK_ESCAPE then if Key = VK_ESCAPE then
actCancel.Execute; actCancel.Execute;
end; end;

View File

@ -34,7 +34,7 @@ interface
uses uses
{$IFDEF LCL} {$IFDEF LCL}
LMessages, LCLProc, LCLType, LCLIntf, LResources, LCLProc, LCLType, LCLIntf, LResources,
{$ELSE} {$ELSE}
Windows, Messages, Windows, Messages,
{$ENDIF} {$ENDIF}

View File

@ -32,12 +32,12 @@ interface
uses uses
{$IFDEF LCL} {$IFDEF LCL}
LMessages, LCLProc, LCLType, LCLIntf, LResources, LCLProc, LCLType, LCLIntf, LResources,
{$ELSE} {$ELSE}
Windows, Messages, Windows, Messages,
{$ENDIF} {$ENDIF}
SysUtils, Classes, Graphics, Controls, Forms, Dialogs, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, VpBaseDS, VpBase, VpDlg, VpResEditDlg, ExtCtrls; StdCtrls, VpBaseDS, VpResEditDlg, ExtCtrls;
type type
TfrmSelectResource = class(TForm) TfrmSelectResource = class(TForm)

View File

@ -35,14 +35,14 @@ interface
uses uses
{$IFDEF LCL} {$IFDEF LCL}
LMessages, LCLProc, LCLType, LCLIntf, LResources, LCLProc, LCLType, LCLIntf, LResources,
{$ELSE} {$ELSE}
Windows, Messages, Windows, Messages, VpEdPop, VpDateEdit,
{$ENDIF} {$ENDIF}
SysUtils, SysUtils,
{$IFDEF VERSION6} Variants, {$ENDIF} {$IFDEF VERSION6} Variants, {$ENDIF}
Classes, Graphics, Controls, Forms, Dialogs, VpData, StdCtrls, ExtCtrls, Classes, Graphics, Controls, Forms, Dialogs, VpData, StdCtrls, ExtCtrls,
VpEdPop, VpDateEdit, VpBase, VpSR, VpDlg, ComCtrls, EditBtn; VpBase, VpSR, VpDlg, ComCtrls, EditBtn;
type type
{ forward declarations } { forward declarations }

View File

@ -38,7 +38,7 @@ uses
{$ELSE} {$ELSE}
Windows, Messages, Windows, Messages,
{$ENDIF} {$ENDIF}
Classes, Graphics, Controls, ComCtrls, ExtCtrls, StdCtrls, Classes, Graphics, Controls, ExtCtrls, StdCtrls,
VpBase, VpBaseDS, VpMisc, VpData, VpSR, VpConst, VpCanvasUtils, Menus; VpBase, VpBaseDS, VpMisc, VpData, VpSR, VpConst, VpCanvasUtils, Menus;
type type
@ -228,19 +228,12 @@ type
procedure LinkHandler(Sender: TComponent; procedure LinkHandler(Sender: TComponent;
NotificationType: TVpNotificationType; NotificationType: TVpNotificationType;
const Value: Variant); override; const Value: Variant); override;
function GetControlType : TVpItemType; override; function GetControlType: TVpItemType; override;
procedure PaintToCanvas (ACanvas : TCanvas; procedure PaintToCanvas(ACanvas: TCanvas; ARect: TRect;
ARect : TRect; Angle: TVpRotationAngle);
Angle : TVpRotationAngle); procedure RenderToCanvas(RenderCanvas: TCanvas; RenderIn: TRect;
procedure RenderToCanvas (RenderCanvas : TCanvas; Angle: TVpRotationAngle; Scale: Extended; RenderDate: TDateTime;
RenderIn : TRect; StartLine, StopLine: Integer; UseGran: TVpGranularity; DisplayOnly: Boolean); override;
Angle : TVpRotationAngle;
Scale : Extended;
RenderDate : TDateTime;
StartLine : Integer;
StopLine : Integer;
UseGran : TVpGranularity;
DisplayOnly : Boolean); override;
property ActiveTask: TVpTask read FActiveTask; property ActiveTask: TVpTask read FActiveTask;
property TaskIndex: Integer read GetTaskIndex write SetTaskIndex; property TaskIndex: Integer read GetTaskIndex write SetTaskIndex;
published published
@ -282,7 +275,7 @@ type
implementation implementation
uses uses
SysUtils, Math, Forms, Dialogs, VpTaskEditDlg, VpDlg, VpTasklistPainter; SysUtils, Forms, Dialogs, VpTaskEditDlg, VpDlg, VpTasklistPainter;
(*****************************************************************************) (*****************************************************************************)
@ -570,13 +563,10 @@ end;
procedure TVpTaskList.DeleteActiveTask(Verify: Boolean); procedure TVpTaskList.DeleteActiveTask(Verify: Boolean);
var var
Str: string;
DoIt: Boolean; DoIt: Boolean;
begin begin
DoIt := not Verify; DoIt := not Verify;
if FActiveTask <> nil then begin if FActiveTask <> nil then begin
Str := FActiveTask.Description;
if Verify then if Verify then
DoIt := (MessageDlg(RSConfirmDeleteTask + #13#10#10 + RSPermanent, DoIt := (MessageDlg(RSConfirmDeleteTask + #13#10#10 + RSPermanent,
mtConfirmation, [mbYes, mbNo], 0) = mrYes); mtConfirmation, [mbYes, mbNo], 0) = mrYes);
@ -603,9 +593,10 @@ end;
procedure TVpTaskList.LinkHandler(Sender: TComponent; procedure TVpTaskList.LinkHandler(Sender: TComponent;
NotificationType: TVpNotificationType; const Value: Variant); NotificationType: TVpNotificationType; const Value: Variant);
begin begin
Unused(Value);
case NotificationType of case NotificationType of
neDataStoreChange: Invalidate; neDataStoreChange : Invalidate;
neInvalidate: Invalidate; neInvalidate : Invalidate;
end; end;
end; end;
{=====} {=====}

View File

@ -36,12 +36,12 @@ interface
uses uses
{$IFDEF LCL} {$IFDEF LCL}
LMessages, LCLProc, LCLType, LCLIntf, LResources, LCLProc, LCLType, LCLIntf, LResources,
{$ELSE} {$ELSE}
Windows, Messages, Windows, Messages,
{$ENDIF} {$ENDIF}
SysUtils, Classes, Graphics, Controls, Forms, Dialogs, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
FileCtrl, StdCtrls, ExtCtrls, Buttons, VpBase, ComCtrls, ShellCtrls; StdCtrls, ExtCtrls, Buttons, VpBase, ComCtrls, ShellCtrls;
type type

View File

@ -46,7 +46,7 @@ uses
{$ELSE} {$ELSE}
DsgnIntf, DsgnIntf,
{$ENDIF} {$ENDIF}
VpBase, VpWavDlg, Forms; VpWavDlg, Forms;
type type
{TWavFileProperty} {TWavFileProperty}

View File

@ -110,11 +110,11 @@ implementation
uses uses
{$IFDEF LCL} {$IFDEF LCL}
LMessages,LCLProc,LCLType, LCLProc, LCLType,
{$ELSE} {$ELSE}
Windows, Windows,
{$ENDIF} {$ENDIF}
SysUtils; SysUtils, VpMisc;
{== Utility methods ==================================================} {== Utility methods ==================================================}
@ -675,6 +675,7 @@ end;
{==TVpMemoryStream===================================================} {==TVpMemoryStream===================================================}
procedure TVpMemoryStream.SetPointer(Ptr : Pointer; Size : Integer); procedure TVpMemoryStream.SetPointer(Ptr : Pointer; Size : Integer);
begin begin
Unused(Ptr, Size);
Assert(not Assigned(Memory)); Assert(not Assigned(Memory));
// inherited SetPointer(Ptr); // inherited SetPointer(Ptr);
end; end;

View File

@ -92,35 +92,29 @@ type
protected protected
procedure csAdvanceLine; procedure csAdvanceLine;
procedure csAdvanceLinePos; procedure csAdvanceLinePos;
procedure csGetCharPrim(var aCh : TVpUcs4Char; procedure csGetCharPrim(var aCh: TVpUcs4Char; var aIsLiteral: Boolean);
var aIsLiteral : Boolean); function csGetNextBuffer: Boolean;
function csGetNextBuffer : Boolean; function csGetTwoAnsiChars(var Buffer): Boolean;
function csGetTwoAnsiChars(var Buffer) : Boolean; function csGetUtf8Char: TVpUcs4Char;
function csGetUtf8Char : TVpUcs4Char;
procedure csIdentifyFormat; procedure csIdentifyFormat;
procedure csPushCharPrim(aCh : TVpUcs4Char); procedure csPushCharPrim(aCh: TVpUcs4Char);
procedure csSetFormat(const aValue : TVpStreamFormat); override; procedure csSetFormat(const aValue: TVpStreamFormat); override;
procedure csGetChar(var aCh: TVpUcs4Char; var aIsLiteral: Boolean);
procedure csGetChar(var aCh : TVpUcs4Char;
var aIsLiteral : Boolean);
public public
constructor Create(aStream : TStream; const aBufSize : Longint); override; constructor Create(aStream: TStream; const aBufSize: Longint); override;
property Format: TVpStreamFormat read FFormat write csSetFormat;
property EOF: Boolean read FEOF;
property Format : TVpStreamFormat
read FFormat
write csSetFormat;
property EOF : Boolean
read FEOF;
public public
procedure SkipChar; procedure SkipChar;
function TryRead(const S : array of Longint) : Boolean; function TryRead(const S: array of Longint) : Boolean;
function ReadChar : DOMChar; function ReadChar: DOMChar;
function ReadAndSkipChar : DOMChar; function ReadAndSkipChar: DOMChar;
property Line : LongInt
read FLine; property Line : LongInt read FLine;
property LinePos : LongInt property LinePos : LongInt read FLinePos;
read FLinePos;
end; end;
TVpOutCharFilter = class(TVpBaseCharFilter) TVpOutCharFilter = class(TVpBaseCharFilter)
@ -275,10 +269,7 @@ begin
{check to see that the character is valid according to XML} {check to see that the character is valid according to XML}
if (aCh <> TVpUCS4Char(VpEndOfStream)) and (not VpIsChar(aCh)) then if (aCh <> TVpUCS4Char(VpEndOfStream)) and (not VpIsChar(aCh)) then
raise EVpFilterError.CreateError (FStream.Position, raise EVpFilterError.CreateError(FStream.Position, Line, LinePos, sInvalidXMLChar);
Line,
LinePos,
sInvalidXMLChar);
end; end;
{--------} {--------}
function TVpInCharFilter.csGetNextBuffer : Boolean; function TVpInCharFilter.csGetNextBuffer : Boolean;
@ -546,7 +537,7 @@ var
i : integer; i : integer;
begin begin
if not VpUcs4ToUtf8(aCh, UTF8) then if not VpUcs4ToUtf8(aCh, UTF8) then
raise EVpStreamError.CreateError (FStream.Position, sUCS_U8ConverErr); raise EVpStreamError.CreateError(FStream.Position, sUCS_U8ConverErr);
for i := 1 to length(UTF8) do begin for i := 1 to length(UTF8) do begin
if (FBufPos = FBufSize) then if (FBufPos = FBufSize) then
csWriteBuffer; csWriteBuffer;

View File

@ -34,19 +34,12 @@ interface
uses uses
{$IFDEF LCL} {$IFDEF LCL}
LMessages, LCLProc, LCLType, LCLProc, LCLType,
{$ELSE} {$ELSE}
Windows, Windows,
{$ENDIF} {$ENDIF}
Graphics, Graphics, Controls, SysUtils, Classes,
Controls, VpConst, VpSR, VpBase, VpXBase, VpXChrFlt;
SysUtils,
Classes,
VpConst,
VpSR,
VpBase,
VpXBase,
VpXChrFlt;
type type
StringIds = array[0..1] of DOMString; StringIds = array[0..1] of DOMString;
@ -342,6 +335,10 @@ implementation
{.$R *.RES} {.$R *.RES}
uses
VpMisc;
{== TVpEntityInfo ====================================================} {== TVpEntityInfo ====================================================}
type type
TVpEntityInfo = class(TObject) TVpEntityInfo = class(TObject)
@ -684,6 +681,8 @@ function TVpParser.DeclaredAttributes(const sName : DOMString;
aIdx : Integer) aIdx : Integer)
: TStringList; : TStringList;
begin begin
Unused(sName);
if aIdx < 0 then if aIdx < 0 then
Result := nil Result := nil
else else
@ -722,6 +721,8 @@ var
oAttr : TVpAttributeInfo; oAttr : TVpAttributeInfo;
HasEntRef : Boolean; HasEntRef : Boolean;
begin begin
Unused(sElemName);
SetLength(Result, 0); SetLength(Result, 0);
HasEntRef := False; HasEntRef := False;
if aIdx >= 0 then begin if aIdx >= 0 then begin
@ -749,6 +750,7 @@ function TVpParser.GetElementContentType(const sName : DOMString;
aIdx : Integer) aIdx : Integer)
: Integer; : Integer;
begin begin
Unused(sName);
if aIdx < 0 then if aIdx < 0 then
Result := CONTENT_UNDECLARED Result := CONTENT_UNDECLARED
else else
@ -1881,9 +1883,8 @@ begin
on E:EStringListError do begin on E:EStringListError do begin
EntRefs.Free; EntRefs.Free;
raise EVpParserError.CreateError (FFilter.Line, raise EVpParserError.CreateError (FFilter.Line,
FFilter.LinePos, FFilter.LinePos,
sCircularEntRef + sCircularEntRef + TempChar);
TempChar);
end; end;
on E:EVpParserError do on E:EVpParserError do
raise; raise;
@ -2252,10 +2253,7 @@ begin
for i := 1 to Length(aString) do begin for i := 1 to Length(aString) do begin
VpIso88591ToUcs4(AnsiChar(aString[i]), Ucs4Char); VpIso88591ToUcs4(AnsiChar(aString[i]), Ucs4Char);
if (not VpIsPubidChar(Ucs4Char)) then if (not VpIsPubidChar(Ucs4Char)) then
raise EVpParserError.CreateError (FFilter.Line, raise EVpParserError.CreateError(FFilter.Line, FFilter.LinePos, sInvPubIDChar + QuotedStr(aString[i]));
FFilter.LinePos,
sInvPubIDChar +
QuotedStr(aString[i]));
end; end;
end; end;
{--------} {--------}