Skip to content

Commit b9d4a2b

Browse files
committed
Removed vcl styles utils units
Updated copyright banner Format spurce code
1 parent da95021 commit b9d4a2b

107 files changed

Lines changed: 9295 additions & 45454 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Main.dfm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ object FrmMain: TFrmMain
9292
object TabSheet2: TTabSheet
9393
Caption = 'Log'
9494
ImageIndex = 35
95+
ExplicitLeft = 0
96+
ExplicitTop = 0
97+
ExplicitWidth = 0
98+
ExplicitHeight = 0
9599
object MemoLog: TMemo
96100
Left = 0
97101
Top = 0
@@ -239,7 +243,7 @@ object FrmMain: TFrmMain
239243
Left = 423
240244
Top = 198
241245
Bitmap = {
242-
494C010157005900040010001000FFFFFFFF2110FFFFFFFFFFFFFFFF424D3600
246+
494C0101570059000C0010001000FFFFFFFF2110FFFFFFFFFFFFFFFF424D3600
243247
0000000000003600000028000000400000006001000001002000000000000060
244248
010000000000000000000000000000000000050505060D0D0D0E1919191A2525
245249
25262F2F2F30323232338D8D8D8FB0BCAFCCB0BCAFCC8D8D8D8F323232333232

Main.pas

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// The Original Code is Main.pas.
1616
//
1717
// The Initial Developer of the Original Code is Rodrigo Ruz V.
18-
// Portions created by Rodrigo Ruz V. are Copyright (C) 2011-2015 Rodrigo Ruz V.
18+
// Portions created by Rodrigo Ruz V. are Copyright (C) 2011-2019 Rodrigo Ruz V.
1919
// All Rights Reserved.
2020
//
2121
// **************************************************************************************************
@@ -29,7 +29,7 @@ interface
2929
Dialogs, StdCtrls, ComCtrls, ExtCtrls, Rtti, Generics.Collections, uHostsAdmin,
3030
SynEdit, ImgList, ToolWin, uSettings, Menus, Buttons, Vcl.Styles.ColorTabs,
3131
Vcl.PlatformDefaultStyleActnCtrls, Vcl.ActnPopup, Vcl.ActnList, Vcl.ActnMan,
32-
System.Actions;
32+
System.Actions, System.ImageList;
3333

3434
type
3535
TFrmMain = class(TForm)
@@ -82,7 +82,8 @@ TFrmMain = class(TForm)
8282
procedure ActionDisconnectUpdate(Sender: TObject);
8383
procedure ToolButton1Click(Sender: TObject);
8484
procedure ToolButtonExitClick(Sender: TObject);
85-
procedure TreeViewTasksCustomDrawItem(Sender: TCustomTreeView; Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
85+
procedure TreeViewTasksCustomDrawItem(Sender: TCustomTreeView; Node: TTreeNode; State: TCustomDrawState;
86+
var DefaultDraw: Boolean);
8687
private
8788
FSettings: TSettings;
8889
FCtx: TRttiContext;
@@ -546,7 +547,8 @@ procedure TFrmMain.TreeViewTasksChange(Sender: TObject; Node: TTreeNode);
546547

547548
end;
548549

549-
procedure TFrmMain.TreeViewTasksCustomDrawItem(Sender: TCustomTreeView; Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
550+
procedure TFrmMain.TreeViewTasksCustomDrawItem(Sender: TCustomTreeView; Node: TTreeNode; State: TCustomDrawState;
551+
var DefaultDraw: Boolean);
550552
begin
551553
if not StyleServices.IsSystemStyle then
552554
if cdsSelected in State then

Units/Misc/uComboBox.pas

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//**************************************************************************************************
1+
// **************************************************************************************************
22
//
33
// Unit uComboBox
44
// unit for the WMI Delphi Code Creator
@@ -15,10 +15,10 @@
1515
// The Original Code is uComboBox.pas.
1616
//
1717
// The Initial Developer of the Original Code is Rodrigo Ruz V.
18-
// Portions created by Rodrigo Ruz V. are Copyright (C) 2011-2015 Rodrigo Ruz V.
18+
// Portions created by Rodrigo Ruz V. are Copyright (C) 2011-2019 Rodrigo Ruz V.
1919
// All Rights Reserved.
2020
//
21-
//**************************************************************************************************
21+
// **************************************************************************************************
2222

2323
unit uComboBox;
2424

@@ -41,11 +41,9 @@ TComboBox = class(StdCtrls.TComboBox)
4141
constructor Create(AOwner: TComponent); override;
4242
property ItemWidth: integer Read FItemWidth Write FItemWidth;
4343
published
44-
property DropDownFixedWidth: integer Read FDropDownFixedWidth
45-
Write SetDropDownFixedWidth;
44+
property DropDownFixedWidth: integer Read FDropDownFixedWidth Write SetDropDownFixedWidth;
4645
end;
4746

48-
4947
implementation
5048

5149
uses

Units/Misc/uCustomImageDrawHook.pas

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//**************************************************************************************************
1+
// **************************************************************************************************
22
//
33
// Unit uCustomImageDrawHook
44
// unit for the WMI Delphi Code Creator
@@ -15,12 +15,10 @@
1515
// The Original Code is uCustomImageDrawHook.pas.
1616
//
1717
// The Initial Developer of the Original Code is Rodrigo Ruz V.
18-
// Portions created by Rodrigo Ruz V. are Copyright (C) 2011-2015 Rodrigo Ruz V.
18+
// Portions created by Rodrigo Ruz V. are Copyright (C) 2011-2019 Rodrigo Ruz V.
1919
// All Rights Reserved.
2020
//
21-
//**************************************************************************************************
22-
23-
21+
// **************************************************************************************************
2422

2523
unit uCustomImageDrawHook;
2624

@@ -43,15 +41,15 @@ implementation
4341
PXRedirCode = ^TXRedirCode;
4442

4543
TXRedirCode = packed record
46-
Jump: byte;
44+
Jump: byte;
4745
Offset: TJumpOfs;
4846
end;
4947

5048
PAbsoluteIndirectJmp = ^TAbsoluteIndirectJmp;
5149

5250
TAbsoluteIndirectJmp = packed record
5351
OpCode: word;
54-
Addr: PPointer;
52+
Addr: PPointer;
5553
end;
5654

5755
TCustomImageListClass = class(TCustomImageList);
@@ -63,8 +61,7 @@ function GetActualAddr(Proc: Pointer): Pointer;
6361
begin
6462
if Proc <> nil then
6563
begin
66-
if (Win32Platform = VER_PLATFORM_WIN32_NT) and
67-
(PAbsoluteIndirectJmp(Proc).OpCode = $25FF) then
64+
if (Win32Platform = VER_PLATFORM_WIN32_NT) and (PAbsoluteIndirectJmp(Proc).OpCode = $25FF) then
6865
Result := PAbsoluteIndirectJmp(Proc).Addr^
6966
else
7067
Result := Proc;
@@ -75,14 +72,14 @@ function GetActualAddr(Proc: Pointer): Pointer;
7572

7673
procedure HookProc(Proc, Dest: Pointer; var BackupCode: TXRedirCode);
7774
var
78-
lpNumberOfBytesRead: SIZE_T;
75+
lpNumberOfBytesRead: SIZE_T;
7976
Code: TXRedirCode;
8077
begin
8178
Proc := GetActualAddr(Proc);
8279
Assert(Proc <> nil);
8380
if ReadProcessMemory(GetCurrentProcess, Proc, @BackupCode, SizeOf(BackupCode), lpNumberOfBytesRead) then
8481
begin
85-
Code.Jump := $E9;
82+
Code.Jump := $E9;
8683
Code.Offset := PAnsiChar(Dest) - PAnsiChar(Proc) - SizeOf(Code);
8784
WriteProcessMemory(GetCurrentProcess, Proc, @Code, SizeOf(Code), lpNumberOfBytesRead);
8885
end;
@@ -101,7 +98,7 @@ procedure UnhookProc(Proc: Pointer; var BackupCode: TXRedirCode);
10198
end;
10299
end;
103100

104-
procedure DoDrawGrayImage(hdcDst: HDC; himl: HIMAGELIST; ImageIndex, X, Y: Integer);
101+
procedure DoDrawGrayImage(hdcDst: HDC; himl: HIMAGELIST; ImageIndex, X, Y: integer);
105102
var
106103
pimldp: TImageListDrawParams;
107104
begin
@@ -111,13 +108,11 @@ procedure DoDrawGrayImage(hdcDst: HDC; himl: HIMAGELIST; ImageIndex, X, Y: Integ
111108
pimldp.hdcDst := hdcDst;
112109
pimldp.himl := himl;
113110
pimldp.i := ImageIndex;
114-
pimldp.x := X;
115-
pimldp.y := Y;
111+
pimldp.X := X;
112+
pimldp.Y := Y;
116113
ImageList_DrawIndirect(@pimldp);
117114
end;
118115

119-
120-
121116
function GetRGBColor(Value: TColor): DWORD;
122117
begin
123118
Result := ColorToRGB(Value);
@@ -129,19 +124,17 @@ function GetRGBColor(Value: TColor): DWORD;
129124
end;
130125
end;
131126

132-
procedure New_Draw(Self: TObject; Index: integer; Canvas: TCanvas;
133-
X, Y: integer; Style: cardinal; Enabled: boolean);
127+
procedure New_Draw(Self: TObject; Index: integer; Canvas: TCanvas; X, Y: integer; Style: cardinal; Enabled: boolean);
134128
var
135-
LImageList : TCustomImageList;
129+
LImageList: TCustomImageList;
136130
begin
137-
LImageList:=TCustomImageListClass(Self);
131+
LImageList := TCustomImageListClass(Self);
138132
with TCustomImageListClass(Self) do
139133
begin
140134
if not HandleAllocated then
141135
Exit;
142136
if Enabled then
143-
ImageList_DrawEx(Handle, Index, Canvas.Handle, X, Y, 0, 0,
144-
GetRGBColor(BkColor), GetRGBColor(BlendColor), Style)
137+
ImageList_DrawEx(Handle, Index, Canvas.Handle, X, Y, 0, 0, GetRGBColor(BkColor), GetRGBColor(BlendColor), Style)
145138
else
146139
DoDrawGrayImage(Canvas.Handle, LImageList.Handle, Index, X, Y);
147140
end;
@@ -157,10 +150,12 @@ procedure UnHookDraw;
157150
UnhookProc(@TCustomImageListClass.DoDraw, DoDrawBackup);
158151
end;
159152

160-
161153
initialization
162-
HookDraw;
154+
155+
HookDraw;
163156

164157
finalization
165-
UnHookDraw;
158+
159+
UnHookDraw;
160+
166161
end.

Units/Misc/uListView_Helper.pas

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//**************************************************************************************************
1+
// **************************************************************************************************
22
//
33
// Unit uListView_Helper
44
// unit for the WMI Delphi Code Creator
@@ -15,10 +15,10 @@
1515
// The Original Code is uListView_Helper.pas.
1616
//
1717
// The Initial Developer of the Original Code is Rodrigo Ruz V.
18-
// Portions created by Rodrigo Ruz V. are Copyright (C) 2011-2015 Rodrigo Ruz V.
18+
// Portions created by Rodrigo Ruz V. are Copyright (C) 2011-2019 Rodrigo Ruz V.
1919
// All Rights Reserved.
2020
//
21-
//**************************************************************************************************
21+
// **************************************************************************************************
2222

2323
unit uListView_Helper;
2424

@@ -31,55 +31,51 @@ interface
3131
const
3232
LVSCW_AUTOSIZE_BESTFIT = -3;
3333

34-
procedure AutoResizeColumn(const Column: TListColumn; const Mode: integer = LVSCW_AUTOSIZE_BESTFIT);
35-
procedure AutoResizeColumns(const Columns: array of TListColumn; const Mode: integer = LVSCW_AUTOSIZE_BESTFIT);
36-
procedure AutoResizeListView(const ListView: TListView; const Mode: integer = LVSCW_AUTOSIZE_BESTFIT);
37-
34+
procedure AutoResizeColumn(const Column: TListColumn; const Mode: integer = LVSCW_AUTOSIZE_BESTFIT);
35+
procedure AutoResizeColumns(const Columns: array of TListColumn; const Mode: integer = LVSCW_AUTOSIZE_BESTFIT);
36+
procedure AutoResizeListView(const ListView: TListView; const Mode: integer = LVSCW_AUTOSIZE_BESTFIT);
3837

3938
implementation
4039

4140
uses
4241
System.Classes,
4342
Winapi.Windows;
4443

45-
46-
procedure AutoResizeColumn(const Column: TListColumn;
47-
const Mode: integer = LVSCW_AUTOSIZE_BESTFIT);
44+
procedure AutoResizeColumn(const Column: TListColumn; const Mode: integer = LVSCW_AUTOSIZE_BESTFIT);
4845
var
4946
LWidth: integer;
5047
begin
5148
case Mode of
5249
LVSCW_AUTOSIZE_BESTFIT:
53-
begin
54-
Column.Width := LVSCW_AUTOSIZE;
55-
LWidth := Column.Width;
56-
Column.Width := LVSCW_AUTOSIZE_USEHEADER;
57-
if LWidth > Column.Width then
50+
begin
5851
Column.Width := LVSCW_AUTOSIZE;
59-
end;
52+
LWidth := Column.Width;
53+
Column.Width := LVSCW_AUTOSIZE_USEHEADER;
54+
if LWidth > Column.Width then
55+
Column.Width := LVSCW_AUTOSIZE;
56+
end;
6057

61-
LVSCW_AUTOSIZE: Column.Width := LVSCW_AUTOSIZE;
62-
LVSCW_AUTOSIZE_USEHEADER: Column.Width := LVSCW_AUTOSIZE_USEHEADER;
58+
LVSCW_AUTOSIZE:
59+
Column.Width := LVSCW_AUTOSIZE;
60+
LVSCW_AUTOSIZE_USEHEADER:
61+
Column.Width := LVSCW_AUTOSIZE_USEHEADER;
6362
end;
6463
end;
6564

66-
procedure AutoResizeColumns(const Columns: array of TListColumn;
67-
const Mode: integer = LVSCW_AUTOSIZE_BESTFIT);
65+
procedure AutoResizeColumns(const Columns: array of TListColumn; const Mode: integer = LVSCW_AUTOSIZE_BESTFIT);
6866
var
6967
LIndex: integer;
7068
begin
7169
for LIndex := Low(Columns) to High(Columns) do
7270
AutoResizeColumn(Columns[LIndex], Mode);
7371
end;
7472

75-
procedure AutoResizeListView(const ListView: TListView;
76-
const Mode: integer = LVSCW_AUTOSIZE_BESTFIT);
73+
procedure AutoResizeListView(const ListView: TListView; const Mode: integer = LVSCW_AUTOSIZE_BESTFIT);
7774
var
7875
LIndex: integer;
7976
begin
8077
for LIndex := 0 to ListView.Columns.Count - 1 do
8178
AutoResizeColumn(ListView.Columns[LIndex], Mode);
8279
end;
8380

84-
8581
end.

0 commit comments

Comments
 (0)