mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 17:59:22 +02:00
win32: add TWin32ThemeServices.DrawTextEx
git-svn-id: trunk@20545 -
This commit is contained in:
parent
69228880ca
commit
aa7a14e2ac
@ -1777,7 +1777,6 @@ begin
|
|||||||
else
|
else
|
||||||
WindowsVersion := wvLater;
|
WindowsVersion := wvLater;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
else
|
else
|
||||||
WindowsVersion := wvLater;
|
WindowsVersion := wvLater;
|
||||||
|
@ -52,6 +52,9 @@ type
|
|||||||
procedure DrawText(ACanvas: TPersistent; Details: TThemedElementDetails;
|
procedure DrawText(ACanvas: TPersistent; Details: TThemedElementDetails;
|
||||||
const S: String; R: TRect; Flags, Flags2: Cardinal); override;
|
const S: String; R: TRect; Flags, Flags2: Cardinal); override;
|
||||||
|
|
||||||
|
procedure DrawTextEx(DC: HDC; Details: TThemedElementDetails;
|
||||||
|
const S: String; R: TRect; Flags: Cardinal; Options: PDTTOpts);
|
||||||
|
|
||||||
function ContentRect(DC: HDC; Details: TThemedElementDetails; BoundingRect: TRect): TRect; override;
|
function ContentRect(DC: HDC; Details: TThemedElementDetails; BoundingRect: TRect): TRect; override;
|
||||||
function HasTransparentParts(Details: TThemedElementDetails): Boolean; override;
|
function HasTransparentParts(Details: TThemedElementDetails): Boolean; override;
|
||||||
procedure PaintBorder(Control: TObject; EraseLRCorner: Boolean); override;
|
procedure PaintBorder(Control: TObject; EraseLRCorner: Boolean); override;
|
||||||
@ -432,4 +435,26 @@ begin
|
|||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TWin32ThemeServices.DrawTextEx(DC: HDC;
|
||||||
|
Details: TThemedElementDetails; const S: String; R: TRect; Flags: Cardinal;
|
||||||
|
Options: PDTTOpts);
|
||||||
|
{$IFDEF WindowsUnicodeSupport}
|
||||||
|
var
|
||||||
|
w: widestring;
|
||||||
|
{$ENDIF}
|
||||||
|
begin
|
||||||
|
if ThemesEnabled and (DrawThemeTextEx <> nil) then
|
||||||
|
with Details do
|
||||||
|
{$IFDEF WindowsUnicodeSupport}
|
||||||
|
begin
|
||||||
|
w := UTF8ToUTF16(S);
|
||||||
|
DrawThemeTextEx(Theme[Element], DC, Part, State, PWideChar(w), Length(w), Flags, @R, Options);
|
||||||
|
end
|
||||||
|
{$ELSE}
|
||||||
|
DrawThemeTextEx(Theme[Element], DC, Part, State, PWideChar(WideString(S)), Length(S), Flags, @R, Options)
|
||||||
|
{$ENDIF}
|
||||||
|
else
|
||||||
|
DrawText(DC, Details, S, R, Flags, 0);
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -1451,7 +1451,7 @@ type
|
|||||||
{$EXTERNALSYM DTTOPTS}
|
{$EXTERNALSYM DTTOPTS}
|
||||||
PDTTOPTS = ^_DTTOPTS;
|
PDTTOPTS = ^_DTTOPTS;
|
||||||
{$EXTERNALSYM PDTTOPTS}
|
{$EXTERNALSYM PDTTOPTS}
|
||||||
TDTOpts = DTTOPTS;
|
TDTTOpts = DTTOPTS;
|
||||||
|
|
||||||
// if (_WIN32_WINNT >= 0x0600)
|
// if (_WIN32_WINNT >= 0x0600)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user