Guido van Rossum | 6e0a413 | 1998-11-27 03:17:49 +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. |
Guido van Rossum | 3b4ca0d | 1998-10-10 18:48:31 +0000 | [diff] [blame] | 7 | |
Guido van Rossum | 6e0a413 | 1998-11-27 03:17:49 +0000 | [diff] [blame] | 8 | import sys |
| 9 | import string |
Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 10 | from keydefs import * |
Guido van Rossum | 3b4ca0d | 1998-10-10 18:48:31 +0000 | [diff] [blame] | 11 | |
Guido van Rossum | 6e0a413 | 1998-11-27 03:17:49 +0000 | [diff] [blame] | 12 | menudefs = [ |
| 13 | # underscore prefixes character to underscore |
| 14 | ('file', [ |
| 15 | ('_New window', '<<open-new-window>>'), |
| 16 | ('_Open...', '<<open-window-from-file>>'), |
| 17 | ('Open _module...', '<<open-module>>'), |
Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 18 | ('Class _browser', '<<open-class-browser>>'), |
Guido van Rossum | d6e8713 | 1999-03-10 05:18:02 +0000 | [diff] [blame] | 19 | ('_Path browser', '<<open-path-browser>>'), |
Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 20 | ('Python shell', '<<open-python-shell>>'), |
Guido van Rossum | 6e0a413 | 1998-11-27 03:17:49 +0000 | [diff] [blame] | 21 | None, |
| 22 | ('_Save', '<<save-window>>'), |
| 23 | ('Save _As...', '<<save-window-as-file>>'), |
| 24 | ('Save Co_py As...', '<<save-copy-of-window-as-file>>'), |
| 25 | None, |
| 26 | ('_Close', '<<close-window>>'), |
| 27 | ('E_xit', '<<close-all-windows>>'), |
| 28 | ]), |
| 29 | ('edit', [ |
| 30 | ('_Undo', '<<undo>>'), |
| 31 | ('_Redo', '<<redo>>'), |
| 32 | None, |
| 33 | ('Cu_t', '<<Cut>>'), |
| 34 | ('_Copy', '<<Copy>>'), |
| 35 | ('_Paste', '<<Paste>>'), |
Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 36 | ('Select _All', '<<select-all>>'), |
| 37 | ]), |
Guido van Rossum | 6e0a413 | 1998-11-27 03:17:49 +0000 | [diff] [blame] | 38 | ('debug', [ |
Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 39 | ('_Go to file/line', '<<goto-file-line>>'), |
Guido van Rossum | 07ec896 | 1999-01-28 22:02:47 +0000 | [diff] [blame] | 40 | ('_Stack viewer', '<<open-stack-viewer>>'), |
| 41 | ('!_Debugger', '<<toggle-debugger>>'), |
| 42 | ('!_Auto-open stack viewer', '<<toggle-jit-stack-viewer>>' ), |
Guido van Rossum | 6e0a413 | 1998-11-27 03:17:49 +0000 | [diff] [blame] | 43 | ]), |
| 44 | ('help', [ |
| 45 | ('_Help...', '<<help>>'), |
Guido van Rossum | 7f1fdfc | 1999-08-26 23:06:22 +0000 | [diff] [blame] | 46 | ('Python _Documentation...', '<<python-docs>>'), |
Guido van Rossum | 6e0a413 | 1998-11-27 03:17:49 +0000 | [diff] [blame] | 47 | None, |
| 48 | ('_About IDLE...', '<<about-idle>>'), |
| 49 | ]), |
Guido van Rossum | 3b4ca0d | 1998-10-10 18:48:31 +0000 | [diff] [blame] | 50 | ] |
| 51 | |
Guido van Rossum | 6e0a413 | 1998-11-27 03:17:49 +0000 | [diff] [blame] | 52 | if sys.platform == 'win32': |
| 53 | default_keydefs = windows_keydefs |
| 54 | else: |
Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 55 | default_keydefs = unix_keydefs |
Guido van Rossum | 7f1fdfc | 1999-08-26 23:06:22 +0000 | [diff] [blame] | 56 | |
| 57 | del sys |