Zitat von
stOrM:
Hmm vielleicht machste was falsch? Zeig ma deinen Code?
Naja das ist (im Moment noch) ziemlich verworren. Also mein OnPainBackground sieht so aus:
Delphi-Quellcode:
procedure TForm1.vstNetworkPaintBackground(Sender: TBaseVirtualTree;
TargetCanvas: TCanvas; R: TRect; var Handled: Boolean);
var
BlendRec: TBlendFunction;
Bitmap : TBitmap;
begin
Handled := True;
BlendRec.BlendOp := AC_SRC_OVER;
BlendRec.BlendFlags := 0;
BlendRec.SourceConstantAlpha := 255;
BlendRec.AlphaFormat := AC_SRC_ALPHA;
Bitmap := TVirtualStringTree(Sender).Background.Bitmap;
Windows.AlphaBlend(TargetCanvas.Handle,
R.Right - Bitmap.Width, R.Bottom - Bitmap.Height, Bitmap.Width,
Bitmap.Height, Bitmap.Canvas.Handle, 0, 0,
Bitmap.Width, Bitmap.Height, BlendRec);
end;
Und das Erstellen des VST so:
Delphi-Quellcode:
FOwnFiles := TSLFileTree.Create(nil);
with FOwnFiles do
begin
Name := 'FOwnFiles';
Parent := TabSheet1;
Left := 0;
Top := 34;
Width := 732;
Height := 483;
Anchors := [akLeft, akTop, akRight, akBottom];
Images := ilImageCollection;
TabOrder := 1;
// LoadFromDirectory(FFiles); --> Befüllt nur mit Daten!
TreeOptions.PaintOptions := TreeOptions.PaintOptions + [toStaticBackground, toUseExplorerTheme];
OnPaintBackground := vstNetworkPaintBackground;
end;
Beziehungsweise das Create:
Delphi-Quellcode:
constructor TSLFileTree.Create(AOwner: TComponent);
begin
inherited;
Header.Options := Header.Options + [hoVisible, hoDblClickResize, hoShowSortGlyphs] - [hoDrag];
LineStyle := lsSolid;
//TreeOptions.PaintOptions := TreeOptions.PaintOptions - [toShowRoot] + [toShowHorzGridLines, toShowVertGridLines];
//TreeOptions.SelectionOptions := TreeOptions.SelectionOptions + [toFullRowSelect, toMultiSelect];
TreeOptions.AutoOptions := TreeOptions.AutoOptions + [toAutoSort];
TreeOptions.MiscOptions := TreeOptions.MiscOptions + [toEditable];
NodeDataSize := SizeOf(TSLFileBase);
with Header.Columns do
begin
with Add do
begin
Position := 0;
Text := 'Virtueller Dateiname';
end;
with Add do
begin
Position := 1;
Text := 'Anzahl Dateien/Ordner';
end;
with Add do
begin
Position := 2;
Text := 'Datei/Ordnergröße';
end;
with Add do
begin
Position := 3;
Text := 'Typ';
end;
with Add do
begin
Position := 4;
Text := 'Zugriff';
end;
end;
OnNewText := SelfOnNewText;
OnFocusChanged := SelfOnFocusChanged;
end;
MfG
xZise