mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-25 13:59:12 +02:00
IDE: Added list of recorded editor macros
git-svn-id: trunk@37679 -
This commit is contained in:
parent
e5c319db91
commit
4eeeddf42d
@ -518,6 +518,7 @@ begin
|
||||
ecToggleCodeBrowser : Result:= srkmecToggleCodeBrowser;
|
||||
ecToggleRestrictionBrowser: Result:= srkmecToggleRestrictionBrowser;
|
||||
ecViewComponents : Result:= srkmecViewComponents;
|
||||
ecViewMacroList : Result:= srkmecViewEditorMacros;
|
||||
ecViewJumpHistory : Result:= lisMenuViewJumpHistory;
|
||||
ecToggleCompPalette : Result:= srkmecToggleCompPalette;
|
||||
ecToggleIDESpeedBtns : Result:= srkmecToggleIDESpeedBtns;
|
||||
@ -2661,6 +2662,7 @@ begin
|
||||
C:=Categories[AddCategory('MacroRecording', srkmCatMacroRecording, IDECmdScopeSrcEditOnly)];
|
||||
AddDefault(C, 'Record Macro', srkmecSynMacroRecord, ecSynMacroRecord);
|
||||
AddDefault(C, 'Play Macro', srkmecSynMacroPlay, ecSynMacroPlay);
|
||||
AddDefault(C, 'View Editor Macros', srkmecViewEditorMacros, ecViewMacroList);
|
||||
|
||||
// Template editing
|
||||
C:=Categories[AddCategory('Edit Template', srkmCatTemplateEdit, IDECmdScopeSrcEditOnlyTmplEdit)];
|
||||
|
@ -305,6 +305,7 @@ resourcestring
|
||||
lisMenuJumpForward = 'Jump Forward';
|
||||
lisMenuAddJumpPointToHistory = 'Add Jump Point to History';
|
||||
lisMenuViewJumpHistory = 'Jump History';
|
||||
lisMenuMacroListView = 'Editor Macros ...';
|
||||
lisMenuFindBlockOtherEndOfCodeBlock = 'Find Other End of Code Block';
|
||||
lisMenuFindCodeBlockStart = 'Find Start of Code Block';
|
||||
lisMenuFindDeclarationAtCursor = 'Find Declaration at Cursor';
|
||||
@ -2746,6 +2747,7 @@ resourcestring
|
||||
srkmecViewUnits = 'View units';
|
||||
srkmecViewForms = 'View forms';
|
||||
srkmecViewComponents = 'View components';
|
||||
srkmecViewEditorMacros = 'View editor macros';
|
||||
lisKMViewJumpHistory = 'View jump history';
|
||||
srkmecViewUnitDependencies = 'View unit dependencies';
|
||||
srkmecViewUnitInfo = 'View unit information';
|
||||
@ -5527,6 +5529,10 @@ resourcestring
|
||||
lisWhatNeedsBuilding = 'What needs building';
|
||||
lisTarget = 'Target:';
|
||||
lisDirectives = 'Directives';
|
||||
lisRecordedMacros = 'Recorded Macros';
|
||||
lisRename2 = 'Rename ...';
|
||||
lisNewMacroName = 'Macro %d';
|
||||
lisEditorMacros = 'Editor macros';
|
||||
|
||||
implementation
|
||||
|
||||
|
11
ide/main.pp
11
ide/main.pp
@ -152,6 +152,7 @@ uses
|
||||
UseUnitDlg, FindOverloadsDlg, EditorFileManager,
|
||||
CleanDirDlg, CodeContextForm, AboutFrm, CompatibilityRestrictions,
|
||||
RestrictionBrowser, ProjectWizardDlg, IDECmdLine, IDEGuiCmdLine, CodeExplOpts,
|
||||
EditorMacroListViewer,
|
||||
// main ide
|
||||
MainBar, MainIntf, MainBase;
|
||||
|
||||
@ -244,6 +245,7 @@ type
|
||||
procedure mnuViewCodeExplorerClick(Sender: TObject);
|
||||
procedure mnuViewCodeBrowserClick(Sender: TObject);
|
||||
procedure mnuViewComponentsClick(Sender: TObject);
|
||||
procedure mnuViewMacroListClick(Sender: TObject);
|
||||
procedure mnuViewRestrictionBrowserClick(Sender: TObject);
|
||||
procedure mnuViewMessagesClick(Sender: TObject);
|
||||
procedure mnuViewSearchResultsClick(Sender: TObject);
|
||||
@ -2588,6 +2590,7 @@ begin
|
||||
itmViewCodeBrowser.OnClick := @mnuViewCodeBrowserClick;
|
||||
itmViewRestrictionBrowser.OnClick := @mnuViewRestrictionBrowserClick;
|
||||
itmViewComponents.OnClick := @mnuViewComponentsClick;
|
||||
itmMacroListView.OnClick := @mnuViewMacroListClick;
|
||||
itmViewFPDocEditor.OnClick := @mnuViewFPDocEditorClicked;
|
||||
itmViewMessage.OnClick := @mnuViewMessagesClick;
|
||||
itmViewSearchResults.OnClick := @mnuViewSearchResultsClick;
|
||||
@ -3514,6 +3517,9 @@ begin
|
||||
ecInsertFilename:
|
||||
mnuSourceInsertFilename(self);
|
||||
|
||||
ecViewMacroList:
|
||||
mnuViewMacroListClick(self);
|
||||
|
||||
else
|
||||
Handled:=false;
|
||||
// let the bosses handle it
|
||||
@ -4154,6 +4160,11 @@ begin
|
||||
DoShowComponentList(true);
|
||||
end;
|
||||
|
||||
procedure TMainIDE.mnuViewMacroListClick(Sender: TObject);
|
||||
begin
|
||||
ShowMacroListViewer;
|
||||
end;
|
||||
|
||||
procedure TMainIDE.mnuViewRestrictionBrowserClick(Sender: TObject);
|
||||
begin
|
||||
DoShowRestrictionBrowser(true);
|
||||
|
@ -173,6 +173,7 @@ type
|
||||
itmViewRestrictionBrowser: TIDEMenuCommand;
|
||||
itmViewComponents: TIDEMenuCommand;
|
||||
itmJumpHistory: TIDEMenuCommand;
|
||||
itmMacroListView: TIDEMenuCommand;
|
||||
//itmViewSecondaryWindows: TIDEMenuSection;
|
||||
itmViewAnchorEditor: TIDEMenuCommand;
|
||||
itmViewTabOrder: TIDEMenuCommand;
|
||||
|
@ -504,6 +504,7 @@ begin
|
||||
CreateMenuItem(ParentMI,itmViewRestrictionBrowser,'itmViewRestrictionBrowser',lisMenuViewRestrictionBrowser, 'menu_view_rectriction_browser');
|
||||
CreateMenuItem(ParentMI,itmViewComponents,'itmViewComponents',lisMenuViewComponents);
|
||||
CreateMenuItem(ParentMI,itmJumpHistory,'itmJumpHistory',lisMenuViewJumpHistory);
|
||||
CreateMenuItem(ParentMI,itmMacroListView,'itmMacroListView',lisMenuMacroListView);
|
||||
|
||||
CreateMenuSeparatorSection(mnuView,itmViewDesignerWindows,'itmViewDesignerWindows');
|
||||
ParentMI:=itmViewDesignerWindows;
|
||||
@ -911,6 +912,7 @@ begin
|
||||
itmViewCodeBrowser.Command:=GetCommand(ecToggleCodeBrowser);
|
||||
itmViewRestrictionBrowser.Command:=GetCommand(ecToggleRestrictionBrowser);
|
||||
itmViewComponents.Command:=GetCommand(ecViewComponents);
|
||||
itmMacroListView.Command:=GetCommand(ecViewMacroList);
|
||||
itmJumpHistory.Command:=GetCommand(ecViewJumpHistory);
|
||||
itmViewMessage.Command:=GetCommand(ecToggleMessages);
|
||||
itmViewSearchResults.Command:=GetCommand(ecToggleSearchResults);
|
||||
|
@ -66,7 +66,7 @@ uses
|
||||
CodeMacroPrompt, CodeTemplatesDlg, CodeToolsOptions,
|
||||
SortSelectionDlg, EncloseSelectionDlg, ConDef, InvertAssignTool,
|
||||
SourceEditProcs, SourceMarks, CharacterMapDlg, SearchFrm,
|
||||
FPDocHints,
|
||||
FPDocHints, EditorMacroListViewer,
|
||||
BaseDebugManager, Debugger, MainIntf, GotoFrm;
|
||||
|
||||
type
|
||||
@ -940,7 +940,7 @@ type
|
||||
procedure DecUpdateLock;
|
||||
procedure ShowActiveWindowOnTop(Focus: Boolean = False);
|
||||
private
|
||||
FMacroRecorder: TSynMacroRecorder;
|
||||
FMacroRecorder: TEditorMacro;
|
||||
FOnCurrentCodeBufferChanged: TNotifyEvent;
|
||||
procedure DoMacroRecorderState(Sender: TObject);
|
||||
procedure DoMacroRecorderUserCommand(aSender: TCustomSynMacroRecorder;
|
||||
@ -948,7 +948,7 @@ type
|
||||
public
|
||||
property OnCurrentCodeBufferChanged: TNotifyEvent
|
||||
read FOnCurrentCodeBufferChanged write FOnCurrentCodeBufferChanged;
|
||||
property MacroRecorder: TSynMacroRecorder read FMacroRecorder;
|
||||
property MacroRecorder: TEditorMacro read FMacroRecorder;
|
||||
end;
|
||||
|
||||
{ TSourceEditorManager }
|
||||
@ -8124,6 +8124,7 @@ var
|
||||
begin
|
||||
For i := 0 to SourceWindowCount - 1 do
|
||||
TSourceNotebook(SourceWindows[i]).UpdateStatusBar;
|
||||
DoEditorMacroStateChanged;
|
||||
end;
|
||||
|
||||
procedure TSourceEditorManagerBase.DoMacroRecorderUserCommand(aSender: TCustomSynMacroRecorder;
|
||||
@ -8563,13 +8564,14 @@ var
|
||||
i: TsemChangeReason;
|
||||
h: TSrcEditMangerHandlerType;
|
||||
begin
|
||||
FMacroRecorder := TSynMacroRecorder.Create(self);
|
||||
FMacroRecorder := TEditorMacro.Create(self);
|
||||
FMacroRecorder.OnStateChange := @DoMacroRecorderState;
|
||||
FMacroRecorder.OnUserCommand := @DoMacroRecorderUserCommand;
|
||||
FMacroRecorder.RecordCommandID := ecSynMacroRecord;
|
||||
FMacroRecorder.PlaybackCommandID := ecSynMacroPlay;
|
||||
FMacroRecorder.RecordShortCut := 0;
|
||||
FMacroRecorder.PlaybackShortCut := 0;
|
||||
EditorMacroRecorder := FMacroRecorder;
|
||||
|
||||
|
||||
FUpdateFlags := [];
|
||||
@ -8601,6 +8603,7 @@ begin
|
||||
FreeCompletionPlugins;
|
||||
FreeSourceWindows;
|
||||
SrcEditorIntf.SourceEditorManagerIntf := nil; // xx move down
|
||||
EditorMacroRecorder := nil;
|
||||
FreeAndNil(FMacroRecorder);
|
||||
FreeAndNil(FCompletionPlugins);
|
||||
FreeAndNil(FSourceWindowList);
|
||||
|
@ -189,6 +189,7 @@ const
|
||||
ecViewPseudoTerminal = ecFirstLazarus + 328;
|
||||
ecViewThreads = ecFirstLazarus + 329;
|
||||
ecViewHistory = ecFirstLazarus + 460;
|
||||
ecViewMacroList = ecFirstLazarus + 461;
|
||||
|
||||
// sourcenotebook commands
|
||||
ecNextEditor = ecFirstLazarus + 330;
|
||||
@ -264,7 +265,7 @@ const
|
||||
ecAddBpAddress = ecFirstLazarus + 450;
|
||||
ecAddBpDataWatch = ecFirstLazarus + 451;
|
||||
|
||||
// 460++ : used for ecViewHistory (debugger)
|
||||
// 460++ : used for ecViewHistory (debugger) / ecViewMacroList
|
||||
|
||||
// project menu
|
||||
ecNewProject = ecFirstLazarus + 500;
|
||||
|
Loading…
Reference in New Issue
Block a user