win32: add TWin32ThemeServices.DrawTextEx

git-svn-id: trunk@20545 -
This commit is contained in:
paul 2009-06-09 09:06:40 +00:00
parent 69228880ca
commit aa7a14e2ac
3 changed files with 26 additions and 2 deletions

View File

@ -1777,7 +1777,6 @@ begin
else
WindowsVersion := wvLater;
end;
end;
else
WindowsVersion := wvLater;

View File

@ -52,6 +52,9 @@ type
procedure DrawText(ACanvas: TPersistent; Details: TThemedElementDetails;
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 HasTransparentParts(Details: TThemedElementDetails): Boolean; override;
procedure PaintBorder(Control: TObject; EraseLRCorner: Boolean); override;
@ -432,4 +435,26 @@ begin
inherited;
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.

View File

@ -1451,7 +1451,7 @@ type
{$EXTERNALSYM DTTOPTS}
PDTTOPTS = ^_DTTOPTS;
{$EXTERNALSYM PDTTOPTS}
TDTOpts = DTTOPTS;
TDTTOpts = DTTOPTS;
// if (_WIN32_WINNT >= 0x0600)