From c0a075c8002c1571b9c9d41e0e698de241efdf0b Mon Sep 17 00:00:00 2001 From: ask Date: Tue, 5 Jun 2012 08:43:35 +0000 Subject: [PATCH] TAChart: Add IfThen overload for TObject git-svn-id: trunk@37527 - --- components/tachart/tachartutils.pas | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/tachart/tachartutils.pas b/components/tachart/tachartutils.pas index c03950d79b..5f598c6a5d 100644 --- a/components/tachart/tachartutils.pas +++ b/components/tachart/tachartutils.pas @@ -267,6 +267,7 @@ procedure Exchange(var A, B: String); overload; inline; function FormatIfNotEmpty(AFormat, AStr: String): String; inline; +function IfThen(ACond: Boolean; ATrue, AFalse: TObject): TObject; overload; function InterpolateRGB(AColor1, AColor2: Integer; ACoeff: Double): Integer; function IntToColorHex(AColor: Integer): String; inline; function IsNan(const APoint: TDoublePoint): Boolean; overload; inline; @@ -365,6 +366,14 @@ begin Result := Format(AFormat, [AStr]); end; +function IfThen(ACond: Boolean; ATrue, AFalse: TObject): TObject; +begin + if ACond then + Result := ATrue + else + Result := AFalse; +end; + function InterpolateRGB(AColor1, AColor2: Integer; ACoeff: Double): Integer; type TBytes = packed array [1..4] of Byte;