-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmarioVST.pas
More file actions
162 lines (147 loc) · 4.87 KB
/
Copy pathmarioVST.pas
File metadata and controls
162 lines (147 loc) · 4.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
unit marioVST;//V0.02
interface
uses
Windows, SysUtils, Classes, ZipMstr, Forms, VirtualTrees, Graphics,
MarioSec, mario;
procedure vstSetTreeSettings(vTree:TVirtualStringTree);
procedure vstSetParentVisible(vTree:TVirtualStringTree;aNode:PVirtualNode);
procedure vstSetParentExpand(vTree:TVirtualStringTree;aNode:PVirtualNode);
Function vstColumnWidthsGet(vTree:TVirtualStringTree):String;
Procedure vstColumnWidthsSet(vTree:TVirtualStringTree;encodedString:String);
var
zzBusy : Boolean =false;
implementation
Uses
vtMethods, TTMain ;
procedure vstSetTreeSettings(vTree: TVirtualStringTree);
begin
vTree.Colors.FocusedSelectionColor := aConfig.selColor;
vTree.Colors.FocusedSelectionBorderColor := aConfig.selBordrColor;
vTree.Header.Style := hsXPStyle;
vTree.CheckImageKind := ckXP;
vTree.Font := Form1.FontBlack;
vTree.Header.Background := clMoneyGreen;
vTree.TreeOptions.SelectionOptions := vTree.TreeOptions.SelectionOptions + [toFullRowSelect];
vTree.TreeOptions.SelectionOptions := vTree.TreeOptions.SelectionOptions + [toRightClickSelect];
vTree.OnMeasureItem := Form1.VstNMeasureItem;
If aConfig.ShowBackGround = true then Begin
Randomize;
Form1.VstN.TreeOptions.PaintOptions := Form1.VstN.TreeOptions.PaintOptions + [toShowBackground];
vTree.Background := Form1.VstN.Background;
vTree.TreeOptions.PaintOptions := vTree.TreeOptions.PaintOptions + [toShowBackground];
vTree.BackgroundOffsetX := random(300);
vTree.BackgroundOffsety := random(300);
End else
vTree.TreeOptions.PaintOptions := vTree.TreeOptions.PaintOptions - [toShowBackground];
{If aConfig.AnimateTree = true then Begin
VstN.TreeOptions.AnimationOptions := VstN.TreeOptions.AnimationOptions + [toAnimatedToggle];
VSTCurrent.TreeOptions.AnimationOptions := VSTCurrent.TreeOptions.AnimationOptions + [toAnimatedToggle];
vTree.TreeOptions.AnimationOptions := vTree.TreeOptions.AnimationOptions + [toAnimatedToggle];
End
Else Begin
vTree.TreeOptions.AnimationOptions := vTree.TreeOptions.AnimationOptions - [toAnimatedToggle];
End;}
//vTree.ScrollBarOptions.ScrollBarStyle := sbm3D;
end;
procedure vstSetParentVisible(vTree:TVirtualStringTree;aNode:PVirtualNode);
Var
aParent : PVirtualNode;
begin
Try
if Form1.canProceed then Begin
if aNode <> nil then
aParent := vTree.NodeParent[aNode];// aNode.Parent;
While aParent <> nil do Begin
Try
If vTree.IsVisible[aParent] = false then
vTree.IsVisible[aParent] := True;
Except
End;
//aParent.States := aParent.States + [vsVisible];
aParent := vTree.NodeParent[aParent];// aParent.Parent;
End;
End;
Except
end;
End;
procedure vstSetParentExpand(vTree:TVirtualStringTree;aNode:PVirtualNode);
Var
aParent : PVirtualNode;
i : Integer;
begin
if Form1.canProceed then Begin
If Assigned(aNode) then
If Assigned(aNode.Parent) then Begin
aParent := vTree.NodeParent[aNode]; //;aNode.Parent;
While Assigned(aParent) do Begin //<> nil do Begin
Try
i := vTree.GetNodeLevel(aParent);
vTree.Expanded[aParent] := True;
If i = 0 then
aParent := nil;
Except
End;
If Assigned(aParent) then
If Assigned(aParent.Parent) then
aParent := vTree.NodeParent[aParent]// aParent.Parent
Else
aParent := nil;
End;
End;
End;
End;
Function vstColumnWidthsGet(vTree:TVirtualStringTree):String;
Var
Lst : TStringList;
s : String;
i : Integer;
Stream : TMemoryStream;
begin
Try
Lst := TStringList.Create;
Stream := TMemoryStream.Create;
For i := 0 to vTree.Header.Columns.Count -1 do Begin
Lst.Add(IntToStr(vTree.Header.Columns[i].Width));
end;
Lst.SaveToStream(Stream);
s := EncodeStream(Stream);
Finally
Lst.Free;
Result := s;
Stream.Free;
end;
End;
Procedure vstColumnWidthsSet(vTree:TVirtualStringTree;encodedString:String);
Var
Lst : TStringList;
i, Value : Integer;
begin
Try
If encodedString = '' then
encodedString := 'MTU4DQo3NQ0KMjMwDQoxNTANCjUwDQo=';
If encodedString <> '' then Begin
Lst := TStringList.Create;
Lst.Text := DecodeStringStr(encodedString);
i := 0;
While i < Lst.Count do Begin
Try
Value := StrToInt(Lst.Strings[i]);
if Value < 8 then
Value := 8;
Except
Value := 20;
End;
If Value > 15 then
if i < vTree.Header.Columns.Count + 1 then
vTree.Header.Columns[i].Width := Value
Else
i := Lst.Count;
inc(i);
End;
End;
Finally
if Lst <> nil then
Lst.Free;
end;
End;
End.