/jEdit/tags/jedit-4-2-pre14/macros/Interface/Open_Context_Menu.bsh
Unknown | 34 lines | 28 code | 6 blank | 0 comment | 0 complexity | b1c6d694b02762cbbc872d5da05b3045 MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
- /*
- * Open_Context_Menu.bsh - a BeanShell macro script for
- * the jEdit text editor - Opens the editor context menu
- * just below and to the right of the cursor.
- *
- * Copyright (C) 2003 Nitsan Vardi
- *
- * $Id: Open_Context_Menu.bsh 4937 2003-12-22 04:14:55Z spestov $
- */
- openContextMenu(){
- // Get the caret's position
- caretOffset = textArea.getCaretPosition();
- caretPos = textArea.offsetToXY(caretOffset);
- // Open the context menu near the caret
- GUIUtilities.showPopupMenu(textArea.getRightClickPopup(),
- textArea,caretPos.x+10,caretPos.y+20);
- }
- openContextMenu();
- /*
- Macro index data (in DocBook format)
- <listitem>
- <para><filename>Open_Context_Menu.bsh</filename></para>
- <abstract><para>
- Opens the text area context menu just below and to
- the right of the caret.
- </para></abstract>
- </listitem>
- */