wiki:Features/RightClick

Version 3 (modified by szabgab, 3 years ago) (diff)

--

Context Sensitive Right Click on the mouse

Clicking on the right button of the mouse trigger a pop-up in Padre with a list of actions that can be executed. The exact list depends on the file type and the specific location of the mouse.

As Padre also tries to be keyboard friendly the same pop-up can be triggerd by pressing Alt-/

Undo and Redo are always listed but they might be grayed out. They are the same as in Edit -> Undo and Redo

Open Selection is show if there is a selection

Open File in Browser will open the File Explorer of Windows or Nautilus on Ubuntu at the directory where the current file can be found

Find in Files will open that menu in Search -> Find in Files...

Copy and Cut, Paste, Select All the standard menu options

Toggle Comment, Comment and Uncomment can comment out one or more lines at a time

If the Show Code Folding is enabled and the mouse is over the folding margin on the left then you can see another two menu options to Fold All and Unfold All.

In addition each document type can add its own menu items by implementing the event_on_right_down method. For example the Perl document class Padre::Document::Perl adds Find Variable, Rename Variable and the whole Change Variable stye submenu if the mouse is over a variable name. Find Method Declaration if the mouse is over a subroutine or method name. If something is selected then it will also show Introduce Temporary Variable and Edit with Regex Editor.

Finally the plugins can also add extra menu options. (See on_context_menu of the Plugin Manager)

Test

Implementation

Padre::Wx::Menu::RightClick

TODO

  • Describe in detail
  • Allow plug-ins to add items
  • Allow the user to configure what's in the right-click menu
  • The Perl document should be able to recognize when the mouse is in a regex and show the Edit with Regex Editor only if it is and be able to paste the new regex back to the same location.