2
0
Эх сурвалжийг харах

Support older Delphi (2).

Martijn Laan 1 сар өмнө
parent
commit
583f0fab7c

+ 19 - 0
Projects/Src/IDE.HelperFunc.pas

@@ -131,6 +131,21 @@ begin
 end;
 end;
 
 
 function InitFormTheme(const Form: TForm): Boolean;
 function InitFormTheme(const Form: TForm): Boolean;
+
+{$IF CompilerVersion >= 36.0}
+  procedure HideGroupBoxFrames(const ParentControl: TWinControl);
+  begin
+    for var I := 0 to ParentControl.ControlCount-1 do begin
+      const Control = ParentControl.Controls[I];
+      if Control is TGroupBox then
+        (Control as TGroupBox).ShowFrame := False;
+
+      if Control is TWinControl then
+        HideGroupBoxFrames(Control as TWinControl);
+    end;
+  end;
+{$ENDIF}
+
 { Assumes forms other then MainForm call this function only once during creation, and assumes they
 { Assumes forms other then MainForm call this function only once during creation, and assumes they
   don't need any styling if the theme is non dark. Always styles MainForm. Returns True if it did
   don't need any styling if the theme is non dark. Always styles MainForm. Returns True if it did
   style, False otherwise. }
   style, False otherwise. }
@@ -149,6 +164,10 @@ begin
       DwmSetWindowAttribute(Form.Handle, DWMWA_USE_IMMERSIVE_DARK_MODE, @value, SizeOf(value));
       DwmSetWindowAttribute(Form.Handle, DWMWA_USE_IMMERSIVE_DARK_MODE, @value, SizeOf(value));
     end;
     end;
   end;
   end;
+
+{$IF CompilerVersion >= 36.0}
+  HideGroupBoxFrames(Form);
+{$ENDIF}
 end;
 end;
 
 
 function InitFormThemeGetBkColor(const WindowColor: Boolean): TColor;
 function InitFormThemeGetBkColor(const WindowColor: Boolean): TColor;

+ 0 - 6
Projects/Src/IDE.MsgBoxDesignerForm.dfm

@@ -103,7 +103,6 @@ object MsgBoxDesignerForm: TMsgBoxDesignerForm
     Height = 81
     Height = 81
     Anchors = [akLeft, akTop, akRight]
     Anchors = [akLeft, akTop, akRight]
     Caption = ' Message '
     Caption = ' Message '
-    ShowFrame = False
     TabOrder = 0
     TabOrder = 0
     DesignSize = (
     DesignSize = (
       532
       532
@@ -125,7 +124,6 @@ object MsgBoxDesignerForm: TMsgBoxDesignerForm
     Width = 240
     Width = 240
     Height = 60
     Height = 60
     Caption = ' Type'
     Caption = ' Type'
-    ShowFrame = False
     TabOrder = 6
     TabOrder = 6
     object cb_Suppressible: TCheckBox
     object cb_Suppressible: TCheckBox
       Left = 14
       Left = 14
@@ -165,7 +163,6 @@ object MsgBoxDesignerForm: TMsgBoxDesignerForm
     Height = 60
     Height = 60
     Anchors = [akLeft, akTop, akRight]
     Anchors = [akLeft, akTop, akRight]
     Caption = ' Flags '
     Caption = ' Flags '
-    ShowFrame = False
     TabOrder = 7
     TabOrder = 7
     object NewStaticText1: TNewStaticText
     object NewStaticText1: TNewStaticText
       Left = 14
       Left = 14
@@ -214,7 +211,6 @@ object MsgBoxDesignerForm: TMsgBoxDesignerForm
     Height = 174
     Height = 174
     Anchors = [akLeft, akTop, akBottom]
     Anchors = [akLeft, akTop, akBottom]
     Caption = ' Icon '
     Caption = ' Icon '
-    ShowFrame = False
     TabOrder = 8
     TabOrder = 8
     DesignSize = (
     DesignSize = (
       160
       160
@@ -422,7 +418,6 @@ object MsgBoxDesignerForm: TMsgBoxDesignerForm
     Height = 174
     Height = 174
     Anchors = [akLeft, akTop, akBottom]
     Anchors = [akLeft, akTop, akBottom]
     Caption = ' Buttons '
     Caption = ' Buttons '
-    ShowFrame = False
     TabOrder = 9
     TabOrder = 9
     DesignSize = (
     DesignSize = (
       169
       169
@@ -502,7 +497,6 @@ object MsgBoxDesignerForm: TMsgBoxDesignerForm
     Height = 174
     Height = 174
     Anchors = [akLeft, akTop, akBottom]
     Anchors = [akLeft, akTop, akBottom]
     Caption = ' Return values '
     Caption = ' Return values '
-    ShowFrame = False
     TabOrder = 10
     TabOrder = 10
     object cb_IDOK: TCheckBox
     object cb_IDOK: TCheckBox
       Left = 16
       Left = 16

+ 0 - 3
Projects/Src/IDE.OptionsForm.dfm

@@ -26,7 +26,6 @@ object OptionsForm: TOptionsForm
     Height = 314
     Height = 314
     Anchors = [akLeft, akTop, akBottom]
     Anchors = [akLeft, akTop, akBottom]
     Caption = ' Miscellaneous '
     Caption = ' Miscellaneous '
-    ShowFrame = False
     TabOrder = 0
     TabOrder = 0
     object StartupCheck: TCheckBox
     object StartupCheck: TCheckBox
       Left = 8
       Left = 8
@@ -141,7 +140,6 @@ object OptionsForm: TOptionsForm
     Height = 57
     Height = 57
     Anchors = [akLeft, akBottom]
     Anchors = [akLeft, akBottom]
     Caption = ' File Associations '
     Caption = ' File Associations '
-    ShowFrame = False
     TabOrder = 1
     TabOrder = 1
     DesignSize = (
     DesignSize = (
       281
       281
@@ -164,7 +162,6 @@ object OptionsForm: TOptionsForm
     Height = 372
     Height = 372
     Anchors = [akLeft, akTop, akBottom]
     Anchors = [akLeft, akTop, akBottom]
     Caption = ' Editor '
     Caption = ' Editor '
-    ShowFrame = False
     TabOrder = 2
     TabOrder = 2
     object AutoAutoCompleteCheck: TCheckBox
     object AutoAutoCompleteCheck: TCheckBox
       Left = 8
       Left = 8

+ 0 - 1
Projects/Src/IDE.SignToolsForm.dfm

@@ -25,7 +25,6 @@ object SignToolsForm: TSignToolsForm
     Height = 201
     Height = 201
     Anchors = [akLeft, akTop, akRight, akBottom]
     Anchors = [akLeft, akTop, akRight, akBottom]
     Caption = ' Sign Tools '
     Caption = ' Sign Tools '
-    ShowFrame = False
     TabOrder = 0
     TabOrder = 0
     DesignSize = (
     DesignSize = (
       561
       561

+ 0 - 2
Projects/Src/IDE.StartupForm.dfm

@@ -270,7 +270,6 @@ object StartupForm: TStartupForm
     Height = 61
     Height = 61
     Anchors = [akLeft, akTop, akRight]
     Anchors = [akLeft, akTop, akRight]
     Caption = ' New file '
     Caption = ' New file '
-    ShowFrame = False
     TabOrder = 0
     TabOrder = 0
     DesignSize = (
     DesignSize = (
       563
       563
@@ -313,7 +312,6 @@ object StartupForm: TStartupForm
     Height = 303
     Height = 303
     Anchors = [akLeft, akTop, akRight, akBottom]
     Anchors = [akLeft, akTop, akRight, akBottom]
     Caption = ' Open file '
     Caption = ' Open file '
-    ShowFrame = False
     TabOrder = 1
     TabOrder = 1
     DesignSize = (
     DesignSize = (
       563
       563

+ 0 - 2
Projects/Src/IDE.Wizard.WizardFileForm.dfm

@@ -60,7 +60,6 @@ object WizardFileForm: TWizardFileForm
     Width = 333
     Width = 333
     Height = 149
     Height = 149
     Caption = ' Destination '
     Caption = ' Destination '
-    ShowFrame = False
     TabOrder = 0
     TabOrder = 0
     object DestRootDirLabel: TNewStaticText
     object DestRootDirLabel: TNewStaticText
       Left = 12
       Left = 12
@@ -112,7 +111,6 @@ object WizardFileForm: TWizardFileForm
     Width = 333
     Width = 333
     Height = 93
     Height = 93
     Caption = ' Source '
     Caption = ' Source '
-    ShowFrame = False
     TabOrder = 3
     TabOrder = 3
     object SourceLabel: TNewStaticText
     object SourceLabel: TNewStaticText
       Left = 12
       Left = 12

+ 1 - 1
Projects/Src/Shared.TaskDialogFunc.pas

@@ -129,7 +129,7 @@ begin
 
 
   { Set ButtonIDs and TDCommonButtons }
   { Set ButtonIDs and TDCommonButtons }
   const NButtonLabelsAvailable = Length(ButtonLabels);
   const NButtonLabelsAvailable = Length(ButtonLabels);
-  var ButtonIDs: array of Integer;
+  var ButtonIDs: TArray<Integer>;
   var TDCommonButtons: Cardinal;
   var TDCommonButtons: Cardinal;
   case Buttons of
   case Buttons of
     MB_OK, MB_OKCANCEL:
     MB_OK, MB_OKCANCEL: