News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Is there a way to get copy/cut/paste in the right click context menu?

Started by c_weed, October 01, 2013, 07:22:30 AM

Previous topic - Next topic

marosknapcok

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.


harrykar

Quote from: oBFusCATed on July 12, 2014, 01:40:48 AM
Quote from: marosknapcok on July 12, 2014, 12:45:37 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
--"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

harrykar

Quote from: marosknapcok on July 12, 2014, 12:45:37 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

cacb

Quote from: marosknapcok 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.

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.

marosknapcok

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 :-)

marosknapcok

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:

// ----------------------------------------------------------------------------
  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:

    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

oBFusCATed

Quote from: marosknapcok 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?
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!]