blob: 8bf0e704c4b58ebaa7302a3658135e00ce4af5b1 [file] [log] [blame]
Guido van Rossum6e0a4131998-11-27 03:17:49 +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.
Guido van Rossum3b4ca0d1998-10-10 18:48:31 +00007
Guido van Rossum6e0a4131998-11-27 03:17:49 +00008import sys
9import string
Guido van Rossum504b0bf1999-01-02 21:28:54 +000010from keydefs import *
Guido van Rossum3b4ca0d1998-10-10 18:48:31 +000011
Guido van Rossum6e0a4131998-11-27 03:17:49 +000012menudefs = [
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 Rossum504b0bf1999-01-02 21:28:54 +000018 ('Class _browser', '<<open-class-browser>>'),
Guido van Rossumd6e87131999-03-10 05:18:02 +000019 ('_Path browser', '<<open-path-browser>>'),
Guido van Rossum504b0bf1999-01-02 21:28:54 +000020 ('Python shell', '<<open-python-shell>>'),
Guido van Rossum6e0a4131998-11-27 03:17:49 +000021 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,
Guido van Rossum2ca78622002-06-10 18:52:02 +000026 ('_Print window', '<<print-window>>'),
27 None,
Guido van Rossum6e0a4131998-11-27 03:17:49 +000028 ('_Close', '<<close-window>>'),
29 ('E_xit', '<<close-all-windows>>'),
30 ]),
31 ('edit', [
32 ('_Undo', '<<undo>>'),
33 ('_Redo', '<<redo>>'),
34 None,
35 ('Cu_t', '<<Cut>>'),
36 ('_Copy', '<<Copy>>'),
37 ('_Paste', '<<Paste>>'),
Guido van Rossum504b0bf1999-01-02 21:28:54 +000038 ('Select _All', '<<select-all>>'),
39 ]),
Guido van Rossum6e0a4131998-11-27 03:17:49 +000040 ('debug', [
Guido van Rossum504b0bf1999-01-02 21:28:54 +000041 ('_Go to file/line', '<<goto-file-line>>'),
Guido van Rossum07ec8961999-01-28 22:02:47 +000042 ('_Stack viewer', '<<open-stack-viewer>>'),
43 ('!_Debugger', '<<toggle-debugger>>'),
44 ('!_Auto-open stack viewer', '<<toggle-jit-stack-viewer>>' ),
Guido van Rossum6e0a4131998-11-27 03:17:49 +000045 ]),
46 ('help', [
47 ('_Help...', '<<help>>'),
Guido van Rossum7f1fdfc1999-08-26 23:06:22 +000048 ('Python _Documentation...', '<<python-docs>>'),
Guido van Rossum6e0a4131998-11-27 03:17:49 +000049 None,
50 ('_About IDLE...', '<<about-idle>>'),
51 ]),
Guido van Rossum3b4ca0d1998-10-10 18:48:31 +000052]
53
Guido van Rossum6e0a4131998-11-27 03:17:49 +000054if sys.platform == 'win32':
55 default_keydefs = windows_keydefs
56else:
Guido van Rossum504b0bf1999-01-02 21:28:54 +000057 default_keydefs = unix_keydefs
Guido van Rossum7f1fdfc1999-08-26 23:06:22 +000058
59del sys