Skip to content

Commit

Permalink
Add small panel to indicate FindRegEx state.
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnlaan committed Aug 23, 2024
1 parent ed1f132 commit 1edf17c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
6 changes: 6 additions & 0 deletions Projects/Src/IDE.MainForm.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 15 additions & 4 deletions Projects/Src/IDE.MainForm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ TMainForm = class(TUIStateForm)
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;
Expand Down Expand Up @@ -674,10 +675,11 @@ implementation
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;
Expand Down Expand Up @@ -851,6 +853,7 @@ constructor TMainForm.Create(AOwner: TComponent);
UpdateNewMainFileButtons;
UpdateKeyMapping;
UpdateTheme;
UpdateFindRegExPanel;

{ Window state }
WindowPlacement.length := SizeOf(WindowPlacement);
Expand Down Expand Up @@ -3854,6 +3857,7 @@ procedure TMainForm.ReplaceDialogReplace(Sender: TObject);
procedure TMainForm.EFindRegExClick(Sender: TObject);
begin
FOptions.FindRegEx := not FOptions.FindRegEx;
UpdateFindRegExPanel;
var Ini := TConfigIniFile.Create;
try
Ini.WriteBool('Options', 'FindRegEx', FOptions.FindRegEx);
Expand Down Expand Up @@ -4702,6 +4706,13 @@ procedure TMainForm.UpdateEditModePanel;
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;
Expand Down
2 changes: 1 addition & 1 deletion whatsnew.htm
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<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>

This comment has been minimized.

Copy link
@jordanrussell

jordanrussell Aug 25, 2024

Member

Alt+R is already used to open the Run menu...

This comment has been minimized.

Copy link
@martijnlaan

martijnlaan Aug 25, 2024

Author Member

Oh 💩

<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>
Expand Down

0 comments on commit 1edf17c

Please sign in to comment.