David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 1 | # This file defines the menu contents and key bindings. Note that |
| 2 | # there is additional configuration information in the EditorWindow |
| 3 | # class (and subclasses): the menus are created there based on the |
| 4 | # menu_specs (class) variable, and menus not created are silently |
| 5 | # skipped by the code here. This makes it possible to define the |
| 6 | # Debug menu here, which is only present in the PythonShell window. |
| 7 | |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 8 | import sys |
Steven M. Gava | 17d0154 | 2001-12-03 00:37:28 +0000 | [diff] [blame] | 9 | from configHandler import idleConf |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 10 | |
| 11 | menudefs = [ |
| 12 | # underscore prefixes character to underscore |
| 13 | ('file', [ |
| 14 | ('_New window', '<<open-new-window>>'), |
| 15 | ('_Open...', '<<open-window-from-file>>'), |
| 16 | ('Open _module...', '<<open-module>>'), |
| 17 | ('Class _browser', '<<open-class-browser>>'), |
| 18 | ('_Path browser', '<<open-path-browser>>'), |
| 19 | None, |
| 20 | ('_Save', '<<save-window>>'), |
| 21 | ('Save _As...', '<<save-window-as-file>>'), |
| 22 | ('Save Co_py As...', '<<save-copy-of-window-as-file>>'), |
| 23 | None, |
Steven M. Gava | 7981ce5 | 2002-06-11 04:45:34 +0000 | [diff] [blame] | 24 | ('_Print window', '<<print-window>>'), |
| 25 | None, |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 26 | ('_Close', '<<close-window>>'), |
| 27 | ('E_xit', '<<close-all-windows>>'), |
| 28 | ]), |
| 29 | ('edit', [ |
| 30 | ('_Undo', '<<undo>>'), |
| 31 | ('_Redo', '<<redo>>'), |
| 32 | None, |
Steven M. Gava | 82c6682 | 2002-02-18 01:45:43 +0000 | [diff] [blame] | 33 | ('Cu_t', '<<cut>>'), |
| 34 | ('_Copy', '<<copy>>'), |
| 35 | ('_Paste', '<<paste>>'), |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 36 | ('Select _All', '<<select-all>>'), |
Steven M. Gava | c597640 | 2002-01-04 03:06:08 +0000 | [diff] [blame] | 37 | None, |
| 38 | ('_Find...', '<<find>>'), |
| 39 | ('Find a_gain', '<<find-again>>'), |
| 40 | ('Find _selection', '<<find-selection>>'), |
| 41 | ('Find in Files...', '<<find-in-files>>'), |
| 42 | ('R_eplace...', '<<replace>>'), |
| 43 | ('Go to _line', '<<goto-line>>'), |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 44 | ]), |
Kurt B. Kaiser | 0c9b617 | 2002-09-14 00:50:44 +0000 | [diff] [blame] | 45 | ('format', [ |
| 46 | ('_Indent region', '<<indent-region>>'), |
| 47 | ('_Dedent region', '<<dedent-region>>'), |
| 48 | ('Comment _out region', '<<comment-region>>'), |
| 49 | ('U_ncomment region', '<<uncomment-region>>'), |
| 50 | ('Tabify region', '<<tabify-region>>'), |
| 51 | ('Untabify region', '<<untabify-region>>'), |
| 52 | ('Toggle tabs', '<<toggle-tabs>>'), |
| 53 | ('New indent width', '<<change-indentwidth>>'), |
| 54 | ]), |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 55 | ('run',[ |
| 56 | ('Python shell', '<<open-python-shell>>'), |
| 57 | ]), |
| 58 | ('debug', [ |
| 59 | ('_Go to file/line', '<<goto-file-line>>'), |
| 60 | ('_Stack viewer', '<<open-stack-viewer>>'), |
| 61 | ('!_Debugger', '<<toggle-debugger>>'), |
| 62 | ('!_Auto-open stack viewer', '<<toggle-jit-stack-viewer>>' ), |
| 63 | ]), |
Steven M. Gava | 82c6682 | 2002-02-18 01:45:43 +0000 | [diff] [blame] | 64 | ('settings', [ |
| 65 | ('_Configure Idle...', '<<open-config-dialog>>'), |
| 66 | None, |
| 67 | ('Revert to _Default Settings', '<<revert-all-settings>>'), |
| 68 | ]), |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 69 | ('help', [ |
| 70 | ('_IDLE Help...', '<<help>>'), |
| 71 | ('Python _Documentation...', '<<python-docs>>'), |
| 72 | ('_Advice...', '<<good-advice>>'), |
Steven M. Gava | 0ba4df8 | 2001-08-11 07:42:37 +0000 | [diff] [blame] | 73 | ('View IDLE _Readme...', '<<view-readme>>'), |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 74 | None, |
| 75 | ('_About IDLE...', '<<about-idle>>'), |
| 76 | ]), |
| 77 | ] |
| 78 | |
Steven M. Gava | 72c3bf0 | 2002-01-19 10:41:51 +0000 | [diff] [blame] | 79 | default_keydefs = idleConf.GetCurrentKeySet() |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 80 | |
| 81 | del sys |