From b8d1a1adec59f2f1b307ae5e986e297787c8ab6c Mon Sep 17 00:00:00 2001 From: paul Date: Mon, 25 May 2009 02:10:05 +0000 Subject: [PATCH] lcl: formatting git-svn-id: trunk@20179 - --- lcl/interfaces/gtk/gtkcallback.inc | 10 ++++----- lcl/interfaces/qt/qtwinapi.inc | 33 +++++++++++++++++++++++------- 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/lcl/interfaces/gtk/gtkcallback.inc b/lcl/interfaces/gtk/gtkcallback.inc index be74c2c728..98d467d1ec 100644 --- a/lcl/interfaces/gtk/gtkcallback.inc +++ b/lcl/interfaces/gtk/gtkcallback.inc @@ -1570,14 +1570,14 @@ begin DesignOnlySignal := GetDesignOnlySignalFlag(Widget, dstMousePress); if DesignOnlySignal then exit; - if not ControlGetsMouseDownBefore(TControl(Data),Widget) then exit; + if not ControlGetsMouseDownBefore(TControl(Data), Widget) then Exit; - CaptureWidget:=PGtkWidget(TWinControl(Data).Handle); + CaptureWidget := PGtkWidget(TWinControl(Data).Handle); if Event^.button = 1 then begin - EventXY:=Point(TruncToInt(Event^.X),TruncToInt(Event^.Y)); - MappedXY:=TranslateGdkPointToClientArea(Event^.Window,EventXY,CaptureWidget); - SetCaptureControl(TWinControl(Data),MappedXY); + EventXY := Point(TruncToInt(Event^.X), TruncToInt(Event^.Y)); + MappedXY := TranslateGdkPointToClientArea(Event^.Window, EventXY, CaptureWidget); + SetCaptureControl(TWinControl(Data), MappedXY); //CaptureMouseForWidget(CaptureWidget,mctGTKIntf); end else diff --git a/lcl/interfaces/qt/qtwinapi.inc b/lcl/interfaces/qt/qtwinapi.inc index 7efd3be75a..b943c76043 100644 --- a/lcl/interfaces/qt/qtwinapi.inc +++ b/lcl/interfaces/qt/qtwinapi.inc @@ -4669,9 +4669,8 @@ begin SB_HORZ: begin - if (csReading in TQtWidget(Handle).LCLObject.ComponentState) - or (csDestroying in TQtWidget(Handle).LCLObject.ComponentState) - then + if (csReading in TQtWidget(Handle).LCLObject.ComponentState) or + (csDestroying in TQtWidget(Handle).LCLObject.ComponentState) then exit; if TQtWidget(Handle) is TQtAbstractScrollArea then @@ -4688,9 +4687,8 @@ begin SB_VERT: begin - if (csReading in TQtWidget(Handle).LCLObject.ComponentState) - or (csDestroying in TQtWidget(Handle).LCLObject.ComponentState) - then + if (csReading in TQtWidget(Handle).LCLObject.ComponentState) or + (csDestroying in TQtWidget(Handle).LCLObject.ComponentState) then exit; if TQtWidget(Handle) is TQtAbstractScrollArea then @@ -4880,6 +4878,7 @@ var SrcRect, DstRect, MaskRect: TRect; SrcWidthOrig, SrcHeightOrig: Integer; Image, TmpImage, QMask, TmpMask: QImageH; + TmpPixmap: QPixmapH; SrcMatrix: QMatrixH; dx, dy: integer; begin @@ -4894,8 +4893,25 @@ begin ' WSrc:', dbgs(SrcWidth), ' HSrc:', dbgs(SrcHeight)); {$endif} + Result := False; + SrcMatrix := QPainter_Matrix(SrcQDC.Widget); - Image := SrcQDC.vImage.Handle; + if SrcQDC.vImage = nil then + begin + if SrcQDC.Parent <> nil then + begin + with SrcQDC.getDeviceSize do + TmpPixmap := QPixmap_create(x, y); + QPixmap_grabWindow(TmpPixmap, QWidget_winId(SrcQDC.Parent), 0, 0); + Image := QImage_create(); + QPixmap_toImage(TmpPixmap, Image); + QPixmap_destroy(TmpPixmap); + end + else + Exit; + end + else + Image := SrcQDC.vImage.Handle; SrcWidthOrig := QImage_width(Image); SrcHeightOrig := QImage_height(Image); QMatrix_map(SrcMatrix, XSrc, YSrc, @XSrc, @YSrc); @@ -4975,6 +4991,9 @@ begin else DstQDC.drawImage(@DstRect, Image, @SrcRect, QMask, @MaskRect); + if SrcQDC.vImage = nil then + QImage_destroy(Image); + Result := True; end;