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 |
Steven M. Gava | 17d0154 | 2001-12-03 00:37:28 +0000 | [diff] [blame] | 17 | #from keydefs import * |
| 18 | from configHandler import idleConf |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 19 | |
| 20 | menudefs = [ |
| 21 | # underscore prefixes character to underscore |
| 22 | ('file', [ |
| 23 | ('_New window', '<<open-new-window>>'), |
| 24 | ('_Open...', '<<open-window-from-file>>'), |
| 25 | ('Open _module...', '<<open-module>>'), |
| 26 | ('Class _browser', '<<open-class-browser>>'), |
| 27 | ('_Path browser', '<<open-path-browser>>'), |
| 28 | None, |
| 29 | ('_Save', '<<save-window>>'), |
| 30 | ('Save _As...', '<<save-window-as-file>>'), |
| 31 | ('Save Co_py As...', '<<save-copy-of-window-as-file>>'), |
| 32 | None, |
Steven M. Gava | 7981ce5 | 2002-06-11 04:45:34 +0000 | [diff] [blame] | 33 | ('_Print window', '<<print-window>>'), |
| 34 | None, |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 35 | ('_Close', '<<close-window>>'), |
| 36 | ('E_xit', '<<close-all-windows>>'), |
| 37 | ]), |
| 38 | ('edit', [ |
| 39 | ('_Undo', '<<undo>>'), |
| 40 | ('_Redo', '<<redo>>'), |
| 41 | None, |
Steven M. Gava | 82c6682 | 2002-02-18 01:45:43 +0000 | [diff] [blame] | 42 | ('Cu_t', '<<cut>>'), |
| 43 | ('_Copy', '<<copy>>'), |
| 44 | ('_Paste', '<<paste>>'), |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 45 | ('Select _All', '<<select-all>>'), |
Steven M. Gava | c597640 | 2002-01-04 03:06:08 +0000 | [diff] [blame] | 46 | None, |
| 47 | ('_Find...', '<<find>>'), |
| 48 | ('Find a_gain', '<<find-again>>'), |
| 49 | ('Find _selection', '<<find-selection>>'), |
| 50 | ('Find in Files...', '<<find-in-files>>'), |
| 51 | ('R_eplace...', '<<replace>>'), |
| 52 | ('Go to _line', '<<goto-line>>'), |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 53 | ]), |
| 54 | ('run',[ |
| 55 | ('Python shell', '<<open-python-shell>>'), |
| 56 | ]), |
| 57 | ('debug', [ |
| 58 | ('_Go to file/line', '<<goto-file-line>>'), |
| 59 | ('_Stack viewer', '<<open-stack-viewer>>'), |
| 60 | ('!_Debugger', '<<toggle-debugger>>'), |
| 61 | ('!_Auto-open stack viewer', '<<toggle-jit-stack-viewer>>' ), |
| 62 | ]), |
Steven M. Gava | 82c6682 | 2002-02-18 01:45:43 +0000 | [diff] [blame] | 63 | ('settings', [ |
| 64 | ('_Configure Idle...', '<<open-config-dialog>>'), |
| 65 | None, |
| 66 | ('Revert to _Default Settings', '<<revert-all-settings>>'), |
| 67 | ]), |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 68 | ('help', [ |
| 69 | ('_IDLE Help...', '<<help>>'), |
| 70 | ('Python _Documentation...', '<<python-docs>>'), |
| 71 | ('_Advice...', '<<good-advice>>'), |
Steven M. Gava | 0ba4df8 | 2001-08-11 07:42:37 +0000 | [diff] [blame] | 72 | ('View IDLE _Readme...', '<<view-readme>>'), |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 73 | None, |
| 74 | ('_About IDLE...', '<<about-idle>>'), |
| 75 | ]), |
| 76 | ] |
| 77 | |
Steven M. Gava | 72c3bf0 | 2002-01-19 10:41:51 +0000 | [diff] [blame] | 78 | default_keydefs = idleConf.GetCurrentKeySet() |
David Scherer | 7aced17 | 2000-08-15 01:13:23 +0000 | [diff] [blame] | 79 | |
| 80 | del sys |