From a78e0acf2f48ea386e0ad38444a333958210d199 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Fri, 20 Apr 2018 11:17:15 +0000 Subject: [PATCH] jvcllaz: Fix compilation of thumbnail and simscope demos with Laz 1.6.4 git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6324 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../examples/JvTMTimeLine/SimpleTLTest1.lpi | 10 ++++------ .../examples/JvTMTimeLine/SimpleTLTest1.lpr | 4 +++- components/jvcllaz/run/JvCore/JvJCLUtils.pas | 15 +++++++++++++++ components/jvcllaz/run/JvCore/JvJVCLUtils.pas | 14 +++++++++++++- .../jvcllaz/run/JvCustomControls/JvThumbViews.pas | 2 +- components/jvcllaz/run/JvJans/JvSimScope.pas | 7 +++++++ 6 files changed, 43 insertions(+), 9 deletions(-) diff --git a/components/jvcllaz/examples/JvTMTimeLine/SimpleTLTest1.lpi b/components/jvcllaz/examples/JvTMTimeLine/SimpleTLTest1.lpi index ebb2241f5..e361fca81 100644 --- a/components/jvcllaz/examples/JvTMTimeLine/SimpleTLTest1.lpi +++ b/components/jvcllaz/examples/JvTMTimeLine/SimpleTLTest1.lpi @@ -1,13 +1,12 @@ - + - <Scaled Value="True"/> <ResourceType Value="res"/> <UseXPManifest Value="True"/> <XPManifest> @@ -21,10 +20,9 @@ <Version Value="2"/> </PublishOptions> <RunParams> - <FormatVersion Value="2"/> - <Modes Count="1"> - <Mode0 Name="default"/> - </Modes> + <local> + <FormatVersion Value="1"/> + </local> </RunParams> <RequiredPackages Count="3"> <Item1> diff --git a/components/jvcllaz/examples/JvTMTimeLine/SimpleTLTest1.lpr b/components/jvcllaz/examples/JvTMTimeLine/SimpleTLTest1.lpr index be912fd23..b42b03e67 100644 --- a/components/jvcllaz/examples/JvTMTimeLine/SimpleTLTest1.lpr +++ b/components/jvcllaz/examples/JvTMTimeLine/SimpleTLTest1.lpr @@ -3,14 +3,16 @@ {$mode objfpc}{$H+} uses - Forms, datetimectrls, Interfaces, + Forms, datetimectrls, Interfaces, LCLVersion, frmMemoEdit in 'frmMemoEdit.pas' {MemoEditFrm}, TMTimeLineMainFormU in 'TMTimeLineMainFormU.pas' {TMTimeLineMainForm}; {$R *.res} begin + {$IF LCL_FULLVERSION >= 1080000} Application.Scaled := True; + {$ENDIF} Application.Initialize; Application.CreateForm(TTMTimeLineMainForm, TMTimeLineMainForm); Application.Run; diff --git a/components/jvcllaz/run/JvCore/JvJCLUtils.pas b/components/jvcllaz/run/JvCore/JvJCLUtils.pas index d3d4a1f5e..e4b62cac2 100644 --- a/components/jvcllaz/run/JvCore/JvJCLUtils.pas +++ b/components/jvcllaz/run/JvCore/JvJCLUtils.pas @@ -69,6 +69,11 @@ const BOM_LSB_FIRST = WideChar($FEFF); BOM_MSB_FIRST = WideChar($FFFE); +{$IF FPC_FullVersion < 30000} +type + TSysCharSet = set of AnsiChar; +{$ENDIF} + (******************** NOT CONVERTED {$IFDEF UNIX} type @@ -199,7 +204,13 @@ function CurrencyToStr(const Cur: Currency): string; function HasChar(const Ch: Char; const S: string): Boolean; function HasCharW(const Ch: WideChar; const S: WideString): Boolean; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF SUPPORTS_INLINE} function HasAnyChar(const Chars: string; const S: string): Boolean; +********************) + +{$IF FPC_FullVersion < 30000} function CharInSet(const Ch: Char; const SetOfChar: TSysCharSet): Boolean; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF SUPPORTS_INLINE} +{$ENDIF} + +(********************* function CharInSetW(const Ch: WideChar; const SetOfChar: TSysCharSet): Boolean; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF SUPPORTS_INLINE} function CountOfChar(const Ch: Char; const S: string): Integer; function DefStr(const S: string; Default: string): string; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF SUPPORTS_INLINE} @@ -2738,12 +2749,16 @@ function FileNewExt(const FileName, NewExt: TFileName): TFileName; begin Result := Copy(FileName, 1, Length(FileName) - Length(ExtractFileExt(FileName))) + NewExt; end; +*****************************) +{$IF FPC_FULLVERSION < 30000} function CharInSet(const Ch: Char; const SetOfChar: TSysCharSet): Boolean; begin Result := Ch in SetOfChar; end; +{$ENDIF} +(***************************** function CharInSetW(const Ch: WideChar; const SetOfChar: TSysCharSet): Boolean; begin if Word(Ch) > 255 then diff --git a/components/jvcllaz/run/JvCore/JvJVCLUtils.pas b/components/jvcllaz/run/JvCore/JvJVCLUtils.pas index 4eb7bc9df..7846474e2 100644 --- a/components/jvcllaz/run/JvCore/JvJVCLUtils.pas +++ b/components/jvcllaz/run/JvCore/JvJVCLUtils.pas @@ -38,7 +38,7 @@ uses Windows, // before Types! {$ENDIF} Classes, Graphics, Controls, ImgList, - LCLType, LCLProc, LMessages, Types, + LCLType, LCLProc, LCLVersion, LMessages, Types, JvTypes; (******************** NOT CONVERTED @@ -852,6 +852,10 @@ function ReplaceComponentReference(This, NewReference: TComponent; var VarRefere function ReplaceImageListReference(This: TComponent; NewReference: TCustomImageList; var VarReference: TCustomImageList; ChangeLink: TChangeLink): Boolean; +{$IF LCL_FullVersion < 3000000} +function Scale96ToForm(ASize: Integer): Integer; +{$ENDIF} + implementation uses @@ -7842,6 +7846,14 @@ begin end; end; +{$IF LCL_FullVersion < 3000000} +function Scale96ToForm(ASize: Integer): Integer; +begin + Result := MulDiv(ASize, ScreenInfo.PixelsPerInchX, 96); +end; +{$ENDIF} + + (************ initialization diff --git a/components/jvcllaz/run/JvCustomControls/JvThumbViews.pas b/components/jvcllaz/run/JvCustomControls/JvThumbViews.pas index 250f424dc..f2a4f5a26 100644 --- a/components/jvcllaz/run/JvCustomControls/JvThumbViews.pas +++ b/components/jvcllaz/run/JvCustomControls/JvThumbViews.pas @@ -31,7 +31,7 @@ unit JvThumbViews; interface uses - LCLType, LMessages, Types, + LCLIntf, LCLType, LMessages, Types, Classes, Controls, Forms, ExtCtrls, SysUtils, Graphics, JvThumbnails, JvBaseThumbnail, JvExControls; diff --git a/components/jvcllaz/run/JvJans/JvSimScope.pas b/components/jvcllaz/run/JvJans/JvSimScope.pas index 4a0d0a502..d99737bd3 100644 --- a/components/jvcllaz/run/JvJans/JvSimScope.pas +++ b/components/jvcllaz/run/JvJans/JvSimScope.pas @@ -166,6 +166,7 @@ type procedure DrawTimerTimer(Sender: TObject); function GetLinePixelPosition(Line: TJvScopeLine; Position: Integer): Integer; procedure Loaded; override; + procedure Resize; override; public procedure Paint; override; constructor Create(AOwner: TComponent); override; @@ -497,6 +498,12 @@ begin FAllowed := True; end; +procedure TJvSimScope.Resize; +begin + inherited; + SetBounds(Left, Top, Width, Height); +end; + procedure TJvSimScope.Clear; var A: Double;