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 | |
| 8 | # changes by dscherer@cmu.edu: |
| 9 | # - Python shell moved to 'Run' menu |
| 10 | # - "Help" renamed to "IDLE Help" to distinguish from Python help. |
| 11 | # The distinction between the environment and the language is dim |
| 12 | # or nonexistent in a novice's mind. |
| 13 | # - Silly advice added |
| 14 | |
| 15 | import sys |
| 16 | import string |
| 17 | from keydefs import * |
| 18 | |
| 19 | menudefs = [ |
| 20 | # underscore prefixes character to underscore |
| 21 | ('file', [ |
| 22 | ('_New window', '<<open-new-window>>'), |
| 23 | ('_Open...', '<<open-window-from-file>>'), |
| 24 | ('Open _module...', '<<open-module>>'), |
| 25 | ('Class _browser', '<<open-class-browser>>'), |
| 26 | ('_Path browser', '<<open-path-browser>>'), |
| 27 | None, |
| 28 | ('_Save', '<<save-window>>'), |
| 29 | ('Save _As...', '<<save-window-as-file>>'), |
| 30 | ('Save Co_py As...', '<<save-copy-of-window-as-file>>'), |
| 31 | None, |
| 32 | ('_Close', '<<close-window>>'), |
| 33 | ('E_xit', '<<close-all-windows>>'), |
| 34 | ]), |
| 35 | ('edit', [ |
| 36 | ('_Undo', '<<undo>>'), |
| 37 | ('_Redo', '<<redo>>'), |
| 38 | None, |
| 39 | ('Cu_t', '<<Cut>>'), |
| 40 | ('_Copy', '<<Copy>>'), |
| 41 | ('_Paste', '<<Paste>>'), |
| 42 | ('Select _All', '<<select-all>>'), |
| 43 | ]), |
| 44 | ('run',[ |
| 45 | ('Python shell', '<<open-python-shell>>'), |
| 46 | ]), |
| 47 | ('debug', [ |
| 48 | ('_Go to file/line', '<<goto-file-line>>'), |
| 49 | ('_Stack viewer', '<<open-stack-viewer>>'), |
| 50 | ('!_Debugger', '<<toggle-debugger>>'), |
| 51 | ('!_Auto-open stack viewer', '<<toggle-jit-stack-viewer>>' ), |
| 52 | ]), |
| 53 | ('help', [ |
| 54 | ('_IDLE Help...', '<<help>>'), |
| 55 | ('Python _Documentation...', '<<python-docs>>'), |
| 56 | ('_Advice...', '<<good-advice>>'), |
Steven M. Gava | 0ba4df8 | 2001-08-11 07:42:37 +0000 | [diff] [blame] | 57 | ('View IDLE _Readme...', '<<view-readme>>'), |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 58 | None, |
| 59 | ('_About IDLE...', '<<about-idle>>'), |
| 60 | ]), |
| 61 | ] |
| 62 | |
| 63 | if sys.platform == 'win32': |
| 64 | default_keydefs = windows_keydefs |
| 65 | else: |
| 66 | default_keydefs = unix_keydefs |
| 67 | |
| 68 | del sys |