You've already forked lazarus-ccr
* Comment win32 specific theme code. Enable theme support
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1094 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -29,9 +29,7 @@
|
|||||||
{$define EnableAdvancedGraphics}
|
{$define EnableAdvancedGraphics}
|
||||||
{$define EnableAlphaBlend}
|
{$define EnableAlphaBlend}
|
||||||
{.$define EnableAccessible}
|
{.$define EnableAccessible}
|
||||||
{$ifdef LCLWin32}
|
{$define ThemeSupport}
|
||||||
{.$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}
|
||||||
|
@ -333,7 +333,7 @@ uses
|
|||||||
SyncObjs, // Thread support
|
SyncObjs, // Thread support
|
||||||
Clipbrd // Clipboard support
|
Clipbrd // Clipboard support
|
||||||
{$ifdef ThemeSupport}
|
{$ifdef ThemeSupport}
|
||||||
, Themes , Win32UxTheme, UxTheme
|
, Themes , TmSchema
|
||||||
{$endif ThemeSupport}
|
{$endif ThemeSupport}
|
||||||
{$ifdef EnableAccessible}
|
{$ifdef EnableAccessible}
|
||||||
, oleacc // for MSAA IAccessible support
|
, oleacc // for MSAA IAccessible support
|
||||||
@ -5336,9 +5336,9 @@ begin
|
|||||||
DoStateChange([tsUseThemes])
|
DoStateChange([tsUseThemes])
|
||||||
else if (toThemeAware in ToBeCleared) then
|
else if (toThemeAware in ToBeCleared) then
|
||||||
DoStateChange([], [tsUseThemes]);
|
DoStateChange([], [tsUseThemes]);
|
||||||
|
//todo
|
||||||
if (tsUseThemes in FStates) and (toUseExplorerTheme in FOptions.FPaintOptions) and IsWinVistaOrAbove then
|
//if (tsUseThemes in FStates) and (toUseExplorerTheme in FOptions.FPaintOptions) and IsWinVistaOrAbove then
|
||||||
SetWindowTheme(Handle, 'explorer', nil);
|
// SetWindowTheme(Handle, 'explorer', nil);
|
||||||
|
|
||||||
PrepareBitmaps(True, False);
|
PrepareBitmaps(True, False);
|
||||||
RedrawWindow(Handle, nil, 0, RDW_INVALIDATE or RDW_VALIDATE or RDW_FRAME);
|
RedrawWindow(Handle, nil, 0, RDW_INVALIDATE or RDW_VALIDATE or RDW_FRAME);
|
||||||
@ -13188,7 +13188,7 @@ var
|
|||||||
Bits: Pointer;
|
Bits: Pointer;
|
||||||
Size: TSize;
|
Size: TSize;
|
||||||
{$ifdef ThemeSupport}
|
{$ifdef ThemeSupport}
|
||||||
Theme: HTHEME;
|
//Theme: HTHEME;
|
||||||
R: TRect;
|
R: TRect;
|
||||||
|
|
||||||
const
|
const
|
||||||
@ -13235,6 +13235,8 @@ begin
|
|||||||
Size.cy := 9;
|
Size.cy := 9;
|
||||||
|
|
||||||
{$ifdef ThemeSupport}
|
{$ifdef ThemeSupport}
|
||||||
|
//todo
|
||||||
|
{
|
||||||
if tsUseThemes in FStates then
|
if tsUseThemes in FStates then
|
||||||
begin
|
begin
|
||||||
Theme := OpenThemeData(Handle, 'TREEVIEW');
|
Theme := OpenThemeData(Handle, 'TREEVIEW');
|
||||||
@ -13246,6 +13248,7 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
Theme := 0;
|
Theme := 0;
|
||||||
|
}
|
||||||
{$endif ThemeSupport}
|
{$endif ThemeSupport}
|
||||||
|
|
||||||
if NeedButtons then
|
if NeedButtons then
|
||||||
@ -13327,7 +13330,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{$ifdef ThemeSupport}
|
{$ifdef ThemeSupport}
|
||||||
|
//todo
|
||||||
// Overwrite glyph images if theme is active.
|
// Overwrite glyph images if theme is active.
|
||||||
|
{
|
||||||
if (tsUseThemes in FStates) and (Theme <> 0) then
|
if (tsUseThemes in FStates) and (Theme <> 0) then
|
||||||
begin
|
begin
|
||||||
R := Rect(0, 0, Size.cx, Size.cy);
|
R := Rect(0, 0, Size.cx, Size.cy);
|
||||||
@ -13344,6 +13349,7 @@ begin
|
|||||||
FHotMinusBM.Canvas.Draw(0, 0, FMinusBM);
|
FHotMinusBM.Canvas.Draw(0, 0, FMinusBM);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
}
|
||||||
{$endif ThemeSupport}
|
{$endif ThemeSupport}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -17423,8 +17429,9 @@ begin
|
|||||||
if ThemeServices.ThemesEnabled and (toThemeAware in TreeOptions.PaintOptions) then
|
if ThemeServices.ThemesEnabled and (toThemeAware in TreeOptions.PaintOptions) then
|
||||||
begin
|
begin
|
||||||
DoStateChange([tsUseThemes]);
|
DoStateChange([tsUseThemes]);
|
||||||
if (toUseExplorerTheme in FOptions.FPaintOptions) and IsWinVistaOrAbove then
|
//todo
|
||||||
SetWindowTheme(Handle, 'explorer', nil);
|
//if (toUseExplorerTheme in FOptions.FPaintOptions) and IsWinVistaOrAbove then
|
||||||
|
// SetWindowTheme(Handle, 'explorer', nil);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
{$endif ThemeSupport}
|
{$endif ThemeSupport}
|
||||||
@ -22565,7 +22572,7 @@ var
|
|||||||
InnerRect: TRect;
|
InnerRect: TRect;
|
||||||
{$ifdef ThemeSupport}
|
{$ifdef ThemeSupport}
|
||||||
RowRect: TRect;
|
RowRect: TRect;
|
||||||
Theme: HTHEME;
|
//Theme: HTHEME;
|
||||||
|
|
||||||
{$ifndef COMPILER_11_UP}
|
{$ifndef COMPILER_11_UP}
|
||||||
const
|
const
|
||||||
@ -22598,6 +22605,8 @@ var
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
{$ifdef ThemeSupport}
|
{$ifdef ThemeSupport}
|
||||||
|
//todo
|
||||||
|
{
|
||||||
procedure DrawBackground(State: Integer);
|
procedure DrawBackground(State: Integer);
|
||||||
begin
|
begin
|
||||||
with PaintInfo do
|
with PaintInfo do
|
||||||
@ -22606,12 +22615,15 @@ var
|
|||||||
else
|
else
|
||||||
DrawThemeBackground(Theme, Canvas.Handle, TVP_TREEITEM, State, InnerRect, nil);
|
DrawThemeBackground(Theme, Canvas.Handle, TVP_TREEITEM, State, InnerRect, nil);
|
||||||
end;
|
end;
|
||||||
|
}
|
||||||
{$endif ThemeSupport}
|
{$endif ThemeSupport}
|
||||||
|
|
||||||
//--------------- end local functions ---------------------------------------
|
//--------------- end local functions ---------------------------------------
|
||||||
|
|
||||||
begin
|
begin
|
||||||
{$ifdef ThemeSupport}
|
{$ifdef ThemeSupport}
|
||||||
|
//todo
|
||||||
|
{
|
||||||
if IsWinVistaOrAbove and (tsUseThemes in FStates) and (toUseExplorerTheme in FOptions.FPaintOptions) then
|
if IsWinVistaOrAbove and (tsUseThemes in FStates) and (toUseExplorerTheme in FOptions.FPaintOptions) then
|
||||||
begin
|
begin
|
||||||
RowRect := Rect(0, PaintInfo.CellRect.Top, FRangeX, PaintInfo.CellRect.Bottom);
|
RowRect := Rect(0, PaintInfo.CellRect.Top, FRangeX, PaintInfo.CellRect.Bottom);
|
||||||
@ -22621,6 +22633,7 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
Theme := 0;
|
Theme := 0;
|
||||||
|
}
|
||||||
{$endif ThemeSupport}
|
{$endif ThemeSupport}
|
||||||
|
|
||||||
with PaintInfo, Canvas do
|
with PaintInfo, Canvas do
|
||||||
@ -22706,6 +22719,8 @@ begin
|
|||||||
InnerRect := CellRect;
|
InnerRect := CellRect;
|
||||||
if not IsRectEmpty(InnerRect) then
|
if not IsRectEmpty(InnerRect) then
|
||||||
{$ifdef ThemeSupport}
|
{$ifdef ThemeSupport}
|
||||||
|
//todo
|
||||||
|
{
|
||||||
if Theme <> 0 then
|
if Theme <> 0 then
|
||||||
begin
|
begin
|
||||||
// If the node is also hot, its background will be drawn later.
|
// If the node is also hot, its background will be drawn later.
|
||||||
@ -22714,6 +22729,7 @@ begin
|
|||||||
DrawBackground(IfThen(Self.Focused, TREIS_SELECTED, TREIS_SELECTEDNOTFOCUS));
|
DrawBackground(IfThen(Self.Focused, TREIS_SELECTED, TREIS_SELECTEDNOTFOCUS));
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
}
|
||||||
{$endif ThemeSupport}
|
{$endif ThemeSupport}
|
||||||
if MMXAvailable and (toUseBlendedSelection in FOptions.PaintOptions) then
|
if MMXAvailable and (toUseBlendedSelection in FOptions.PaintOptions) then
|
||||||
AlphaBlendSelection(Brush.Color)
|
AlphaBlendSelection(Brush.Color)
|
||||||
@ -22725,10 +22741,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{$ifdef ThemeSupport}
|
{$ifdef ThemeSupport}
|
||||||
|
//todo
|
||||||
|
{
|
||||||
if (Theme <> 0) and (toHotTrack in FOptions.FPaintOptions) and (Node = FCurrentHotNode) and
|
if (Theme <> 0) and (toHotTrack in FOptions.FPaintOptions) and (Node = FCurrentHotNode) and
|
||||||
((Column = FCurrentHotColumn) or (toFullRowSelect in FOptions.FSelectionOptions)) then
|
((Column = FCurrentHotColumn) or (toFullRowSelect in FOptions.FSelectionOptions)) then
|
||||||
DrawBackground(IfThen((vsSelected in Node.States) and not (toAlwaysHideSelection in FOptions.FPaintOptions),
|
DrawBackground(IfThen((vsSelected in Node.States) and not (toAlwaysHideSelection in FOptions.FPaintOptions),
|
||||||
TREIS_HOTSELECTED, TREIS_HOT));
|
TREIS_HOTSELECTED, TREIS_HOT));
|
||||||
|
}
|
||||||
{$endif ThemeSupport}
|
{$endif ThemeSupport}
|
||||||
|
|
||||||
if (Column = FFocusedColumn) or (toFullRowSelect in FOptions.FSelectionOptions) then
|
if (Column = FFocusedColumn) or (toFullRowSelect in FOptions.FSelectionOptions) then
|
||||||
@ -22737,10 +22756,13 @@ begin
|
|||||||
if (poDrawFocusRect in PaintOptions) and
|
if (poDrawFocusRect in PaintOptions) and
|
||||||
(Focused or (toPopupMode in FOptions.FPaintOptions)) and (FFocusedNode = Node) and
|
(Focused or (toPopupMode in FOptions.FPaintOptions)) and (FFocusedNode = Node) and
|
||||||
( (Column = FFocusedColumn)
|
( (Column = FFocusedColumn)
|
||||||
{$ifdef ThemeSupport} or
|
{$ifdef ThemeSupport}
|
||||||
|
//todo
|
||||||
|
{ or
|
||||||
(not (toExtendedFocus in FOptions.FSelectionOptions) and
|
(not (toExtendedFocus in FOptions.FSelectionOptions) and
|
||||||
(toFullRowSelect in FOptions.FSelectionOptions) and
|
(toFullRowSelect in FOptions.FSelectionOptions) and
|
||||||
(Theme <> 0) )
|
(Theme <> 0) )
|
||||||
|
}
|
||||||
{$endif ThemeSupport}
|
{$endif ThemeSupport}
|
||||||
) then
|
) then
|
||||||
begin
|
begin
|
||||||
@ -22750,10 +22772,13 @@ begin
|
|||||||
SetBkColor(Handle, 0);
|
SetBkColor(Handle, 0);
|
||||||
|
|
||||||
{$ifdef ThemeSupport}
|
{$ifdef ThemeSupport}
|
||||||
|
//todo
|
||||||
|
{
|
||||||
if not (toExtendedFocus in FOptions.FSelectionOptions) and (toFullRowSelect in FOptions.FSelectionOptions) and
|
if not (toExtendedFocus in FOptions.FSelectionOptions) and (toFullRowSelect in FOptions.FSelectionOptions) and
|
||||||
(Theme <> 0) then
|
(Theme <> 0) then
|
||||||
FocusRect := RowRect
|
FocusRect := RowRect
|
||||||
else
|
else
|
||||||
|
}
|
||||||
{$endif ThemeSupport}
|
{$endif ThemeSupport}
|
||||||
if toGridExtensions in FOptions.FMiscOptions then
|
if toGridExtensions in FOptions.FMiscOptions then
|
||||||
FocusRect := CellRect
|
FocusRect := CellRect
|
||||||
@ -22761,8 +22786,11 @@ begin
|
|||||||
FocusRect := InnerRect;
|
FocusRect := InnerRect;
|
||||||
|
|
||||||
{$ifdef ThemeSupport}
|
{$ifdef ThemeSupport}
|
||||||
|
//todo
|
||||||
|
{
|
||||||
if Theme <> 0 then
|
if Theme <> 0 then
|
||||||
InflateRect(FocusRect, -1, -1);
|
InflateRect(FocusRect, -1, -1);
|
||||||
|
}
|
||||||
{$endif ThemeSupport}
|
{$endif ThemeSupport}
|
||||||
|
|
||||||
LCLIntf.DrawFocusRect(Handle, FocusRect);
|
LCLIntf.DrawFocusRect(Handle, FocusRect);
|
||||||
@ -22772,8 +22800,11 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{$ifdef ThemeSupport}
|
{$ifdef ThemeSupport}
|
||||||
|
//todo
|
||||||
|
{
|
||||||
if Theme <> 0 then
|
if Theme <> 0 then
|
||||||
CloseThemeData(Theme);
|
CloseThemeData(Theme);
|
||||||
|
}
|
||||||
{$endif ThemeSupport}
|
{$endif ThemeSupport}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user