blob: 2d5d7bbf0a7ccaca59b89257e4c86e585282ad3d [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
David Scherer7aced172000-08-15 01:13:23 +00008import sys
9import string
Steven M. Gava17d01542001-12-03 00:37:28 +000010from configHandler import idleConf
David Scherer7aced172000-08-15 01:13:23 +000011
12menudefs = [
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>>'),
18 ('Class _browser', '<<open-class-browser>>'),
19 ('_Path browser', '<<open-path-browser>>'),
20 None,
21 ('_Save', '<<save-window>>'),
22 ('Save _As...', '<<save-window-as-file>>'),
23 ('Save Co_py As...', '<<save-copy-of-window-as-file>>'),
24 None,
Steven M. Gava7981ce52002-06-11 04:45:34 +000025 ('_Print window', '<<print-window>>'),
26 None,
David Scherer7aced172000-08-15 01:13:23 +000027 ('_Close', '<<close-window>>'),
28 ('E_xit', '<<close-all-windows>>'),
29 ]),
30 ('edit', [
31 ('_Undo', '<<undo>>'),
32 ('_Redo', '<<redo>>'),
33 None,
Steven M. Gava82c66822002-02-18 01:45:43 +000034 ('Cu_t', '<<cut>>'),
35 ('_Copy', '<<copy>>'),
36 ('_Paste', '<<paste>>'),
David Scherer7aced172000-08-15 01:13:23 +000037 ('Select _All', '<<select-all>>'),
Steven M. Gavac5976402002-01-04 03:06:08 +000038 None,
39 ('_Find...', '<<find>>'),
40 ('Find a_gain', '<<find-again>>'),
41 ('Find _selection', '<<find-selection>>'),
42 ('Find in Files...', '<<find-in-files>>'),
43 ('R_eplace...', '<<replace>>'),
44 ('Go to _line', '<<goto-line>>'),
David Scherer7aced172000-08-15 01:13:23 +000045 ]),
Kurt B. Kaiser0c9b6172002-09-14 00:50:44 +000046('format', [
47 ('_Indent region', '<<indent-region>>'),
48 ('_Dedent region', '<<dedent-region>>'),
49 ('Comment _out region', '<<comment-region>>'),
50 ('U_ncomment region', '<<uncomment-region>>'),
51 ('Tabify region', '<<tabify-region>>'),
52 ('Untabify region', '<<untabify-region>>'),
53 ('Toggle tabs', '<<toggle-tabs>>'),
54 ('New indent width', '<<change-indentwidth>>'),
55]),
David Scherer7aced172000-08-15 01:13:23 +000056 ('run',[
57 ('Python shell', '<<open-python-shell>>'),
58 ]),
59 ('debug', [
60 ('_Go to file/line', '<<goto-file-line>>'),
61 ('_Stack viewer', '<<open-stack-viewer>>'),
62 ('!_Debugger', '<<toggle-debugger>>'),
63 ('!_Auto-open stack viewer', '<<toggle-jit-stack-viewer>>' ),
64 ]),
Steven M. Gava82c66822002-02-18 01:45:43 +000065 ('settings', [
66 ('_Configure Idle...', '<<open-config-dialog>>'),
67 None,
68 ('Revert to _Default Settings', '<<revert-all-settings>>'),
69 ]),
David Scherer7aced172000-08-15 01:13:23 +000070 ('help', [
71 ('_IDLE Help...', '<<help>>'),
72 ('Python _Documentation...', '<<python-docs>>'),
73 ('_Advice...', '<<good-advice>>'),
Steven M. Gava0ba4df82001-08-11 07:42:37 +000074 ('View IDLE _Readme...', '<<view-readme>>'),
David Scherer7aced172000-08-15 01:13:23 +000075 None,
76 ('_About IDLE...', '<<about-idle>>'),
77 ]),
78]
79
Steven M. Gava72c3bf02002-01-19 10:41:51 +000080default_keydefs = idleConf.GetCurrentKeySet()
David Scherer7aced172000-08-15 01:13:23 +000081
82del sys