* Fix Compilation under non Windows: enable themes only for win32

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1068 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
blikblum
2009-12-16 17:03:00 +00:00
parent b4ff3cb583
commit adabb04016
2 changed files with 12 additions and 2 deletions

View File

@ -29,7 +29,9 @@
{$define EnableAdvancedGraphics} {$define EnableAdvancedGraphics}
{$define EnableAlphaBlend} {$define EnableAlphaBlend}
{.$define EnableAccessible} {.$define EnableAccessible}
{$define ThemeSupport} {$ifdef LCLWin32}
{$define ThemeSupport}
{$endif}
//under linux the performance is poor with threading enabled //under linux the performance is poor with threading enabled
{$ifdef Windows} {$ifdef Windows}

View File

@ -331,7 +331,7 @@ uses
SyncObjs // Thread support SyncObjs // Thread support
//Clipbrd // Clipboard support //Clipbrd // Clipboard support
{$ifdef ThemeSupport} {$ifdef ThemeSupport}
, Themes , UxTheme , Themes , Win32UxTheme
{$endif ThemeSupport} {$endif ThemeSupport}
{$ifdef EnableAccessible} {$ifdef EnableAccessible}
, oleacc // for MSAA IAccessible support , oleacc // for MSAA IAccessible support
@ -22750,16 +22750,23 @@ procedure TBaseVirtualTree.PaintCheckImage(const PaintInfo: TVTPaintInfo);
var var
R: TRect; R: TRect;
{$ifdef ThemeSupport}
Details: TThemedElementDetails; Details: TThemedElementDetails;
{$endif}
UseThemes: Boolean; UseThemes: Boolean;
begin begin
Logger.EnterMethod([lcCheck],'PaintCheckImage'); Logger.EnterMethod([lcCheck],'PaintCheckImage');
with PaintInfo, ImageInfo[iiCheck] do with PaintInfo, ImageInfo[iiCheck] do
begin begin
{$ifdef ThemeSupport}
UseThemes := (tsUseThemes in FStates) and (FCheckImageKind = ckSystemDefault); UseThemes := (tsUseThemes in FStates) and (FCheckImageKind = ckSystemDefault);
{$else}
UseThemes := False;
{$endif}
if UseThemes or ((FCheckImageKind in [ckSystemFlat, ckSystemDefault]) and not (Index in [21..24])) then if UseThemes or ((FCheckImageKind in [ckSystemFlat, ckSystemDefault]) and not (Index in [21..24])) then
begin begin
{$ifdef ThemeSupport}
if UseThemes then if UseThemes then
begin begin
R := Rect(XPos - 1, YPos, XPos + 16, YPos + 16); R := Rect(XPos - 1, YPos, XPos + 16, YPos + 16);
@ -22791,6 +22798,7 @@ begin
Canvas.Handle, 4 * Height, 0, MaskHandle); Canvas.Handle, 4 * Height, 0, MaskHandle);
end end
else else
{$endif}
begin begin
R := Rect(XPos + 1, YPos + 1, XPos + 14, YPos + 14); R := Rect(XPos + 1, YPos + 1, XPos + 14, YPos + 14);
DrawCheckButton(Canvas, Index, R, FCheckImageKind = ckSystemFlat); DrawCheckButton(Canvas, Index, R, FCheckImageKind = ckSystemFlat);