lcl: formatting

git-svn-id: trunk@20179 -
This commit is contained in:
paul 2009-05-25 02:10:05 +00:00
parent 7d267984d2
commit b8d1a1adec
2 changed files with 31 additions and 12 deletions

View File

@ -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

View File

@ -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;