Ver código fonte

Add small panel to indicate FindRegEx state.

Martijn Laan 1 ano atrás
pai
commit
1edf17c8b5
3 arquivos alterados com 22 adições e 5 exclusões
  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'
         Width = 64
       end
+      item
+        Alignment = taCenter
+        Bevel = pbNone
+        Text = '.*'
+        Width = 23
+      end
       item
         Bevel = pbNone
         Style = psOwnerDraw

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

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