mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-16 13:09:28 +02:00
Qt: implemented TQtWidgetSet.ExtUTF8Out() and ETO_RTLREADING
git-svn-id: trunk@53826 -
This commit is contained in:
parent
dc36528c42
commit
85e23e66e3
@ -896,6 +896,11 @@ begin
|
||||
QRubberBand_setGeometry(QRubberBandH(ARubberBand), @ARect);
|
||||
end;
|
||||
|
||||
function TQtWidgetSet.ExtUTF8Out(DC: HDC; X, Y: Integer; Options: Longint; Rect: PRect; Str: PChar; Count: Longint; Dx: PInteger): Boolean;
|
||||
begin
|
||||
Result := ExtTextOut(DC,X,Y,Options,Rect,Str,Count,Dx);
|
||||
end;
|
||||
|
||||
function TQtWidgetSet.TextUTF8Out(DC: HDC; X, Y: Integer; Str: PChar; Count: Longint): Boolean;
|
||||
begin
|
||||
Result := False;
|
||||
|
@ -43,6 +43,7 @@ procedure DrawDefaultDockImage(AOldRect, ANewRect: TRect; AOperation: TDockImage
|
||||
procedure DrawGrid(DC: HDC; const R: TRect; DX, DY: Integer); override;
|
||||
procedure DestroyRubberBand(ARubberBand: HWND); override;
|
||||
|
||||
function ExtUTF8Out(DC: HDC; X, Y: Integer; Options: Longint; Rect: PRect; Str: PChar; Count: Longint; Dx: PInteger): Boolean; override;
|
||||
function FontCanUTF8(Font: HFont): boolean; override;
|
||||
function FontIsMonoSpace(Font: HFont): boolean; override;
|
||||
|
||||
|
@ -2197,6 +2197,7 @@ var
|
||||
QtDC: TQtDeviceContext absolute DC;
|
||||
R, R1: TRect;
|
||||
Pt: TPoint;
|
||||
ALayout: QtLayoutDirection;
|
||||
|
||||
procedure DoDrawCharByChar(const AClipped: Boolean);
|
||||
var
|
||||
@ -2259,7 +2260,7 @@ begin
|
||||
begin
|
||||
// couldn't find way to fix it.
|
||||
end;
|
||||
QtDC.fillRect(Rect^.Left, Rect^.Top, Rect^.Right - Rect^.Left, Rect^.Bottom - Rect^.Top);
|
||||
QtDC.fillRect(X, Y, Rect^.Right - Rect^.Left, Rect^.Bottom - Rect^.Top);
|
||||
end else
|
||||
if ((Options and ETO_OPAQUE) = 0) and (Rect <> nil) and (QtDC.getBKMode = OPAQUE) then
|
||||
begin
|
||||
@ -2281,6 +2282,9 @@ begin
|
||||
|
||||
if Str <> nil then
|
||||
begin
|
||||
ALayout := QPainter_layoutDirection(QtDC.Widget);
|
||||
if Options and ETO_RTLREADING <> 0 then
|
||||
QPainter_setLayoutDirection(QtDC.Widget, QtRightToLeft);
|
||||
if Count >= 0 then
|
||||
WideStr := GetUtf8String(Copy(Str, 1, Count))
|
||||
else
|
||||
@ -2306,6 +2310,8 @@ begin
|
||||
else
|
||||
QtDC.drawText(X, Y, @WideStr);
|
||||
end;
|
||||
if Options and ETO_RTLREADING <> 0 then
|
||||
QPainter_setLayoutDirection(QtDC.Widget, ALayout);
|
||||
end;
|
||||
|
||||
Result := True;
|
||||
|
Loading…
Reference in New Issue
Block a user