mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 20:19:24 +02:00
- extending QT ExtTextOut support
git-svn-id: trunk@11456 -
This commit is contained in:
parent
3862347c8a
commit
c73f4c6b4d
@ -223,6 +223,10 @@ type
|
|||||||
procedure DrawText(x,y,w,h,flags: Integer; s:PWideString); overload;
|
procedure DrawText(x,y,w,h,flags: Integer; s:PWideString); overload;
|
||||||
procedure drawLine(x1: Integer; y1: Integer; x2: Integer; y2: Integer);
|
procedure drawLine(x1: Integer; y1: Integer; x2: Integer; y2: Integer);
|
||||||
procedure drawEllipse(x: Integer; y: Integer; w: Integer; h: Integer);
|
procedure drawEllipse(x: Integer; y: Integer; w: Integer; h: Integer);
|
||||||
|
procedure fillRect(ARect: PRect; ABrush: QBrushH); overload;
|
||||||
|
procedure fillRect(x, y, w, h: Integer; ABrush: QBrushH); overload;
|
||||||
|
procedure fillRect(x, y, w, h: Integer); overload;
|
||||||
|
|
||||||
procedure setBrushOrigin(x, y: Integer);
|
procedure setBrushOrigin(x, y: Integer);
|
||||||
procedure brushOrigin(retval: PPoint);
|
procedure brushOrigin(retval: PPoint);
|
||||||
function font: TQtFont;
|
function font: TQtFont;
|
||||||
@ -1139,6 +1143,21 @@ begin
|
|||||||
QPainter_drawEllipse(Widget, x, y, w, h);
|
QPainter_drawEllipse(Widget, x, y, w, h);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TQtDeviceContext.fillRect(ARect: PRect; ABrush: QBrushH);
|
||||||
|
begin
|
||||||
|
QPainter_fillRect(Widget, ARect, ABrush);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TQtDeviceContext.fillRect(x, y, w, h: Integer; ABrush: QBrushH);
|
||||||
|
begin
|
||||||
|
QPainter_fillRect(Widget, x, y, w, h, ABrush);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TQtDeviceContext.fillRect(x, y, w, h: Integer);
|
||||||
|
begin
|
||||||
|
fillRect(x, y, w, h, BackgroundBrush.Widget);
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Function: TQtDeviceContext.drawPoint
|
Function: TQtDeviceContext.drawPoint
|
||||||
Params: x1,y1 : Integer
|
Params: x1,y1 : Integer
|
||||||
|
@ -816,6 +816,7 @@ function TQtWidgetSet.ExtTextOut(DC: HDC; X, Y: Integer; Options: Longint;
|
|||||||
Rect: PRect; Str: PChar; Count: Longint; Dx: PInteger): Boolean;
|
Rect: PRect; Str: PChar; Count: Longint; Dx: PInteger): Boolean;
|
||||||
var
|
var
|
||||||
WideStr: WideString;
|
WideStr: WideString;
|
||||||
|
QtDC: TQtDeviceContext absolute DC;
|
||||||
begin
|
begin
|
||||||
{$ifdef VerboseQtWinAPI}
|
{$ifdef VerboseQtWinAPI}
|
||||||
WriteLn('[WinAPI ExtTextOut]');
|
WriteLn('[WinAPI ExtTextOut]');
|
||||||
@ -823,11 +824,21 @@ begin
|
|||||||
|
|
||||||
Result := False;
|
Result := False;
|
||||||
|
|
||||||
|
if ((Options and (ETO_OPAQUE + ETO_CLIPPED)) <> 0) and (Rect = nil) then
|
||||||
|
exit;
|
||||||
|
|
||||||
if not IsValidDC(DC) then Exit;
|
if not IsValidDC(DC) then Exit;
|
||||||
|
|
||||||
WideStr := UTF8Decode(Str);
|
if ((Options and ETO_OPAQUE) <> 0) then
|
||||||
|
QtDC.fillRect(Rect^.Left, Rect^.Top, Rect^.Right - Rect^.Left, Rect^.Bottom - Rect^.Top);
|
||||||
|
|
||||||
TQtDeviceContext(DC).drawText(X, Y, @WideStr);
|
if Str <> nil then
|
||||||
|
begin
|
||||||
|
WideStr := UTF8Decode(Str);
|
||||||
|
|
||||||
|
QtDC.drawText(X, Y, @WideStr);
|
||||||
|
end;
|
||||||
|
|
||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -839,9 +850,6 @@ end;
|
|||||||
|
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
function TQtWidgetSet.FillRect(DC: HDC; const Rect: TRect; Brush: HBRUSH): Boolean;
|
function TQtWidgetSet.FillRect(DC: HDC; const Rect: TRect; Brush: HBRUSH): Boolean;
|
||||||
var
|
|
||||||
Painter: QPainterH;
|
|
||||||
ABrush: QBrushH;
|
|
||||||
begin
|
begin
|
||||||
result:=false;
|
result:=false;
|
||||||
|
|
||||||
@ -854,11 +862,8 @@ begin
|
|||||||
if not IsValidGdiObject(Brush) then
|
if not IsValidGdiObject(Brush) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
Painter:= TQTDeviceContext(DC).Widget;
|
TQTDeviceContext(DC).fillRect(@Rect, TQTBrush(Brush).Widget);
|
||||||
ABrush := TQTBrush(Brush).Widget;
|
|
||||||
|
|
||||||
QPainter_FillRect(Painter, @Rect, ABrush);
|
|
||||||
|
|
||||||
result := true;
|
result := true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user