فهرست منبع

Add the GUI for the new option. Rename it, because it also keeps working (in the background) even if OpenIncludedFiles is off (like everything else related to known include files).

Update whatsnew.
Martijn Laan 2 روز پیش
والد
کامیت
8bb805e495
4فایلهای تغییر یافته به همراه39 افزوده شده و 27 حذف شده
  1. 6 4
      Projects/Src/IDE.MainForm.pas
  2. 31 23
      Projects/Src/IDE.OptionsForm.dfm
  3. 1 0
      Projects/Src/IDE.OptionsForm.pas
  4. 1 0
      whatsnew.htm

+ 6 - 4
Projects/Src/IDE.MainForm.pas

@@ -143,7 +143,7 @@ type
     ThemeType: TThemeType;
     ShowPreprocessorOutput: Boolean;
     OpenIncludedFiles: Boolean;
-    OpenIncludedFilesHideNew: Boolean;
+    AutoHideNewIncludedFiles: Boolean;
     ShowCaretPosition: Boolean;
   end;
 
@@ -862,7 +862,7 @@ constructor TMainForm.Create(AOwner: TComponent);
       FOptions.GutterLineNumbers := Ini.ReadBool('Options', 'GutterLineNumbers', False);
       FOptions.ShowPreprocessorOutput := Ini.ReadBool('Options', 'ShowPreprocessorOutput', True);
       FOptions.OpenIncludedFiles := Ini.ReadBool('Options', 'OpenIncludedFiles', True);
-      FOptions.OpenIncludedFilesHideNew := Ini.ReadBool('Options', 'OpenIncludedFilesHideNew', False);
+      FOptions.AutoHideNewIncludedFiles := Ini.ReadBool('Options', 'AutoHideNewIncludedFiles', False);
       I := Ini.ReadInteger('Options', 'KeyMappingType', Ord(GetDefaultKeyMappingType));
       if (I >= 0) and (I <= Ord(High(TKeyMappingType))) then
         FOptions.KeyMappingType := TKeyMappingType(I);
@@ -2149,7 +2149,7 @@ begin
           Form.FPreprocessorOutput := TrimRight(Data.PreprocessedScript);
           { Also stores last write time }
           DecodeIncludedFilenames(Data.IncludedFilenames, Form.FIncludedFiles,
-            Form.FOptions.OpenIncludedFilesHideNew, Form.FHiddenFiles);
+            Form.FOptions.AutoHideNewIncludedFiles, Form.FHiddenFiles);
           CleanHiddenFiles(Form.FIncludedFiles, Form.FHiddenFiles);
           Form.InvalidateStatusPanel(spHiddenFilesCount);
           Form.BuildAndSaveKnownIncludedAndHiddenFiles;
@@ -3808,6 +3808,7 @@ begin
     OptionsForm.GutterLineNumbersCheck.Checked := FOptions.GutterLineNumbers;
     OptionsForm.ShowPreprocessorOutputCheck.Checked := FOptions.ShowPreprocessorOutput;
     OptionsForm.OpenIncludedFilesCheck.Checked := FOptions.OpenIncludedFiles;
+    OptionsForm.AutoHideNewIncludedFilesCheck.Checked := FOptions.AutoHideNewIncludedFiles;
     OptionsForm.KeyMappingComboBox.ItemIndex := Ord(FOptions.KeyMappingType);
     OptionsForm.MemoKeyMappingComboBox.ItemIndex := Ord(FOptions.MemoKeyMappingType);
     OptionsForm.ThemeComboBox.ItemIndex := Ord(FOptions.ThemeType);
@@ -3844,6 +3845,7 @@ begin
     FOptions.GutterLineNumbers := OptionsForm.GutterLineNumbersCheck.Checked;
     FOptions.ShowPreprocessorOutput := OptionsForm.ShowPreprocessorOutputCheck.Checked;
     FOptions.OpenIncludedFiles := OptionsForm.OpenIncludedFilesCheck.Checked;
+    FOptions.AutoHideNewIncludedFiles := OptionsForm.AutoHideNewIncludedFilesCheck.Checked;
     FOptions.KeyMappingType := TKeyMappingType(OptionsForm.KeyMappingComboBox.ItemIndex);
     FOptions.MemoKeyMappingType := TIDEScintKeyMappingType(OptionsForm.MemoKeyMappingComboBox.ItemIndex);
     FOptions.ThemeType := TThemeType(OptionsForm.ThemeComboBox.ItemIndex);
@@ -3896,7 +3898,7 @@ begin
       Ini.WriteBool('Options', 'GutterLineNumbers', FOptions.GutterLineNumbers);
       Ini.WriteBool('Options', 'ShowPreprocessorOutput', FOptions.ShowPreprocessorOutput);
       Ini.WriteBool('Options', 'OpenIncludedFiles', FOptions.OpenIncludedFiles);
-      Ini.WriteBool('Options', 'OpenIncludedFilesHideNew', FOptions.OpenIncludedFilesHideNew);
+      Ini.WriteBool('Options', 'AutoHideNewIncludedFiles', FOptions.AutoHideNewIncludedFiles);
       Ini.WriteInteger('Options', 'KeyMappingType', Ord(FOptions.KeyMappingType));
       Ini.WriteInteger('Options', 'MemoKeyMappingType', Ord(FOptions.MemoKeyMappingType));
       Ini.WriteInteger('Options', 'ThemeType', Ord(FOptions.ThemeType)); { Also see Destroy }

+ 31 - 23
Projects/Src/IDE.OptionsForm.dfm

@@ -23,7 +23,7 @@ object OptionsForm: TOptionsForm
     Left = 8
     Top = 8
     Width = 281
-    Height = 314
+    Height = 334
     Anchors = [akLeft, akTop, akBottom]
     Caption = ' Miscellaneous '
     TabOrder = 0
@@ -45,59 +45,59 @@ object OptionsForm: TOptionsForm
     end
     object AutosaveCheck: TCheckBox
       Left = 8
-      Top = 96
+      Top = 116
       Width = 265
       Height = 17
       Caption = 'Automatically sa&ve before compiling'
-      TabOrder = 4
+      TabOrder = 5
     end
     object BackupCheck: TCheckBox
       Left = 8
-      Top = 116
+      Top = 136
       Width = 265
       Height = 17
       Caption = 'Create &backups when saving'
-      TabOrder = 5
+      TabOrder = 6
     end
     object UndoAfterSaveCheck: TCheckBox
       Left = 8
-      Top = 136
+      Top = 156
       Width = 265
       Height = 17
       Caption = 'Allow &Undo after save'
-      TabOrder = 6
+      TabOrder = 7
     end
     object FullPathCheck: TCheckBox
       Left = 8
-      Top = 194
+      Top = 214
       Width = 265
       Height = 17
       Caption = 'Display &full path in title bar'
-      TabOrder = 9
+      TabOrder = 10
     end
     object PauseOnDebuggerExceptionsCheck: TCheckBox
       Left = 8
-      Top = 214
+      Top = 234
       Width = 265
       Height = 17
       Caption = '&Pause on exceptions'
-      TabOrder = 10
+      TabOrder = 11
     end
     object RunAsDifferentUserCheck: TCheckBox
       Left = 8
-      Top = 234
+      Top = 254
       Width = 265
       Height = 17
       Caption = 'Always &launch Setup/Uninstall as administrator'
-      TabOrder = 11
+      TabOrder = 12
     end
     object ColorizeCompilerOutputCheck: TCheckBox
       Left = 8
-      Top = 254
+      Top = 274
       Width = 265
       Height = 17
       Caption = 'Colori&ze "Compiler Output" view'
-      TabOrder = 12
+      TabOrder = 13
     end
     object OpenIncludedFilesCheck: TCheckBox
       Left = 8
@@ -117,36 +117,44 @@ object OptionsForm: TOptionsForm
     end
     object Label3: TNewStaticText
       Left = 8
-      Top = 281
+      Top = 301
       Width = 56
       Height = 14
       Caption = 'Menu &keys:'
       FocusControl = KeyMappingComboBox
-      TabOrder = 13
+      TabOrder = 14
     end
     object KeyMappingComboBox: TComboBox
       Left = 72
-      Top = 277
+      Top = 297
       Width = 201
       Height = 21
       Style = csDropDownList
-      TabOrder = 14
+      TabOrder = 15
     end
     object AutoreloadCheck: TCheckBox
       Left = 8
-      Top = 156
+      Top = 176
       Width = 265
       Height = 17
       Caption = 'Automatically reload files'
-      TabOrder = 7
+      TabOrder = 8
     end
     object UndoAfterReloadCheck: TCheckBox
       Left = 8
-      Top = 176
+      Top = 196
       Width = 265
       Height = 17
       Caption = 'Allow Undo after reload'
-      TabOrder = 8
+      TabOrder = 9
+    end
+    object AutoHideNewIncludedFilesCheck: TCheckBox
+      Left = 8
+      Top = 96
+      Width = 265
+      Height = 17
+      Caption = 'Keep new #include files closed'
+      TabOrder = 4
     end
   end
   object GroupBox3: TGroupBox

+ 1 - 0
Projects/Src/IDE.OptionsForm.pas

@@ -59,6 +59,7 @@ type
     ShowWhiteSpaceCheck: TCheckBox;
     AutoreloadCheck: TCheckBox;
     UndoAfterReloadCheck: TCheckBox;
+    AutoHideNewIncludedFilesCheck: TCheckBox;
     procedure AssocButtonClick(Sender: TObject);
     procedure ChangeFontButtonClick(Sender: TObject);
     procedure FormCreate(Sender: TObject);

+ 1 - 0
whatsnew.htm

@@ -123,6 +123,7 @@ For conditions of distribution and use, see <a href="files/is/license.txt">LICEN
     <li>Added autocomplete support in the <tt>[Setup]</tt> section for directive values with fixed options, such as all <tt>yes</tt>/<tt>no</tt> directives and others like <tt>WizardStyle</tt>.</li>
     <li>Ctrl+W now closes the current tab (in addition to Ctrl+F4), consistent with other modern editors. Previously, Ctrl+W was assigned to <i>Target Uninstall</i> in the <i>Run</i> menu, which is now reassigned to Alt+Q.</li>
     <li>The Compiler IDE now opens up to 50 #include files in tabs, instead of up to 20.</li>
+    <li>Added a new <i>Keep new #include files closed</i> option, Disabled by default. When enabled, newly discovered #include files during compilation remain closed until you explicitly reopen their tabs via, for example, the <i>View</i> menu.</li>
   </ul>
   </li>
   <li><i>Fix:</i> File and directory controls in Setup should always use left-to-right reading order, even when a right-to-left language is active, but this has not been the case since version 6.5.2.</li>