Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
8787a65c
Commit
8787a65c
authored
Nov 21, 2001
by
Steven M. Gava
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
back in harness on new config system
parent
39439e58
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
34 deletions
+53
-34
Lib/idlelib/Bindings.py
Lib/idlelib/Bindings.py
+5
-0
Lib/idlelib/EditorWindow.py
Lib/idlelib/EditorWindow.py
+6
-1
Lib/idlelib/PyShell.py
Lib/idlelib/PyShell.py
+1
-1
Lib/idlelib/configDialog.py
Lib/idlelib/configDialog.py
+41
-32
No files found.
Lib/idlelib/Bindings.py
View file @
8787a65c
...
...
@@ -50,6 +50,11 @@ menudefs = [
(
'!_Debugger'
,
'<<toggle-debugger>>'
),
(
'!_Auto-open stack viewer'
,
'<<toggle-jit-stack-viewer>>'
),
]),
# ('settings', [
# ('_Configure Idle...', '<<open-config-dialog>>'),
# None,
# ('Revert to _Default Settings', '<<revert-all-settings>>'),
# ]),
(
'help'
,
[
(
'_IDLE Help...'
,
'<<help>>'
),
(
'Python _Documentation...'
,
'<<python-docs>>'
),
...
...
Lib/idlelib/EditorWindow.py
View file @
8787a65c
...
...
@@ -17,7 +17,7 @@ import webbrowser
import
idlever
import
WindowList
from
IdleConf
import
idleconf
import
aboutDialog
,
textView
import
aboutDialog
,
textView
,
configDialog
# The default tab setting for a Text widget, in average-width characters.
TK_TABWIDTH_DEFAULT
=
8
...
...
@@ -123,6 +123,7 @@ class EditorWindow:
text
.
bind
(
"<<view-readme>>"
,
self
.
view_readme
)
text
.
bind
(
"<<python-docs>>"
,
self
.
python_docs
)
text
.
bind
(
"<<about-idle>>"
,
self
.
about_dialog
)
text
.
bind
(
"<<open-config-dialog>>"
,
self
.
config_dialog
)
text
.
bind
(
"<<open-module>>"
,
self
.
open_module
)
text
.
bind
(
"<<do-nothing>>"
,
lambda
event
:
"break"
)
text
.
bind
(
"<<select-all>>"
,
self
.
select_all
)
...
...
@@ -220,6 +221,7 @@ class EditorWindow:
(
"edit"
,
"_Edit"
),
(
"format"
,
"F_ormat"
),
(
"run"
,
"_Run"
),
#("settings", "_Settings"),
(
"windows"
,
"_Windows"
),
(
"help"
,
"_Help"
),
]
...
...
@@ -278,6 +280,9 @@ class EditorWindow:
def
about_dialog
(
self
,
event
=
None
):
aboutDialog
.
AboutDialog
(
self
.
top
,
'About IDLEfork'
)
def
config_dialog
(
self
,
event
=
None
):
configDialog
.
ConfigDialog
(
self
.
top
,
'Settings'
)
def
good_advice
(
self
,
event
=
None
):
tkMessageBox
.
showinfo
(
'Advice'
,
"Don't Panic!"
,
master
=
self
.
text
)
...
...
Lib/idlelib/PyShell.py
View file @
8787a65c
...
...
@@ -328,7 +328,7 @@ class PyShell(OutputWindow):
# Override menu bar specs
menu_specs
=
PyShellEditorWindow
.
menu_specs
[:]
menu_specs
.
insert
(
len
(
menu_specs
)
-
2
,
(
"debug"
,
"_Debug"
))
menu_specs
.
insert
(
len
(
menu_specs
)
-
3
,
(
"debug"
,
"_Debug"
))
# New classes
from
IdleHistory
import
History
...
...
Lib/idlelib/configDialog.py
View file @
8787a65c
...
...
@@ -17,10 +17,7 @@ class ConfigDialog(Toplevel):
"""
configuration dialog for idle
"""
def
__init__
(
self
,
parent
,
title
,
configDict
):
"""
configDict - dictionary of configuration items
"""
def
__init__
(
self
,
parent
,
title
):
Toplevel
.
__init__
(
self
,
parent
)
self
.
configure
(
borderwidth
=
5
)
self
.
geometry
(
"+%d+%d"
%
(
parent
.
winfo_rootx
()
+
20
,
...
...
@@ -160,6 +157,18 @@ class ConfigDialog(Toplevel):
self
.
radioFg
.
config
(
state
=
NORMAL
)
self
.
radioBg
.
config
(
state
=
NORMAL
)
self
.
fgHilite
.
set
(
1
)
#default to setting foreground attribute
self
.
SetColourSample
()
def
SetColourSampleBinding
(
self
,
*
args
):
self
.
SetColourSample
()
def
SetColourSample
(
self
):
#set the colour smaple area
tag
=
self
.
themeElements
[
self
.
highlightTarget
.
get
()][
0
]
if
self
.
fgHilite
.
get
():
plane
=
'foreground'
else
:
plane
=
'background'
colour
=
self
.
textHighlightSample
.
tag_cget
(
tag
,
plane
)
self
.
frameColourSet
.
config
(
bg
=
colour
)
def
CreateWidgets
(
self
):
self
.
framePages
=
Frame
(
self
)
...
...
@@ -175,7 +184,7 @@ class ConfigDialog(Toplevel):
self
.
buttonCancel
=
Button
(
frameActionButtons
,
text
=
'Cancel'
,
command
=
self
.
Cancel
,
takefocus
=
FALSE
)
#page buttons
self
.
pageNum
=
IntVar
()
self
.
pageNum
=
IntVar
(
self
)
self
.
pageNum
.
set
(
0
)
pageButtonNames
=
(
'Fonts/Tabs'
,
'Highlighting'
,
'Keys'
,
'General'
)
self
.
pageButtons
=
[]
...
...
@@ -211,11 +220,11 @@ class ConfigDialog(Toplevel):
def
CreatePageFontTab
(
self
):
#tkVars
self
.
fontSize
=
StringVar
()
self
.
fontBold
=
StringVar
()
self
.
spaceNum
=
IntVar
()
self
.
tabCols
=
IntVar
()
self
.
indentType
=
IntVar
()
self
.
fontSize
=
StringVar
(
self
)
self
.
fontBold
=
StringVar
(
self
)
self
.
spaceNum
=
IntVar
(
self
)
self
.
tabCols
=
IntVar
(
self
)
self
.
indentType
=
IntVar
(
self
)
self
.
editFont
=
tkFont
.
Font
(
self
,(
'courier'
,
12
,
'normal'
))
##widget creation
#body frame
...
...
@@ -295,13 +304,13 @@ class ConfigDialog(Toplevel):
return
frame
def
CreatePageHighlight
(
self
):
self
.
builtinTheme
=
StringVar
()
self
.
customTheme
=
StringVar
()
self
.
fgHilite
=
IntVar
()
self
.
colour
=
StringVar
()
self
.
fontName
=
StringVar
()
self
.
themeIsBuiltin
=
IntVar
()
self
.
highlightTarget
=
StringVar
()
self
.
builtinTheme
=
StringVar
(
self
)
self
.
customTheme
=
StringVar
(
self
)
self
.
fgHilite
=
IntVar
(
self
)
self
.
colour
=
StringVar
(
self
)
self
.
fontName
=
StringVar
(
self
)
self
.
themeIsBuiltin
=
IntVar
(
self
)
self
.
highlightTarget
=
StringVar
(
self
)
self
.
highlightTarget
.
trace_variable
(
'w'
,
self
.
SetHighlightTargetBinding
)
##widget creation
#body frame
...
...
@@ -340,9 +349,9 @@ class ConfigDialog(Toplevel):
self
.
optMenuHighlightTarget
=
DynOptionMenu
(
self
.
frameColourSet
,
self
.
highlightTarget
,
None
,
highlightthickness
=
0
)
#,command=self.SetHighlightTargetBinding
self
.
radioFg
=
Radiobutton
(
frameFgBg
,
variable
=
self
.
fgHilite
,
value
=
1
,
text
=
'Foreground'
)
#,command=self.SetFgBg
value
=
1
,
text
=
'Foreground'
,
command
=
self
.
SetColourSampleBinding
)
self
.
radioBg
=
Radiobutton
(
frameFgBg
,
variable
=
self
.
fgHilite
,
value
=
0
,
text
=
'Background'
)
#,command=self.SetFgBg
value
=
0
,
text
=
'Background'
,
command
=
self
.
SetColourSampleBinding
)
self
.
fgHilite
.
set
(
1
)
buttonSaveCustomTheme
=
Button
(
frameCustom
,
text
=
'Save as a Custom Theme'
)
...
...
@@ -385,14 +394,14 @@ class ConfigDialog(Toplevel):
def
CreatePageKeys
(
self
):
#tkVars
self
.
bindingTarget
=
StringVar
()
self
.
builtinKeys
=
StringVar
()
self
.
customKeys
=
StringVar
()
self
.
keyChars
=
StringVar
()
self
.
keyCtrl
=
StringVar
()
self
.
keyAlt
=
StringVar
()
self
.
keyShift
=
StringVar
()
self
.
keysAreDefault
=
IntVar
()
self
.
bindingTarget
=
StringVar
(
self
)
self
.
builtinKeys
=
StringVar
(
self
)
self
.
customKeys
=
StringVar
(
self
)
self
.
keyChars
=
StringVar
(
self
)
self
.
keyCtrl
=
StringVar
(
self
)
self
.
keyAlt
=
StringVar
(
self
)
self
.
keyShift
=
StringVar
(
self
)
self
.
keysAreDefault
=
IntVar
(
self
)
##widget creation
#body frame
frame
=
Frame
(
self
.
framePages
,
borderwidth
=
2
,
relief
=
RAISED
)
...
...
@@ -460,10 +469,10 @@ class ConfigDialog(Toplevel):
def
CreatePageGeneral
(
self
):
#tkVars
self
.
runType
=
IntVar
()
self
.
winWidth
=
StringVar
()
self
.
winHeight
=
StringVar
()
self
.
extState
=
IntVar
()
self
.
runType
=
IntVar
(
self
)
self
.
winWidth
=
StringVar
(
self
)
self
.
winHeight
=
StringVar
(
self
)
self
.
extState
=
IntVar
(
self
)
#widget creation
#body
frame
=
Frame
(
self
.
framePages
,
borderwidth
=
2
,
relief
=
RAISED
)
...
...
@@ -663,5 +672,5 @@ if __name__ == '__main__':
#test the dialog
root
=
Tk
()
Button
(
root
,
text
=
'Dialog'
,
command
=
lambda
:
ConfigDialog
(
root
,
'Settings'
,
None
)).
pack
()
command
=
lambda
:
ConfigDialog
(
root
,
'Settings'
)).
pack
()
root
.
mainloop
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment