themes: add size of drop down part of toolbutton

git-svn-id: trunk@12570 -
This commit is contained in:
paul 2007-10-23 22:59:41 +00:00
parent 1d7db6a607
commit 0c359236ac
2 changed files with 22 additions and 2 deletions

View File

@ -6,7 +6,7 @@ interface
uses
// os
Windows, Win32UxTheme, Win32Proc, Win32Extra,
Windows, Win32UxTheme, Win32Proc, Win32Extra, TmSchema,
// rtl
Classes, SysUtils,
// lcl
@ -33,6 +33,8 @@ type
public
destructor Destroy; override;
function GetDetailSize(Details: TThemedElementDetails): Integer; override;
procedure DrawElement(DC: HDC; Details: TThemedElementDetails; const R: TRect;
ClipRect: PRect = nil); override;
procedure DrawEdge(DC: HDC; Details: TThemedElementDetails; const R: TRect; Edge, Flags: Cardinal;
@ -109,6 +111,21 @@ begin
FreeThemeLibrary;
end;
function TWin32ThemeServices.GetDetailSize(Details: TThemedElementDetails
): Integer;
begin
if ThemesEnabled then
case Details.Element of
teToolBar:
if Details.Part = TP_SPLITBUTTONDROPDOWN then
Result := 12;
else
Result:=inherited GetDetailSize(Details);
end
else
Result:=inherited GetDetailSize(Details);
end;
function TWin32ThemeServices.UseThemes: Boolean;
begin
Result := Win32UxTheme.UseThemes and (GetFileVersion(comctl32) >= ComCtlVersionIE6);

View File

@ -1743,9 +1743,12 @@ begin
teButton:
if Details.Part in [BP_RADIOBUTTON, BP_CHECKBOX] then
Result := 13;
teRebar :
teRebar:
if Details.Part in [RP_GRIPPER, RP_GRIPPERVERT] then
Result := 30;
teToolBar:
if Details.Part = TP_SPLITBUTTONDROPDOWN then
Result := 10;
end;
end;