Browse Source

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 days ago
parent
commit
8bb805e495
4 changed files with 39 additions and 27 deletions
  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;
     ThemeType: TThemeType;
     ShowPreprocessorOutput: Boolean;
     ShowPreprocessorOutput: Boolean;
     OpenIncludedFiles: Boolean;
     OpenIncludedFiles: Boolean;
-    OpenIncludedFilesHideNew: Boolean;
+    AutoHideNewIncludedFiles: Boolean;
     ShowCaretPosition: Boolean;
     ShowCaretPosition: Boolean;
   end;
   end;
 
 
@@ -862,7 +862,7 @@ constructor TMainForm.Create(AOwner: TComponent);
       FOptions.GutterLineNumbers := Ini.ReadBool('Options', 'GutterLineNumbers', False);
       FOptions.GutterLineNumbers := Ini.ReadBool('Options', 'GutterLineNumbers', False);
       FOptions.ShowPreprocessorOutput := Ini.ReadBool('Options', 'ShowPreprocessorOutput', True);
       FOptions.ShowPreprocessorOutput := Ini.ReadBool('Options', 'ShowPreprocessorOutput', True);
       FOptions.OpenIncludedFiles := Ini.ReadBool('Options', 'OpenIncludedFiles', 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));
       I := Ini.ReadInteger('Options', 'KeyMappingType', Ord(GetDefaultKeyMappingType));
       if (I >= 0) and (I <= Ord(High(TKeyMappingType))) then
       if (I >= 0) and (I <= Ord(High(TKeyMappingType))) then
         FOptions.KeyMappingType := TKeyMappingType(I);
         FOptions.KeyMappingType := TKeyMappingType(I);
@@ -2149,7 +2149,7 @@ begin
           Form.FPreprocessorOutput := TrimRight(Data.PreprocessedScript);
           Form.FPreprocessorOutput := TrimRight(Data.PreprocessedScript);
           { Also stores last write time }
           { Also stores last write time }
           DecodeIncludedFilenames(Data.IncludedFilenames, Form.FIncludedFiles,
           DecodeIncludedFilenames(Data.IncludedFilenames, Form.FIncludedFiles,
-            Form.FOptions.OpenIncludedFilesHideNew, Form.FHiddenFiles);
+            Form.FOptions.AutoHideNewIncludedFiles, Form.FHiddenFiles);
           CleanHiddenFiles(Form.FIncludedFiles, Form.FHiddenFiles);
           CleanHiddenFiles(Form.FIncludedFiles, Form.FHiddenFiles);
           Form.InvalidateStatusPanel(spHiddenFilesCount);
           Form.InvalidateStatusPanel(spHiddenFilesCount);
           Form.BuildAndSaveKnownIncludedAndHiddenFiles;
           Form.BuildAndSaveKnownIncludedAndHiddenFiles;
@@ -3808,6 +3808,7 @@ begin
     OptionsForm.GutterLineNumbersCheck.Checked := FOptions.GutterLineNumbers;
     OptionsForm.GutterLineNumbersCheck.Checked := FOptions.GutterLineNumbers;
     OptionsForm.ShowPreprocessorOutputCheck.Checked := FOptions.ShowPreprocessorOutput;
     OptionsForm.ShowPreprocessorOutputCheck.Checked := FOptions.ShowPreprocessorOutput;
     OptionsForm.OpenIncludedFilesCheck.Checked := FOptions.OpenIncludedFiles;
     OptionsForm.OpenIncludedFilesCheck.Checked := FOptions.OpenIncludedFiles;
+    OptionsForm.AutoHideNewIncludedFilesCheck.Checked := FOptions.AutoHideNewIncludedFiles;
     OptionsForm.KeyMappingComboBox.ItemIndex := Ord(FOptions.KeyMappingType);
     OptionsForm.KeyMappingComboBox.ItemIndex := Ord(FOptions.KeyMappingType);
     OptionsForm.MemoKeyMappingComboBox.ItemIndex := Ord(FOptions.MemoKeyMappingType);
     OptionsForm.MemoKeyMappingComboBox.ItemIndex := Ord(FOptions.MemoKeyMappingType);
     OptionsForm.ThemeComboBox.ItemIndex := Ord(FOptions.ThemeType);
     OptionsForm.ThemeComboBox.ItemIndex := Ord(FOptions.ThemeType);
@@ -3844,6 +3845,7 @@ begin
     FOptions.GutterLineNumbers := OptionsForm.GutterLineNumbersCheck.Checked;
     FOptions.GutterLineNumbers := OptionsForm.GutterLineNumbersCheck.Checked;
     FOptions.ShowPreprocessorOutput := OptionsForm.ShowPreprocessorOutputCheck.Checked;
     FOptions.ShowPreprocessorOutput := OptionsForm.ShowPreprocessorOutputCheck.Checked;
     FOptions.OpenIncludedFiles := OptionsForm.OpenIncludedFilesCheck.Checked;
     FOptions.OpenIncludedFiles := OptionsForm.OpenIncludedFilesCheck.Checked;
+    FOptions.AutoHideNewIncludedFiles := OptionsForm.AutoHideNewIncludedFilesCheck.Checked;
     FOptions.KeyMappingType := TKeyMappingType(OptionsForm.KeyMappingComboBox.ItemIndex);
     FOptions.KeyMappingType := TKeyMappingType(OptionsForm.KeyMappingComboBox.ItemIndex);
     FOptions.MemoKeyMappingType := TIDEScintKeyMappingType(OptionsForm.MemoKeyMappingComboBox.ItemIndex);
     FOptions.MemoKeyMappingType := TIDEScintKeyMappingType(OptionsForm.MemoKeyMappingComboBox.ItemIndex);
     FOptions.ThemeType := TThemeType(OptionsForm.ThemeComboBox.ItemIndex);
     FOptions.ThemeType := TThemeType(OptionsForm.ThemeComboBox.ItemIndex);
@@ -3896,7 +3898,7 @@ begin
       Ini.WriteBool('Options', 'GutterLineNumbers', FOptions.GutterLineNumbers);
       Ini.WriteBool('Options', 'GutterLineNumbers', FOptions.GutterLineNumbers);
       Ini.WriteBool('Options', 'ShowPreprocessorOutput', FOptions.ShowPreprocessorOutput);
       Ini.WriteBool('Options', 'ShowPreprocessorOutput', FOptions.ShowPreprocessorOutput);
       Ini.WriteBool('Options', 'OpenIncludedFiles', FOptions.OpenIncludedFiles);
       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', 'KeyMappingType', Ord(FOptions.KeyMappingType));
       Ini.WriteInteger('Options', 'MemoKeyMappingType', Ord(FOptions.MemoKeyMappingType));
       Ini.WriteInteger('Options', 'MemoKeyMappingType', Ord(FOptions.MemoKeyMappingType));
       Ini.WriteInteger('Options', 'ThemeType', Ord(FOptions.ThemeType)); { Also see Destroy }
       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
     Left = 8
     Top = 8
     Top = 8
     Width = 281
     Width = 281
-    Height = 314
+    Height = 334
     Anchors = [akLeft, akTop, akBottom]
     Anchors = [akLeft, akTop, akBottom]
     Caption = ' Miscellaneous '
     Caption = ' Miscellaneous '
     TabOrder = 0
     TabOrder = 0
@@ -45,59 +45,59 @@ object OptionsForm: TOptionsForm
     end
     end
     object AutosaveCheck: TCheckBox
     object AutosaveCheck: TCheckBox
       Left = 8
       Left = 8
-      Top = 96
+      Top = 116
       Width = 265
       Width = 265
       Height = 17
       Height = 17
       Caption = 'Automatically sa&ve before compiling'
       Caption = 'Automatically sa&ve before compiling'
-      TabOrder = 4
+      TabOrder = 5
     end
     end
     object BackupCheck: TCheckBox
     object BackupCheck: TCheckBox
       Left = 8
       Left = 8
-      Top = 116
+      Top = 136
       Width = 265
       Width = 265
       Height = 17
       Height = 17
       Caption = 'Create &backups when saving'
       Caption = 'Create &backups when saving'
-      TabOrder = 5
+      TabOrder = 6
     end
     end
     object UndoAfterSaveCheck: TCheckBox
     object UndoAfterSaveCheck: TCheckBox
       Left = 8
       Left = 8
-      Top = 136
+      Top = 156
       Width = 265
       Width = 265
       Height = 17
       Height = 17
       Caption = 'Allow &Undo after save'
       Caption = 'Allow &Undo after save'
-      TabOrder = 6
+      TabOrder = 7
     end
     end
     object FullPathCheck: TCheckBox
     object FullPathCheck: TCheckBox
       Left = 8
       Left = 8
-      Top = 194
+      Top = 214
       Width = 265
       Width = 265
       Height = 17
       Height = 17
       Caption = 'Display &full path in title bar'
       Caption = 'Display &full path in title bar'
-      TabOrder = 9
+      TabOrder = 10
     end
     end
     object PauseOnDebuggerExceptionsCheck: TCheckBox
     object PauseOnDebuggerExceptionsCheck: TCheckBox
       Left = 8
       Left = 8
-      Top = 214
+      Top = 234
       Width = 265
       Width = 265
       Height = 17
       Height = 17
       Caption = '&Pause on exceptions'
       Caption = '&Pause on exceptions'
-      TabOrder = 10
+      TabOrder = 11
     end
     end
     object RunAsDifferentUserCheck: TCheckBox
     object RunAsDifferentUserCheck: TCheckBox
       Left = 8
       Left = 8
-      Top = 234
+      Top = 254
       Width = 265
       Width = 265
       Height = 17
       Height = 17
       Caption = 'Always &launch Setup/Uninstall as administrator'
       Caption = 'Always &launch Setup/Uninstall as administrator'
-      TabOrder = 11
+      TabOrder = 12
     end
     end
     object ColorizeCompilerOutputCheck: TCheckBox
     object ColorizeCompilerOutputCheck: TCheckBox
       Left = 8
       Left = 8
-      Top = 254
+      Top = 274
       Width = 265
       Width = 265
       Height = 17
       Height = 17
       Caption = 'Colori&ze "Compiler Output" view'
       Caption = 'Colori&ze "Compiler Output" view'
-      TabOrder = 12
+      TabOrder = 13
     end
     end
     object OpenIncludedFilesCheck: TCheckBox
     object OpenIncludedFilesCheck: TCheckBox
       Left = 8
       Left = 8
@@ -117,36 +117,44 @@ object OptionsForm: TOptionsForm
     end
     end
     object Label3: TNewStaticText
     object Label3: TNewStaticText
       Left = 8
       Left = 8
-      Top = 281
+      Top = 301
       Width = 56
       Width = 56
       Height = 14
       Height = 14
       Caption = 'Menu &keys:'
       Caption = 'Menu &keys:'
       FocusControl = KeyMappingComboBox
       FocusControl = KeyMappingComboBox
-      TabOrder = 13
+      TabOrder = 14
     end
     end
     object KeyMappingComboBox: TComboBox
     object KeyMappingComboBox: TComboBox
       Left = 72
       Left = 72
-      Top = 277
+      Top = 297
       Width = 201
       Width = 201
       Height = 21
       Height = 21
       Style = csDropDownList
       Style = csDropDownList
-      TabOrder = 14
+      TabOrder = 15
     end
     end
     object AutoreloadCheck: TCheckBox
     object AutoreloadCheck: TCheckBox
       Left = 8
       Left = 8
-      Top = 156
+      Top = 176
       Width = 265
       Width = 265
       Height = 17
       Height = 17
       Caption = 'Automatically reload files'
       Caption = 'Automatically reload files'
-      TabOrder = 7
+      TabOrder = 8
     end
     end
     object UndoAfterReloadCheck: TCheckBox
     object UndoAfterReloadCheck: TCheckBox
       Left = 8
       Left = 8
-      Top = 176
+      Top = 196
       Width = 265
       Width = 265
       Height = 17
       Height = 17
       Caption = 'Allow Undo after reload'
       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
   end
   end
   object GroupBox3: TGroupBox
   object GroupBox3: TGroupBox

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

@@ -59,6 +59,7 @@ type
     ShowWhiteSpaceCheck: TCheckBox;
     ShowWhiteSpaceCheck: TCheckBox;
     AutoreloadCheck: TCheckBox;
     AutoreloadCheck: TCheckBox;
     UndoAfterReloadCheck: TCheckBox;
     UndoAfterReloadCheck: TCheckBox;
+    AutoHideNewIncludedFilesCheck: TCheckBox;
     procedure AssocButtonClick(Sender: TObject);
     procedure AssocButtonClick(Sender: TObject);
     procedure ChangeFontButtonClick(Sender: TObject);
     procedure ChangeFontButtonClick(Sender: TObject);
     procedure FormCreate(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>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>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>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>
   </ul>
   </li>
   </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>
   <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>