ADD: some new commands to Viewer (from Menu-View, Menu-Edit) can be assigned with hotkeys

This commit is contained in:
meteu 2016-02-29 12:21:24 +00:00
commit 79ca818345
3 changed files with 151 additions and 1 deletions

View file

@ -2347,6 +2347,7 @@ object frmViewer: TfrmViewer
object miLookBook: TMenuItem
AutoCheck = True
Caption = 'Show as B&ook'
Checked = True
GroupIndex = 1
RadioItem = True
ShortCut = 32781
@ -2542,5 +2543,58 @@ object frmViewer: TfrmViewer
Hint = 'Mirror'
OnExecute = actExecute
end
object actCopyToClipboard: TAction
Category = 'Edit'
Caption = 'actCopyToClipboard'
OnExecute = actExecute
end
object actSelectAll: TAction
Category = 'Edit'
Caption = 'actSelectAll'
end
object actSearch: TAction
Category = 'Edit'
Caption = 'actSearch'
end
object acrSearchNext: TAction
Category = 'Edit'
Caption = 'acrSearchNext'
end
object actSearchPrev: TAction
Category = 'Edit'
Caption = 'actSearchPrev'
end
object actPreview: TAction
Category = 'View'
Caption = 'actPreview'
end
object actShowAsText: TAction
Category = 'View'
Caption = 'actShowAsText'
end
object actShowAsBin: TAction
Category = 'View'
Caption = 'actShowAsBin'
end
object actShowAsHex: TAction
Category = 'View'
Caption = 'actShowAsHex'
end
object actShowAsWrapText: TAction
Category = 'View'
Caption = 'actShowAsWrapText'
end
object actShowAsBook: TAction
Category = 'View'
Caption = 'actShowAsBook'
end
object actGraphics: TAction
Category = 'View'
Caption = 'actGraphics'
end
object actPlugins: TAction
Category = 'View'
Caption = 'actPlugins'
end
end
end

View file

@ -98,3 +98,16 @@ TFRMVIEWER.ACTROTATE270.CAPTION=Rotate 270
TFRMVIEWER.ACTROTATE270.HINT=Rotate 270
TFRMVIEWER.ACTMIRROR.CAPTION=Mirror
TFRMVIEWER.ACTMIRROR.HINT=Mirror
TFRMVIEWER.ACTCOPYTOCLIPBOARD.CAPTION=actCopyToClipboard
TFRMVIEWER.ACTSELECTALL.CAPTION=actSelectAll
TFRMVIEWER.ACTSEARCH.CAPTION=actSearch
TFRMVIEWER.ACRSEARCHNEXT.CAPTION=acrSearchNext
TFRMVIEWER.ACTSEARCHPREV.CAPTION=actSearchPrev
TFRMVIEWER.ACTPREVIEW.CAPTION=actPreview
TFRMVIEWER.ACTSHOWASTEXT.CAPTION=actShowAsText
TFRMVIEWER.ACTSHOWASBIN.CAPTION=actShowAsBin
TFRMVIEWER.ACTSHOWASHEX.CAPTION=actShowAsHex
TFRMVIEWER.ACTSHOWASWRAPTEXT.CAPTION=actShowAsWrapText
TFRMVIEWER.ACTSHOWASBOOK.CAPTION=actShowAsBook
TFRMVIEWER.ACTGRAPHICS.CAPTION=actGraphics
TFRMVIEWER.ACTPLUGINS.CAPTION=actPlugins

View file

@ -50,6 +50,19 @@ type
actAbout: TAction;
actCopyFile: TAction;
actDeleteFile: TAction;
actCopyToClipboard: TAction;
acrSearchNext: TAction;
actGraphics: TAction;
actPlugins: TAction;
actShowAsBook: TAction;
actShowAsWrapText: TAction;
actShowAsHex: TAction;
actShowAsBin: TAction;
actShowAsText: TAction;
actPreview: TAction;
actSearchPrev: TAction;
actSearch: TAction;
actSelectAll: TAction;
actMirror: TAction;
actRotate270: TAction;
actRotate180: TAction;
@ -317,6 +330,20 @@ type
procedure cm_Rotate180(const Params: array of string);
procedure cm_Rotate270(const Params: array of string);
procedure cm_Mirror(const Params: array of string);
procedure cm_CopyToClipboard (const Params: array of string);
procedure cm_SelectAll (const Params: array of string);
procedure cm_Search (const Params: array of string);
procedure cm_SearchNext (const Params: array of string);
procedure cm_SearchPrev (const Params: array of string);
procedure cm_Preview (const Params: array of string);
procedure cm_ShowAsText (const Params: array of string);
procedure cm_ShowAsBin (const Params: array of string);
procedure cm_ShowAsHex (const Params: array of string);
procedure cm_ShowAsWrapText (const Params: array of string);
procedure cm_ShowAsBook (const Params: array of string);
end;
procedure ShowViewer(const FilesToView:TStringList; const aFileSource: IFileSource = nil);
@ -801,7 +828,8 @@ begin
Image.Refresh;
end;
procedure TfrmViewer.CreatePreview(FullPathToFile: String; index: integer; delete: Boolean = false);
procedure TfrmViewer.CreatePreview(FullPathToFile: string; index: integer;
delete: boolean);
var
bmpThumb : TBitmap = nil;
begin
@ -2339,6 +2367,61 @@ begin
if bImage then miRotateClick(miMirror);
end;
procedure TfrmViewer.cm_CopyToClipboard(const Params: array of string);
begin
miCopyToClipboardClick(miCopyToClipboard);
end;
procedure TfrmViewer.cm_SelectAll(const Params: array of string);
begin
miSelectAllClick(miSelectAll);
end;
procedure TfrmViewer.cm_Search(const Params: array of string);
begin
miSearchClick(miSearch);
end;
procedure TfrmViewer.cm_SearchNext(const Params: array of string);
begin
miSearchNextClick(miSearchNext);
end;
procedure TfrmViewer.cm_SearchPrev(const Params: array of string);
begin
miSearchPrevClick(miSearchPrev);
end;
procedure TfrmViewer.cm_Preview(const Params: array of string);
begin
miPreviewClick(miPreview);
end;
procedure TfrmViewer.cm_ShowAsText(const Params: array of string);
begin
miTextClick(miText);
end;
procedure TfrmViewer.cm_ShowAsBin(const Params: array of string);
begin
miTextClick(miBin);
end;
procedure TfrmViewer.cm_ShowAsHex(const Params: array of string);
begin
miTextClick(miHex);
end;
procedure TfrmViewer.cm_ShowAsWrapText(const Params: array of string);
begin
miTextClick(miWrapText);
end;
procedure TfrmViewer.cm_ShowAsBook(const Params: array of string);
begin
miTextClick(miLookBook);
end;
initialization
TFormCommands.RegisterCommandsForm(TfrmViewer, HotkeysCategory, @rsHotkeyCategoryViewer);