Skip to content

Commit 851f5c1

Browse files
committed
Providing backwards theme compatibility
1 parent f14e7fd commit 851f5c1

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

Source/Design/PythonTools.Design.dfm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ object DesignForm: TDesignForm
1010
Font.Height = -12
1111
Font.Name = 'Segoe UI'
1212
Font.Style = []
13+
OldCreateOrder = True
1314
PixelsPerInch = 96
1415
TextHeight = 15
1516
end

Source/Design/PythonTools.Design.pas

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{$I PythonTools.inc}
12
unit PythonTools.Design;
23

34
interface
@@ -7,10 +8,13 @@ interface
78
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, ToolsAPI;
89

910
type
10-
TDesignForm = class(TForm, INTAIDEThemingServicesNotifier)
11+
TDesignForm = class(TForm {$IFDEF DELPHI10_2_UP}, INTAIDEThemingServicesNotifier{$ENDIF DELPHI10_2_UP})
1112
private
13+
{$IFDEF DELPHI10_2_UP}
1214
FIDEThemingNotifierId: integer;
15+
{$ENDIF DELPHI10_2_UP}
1316
private
17+
{$IFDEF DELPHI10_2_UP}
1418
//IOTANotifier
1519
procedure AfterSave;
1620
procedure BeforeSave;
@@ -19,6 +23,7 @@ TDesignForm = class(TForm, INTAIDEThemingServicesNotifier)
1923
//INTAIDEThemingServicesNotifier
2024
procedure ChangingTheme();
2125
procedure ChangedTheme();
26+
{$ENDIF DELPHI10_2_UP}
2227
protected
2328
procedure RegisterIDEThemingNotifier();
2429
procedure UnRegisterIDEThemingNotifier();
@@ -40,11 +45,17 @@ implementation
4045
constructor TDesignForm.Create(AOwner: TComponent);
4146
begin
4247
inherited;
48+
{$IFDEF DELPHI10_2_UP}
49+
{$IFDEF DELPHI10_4_UP}
4350
with (BorlandIDEServices as IOTAIDEThemingServices) do begin
51+
{$ELSE}
52+
with (BorlandIDEServices as IOTAIDEThemingServices250) do begin
53+
{$ENDIF DELPHI10_4_UP}
4454
RegisterFormClass(TCustomFormClass(Self.ClassType));
4555
ApplyIDETheming();
4656
RegisterIDEThemingNotifier();
4757
end;
58+
{$ENDIF DELPHI10_2_UP}
4859
end;
4960

5061
destructor TDesignForm.Destroy;
@@ -53,6 +64,8 @@ destructor TDesignForm.Destroy;
5364
inherited;
5465
end;
5566

67+
{$IFDEF DELPHI10_2_UP}
68+
5669
procedure TDesignForm.AfterSave;
5770
begin
5871
end;
@@ -78,25 +91,33 @@ procedure TDesignForm.ChangedTheme;
7891
ApplyIDETheming();
7992
end;
8093

94+
{$ENDIF DELPHI10_2_UP}
95+
8196
procedure TDesignForm.ApplyIDETheming;
8297
begin
98+
{$IFDEF DELPHI10_2_UP}
8399
with (BorlandIDEServices as IOTAIDEThemingServices) do begin
84100
ApplyTheme(Self);
85101
end;
102+
{$ENDIF DELPHI10_2_UP}
86103
end;
87104

88105
procedure TDesignForm.RegisterIDEThemingNotifier;
89106
begin
107+
{$IFDEF DELPHI10_2_UP}
90108
with (BorlandIDEServices as IOTAIDEThemingServices) do begin
91109
FIDEThemingNotifierId := AddNotifier(Self);
92110
end;
111+
{$ENDIF DELPHI10_2_UP}
93112
end;
94113

95114
procedure TDesignForm.UnRegisterIDEThemingNotifier;
96115
begin
116+
{$IFDEF DELPHI10_2_UP}
97117
with (BorlandIDEServices as IOTAIDEThemingServices) do begin
98118
RemoveNotifier(FIDEThemingNotifierId);
99119
end;
120+
{$ENDIF DELPHI10_2_UP}
100121
end;
101122

102123
end.

0 commit comments

Comments
 (0)