cheat-engine/Cheat Engine/betterControls/newvirtualstringtree.pas
Dark Byte 6c72f2a9d5 add lua interface for virtualstringtree, use said component in the .net info window
Also added some new fields to get in the dotnetdatacollector and monodatacollector so you'll need to recompile those
2022-12-07 12:28:52 +01:00

73 lines
2 KiB
ObjectPascal

unit newvirtualstringtree;
{$mode ObjFPC}{$H+}
interface
uses
Classes, SysUtils, graphics, laz.VirtualTrees,JwaUxTheme;
type
TNewLazVirtualStringTree=class(TLazVirtualStringTree)
private
procedure ohdqe(Sender: TVTHeader; var PaintInfo: THeaderPaintInfo; var Elements: THeaderPaintElements);
procedure oahd(Sender: TVTHeader; var PaintInfo: THeaderPaintInfo; const Elements: THeaderPaintElements);
protected
procedure ChildHandlesCreated; override;
end;
implementation
uses betterControls;
procedure TNewLazVirtualStringTree.ohdqe(Sender: TVTHeader; var PaintInfo: THeaderPaintInfo; var Elements: THeaderPaintElements);
begin
Elements:=Elements+[hpeBackground];
end;
procedure TNewLazVirtualStringTree.oahd(Sender: TVTHeader; var PaintInfo: THeaderPaintInfo; const Elements: THeaderPaintElements);
begin
if hpeBackground in elements then
begin
//drawing background
if PaintInfo.Column=nil then
begin
paintinfo.TargetCanvas.brush.color:=inccolor(colorset.TextBackground,8);
paintinfo.TargetCanvas.FillRect(PaintInfo.PaintRectangle);
end
else
begin
paintinfo.TargetCanvas.pen.color:=colorset.ButtonBorderColor;
paintinfo.TargetCanvas.brush.color:=inccolor(colorset.TextBackground,8);
paintinfo.TargetCanvas.Rectangle(PaintInfo.PaintRectangle);
end;
end;
end;
procedure TNewLazVirtualStringTree.ChildHandlesCreated;
begin
inherited ChildHandlesCreated;
if ShouldAppsUseDarkMode and (parent<>nil) then
begin
AllowDarkModeForWindow(handle, 1);
SetWindowTheme(Handle, 'explorer', nil);
color:=colorset.TextBackground;
font.color:=ColorSet.FontColor;
Header.Background:=colorset.TextBackground;
Header.Font.color:=ColorSet.FontColor;
header.style:=hsPlates;
header.Options:=header.Options+[hoOwnerDraw];
OnHeaderDrawQueryElements:=@ohdqe;
OnAdvancedHeaderDraw:=@oahd;
colors.UnfocusedSelectionColor:=inccolor(colors.FocusedSelectionColor,8);
colors.UnfocusedSelectionBorderColor:=inccolor(colors.FocusedSelectionBorderColor,8);
end;
end;
end.