mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: "Paste from clipboard" command to background context menu
This commit is contained in:
parent
b687f063aa
commit
c5a9ca14ae
2 changed files with 15 additions and 4 deletions
|
|
@ -457,6 +457,10 @@ begin
|
|||
mi.Action := frmMain.actReverseOrder;
|
||||
miSortBy.Add(mi);
|
||||
|
||||
mi:=TMenuItem.Create(Self);
|
||||
mi.Caption:='-';
|
||||
Self.Items.Add(mi);
|
||||
|
||||
mi:=TMenuItem.Create(Self);
|
||||
mi.Action := frmMain.actPasteFromClipboard;
|
||||
Self.Items.Add(mi);
|
||||
|
|
|
|||
|
|
@ -236,9 +236,7 @@ begin
|
|||
sCmd:= 'cm_Refresh';
|
||||
I:= sl.Add(sCmd);
|
||||
sAct:= Actions.GetCommandCaption(sCmd);
|
||||
InsertMenuItemEx(FShellMenu, 0, PWideChar(UTF8Decode(sAct)), I, I + USER_CMD_ID, MFT_STRING);
|
||||
// Add menu separator
|
||||
InsertMenuItemEx(FShellMenu, 0, nil, I + 1, 0, MFT_SEPARATOR);
|
||||
InsertMenuItemEx(FShellMenu, 0, PWideChar(UTF8Decode(sAct)), 0, I + USER_CMD_ID, MFT_STRING);
|
||||
|
||||
// Add "Sort by" submenu
|
||||
hActionsSubMenu := CreatePopupMenu;
|
||||
|
|
@ -268,9 +266,18 @@ begin
|
|||
I:= sl.Add(sCmd);
|
||||
sAct:= Actions.GetCommandCaption(sCmd);
|
||||
InsertMenuItemEx(hActionsSubMenu,0, PWideChar(UTF8Decode(sAct)), 0, I + USER_CMD_ID, MFT_STRING);
|
||||
|
||||
// Add submenu to context menu
|
||||
InsertMenuItemEx(FShellMenu, hActionsSubMenu, PWideChar(UTF8Decode(rsMnuSortBy)), 1, 333, MFT_STRING);
|
||||
|
||||
// Add menu separator
|
||||
InsertMenuItemEx(FShellMenu, 0, nil, 2, 0, MFT_SEPARATOR);
|
||||
// Add commands to root of context menu
|
||||
sCmd:= 'cm_PasteFromClipboard';
|
||||
I:= sl.Add(sCmd);
|
||||
sAct:= Actions.GetCommandCaption(sCmd);
|
||||
InsertMenuItemEx(FShellMenu, 0, PWideChar(UTF8Decode(sAct)), 3, I + USER_CMD_ID, MFT_STRING);
|
||||
// Add menu separator
|
||||
InsertMenuItemEx(FShellMenu, 0, nil, 4, 0, MFT_SEPARATOR);
|
||||
end
|
||||
else if (FFiles.Count = 1) then // Add "Actions" submenu
|
||||
begin
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue