浏览代码

Add small panel to indicate FindRegEx state.

Martijn Laan 1 年之前
父节点
当前提交
1edf17c8b5
共有 3 个文件被更改,包括 22 次插入5 次删除
  1. 6 0
      Projects/Src/IDE.MainForm.dfm
  2. 15 4
      Projects/Src/IDE.MainForm.pas
  3. 1 1
      whatsnew.htm

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

@@ -157,6 +157,12 @@ object MainForm: TMainForm
         Text = 'Insert'
         Text = 'Insert'
         Width = 64
         Width = 64
       end
       end
+      item
+        Alignment = taCenter
+        Bevel = pbNone
+        Text = '.*'
+        Width = 23
+      end
       item
       item
         Bevel = pbNone
         Bevel = pbNone
         Style = psOwnerDraw
         Style = psOwnerDraw

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

@@ -591,6 +591,7 @@ type
     procedure UpdateCompileStatusPanels(const AProgress, AProgressMax: Cardinal;
     procedure UpdateCompileStatusPanels(const AProgress, AProgressMax: Cardinal;
       const ASecondsRemaining: Integer; const ABytesCompressedPerSecond: Cardinal);
       const ASecondsRemaining: Integer; const ABytesCompressedPerSecond: Cardinal);
     procedure UpdateEditModePanel;
     procedure UpdateEditModePanel;
+    procedure UpdateFindRegExPanel;
     procedure UpdatePreprocMemos;
     procedure UpdatePreprocMemos;
     procedure UpdateLineMarkers(const AMemo: TIDEScintFileEdit; const Line: Integer);
     procedure UpdateLineMarkers(const AMemo: TIDEScintFileEdit; const Line: Integer);
     procedure UpdateImages;
     procedure UpdateImages;
@@ -674,10 +675,11 @@ const
   spCaretPos = 0;
   spCaretPos = 0;
   spModified = 1;
   spModified = 1;
   spEditMode = 2;
   spEditMode = 2;
-  spHiddenFilesCount = 3;
-  spCompileIcon = 4;
-  spCompileProgress = 5;
-  spExtraStatus = 6;
+  spFindRegEx = 3;
+  spHiddenFilesCount = 4;
+  spCompileIcon = 5;
+  spCompileProgress = 6;
+  spExtraStatus = 7;
 
 
   { Output tab set indexes }
   { Output tab set indexes }
   tiCompilerOutput = 0;
   tiCompilerOutput = 0;
@@ -851,6 +853,7 @@ constructor TMainForm.Create(AOwner: TComponent);
       UpdateNewMainFileButtons;
       UpdateNewMainFileButtons;
       UpdateKeyMapping;
       UpdateKeyMapping;
       UpdateTheme;
       UpdateTheme;
+      UpdateFindRegExPanel;
 
 
       { Window state }
       { Window state }
       WindowPlacement.length := SizeOf(WindowPlacement);
       WindowPlacement.length := SizeOf(WindowPlacement);
@@ -3854,6 +3857,7 @@ end;
 procedure TMainForm.EFindRegExClick(Sender: TObject);
 procedure TMainForm.EFindRegExClick(Sender: TObject);
 begin
 begin
   FOptions.FindRegEx := not FOptions.FindRegEx;
   FOptions.FindRegEx := not FOptions.FindRegEx;
+  UpdateFindRegExPanel;
   var Ini := TConfigIniFile.Create;
   var Ini := TConfigIniFile.Create;
   try
   try
     Ini.WriteBool('Options', 'FindRegEx', FOptions.FindRegEx);
     Ini.WriteBool('Options', 'FindRegEx', FOptions.FindRegEx);
@@ -4702,6 +4706,13 @@ begin
     StatusBar.Panels[spEditMode].Text := InsertText[FActiveMemo.InsertMode];
     StatusBar.Panels[spEditMode].Text := InsertText[FActiveMemo.InsertMode];
 end;
 end;
 
 
+procedure TMainForm.UpdateFindRegExPanel;
+const
+  FindRegExText: array[Boolean] of String = ('', '.*');
+begin
+  StatusBar.Panels[spFindRegEx].Text := FindRegExText[FOptions.FindRegEx];
+end;
+
 procedure TMainForm.UpdateMemosTabSetVisibility;
 procedure TMainForm.UpdateMemosTabSetVisibility;
 begin
 begin
   MemosTabSet.Visible := FPreprocessorOutputMemo.Used or FFileMemos[FirstIncludedFilesMemoIndex].Used;
   MemosTabSet.Visible := FPreprocessorOutputMemo.Used or FFileMemos[FirstIncludedFilesMemoIndex].Used;

+ 1 - 1
whatsnew.htm

@@ -55,7 +55,7 @@ For conditions of distribution and use, see <a href="files/is/license.txt">LICEN
   <li>Added autocompletion support for all Pascal Scripting support functions, types, constants, etcetera. Existing option <i>Invoke autocompletion automatically</i> controls whether the autocompletion suggestions appear automatically or only when invoked manually by pressing Ctrl+Space or Ctrl+I.</li>
   <li>Added autocompletion support for all Pascal Scripting support functions, types, constants, etcetera. Existing option <i>Invoke autocompletion automatically</i> controls whether the autocompletion suggestions appear automatically or only when invoked manually by pressing Ctrl+Space or Ctrl+I.</li>
   <li>Added parameter hints and autocompletion support for all Pascal Scripting support class members and properties. Both always show all classes' members and properties instead of just those of the object's class.</li>
   <li>Added parameter hints and autocompletion support for all Pascal Scripting support class members and properties. Both always show all classes' members and properties instead of just those of the object's class.</li>
   <li>Added new <i>Enable section folding</i> option which allows you to temporarily hide sections while editing by clicking the new minus or plus icons in the editor's gutter or by using the new keyboard shortcuts (Ctrl+Shift+[ to fold and Ctrl+Shift+] to unfold) or menu items. Enabled by default.</li>
   <li>Added new <i>Enable section folding</i> option which allows you to temporarily hide sections while editing by clicking the new minus or plus icons in the editor's gutter or by using the new keyboard shortcuts (Ctrl+Shift+[ to fold and Ctrl+Shift+] to unfold) or menu items. Enabled by default.</li>
-  <li>Added new <i>Use Regular Expressions</i> option to the <i>Edit</i> menu to enable or disable the use of regular expressions for all find and replace operations and added a shortcut for it (Alt+R).</li>
+  <li>Added new <i>Use Regular Expressions</i> option to the <i>Edit</i> menu to enable or disable the use of regular expressions for all find and replace operations and added a shortcut for it (Alt+R). Also added a small panel to the statusbar to indicate the current state.</li>
   <li>The editor's gutter now shows change history to keep track of saved and unsaved modifications. Always enabled.</li>
   <li>The editor's gutter now shows change history to keep track of saved and unsaved modifications. Always enabled.</li>
   <li>The editor's font now defaults to Consolas if available, consistent with most other modern editors.</li>
   <li>The editor's font now defaults to Consolas if available, consistent with most other modern editors.</li>
   <li>The editor can now be scrolled horizontally instead of vertically by holding the Shift key while rotating the mouse wheel. Horizontal scroll wheels are now also supported.</li>
   <li>The editor can now be scrolled horizontally instead of vertically by holding the Shift key while rotating the mouse wheel. Horizontal scroll wheels are now also supported.</li>