Qt: implemented TQtWidgetSet.ExtUTF8Out() and ETO_RTLREADING

git-svn-id: trunk@53826 -
This commit is contained in:
zeljko 2017-01-01 12:36:09 +00:00
parent dc36528c42
commit 85e23e66e3
3 changed files with 13 additions and 1 deletions

View File

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

View File

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

View File

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