summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/configDialog.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-06-04 06:31:08 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-06-04 06:31:08 (GMT)
commit4e49b836db96264b3b5236794a3200eea32b2519 (patch)
treea4c87341cc817962277444d7f8e3fccee9e4cff8 /Lib/idlelib/configDialog.py
parent3c145449daa8356c6ae4c296ffb24b5214647442 (diff)
downloadcpython-4e49b836db96264b3b5236794a3200eea32b2519.zip
cpython-4e49b836db96264b3b5236794a3200eea32b2519.tar.gz
cpython-4e49b836db96264b3b5236794a3200eea32b2519.tar.bz2
SF patch #961387: Make IDLE's paragraph reformatting width configurable
Diffstat (limited to 'Lib/idlelib/configDialog.py')
-rw-r--r--Lib/idlelib/configDialog.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/idlelib/configDialog.py b/Lib/idlelib/configDialog.py
index 2645943..35ef9ae 100644
--- a/Lib/idlelib/configDialog.py
+++ b/Lib/idlelib/configDialog.py
@@ -337,6 +337,7 @@ class ConfigDialog(Toplevel):
#tkVars
self.winWidth=StringVar(self)
self.winHeight=StringVar(self)
+ self.paraWidth=StringVar(self)
self.startupEdit=IntVar(self)
self.autoSave=IntVar(self)
self.encoding=StringVar(self)
@@ -349,6 +350,7 @@ class ConfigDialog(Toplevel):
frameRun=Frame(frame,borderwidth=2,relief=GROOVE)
frameSave=Frame(frame,borderwidth=2,relief=GROOVE)
frameWinSize=Frame(frame,borderwidth=2,relief=GROOVE)
+ frameParaSize=Frame(frame,borderwidth=2,relief=GROOVE)
frameEncoding=Frame(frame,borderwidth=2,relief=GROOVE)
frameHelp=Frame(frame,borderwidth=2,relief=GROOVE)
#frameRun
@@ -374,6 +376,11 @@ class ConfigDialog(Toplevel):
labelWinHeightTitle=Label(frameWinSize,text='Height')
entryWinHeight=Entry(frameWinSize,textvariable=self.winHeight,
width=3)
+ #paragraphFormatWidth
+ labelParaWidthTitle=Label(frameParaSize,text='Paragraph reformat'+
+ ' width (in characters)')
+ entryParaWidth=Entry(frameParaSize,textvariable=self.paraWidth,
+ width=3)
#frameEncoding
labelEncodingTitle=Label(frameEncoding,text="Default Source Encoding")
radioEncLocale=Radiobutton(frameEncoding,variable=self.encoding,
@@ -411,6 +418,7 @@ class ConfigDialog(Toplevel):
frameRun.pack(side=TOP,padx=5,pady=5,fill=X)
frameSave.pack(side=TOP,padx=5,pady=5,fill=X)
frameWinSize.pack(side=TOP,padx=5,pady=5,fill=X)
+ frameParaSize.pack(side=TOP,padx=5,pady=5,fill=X)
frameEncoding.pack(side=TOP,padx=5,pady=5,fill=X)
frameHelp.pack(side=TOP,padx=5,pady=5,expand=TRUE,fill=BOTH)
#frameRun
@@ -429,6 +437,9 @@ class ConfigDialog(Toplevel):
labelWinHeightTitle.pack(side=RIGHT,anchor=E,pady=5)
entryWinWidth.pack(side=RIGHT,anchor=E,padx=10,pady=5)
labelWinWidthTitle.pack(side=RIGHT,anchor=E,pady=5)
+ #paragraphFormatWidth
+ labelParaWidthTitle.pack(side=LEFT,anchor=W,padx=5,pady=5)
+ entryParaWidth.pack(side=RIGHT,anchor=E,padx=10,pady=5)
#frameEncoding
labelEncodingTitle.pack(side=LEFT,anchor=W,padx=5,pady=5)
radioEncNone.pack(side=RIGHT,anchor=E,pady=5)
@@ -466,6 +477,7 @@ class ConfigDialog(Toplevel):
self.keysAreBuiltin.trace_variable('w',self.VarChanged_keysAreBuiltin)
self.winWidth.trace_variable('w',self.VarChanged_winWidth)
self.winHeight.trace_variable('w',self.VarChanged_winHeight)
+ self.paraWidth.trace_variable('w',self.VarChanged_paraWidth)
self.startupEdit.trace_variable('w',self.VarChanged_startupEdit)
self.autoSave.trace_variable('w',self.VarChanged_autoSave)
self.encoding.trace_variable('w',self.VarChanged_encoding)
@@ -558,6 +570,10 @@ class ConfigDialog(Toplevel):
value=self.winHeight.get()
self.AddChangedItem('main','EditorWindow','height',value)
+ def VarChanged_paraWidth(self,*params):
+ value=self.paraWidth.get()
+ self.AddChangedItem('main','FormatParagraph','paragraph',value)
+
def VarChanged_startupEdit(self,*params):
value=self.startupEdit.get()
self.AddChangedItem('main','General','editor-on-startup',value)
@@ -1070,6 +1086,8 @@ class ConfigDialog(Toplevel):
#initial window size
self.winWidth.set(idleConf.GetOption('main','EditorWindow','width'))
self.winHeight.set(idleConf.GetOption('main','EditorWindow','height'))
+ #initial paragraph reformat size
+ self.paraWidth.set(idleConf.GetOption('main','FormatParagraph','paragraph'))
# default source encoding
self.encoding.set(idleConf.GetOption('main', 'EditorWindow',
'encoding', default='none'))