Skip to content

Commit 6489910

Browse files
committed
Added support for DXE7
1 parent f5a947f commit 6489910

17 files changed

+262
-1442
lines changed

delphi-ide-theme-editor/Common/Vcl Styles Utils/KOLDetours.pas

Lines changed: 0 additions & 1241 deletions
This file was deleted.

delphi-ide-theme-editor/Common/Vcl Styles Utils/Vcl.Styles.FormStyleHooks.pas

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ TFormStyleHookHelper = class helper for TFormStyleHook
155155
function _GetIconFast: TIcon;
156156
procedure _ChangeSize;
157157
function _NormalizePoint(P: TPoint): TPoint;
158+
function _GetHitTest(P: TPoint): Integer;
158159
end;
159160

160161
function RectVCenter(var R: TRect; Bounds: TRect): TRect;
@@ -1392,6 +1393,11 @@ function TFormStyleHookHelper._GetBorderSize: TRect;
13921393
Result:=Self.GetBorderSize;
13931394
end;
13941395

1396+
function TFormStyleHookHelper._GetHitTest(P: TPoint): Integer;
1397+
begin
1398+
result:= Self.GetHitTest(P);
1399+
end;
1400+
13951401
function TFormStyleHookHelper._GetIconFast: TIcon;
13961402
begin
13971403
Result:=Self.GetIconFast;

delphi-ide-theme-editor/Common/Vcl Styles Utils/Vcl.Styles.NC.pas

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,15 @@ TNCControls = class(TComponent)
4949
FStyleServices : TCustomStyleServices;
5050
FVisible: Boolean;
5151
FForm : TCustomForm;
52+
FShowSystemMenu: Boolean;
5253
function GetStyleServices: TCustomStyleServices;
5354
procedure SetStyleServices(const Value: TCustomStyleServices);
5455
procedure SetVisible(const Value: Boolean);
5556
public
5657
property List : TListNCButtons read FList;
5758
property StyleServices : TCustomStyleServices read GetStyleServices write SetStyleServices;
5859
property Visible : Boolean read FVisible write SetVisible;
60+
property ShowSystemMenu : Boolean read FShowSystemMenu write FShowSystemMenu;
5961
constructor Create(AOwner: TComponent);override;
6062
destructor Destroy; override;
6163
end;
@@ -128,6 +130,7 @@ TFormStyleNCControls = class(TFormStyleHook)
128130
procedure WMNCLButtonDown(var Message: TWMNCHitMessage); message WM_NCLBUTTONDOWN;
129131
procedure WMNCLButtonUp(var Message: TWMNCHitMessage); message WM_NCLBUTTONUP;
130132
procedure WMNCLButtonDblClk(var Message: TWMNCHitMessage); message WM_NCLBUTTONDBLCLK;
133+
procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST;
131134
procedure PaintNCControls(Canvas: TCanvas; ARect : TRect);
132135
procedure PaintNC(Canvas: TCanvas); override;
133136
strict protected
@@ -143,6 +146,13 @@ TFormStyleNCControls = class(TFormStyleHook)
143146
end;
144147

145148

149+
{
150+
TODO
151+
add more buttons styles (colors, gradient, glow, link)
152+
add hot effects (glow, menu sel)
153+
add support for TAction
154+
}
155+
146156
implementation
147157

148158
uses
@@ -197,6 +207,7 @@ constructor TNCControls.Create(AOwner: TComponent);
197207
FList :=TListNCButtons.Create(True);
198208
FStyleServices:=nil;
199209
FVisible:=True;
210+
FShowSystemMenu:=True;
200211
if not IsStyleHookRegistered(AOwner.ClassType, TFormStyleNCControls) then
201212
TStyleManager.Engine.RegisterStyleHook(AOwner.ClassType, TFormStyleNCControls);
202213
FForm.Perform(CM_RECREATEWND, 0, 0);
@@ -290,8 +301,6 @@ procedure TNCButton.DrawControlText(Canvas: TCanvas; Details: TThemedElementDeta
290301
end;
291302
end;
292303

293-
294-
295304
procedure DoDrawGrayImage(hdcDst: HDC; himl: HIMAGELIST; ImageIndex, X, Y: Integer);
296305
var
297306
pimldp: TImageListDrawParams;
@@ -654,7 +663,38 @@ procedure TFormStyleNCControls.PaintNCControls(Canvas: TCanvas; ARect : TRect);
654663
end;
655664
end;
656665

666+
667+
procedure TFormStyleNCControls.WMNCHitTest(var Message: TWMNCHitTest);
668+
var
669+
P : TPoint;
670+
LHitTest : Integer;
671+
begin
672+
if (NCControls<>nil) and (NCControls.Visible) then
673+
begin
674+
{$IF CompilerVersion>23}
675+
if (TStyleManager.FormBorderStyle = fbsCurrentStyle) and (seBorder in Form.StyleElements) then
676+
{$IFEND}
677+
begin
678+
P := _NormalizePoint(Point(Message.XPos, Message.YPos));
679+
LHitTest := _GetHitTest(P);
680+
if (LHitTest<>HTSYSMENU) or ((LHitTest=HTSYSMENU) and NCControls.ShowSystemMenu) then
681+
begin
682+
Message.Result := LHitTest;
683+
Handled := True;
684+
end
685+
else
686+
begin
687+
Message.Result := WM_NULL;
688+
Handled := True;
689+
end;
690+
end;
691+
end
692+
else
693+
inherited;
694+
end;
695+
657696
//Avoid maximize or restore on DblClk
697+
658698
procedure TFormStyleNCControls.WMNCLButtonDblClk(var Message: TWMNCHitMessage);
659699
var
660700
P : TPoint;
@@ -778,7 +818,7 @@ procedure TFormStyleNCControls.WMNCMouseMove(var Message: TWMNCHitMessage);
778818
end;
779819
{$IFEND}
780820

781-
if ((Message.HitTest = HTTOP) or (Message.HitTest = HTCAPTION)) and PointInButton(P) then
821+
if ((Message.HitTest = HTTOP) or (Message.HitTest = HTCAPTION) or (not NCControls.ShowSystemMenu and (Message.HitTest = HTSYSMENU) )) and PointInButton(P) then
782822
begin
783823
if FHotNCBtnIndex <> GetButtonIndex(P) then
784824
begin
@@ -866,7 +906,8 @@ procedure TFormStyleNCControls.PaintNC(Canvas: TCanvas);
866906
CaptionDetails := Details;
867907

868908
//icon
869-
if (biSystemMenu in TCustomFormClass(Form).BorderIcons) and
909+
if ((NCControls<>nil) and NCControls.ShowSystemMenu) and
910+
(biSystemMenu in TCustomFormClass(Form).BorderIcons) and
870911
(Form.BorderStyle <> bsDialog) and
871912
(Form.BorderStyle <> bsToolWindow) and
872913
(Form.BorderStyle <> bsSizeToolWin) then

delphi-ide-theme-editor/Common/Vcl Styles Utils/Vcl.Styles.OwnerDrawFix.pas

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ procedure TVclStylesOwnerDrawFix.ListViewDrawItem(Sender: TCustomListView;
125125
LColor : TColor;
126126
ImageSize : Integer;
127127
begin
128-
ImageSize:=0;
129128
LStyles:=StyleServices;
130129
if not LStyles.GetElementColor(LStyles.GetElementDetails(ttItemNormal), ecTextColor, LColor) or (LColor = clNone) then
131130
LColor := LStyles.GetSystemColor(clWindowText);

delphi-ide-theme-editor/DITE.dpr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ uses
3636
Vcl.Styles.Ext in 'Common\Vcl Styles Utils\Vcl.Styles.Ext.pas',
3737
Vcl.Styles.Fixes in 'Common\Vcl Styles Utils\Vcl.Styles.Fixes.pas',
3838
Vcl.Styles.Hooks in 'Common\Vcl Styles Utils\Vcl.Styles.Hooks.pas',
39-
Vcl.Styles.OwnerDrawFix in 'Common\Vcl Styles Utils\Vcl.Styles.OwnerDrawFix.pas',
4039
Vcl.Styles.Utils.ComCtrls in 'Common\Vcl Styles Utils\Vcl.Styles.Utils.ComCtrls.pas',
4140
Vcl.Styles.Utils.Forms in 'Common\Vcl Styles Utils\Vcl.Styles.Utils.Forms.pas',
4241
Vcl.Styles.Utils.Menus in 'Common\Vcl Styles Utils\Vcl.Styles.Utils.Menus.pas',
@@ -48,7 +47,8 @@ uses
4847
DDetours in 'Common\delphi-detours-library\DDetours.pas',
4948
InstDecode in 'Common\delphi-detours-library\InstDecode.pas',
5049
Vcl.Styles.FormStyleHooks in 'Common\Vcl Styles Utils\Vcl.Styles.FormStyleHooks.pas',
51-
Vcl.Styles.NC in 'Common\Vcl Styles Utils\Vcl.Styles.NC.pas';
50+
Vcl.Styles.NC in 'Common\Vcl Styles Utils\Vcl.Styles.NC.pas',
51+
Vcl.Styles.OwnerDrawFix in 'Common\Vcl Styles Utils\Vcl.Styles.OwnerDrawFix.pas';
5252

5353
{$R *.res}
5454

delphi-ide-theme-editor/DITE.dproj

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,14 @@
108108
<DCC_DebugInformation>false</DCC_DebugInformation>
109109
</PropertyGroup>
110110
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
111-
<VerInfo_Release>1</VerInfo_Release>
111+
<VerInfo_Release>5</VerInfo_Release>
112112
<DCC_DebugInformation>true</DCC_DebugInformation>
113113
<DCC_MapFile>3</DCC_MapFile>
114114
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
115115
<VerInfo_MinorVer>7</VerInfo_MinorVer>
116116
<VerInfo_Build>0</VerInfo_Build>
117117
<DCC_UNIT_PLATFORM>false</DCC_UNIT_PLATFORM>
118-
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.7.1.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
118+
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.7.5.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
119119
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
120120
</PropertyGroup>
121121
<ItemGroup>
@@ -158,7 +158,6 @@
158158
<DCCReference Include="Common\Vcl Styles Utils\Vcl.Styles.Ext.pas"/>
159159
<DCCReference Include="Common\Vcl Styles Utils\Vcl.Styles.Fixes.pas"/>
160160
<DCCReference Include="Common\Vcl Styles Utils\Vcl.Styles.Hooks.pas"/>
161-
<DCCReference Include="Common\Vcl Styles Utils\Vcl.Styles.OwnerDrawFix.pas"/>
162161
<DCCReference Include="Common\Vcl Styles Utils\Vcl.Styles.Utils.ComCtrls.pas"/>
163162
<DCCReference Include="Common\Vcl Styles Utils\Vcl.Styles.Utils.Forms.pas"/>
164163
<DCCReference Include="Common\Vcl Styles Utils\Vcl.Styles.Utils.Menus.pas"/>
@@ -171,6 +170,7 @@
171170
<DCCReference Include="Common\delphi-detours-library\InstDecode.pas"/>
172171
<DCCReference Include="Common\Vcl Styles Utils\Vcl.Styles.FormStyleHooks.pas"/>
173172
<DCCReference Include="Common\Vcl Styles Utils\Vcl.Styles.NC.pas"/>
173+
<DCCReference Include="Common\Vcl Styles Utils\Vcl.Styles.OwnerDrawFix.pas"/>
174174
<BuildConfiguration Include="Release">
175175
<Key>Cfg_2</Key>
176176
<CfgParent>Base</CfgParent>
@@ -196,7 +196,7 @@
196196
<VersionInfo Name="MajorVer">1</VersionInfo>
197197
<VersionInfo Name="MinorVer">0</VersionInfo>
198198
<VersionInfo Name="Release">0</VersionInfo>
199-
<VersionInfo Name="Build">308</VersionInfo>
199+
<VersionInfo Name="Build">309</VersionInfo>
200200
<VersionInfo Name="Debug">False</VersionInfo>
201201
<VersionInfo Name="PreRelease">False</VersionInfo>
202202
<VersionInfo Name="Special">False</VersionInfo>
@@ -208,7 +208,7 @@
208208
<VersionInfoKeys>
209209
<VersionInfoKeys Name="CompanyName">TheRoadToDelphi</VersionInfoKeys>
210210
<VersionInfoKeys Name="FileDescription"/>
211-
<VersionInfoKeys Name="FileVersion">1.0.0.308</VersionInfoKeys>
211+
<VersionInfoKeys Name="FileVersion">1.0.0.309</VersionInfoKeys>
212212
<VersionInfoKeys Name="InternalName"/>
213213
<VersionInfoKeys Name="LegalCopyright">Rodrigo Ruz V. 2011</VersionInfoKeys>
214214
<VersionInfoKeys Name="LegalTrademarks"/>
@@ -337,3 +337,11 @@
337337
</ProjectExtensions>
338338
<Import Condition="Exists('$(MSBuildProjectName).deployproj')" Project="$(MSBuildProjectName).deployproj"/>
339339
</Project>
340+
341+
<!-- EurekaLog First Line
342+
[Exception Log]
343+
EurekaLog Version=7001
344+
Activate=0
345+
DeleteMapAfterCompile=1
346+
Encrypt Password=""
347+
EurekaLog Last Line -->

delphi-ide-theme-editor/DITE.res

0 Bytes
Binary file not shown.
21 KB
Binary file not shown.

delphi-ide-theme-editor/DelphiIDEThemeEditor.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1917,7 +1917,7 @@ AppPublisherURL=http://theroadtodelphi.wordpress.com/
19171917
AppSupportURL=http://theroadtodelphi.wordpress.com/
19181918
AppUpdatesURL=http://theroadtodelphi.wordpress.com/
19191919
DefaultDirName={pf}\The Road To Delphi\Delphi IDE Theme Editor
1920-
OutputDir=C:\Delphi\google-code\DITE\delphi-ide-theme-editor
1920+
;OutputDir=C:\Delphi\google-code\DITE\delphi-ide-theme-editor
19211921
OutputBaseFileName=Setup_DelphiIDEThemeEditor
19221922
DisableDirPage=false
19231923
Compression=lzma

0 commit comments

Comments
 (0)