mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 06:56:10 +02:00
FPC: Extend System.UITypes
This commit is contained in:
parent
c45dfb7a56
commit
829f320095
@ -126,7 +126,7 @@ end;
|
||||
|
||||
function DelphiIntToFpcFontStyle(aStyle: Integer): TFontStyles;
|
||||
begin
|
||||
result := TFontStyles(aStyle);
|
||||
result := TFontStyles(Byte(aStyle));
|
||||
end;
|
||||
|
||||
function DelphiIntToFPCFrameBorders(aFrameTyp: Integer): TfrFrameBorders;
|
||||
|
@ -26,6 +26,9 @@ unit TAChartUtils;
|
||||
interface
|
||||
|
||||
uses
|
||||
{$IF FPC_FULLVERSION>30300}
|
||||
System.UITypes,
|
||||
{$ENDIF}
|
||||
Classes, Math, Types, SysUtils;
|
||||
|
||||
const
|
||||
@ -47,12 +50,24 @@ type
|
||||
EListenerError = class(EChartError);
|
||||
EDrawDataError = class(EChartError);
|
||||
|
||||
{$IF FPC_FULLVERSION>30300}
|
||||
TChartColor = TColor;
|
||||
TChartFontStyle = TFontStyle;
|
||||
TChartFontStyles = TFontStyles;
|
||||
const
|
||||
cfsBold = fsBold;
|
||||
cfsItalic = fsItalic;
|
||||
cfsUnderline = fsUnderline;
|
||||
cfsStrikeout = fsStrikeout;
|
||||
type
|
||||
{$ELSE}
|
||||
// Like TColor, but avoiding dependency on Graphics.
|
||||
TChartColor = -$7FFFFFFF-1..$7FFFFFFF;
|
||||
|
||||
// dto with TFontStyle
|
||||
TChartFontStyle = (cfsBold, cfsItalic, cfsUnderline, cfsStrikeout);
|
||||
TChartFontStyles = set of TChartFontStyle;
|
||||
{$ENDIF}
|
||||
|
||||
TChartTextFormat = (tfNormal, tfHTML);
|
||||
|
||||
|
@ -11754,7 +11754,11 @@ begin
|
||||
ReadBuffer(Dummy, SizeOf(Dummy));
|
||||
Pitch := TFontPitch(Dummy);
|
||||
ReadBuffer(Dummy, SizeOf(Dummy));
|
||||
{$IF FPC_FULLVERSION>30300}
|
||||
Style := TFontStyles(Byte(Dummy));
|
||||
{$ELSE}
|
||||
Style := TFontStyles(LongWord(Dummy));
|
||||
{$ENDIF}
|
||||
end;
|
||||
// LCL port started with header stream version 6 so no need to do the check here
|
||||
// Read data introduced by stream version 1+.
|
||||
@ -12027,7 +12031,11 @@ begin
|
||||
WriteBuffer(PAnsiChar(Tmp)^, Dummy);
|
||||
Dummy := Ord(Pitch);
|
||||
WriteBuffer(Dummy, SizeOf(Dummy));
|
||||
{$IF FPC_FULLVERSION>30300}
|
||||
Dummy := Byte(Style);
|
||||
{$ELSE}
|
||||
Dummy := Integer(Style);
|
||||
{$ENDIF}
|
||||
WriteBuffer(Dummy, SizeOf(Dummy));
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user