mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-17 04:21:00 +01:00
*Fixed TArrow regression, introduced by latest winapi patch.
git-svn-id: trunk@11579 -
This commit is contained in:
parent
27a0b1dee3
commit
0daf4ff929
@ -89,98 +89,103 @@ var
|
|||||||
APoints: Array [0..2] of TPoint;
|
APoints: Array [0..2] of TPoint;
|
||||||
ArrowType: Integer;
|
ArrowType: Integer;
|
||||||
ARect: TRect;
|
ARect: TRect;
|
||||||
|
Brush: QBrushH;
|
||||||
|
Pen: QPenH;
|
||||||
begin
|
begin
|
||||||
|
|
||||||
DC := TQtDeviceContext.Create(TArrow(Arrow).Handle);
|
DC := TQtDeviceContext(TCanvas(Canvas).Handle);
|
||||||
// TQtDeviceContext(TCanvas(Canvas).Handle);
|
|
||||||
ARect := TControl(Arrow).ClientRect;
|
ARect := TControl(Arrow).ClientRect;
|
||||||
ArrowType := Ord(TArrow(Arrow).ArrowType);
|
ArrowType := Ord(TArrow(Arrow).ArrowType);
|
||||||
try
|
|
||||||
case ArrowType of
|
case ArrowType of
|
||||||
0:{up}
|
0:{up}
|
||||||
begin
|
|
||||||
{$ifdef QT_USE_BIG_TARROW}
|
|
||||||
APoints[0].X := ARect.Right div 2;
|
|
||||||
APoints[0].Y := ARect.Bottom div 3;
|
|
||||||
APoints[1].X := (ARect.Right div 8);
|
|
||||||
APoints[1].Y := ARect.Bottom - (ARect.Bottom div 3);
|
|
||||||
APoints[2].X := ARect.Right - (ARect.Right div 8);
|
|
||||||
APoints[2].Y := ARect.Bottom - (ARect.Bottom div 3);
|
|
||||||
{$else}
|
|
||||||
APoints[0].X := ARect.Right div 2;
|
|
||||||
APoints[0].Y := ARect.Bottom div 4;
|
|
||||||
APoints[1].X := (ARect.Right div 4);
|
|
||||||
APoints[1].Y := ARect.Bottom - (ARect.Bottom div 4);
|
|
||||||
APoints[2].X := ARect.Right - (ARect.Right div 4);
|
|
||||||
APoints[2].Y := ARect.Bottom - (ARect.Bottom div 4);
|
|
||||||
{$endif}
|
|
||||||
end;
|
|
||||||
1:{down}
|
|
||||||
begin
|
|
||||||
{$ifdef QT_USE_BIG_TARROW}
|
|
||||||
APoints[0].X := ARect.Right div 8;
|
|
||||||
APoints[0].Y := ARect.Bottom div 3;
|
|
||||||
APoints[1].X := ARect.Right - (ARect.Right div 8);
|
|
||||||
APoints[1].Y := (ARect.Bottom div 3);
|
|
||||||
APoints[2].X := ARect.Right div 2;
|
|
||||||
APoints[2].Y := ARect.Bottom - (ARect.Bottom div 3);
|
|
||||||
{$else}
|
|
||||||
APoints[0].X := ARect.Right div 4;
|
|
||||||
APoints[0].Y := ARect.Bottom div 4;
|
|
||||||
APoints[1].X := ARect.Right - (ARect.Right div 4);
|
|
||||||
APoints[1].Y := (ARect.Bottom div 4);
|
|
||||||
APoints[2].X := ARect.Right div 2;
|
|
||||||
APoints[2].Y := ARect.Bottom - (ARect.Bottom div 4);
|
|
||||||
{$endif}
|
|
||||||
end;
|
|
||||||
2:{left}
|
|
||||||
begin
|
|
||||||
{$ifdef QT_USE_BIG_TARROW}
|
|
||||||
APoints[0].X := ARect.Right - (ARect.Right div 3);
|
|
||||||
APoints[0].Y := ARect.Bottom div 8;
|
|
||||||
APoints[1].X := ARect.Right - (ARect.Right div 3);
|
|
||||||
APoints[1].Y := ARect.Bottom - (ARect.Bottom div 8);
|
|
||||||
APoints[2].X := ARect.Right div 3;
|
|
||||||
APoints[2].Y := ARect.Bottom div 2;
|
|
||||||
{$else}
|
|
||||||
APoints[0].X := ARect.Right - (ARect.Right div 4);
|
|
||||||
APoints[0].Y := ARect.Bottom div 4;
|
|
||||||
APoints[1].X := ARect.Right - (ARect.Right div 4);
|
|
||||||
APoints[1].Y := ARect.Bottom - (ARect.Bottom div 4);
|
|
||||||
APoints[2].X := (ARect.Right div 4);
|
|
||||||
APoints[2].Y := ARect.Bottom div 2;
|
|
||||||
{$endif}
|
|
||||||
end;
|
|
||||||
3:{right}
|
|
||||||
begin
|
|
||||||
{$ifdef QT_USE_BIG_TARROW}
|
|
||||||
APoints[0].X := ARect.Right div 3;
|
|
||||||
APoints[0].Y := ARect.Bottom div 8;
|
|
||||||
APoints[1].X := ARect.Right div 3;
|
|
||||||
APoints[1].Y := ARect.Bottom - (ARect.Bottom div 8);
|
|
||||||
APoints[2].X := ARect.Right - (ARect.Right div 3);
|
|
||||||
APoints[2].Y := ARect.Bottom div 2;
|
|
||||||
{$else}
|
|
||||||
APoints[0].X := ARect.Right div 4;
|
|
||||||
APoints[0].Y := ARect.Bottom div 4;
|
|
||||||
APoints[1].X := ARect.Right div 4;
|
|
||||||
APoints[1].Y := ARect.Bottom - (ARect.Bottom div 4);
|
|
||||||
APoints[2].X := ARect.Right - (ARect.Right div 4);
|
|
||||||
APoints[2].Y := ARect.Bottom div 2;
|
|
||||||
{$endif}
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
if ArrowType in [0..3] then
|
|
||||||
begin
|
begin
|
||||||
DC.brush.setStyle(QtSolidPattern);
|
{$ifdef QT_USE_BIG_TARROW}
|
||||||
QPainter_setRenderHint(DC.Widget, QPainterAntialiasing, True);
|
APoints[0].X := ARect.Right div 2;
|
||||||
QPainter_setClipRect(DC.Widget, @ARect);
|
APoints[0].Y := ARect.Bottom div 3;
|
||||||
QPainter_drawPolygon(DC.Widget, @APoints, 3, QtWindingFill);
|
APoints[1].X := (ARect.Right div 8);
|
||||||
|
APoints[1].Y := ARect.Bottom - (ARect.Bottom div 3);
|
||||||
|
APoints[2].X := ARect.Right - (ARect.Right div 8);
|
||||||
|
APoints[2].Y := ARect.Bottom - (ARect.Bottom div 3);
|
||||||
|
{$else}
|
||||||
|
APoints[0].X := ARect.Right div 2;
|
||||||
|
APoints[0].Y := ARect.Bottom div 4;
|
||||||
|
APoints[1].X := (ARect.Right div 4);
|
||||||
|
APoints[1].Y := ARect.Bottom - (ARect.Bottom div 4);
|
||||||
|
APoints[2].X := ARect.Right - (ARect.Right div 4);
|
||||||
|
APoints[2].Y := ARect.Bottom - (ARect.Bottom div 4);
|
||||||
|
{$endif}
|
||||||
|
end;
|
||||||
|
1:{down}
|
||||||
|
begin
|
||||||
|
{$ifdef QT_USE_BIG_TARROW}
|
||||||
|
APoints[0].X := ARect.Right div 8;
|
||||||
|
APoints[0].Y := ARect.Bottom div 3;
|
||||||
|
APoints[1].X := ARect.Right - (ARect.Right div 8);
|
||||||
|
APoints[1].Y := (ARect.Bottom div 3);
|
||||||
|
APoints[2].X := ARect.Right div 2;
|
||||||
|
APoints[2].Y := ARect.Bottom - (ARect.Bottom div 3);
|
||||||
|
{$else}
|
||||||
|
APoints[0].X := ARect.Right div 4;
|
||||||
|
APoints[0].Y := ARect.Bottom div 4;
|
||||||
|
APoints[1].X := ARect.Right - (ARect.Right div 4);
|
||||||
|
APoints[1].Y := (ARect.Bottom div 4);
|
||||||
|
APoints[2].X := ARect.Right div 2;
|
||||||
|
APoints[2].Y := ARect.Bottom - (ARect.Bottom div 4);
|
||||||
|
{$endif}
|
||||||
|
end;
|
||||||
|
2:{left}
|
||||||
|
begin
|
||||||
|
{$ifdef QT_USE_BIG_TARROW}
|
||||||
|
APoints[0].X := ARect.Right - (ARect.Right div 3);
|
||||||
|
APoints[0].Y := ARect.Bottom div 8;
|
||||||
|
APoints[1].X := ARect.Right - (ARect.Right div 3);
|
||||||
|
APoints[1].Y := ARect.Bottom - (ARect.Bottom div 8);
|
||||||
|
APoints[2].X := ARect.Right div 3;
|
||||||
|
APoints[2].Y := ARect.Bottom div 2;
|
||||||
|
{$else}
|
||||||
|
APoints[0].X := ARect.Right - (ARect.Right div 4);
|
||||||
|
APoints[0].Y := ARect.Bottom div 4;
|
||||||
|
APoints[1].X := ARect.Right - (ARect.Right div 4);
|
||||||
|
APoints[1].Y := ARect.Bottom - (ARect.Bottom div 4);
|
||||||
|
APoints[2].X := (ARect.Right div 4);
|
||||||
|
APoints[2].Y := ARect.Bottom div 2;
|
||||||
|
{$endif}
|
||||||
|
end;
|
||||||
|
3:{right}
|
||||||
|
begin
|
||||||
|
{$ifdef QT_USE_BIG_TARROW}
|
||||||
|
APoints[0].X := ARect.Right div 3;
|
||||||
|
APoints[0].Y := ARect.Bottom div 8;
|
||||||
|
APoints[1].X := ARect.Right div 3;
|
||||||
|
APoints[1].Y := ARect.Bottom - (ARect.Bottom div 8);
|
||||||
|
APoints[2].X := ARect.Right - (ARect.Right div 3);
|
||||||
|
APoints[2].Y := ARect.Bottom div 2;
|
||||||
|
{$else}
|
||||||
|
APoints[0].X := ARect.Right div 4;
|
||||||
|
APoints[0].Y := ARect.Bottom div 4;
|
||||||
|
APoints[1].X := ARect.Right div 4;
|
||||||
|
APoints[1].Y := ARect.Bottom - (ARect.Bottom div 4);
|
||||||
|
APoints[2].X := ARect.Right - (ARect.Right div 4);
|
||||||
|
APoints[2].Y := ARect.Bottom div 2;
|
||||||
|
{$endif}
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if ArrowType in [0..3] then
|
||||||
|
begin
|
||||||
|
Brush := QBrush_create(QtBlack, QtSolidPattern);
|
||||||
|
Pen := QPen_create(Brush, 1);
|
||||||
|
try
|
||||||
|
QPainter_setBrush(DC.Widget, Brush);
|
||||||
|
QPainter_setPen(DC.Widget, Pen);
|
||||||
|
QPainter_setRenderHint(DC.Widget, QPainterAntialiasing, True);
|
||||||
|
QPainter_drawPolygon(DC.Widget, @APoints, 3, QtWindingFill);
|
||||||
|
finally
|
||||||
|
QPen_destroy(Pen);
|
||||||
|
QBrush_destroy(Brush);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
finally
|
|
||||||
DC.Free;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user