From 4ee0f9c9c5156829377cc038b8abeaf5cbb48747 Mon Sep 17 00:00:00 2001 From: zeljko Date: Fri, 12 Sep 2014 07:16:53 +0000 Subject: [PATCH] Qt: implemented TQtWidgetSet.RadialPie(). Patch by Giuliano Colla. issue #26703 git-svn-id: trunk@46199 - --- lcl/interfaces/qt/qtlclintf.inc | 19 +++++++++++++++++++ lcl/interfaces/qt/qtlclintfh.inc | 3 ++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/lcl/interfaces/qt/qtlclintf.inc b/lcl/interfaces/qt/qtlclintf.inc index 17a3258d9b..ac2ebd37c7 100644 --- a/lcl/interfaces/qt/qtlclintf.inc +++ b/lcl/interfaces/qt/qtlclintf.inc @@ -430,6 +430,25 @@ begin end; end; {TQtWidgetSet.PromptUser} +{------------------------------------------------------------------------------ + Function: RadialPie + Params: DC, PaintRect coordinates, StartAngle16, StopAngle16 + Returns: True if done, False if invalid + + ------------------------------------------------------------------------------} + +function TQtWidgetSet.RadialPie(DC: HDC; x1, y1, x2, y2, Angle1, Angle2: Integer): Boolean; +var + theWidth,theHeight: Integer; +begin + Result := IsValidDC(DC) and (x2 > x1) and (y2 > y1); + if Result then begin + theWidth := x2 - x1 + 1; + theHeight := y2 - y1 + 1; + QPainter_drawPie(TQtDeviceContext(DC).Widget, x1, y1, theWidth, theHeight, Angle1, Angle2); + end; +end; + {------------------------------------------------------------------------------ Function: RawImage_CreateBitmaps Params: ARawImage: diff --git a/lcl/interfaces/qt/qtlclintfh.inc b/lcl/interfaces/qt/qtlclintfh.inc index 296a2fc5af..4421df94d2 100644 --- a/lcl/interfaces/qt/qtlclintfh.inc +++ b/lcl/interfaces/qt/qtlclintfh.inc @@ -58,11 +58,12 @@ function PromptUser(const DialogCaption : string; DefaultIndex : LongInt; EscapeResult : LongInt) : LongInt; override; +function RadialPie(DC: HDC; x1, y1, x2, y2, Angle1, Angle2: Integer): Boolean; override; + function RawImage_CreateBitmaps(const ARawImage: TRawImage; out ABitmap, AMask: HBitmap; ASkipMask: Boolean = False): Boolean; override; function RawImage_DescriptionFromBitmap(ABitmap: HBITMAP; out ADesc: TRawImageDescription): Boolean; override; function RawImage_DescriptionFromDevice(ADC: HDC; out ADesc: TRawImageDescription): Boolean; override; - function RawImage_FromBitmap(out ARawImage: TRawImage; ABitmap, AMask: HBITMAP; ARect: PRect = nil): Boolean; override; function RawImage_FromDevice(out ARawImage: TRawImage; ADC: HDC; const ARect: TRect): Boolean; override; function RawImage_QueryDescription(AFlags: TRawImageQueryFlags; var ADesc: TRawImageDescription): Boolean; override;