ADD: Editor - reload action

This commit is contained in:
Alexander Koblov 2018-03-31 21:50:18 +00:00
commit 9300a1bef2
3 changed files with 21 additions and 0 deletions

View file

@ -703,6 +703,9 @@ object frmEditor: TfrmEditor
object Open1: TMenuItem
Action = actFileOpen
end
object miFileReload: TMenuItem
Action = actFileReload
end
object Save1: TMenuItem
Action = actFileSave
end
@ -1008,6 +1011,11 @@ object frmEditor: TfrmEditor
Caption = 'Find previous'
OnExecute = actExecute
end
object actFileReload: TAction
Category = 'File'
Caption = 'Reload'
OnExecute = actExecute
end
end
object pmContextMenu: TPopupMenu
Images = dmComData.ilEditorImages

View file

@ -59,6 +59,7 @@ type
actEditLineEndLf: TAction;
actEditGotoLine: TAction;
actEditFindPrevious: TAction;
actFileReload: TAction;
MainMenu1: TMainMenu;
ActListEdit: TActionList;
actAbout: TAction;
@ -69,6 +70,7 @@ type
actFileNew: TAction;
actFileExit: TAction;
MenuItem1: TMenuItem;
miFileReload: TMenuItem;
miFindPrevious: TMenuItem;
miGotoLine: TMenuItem;
miEditLineEndCr: TMenuItem;
@ -198,6 +200,7 @@ type
property FileName: String read FFileName write SetFileName;
published
procedure cm_FileReload(const Params: array of string);
procedure cm_EditFind(const {%H-}Params:array of string);
procedure cm_EditFindNext(const {%H-}Params:array of string);
procedure cm_EditFindPrevious(const {%H-}Params:array of string);
@ -789,6 +792,15 @@ begin
end;
end;
procedure TfrmEditor.cm_FileReload(const Params: array of string);
begin
if bChanged then
begin
if not msgYesNo(rsMsgFileReloadWarning) then
Exit;
end;
OpenFile(FFileName);
end;
procedure TfrmEditor.cm_EditFind(const Params: array of string);
begin

View file

@ -40,6 +40,7 @@ resourcestring
rsMsgFileExistsFileInfo = '%s bytes, %s';
rsMsgFileExistsRwrt = 'File %s exists, overwrite?';
rsMsgFileChangedSave = 'File %s changed, save?';
rsMsgFileReloadWarning = 'Are you sure you want to reload the current file and lose the changes?';
rsMsgFolderExistsRwrt = 'Folder %s exists, merge?';
rsMsgFileReadOnly = 'File %s is marked as read-only/hidden/system. Delete it?';
rsMsgNewFile = 'New file';