blob: aae6106e0d27b7e5a7ba2cdd335f82978bf4bfd8 [file] [log] [blame]
David Scherer7aced172000-08-15 01:13:23 +00001# 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
15import sys
16import string
Steven M. Gava17d01542001-12-03 00:37:28 +000017#from keydefs import *
18from configHandler import idleConf
David Scherer7aced172000-08-15 01:13:23 +000019
20menudefs = [
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,
33 ('_Close', '<<close-window>>'),
34 ('E_xit', '<<close-all-windows>>'),
35 ]),
36 ('edit', [
37 ('_Undo', '<<undo>>'),
38 ('_Redo', '<<redo>>'),
39 None,
Steven M. Gava82c66822002-02-18 01:45:43 +000040 ('Cu_t', '<<cut>>'),
41 ('_Copy', '<<copy>>'),
42 ('_Paste', '<<paste>>'),
David Scherer7aced172000-08-15 01:13:23 +000043 ('Select _All', '<<select-all>>'),
Steven M. Gavac5976402002-01-04 03:06:08 +000044 None,
45 ('_Find...', '<<find>>'),
46 ('Find a_gain', '<<find-again>>'),
47 ('Find _selection', '<<find-selection>>'),
48 ('Find in Files...', '<<find-in-files>>'),
49 ('R_eplace...', '<<replace>>'),
50 ('Go to _line', '<<goto-line>>'),
David Scherer7aced172000-08-15 01:13:23 +000051 ]),
52 ('run',[
53 ('Python shell', '<<open-python-shell>>'),
54 ]),
55 ('debug', [
56 ('_Go to file/line', '<<goto-file-line>>'),
57 ('_Stack viewer', '<<open-stack-viewer>>'),
58 ('!_Debugger', '<<toggle-debugger>>'),
59 ('!_Auto-open stack viewer', '<<toggle-jit-stack-viewer>>' ),
60 ]),
Steven M. Gava82c66822002-02-18 01:45:43 +000061 ('settings', [
62 ('_Configure Idle...', '<<open-config-dialog>>'),
63 None,
64 ('Revert to _Default Settings', '<<revert-all-settings>>'),
65 ]),
David Scherer7aced172000-08-15 01:13:23 +000066 ('help', [
67 ('_IDLE Help...', '<<help>>'),
68 ('Python _Documentation...', '<<python-docs>>'),
69 ('_Advice...', '<<good-advice>>'),
Steven M. Gava0ba4df82001-08-11 07:42:37 +000070 ('View IDLE _Readme...', '<<view-readme>>'),
David Scherer7aced172000-08-15 01:13:23 +000071 None,
72 ('_About IDLE...', '<<about-idle>>'),
73 ]),
74]
75
Steven M. Gava72c3bf02002-01-19 10:41:51 +000076default_keydefs = idleConf.GetCurrentKeySet()
David Scherer7aced172000-08-15 01:13:23 +000077
78del sys