Author Topic: Is there a way to get copy/cut/paste in the right click context menu?  (Read 14927 times)

Offline marosknapcok

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Is there a way to get copy/cut/paste in the right click context menu?
« Reply #15 on: July 18, 2014, 11:56:57 pm »
If you want to have "cut, copy, paste and delete" direct in your C::B context menu do the following:
in file "cbeditor.cpp" in function "void cbEditor::AddToContextMenu(.." push between end of condition "if (!pluginsdone)" and (start of) condition "if (insert)" following lines:
//------------------------
popup->Append(idCut, _("Cut"));
popup->Enable(idCut, true);
popup->Append(idCopy, _("Copy"));
popup->Enable(idCopy, true);
popup->Append(idPaste, _("Paste"));
popup->Enable(idPaste, true);
popup->Append(idDelete, _("Delete"));
popup->Enable(idDelete, true);
popup->AppendSeparator();
//------------------------
and compile/build it.


Offline harrykar

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Is there a way to get copy/cut/paste in the right click context menu?
« Reply #16 on: July 19, 2014, 09:18:14 am »
I really do not understand why you are making such an effort to creating menus at all if everything can be don by keyboard?
You've nailed it. The only purpose for the menus is to find what is the shortcut and never use them again  :P ;D

I notice it too that cumbersomeness. I am aware user experience is a difficult task to do well and in that field regard left click menus C:B lack
« Last Edit: July 19, 2014, 09:24:59 am by harrykar »
--"Arguing with an engineer is like wrestling with a pig in the mud; after a while you  realize you are muddy and the pig is enjoying it." <br />-- Don't Learn to HACK - Hack to LEARN <br />-- cyberwarfare is now an active part of information warfare

Offline harrykar

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Is there a way to get copy/cut/paste in the right click context menu?
« Reply #17 on: July 19, 2014, 09:23:39 am »
I really do not understand why you are making such an effort to creating menus at all if everything can be don by keyboard?
I assume you are probably some linux guys don't you?
Apart *nix or not i encounter only few coders that are not typists :)
--"Arguing with an engineer is like wrestling with a pig in the mud; after a while you  realize you are muddy and the pig is enjoying it." <br />-- Don't Learn to HACK - Hack to LEARN <br />-- cyberwarfare is now an active part of information warfare

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Is there a way to get copy/cut/paste in the right click context menu?
« Reply #18 on: July 19, 2014, 09:41:50 am »
If you want to have "cut, copy, paste and delete" direct in your C::B context menu do the following:
in file "cbeditor.cpp" in function "void cbEditor::AddToContextMenu(.." push between end of condition "if (!pluginsdone)" and (start of) condition "if (insert)" following lines:
//------------------------
popup->Append(idCut, _("Cut"));
popup->Enable(idCut, true);
popup->Append(idCopy, _("Copy"));
popup->Enable(idCopy, true);
popup->Append(idPaste, _("Paste"));
popup->Enable(idPaste, true);
popup->Append(idDelete, _("Delete"));
popup->Enable(idDelete, true);
popup->AppendSeparator();
//------------------------
and compile/build it.

Please allow me to vote for this as a standard feature in C::B. Cut, Paste and Delete are among the most used features in an editor. Ok, I also use the keyboard, but not only the keyboard for these operations. Then look at how other applications (editors) do it and the message is clear:  Cut, Paste and Delete should be directly available in the popup context menu, i.e. prioritised higher than now. That obviously means demoting or removing other, less important options.

Thanks for bringing it up.

Offline marosknapcok

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Is there a way to get copy/cut/paste in the right click context menu?
« Reply #19 on: July 19, 2014, 03:10:11 pm »
Is there anyone else who would like to beg the C::B masters for making some special mouse lovers christmas version? Till now there are 2 of us:
-marosknapcok
-cacb

PS:Please please please, we beg you on our knees :-)

Offline marosknapcok

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Is there a way to get copy/cut/paste in the right click context menu?
« Reply #20 on: July 20, 2014, 04:36:56 pm »
To add "Jump Back", "Jump Frwd", "Jump Clear" to contextmenu do the following:
-------------------------------
1.  go to module "JumpTracker.cpp"...
-------------------------------
... to function "JumpTracker::BuildModuleMenu" and replace it by following code:
Code
// ----------------------------------------------------------------------------
  void JumpTracker::BuildModuleMenu(const ModuleType type, wxMenu* pMenu, const FileTreeData* /*data*/)
// ----------------------------------------------------------------------------
{
    wxMenuItem* pMenuItem = NULL;
    if (!pMenu || !IsAttached())
        return;

    //pMenu->AppendSeparator();
    pMenuItem = pMenu->Append(idMenuJumpBack, _("Jump Back"));
    pMenuItem->Enable(true);
    pMenuItem = pMenu->Append(idMenuJumpNext, _("Jump Frwd"));
    pMenuItem->Enable(true);
    pMenuItem = pMenu->Append(idMenuJumpClear, _("Jump Clear"));
    pMenuItem->Enable(true);
}

-------------------------------
2.  go to module "BrowseTracker.cpp"...
-------------------------------
... to function/method "void BrowseTracker::BuildModuleMenu" and add between
end of cycle "for (int i=0; i<knt; ++i)" and "popup->AppendSeparator();" following code:
Code
    popup->AppendSeparator();
    m_pJumpTracker->BuildModuleMenu(type, popup);


-------------------------------
3.  open "CodeBlocks.workspace"...
-------------------------------
with original C::B, select only "BrowseTracker" plugin and build it.


-------------------------------
4.  hit "update.bat"...
-------------------------------
... , "..\src\output" will be generated with
 4.1."..\src\output\share\CodeBlocks\BrowseTracker.zip" file  and ...
 4.2."..\src\output\share\CodeBlocks\plugins\BrowseTracker.dll" file

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Is there a way to get copy/cut/paste in the right click context menu?
« Reply #21 on: July 28, 2014, 09:28:06 pm »
Is there anyone else who would like to beg the C::B masters for making some special mouse lovers christmas version?
The context menu is too cluttered to do what you want. I've tried to start a discussion and mark things that should be removed from it, but there are different people using different subsets of the items. Until there is a menu-configuration system I think we should not move anything anywhere....

p.s. Are you really telling me that you're using the Delete menu item, instead of the delete keyboard button?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline marosknapcok

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Is there a way to get copy/cut/paste in the right click context menu?
« Reply #22 on: July 29, 2014, 09:10:34 pm »
Yes.