ADD: Viewer - show caret command (F6)

This commit is contained in:
Alexander Koblov 2019-07-13 15:34:51 +00:00
commit 3614881981
4 changed files with 20 additions and 3 deletions

View file

@ -2897,6 +2897,11 @@ object frmViewer: TfrmViewer
Enabled = False
OnExecute = actExecute
end
object actShowCaret: TAction
Category = 'View'
Caption = 'Show text c&ursor'
OnExecute = actExecute
end
end
object TimerScreenshot: TTimer
Enabled = False

View file

@ -84,5 +84,6 @@
{"hash":216568103,"name":"tfrmviewer.actchangeencoding.caption","sourcebytes":[67,104,97,110,103,101,32,101,110,99,111,100,105,110,103],"value":"Change encoding"},
{"hash":96796260,"name":"tfrmviewer.actautoreload.caption","sourcebytes":[65,117,116,111,32,82,101,108,111,97,100],"value":"Auto Reload"},
{"hash":216689422,"name":"tfrmviewer.actprintsetup.caption","sourcebytes":[80,114,105,110,116,32,38,115,101,116,117,112,46,46,46],"value":"Print &setup..."},
{"hash":151339998,"name":"tfrmviewer.actprint.caption","sourcebytes":[80,38,114,105,110,116,46,46,46],"value":"P&rint..."}
{"hash":151339998,"name":"tfrmviewer.actprint.caption","sourcebytes":[80,38,114,105,110,116,46,46,46],"value":"P&rint..."},
{"hash":36280978,"name":"tfrmviewer.actshowcaret.caption","sourcebytes":[83,104,111,119,32,116,101,120,116,32,99,38,117,114,115,111,114],"value":"Show text c&ursor"}
]}

View file

@ -92,6 +92,7 @@ type
actCopyToClipboardFormatted: TAction;
actChangeEncoding: TAction;
actAutoReload: TAction;
actShowCaret: TAction;
actPrint: TAction;
actPrintSetup: TAction;
actShowAsDec: TAction;
@ -432,7 +433,7 @@ type
procedure cm_Print(const Params:array of string);
procedure cm_PrintSetup(const Params:array of string);
procedure cm_ShowCaret(const Params: array of string);
end;
procedure ShowViewer(const FilesToView:TStringList; const aFileSource: IFileSource = nil);
@ -2927,6 +2928,15 @@ begin
end;
end;
procedure TfrmViewer.cm_ShowCaret(const Params: array of string);
begin
if not miGraphics.Checked then
begin
ViewerControl.ShowCaret:= not ViewerControl.ShowCaret;
actShowCaret.Checked:= ViewerControl.ShowCaret;
end;
end;
initialization
TFormCommands.RegisterCommandsForm(TfrmViewer, HotkeysCategory, @rsHotkeyCategoryViewer);

View file

@ -163,7 +163,7 @@ type
const
{ Default hotkey list version number }
hkVersion = 48;
hkVersion = 49;
// 47 - In "Copy/Move Dialog" context, add the shortcuts "F5" and "F6" for "cm_ToggleSelectionInName".
// 40 - In "Main" context, added the "Ctrl+Shift+F7" for "cm_AddNewSearch".
// In "Find Files" context, changed "cm_Start" that was "Enter" for "F9".
@ -1109,6 +1109,7 @@ begin
AddIfNotExists(['6'],[],'cm_ShowGraphics');
AddIfNotExists(['7'],[],'cm_ShowPlugins');
AddIfNotExists(['F6'],[],'cm_ShowCaret');
AddIfNotExists(['Q' ,'','',
'Esc','',''],'cm_ExitViewer');