Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
c01e30f0
Kaydet (Commit)
c01e30f0
authored
Agu 11, 2001
tarafından
Steven M. Gava
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
repair posix fonts fix
üst
58682b7f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
38 deletions
+66
-38
aboutDialog.py
Lib/idlelib/aboutDialog.py
+3
-6
configDialog.py
Lib/idlelib/configDialog.py
+63
-32
No files found.
Lib/idlelib/aboutDialog.py
Dosyayı görüntüle @
c01e30f0
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
about box for idle
about box for idle
"""
"""
from
Tkinter
import
*
from
Tkinter
import
*
import
tkFont
import
string
,
os
import
string
,
os
import
textView
import
textView
import
idlever
import
idlever
...
@@ -24,12 +25,8 @@ class AboutDialog(Toplevel):
...
@@ -24,12 +25,8 @@ class AboutDialog(Toplevel):
self
.
bg
=
"#555555"
self
.
bg
=
"#555555"
self
.
fg
=
"#ffffff"
self
.
fg
=
"#ffffff"
#no ugly bold default font on *nix
#no ugly bold default font on *nix
font
=
Label
()
.
cget
(
'font'
)
font
=
tkFont
.
Font
(
self
,
Label
()
.
cget
(
'font'
))
if
os
.
name
==
'posix'
:
if
os
.
name
==
'posix'
:
font
.
config
(
weight
=
NORMAL
)
lFont
=
font
.
split
()
if
len
(
lFont
)
==
2
:
lFont
=
lFont
+
[
'normal'
]
else
:
lFont
[
2
]
=
'normal'
font
=
tuple
(
lFont
)
self
.
textFont
=
font
self
.
textFont
=
font
self
.
CreateWidgets
()
self
.
CreateWidgets
()
...
...
Lib/idlelib/configDialog.py
Dosyayı görüntüle @
c01e30f0
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
configuration dialog
configuration dialog
"""
"""
from
Tkinter
import
*
from
Tkinter
import
*
import
tkMessageBox
,
tkColorChooser
import
tkMessageBox
,
tkColorChooser
,
tkFont
import
IdleConf
import
IdleConf
...
@@ -28,8 +28,6 @@ class ConfigDialog(Toplevel):
...
@@ -28,8 +28,6 @@ class ConfigDialog(Toplevel):
#elguavas - config placeholders til config stuff completed
#elguavas - config placeholders til config stuff completed
self
.
bg
=
self
.
cget
(
'bg'
)
self
.
bg
=
self
.
cget
(
'bg'
)
self
.
fg
=
None
self
.
fg
=
None
#no ugly bold default text font on *nix
self
.
textFont
=
tuple
(
Label
()
.
cget
(
'font'
)
.
split
())[
0
:
2
]
+
(
'normal'
,)
self
.
CreateWidgets
()
self
.
CreateWidgets
()
self
.
resizable
(
height
=
FALSE
,
width
=
FALSE
)
self
.
resizable
(
height
=
FALSE
,
width
=
FALSE
)
...
@@ -41,7 +39,7 @@ class ConfigDialog(Toplevel):
...
@@ -41,7 +39,7 @@ class ConfigDialog(Toplevel):
self
.
framePages
.
focus_set
()
self
.
framePages
.
focus_set
()
#key bindings for this dialog
#key bindings for this dialog
self
.
bind
(
'<Escape>'
,
self
.
CancelBinding
)
#dismiss dialog, no save
self
.
bind
(
'<Escape>'
,
self
.
CancelBinding
)
#dismiss dialog, no save
self
.
bind
(
'<Alt-
s>'
,
self
.
SaveBinding
)
#dismiss dialog
, save
self
.
bind
(
'<Alt-
a>'
,
self
.
ApplyBinding
)
#apply changes
, save
self
.
bind
(
'<F1>'
,
self
.
HelpBinding
)
#context help
self
.
bind
(
'<F1>'
,
self
.
HelpBinding
)
#context help
self
.
bind
(
'<Alt-f>'
,
self
.
ChangePageBinding
)
self
.
bind
(
'<Alt-f>'
,
self
.
ChangePageBinding
)
self
.
bind
(
'<Alt-h>'
,
self
.
ChangePageBinding
)
self
.
bind
(
'<Alt-h>'
,
self
.
ChangePageBinding
)
...
@@ -63,7 +61,10 @@ class ConfigDialog(Toplevel):
...
@@ -63,7 +61,10 @@ class ConfigDialog(Toplevel):
def
Cancel
(
self
):
def
Cancel
(
self
):
self
.
destroy
()
self
.
destroy
()
def
Save
(
self
):
def
Ok
(
self
):
pass
def
Apply
(
self
):
pass
pass
def
Help
(
self
):
def
Help
(
self
):
...
@@ -72,8 +73,11 @@ class ConfigDialog(Toplevel):
...
@@ -72,8 +73,11 @@ class ConfigDialog(Toplevel):
def
CancelBinding
(
self
,
event
):
def
CancelBinding
(
self
,
event
):
self
.
Cancel
()
self
.
Cancel
()
def
SaveBinding
(
self
,
event
):
def
OkBinding
(
self
,
event
):
self
.
Save
()
self
.
Ok
()
def
ApplyBinding
(
self
,
event
):
self
.
Apply
()
def
HelpBinding
(
self
,
event
):
def
HelpBinding
(
self
,
event
):
self
.
Help
()
self
.
Help
()
...
@@ -126,6 +130,20 @@ class ConfigDialog(Toplevel):
...
@@ -126,6 +130,20 @@ class ConfigDialog(Toplevel):
self
.
frameHighlightSample
.
update
()
#redraw after dialog
self
.
frameHighlightSample
.
update
()
#redraw after dialog
self
.
labelTestSample
.
update
()
self
.
labelTestSample
.
update
()
def
__LoadFontList
(
self
):
fonts
=
list
(
tkFont
.
families
(
self
))
fonts
.
sort
()
for
font
in
fonts
:
self
.
listFontName
.
insert
(
END
,
font
)
currentFontIndex
=
fonts
.
index
(
'courier'
)
self
.
listFontName
.
see
(
currentFontIndex
)
self
.
listFontName
.
select_set
(
currentFontIndex
)
self
.
fontSize
.
set
(
'12'
)
def
__SetFontSample
(
self
,
event
):
self
.
newFont
.
config
(
size
=
self
.
fontSize
.
get
(),
weight
=
NORMAL
,
family
=
self
.
listFontName
.
get
(
self
.
listFontName
.
curselection
()[
0
]))
def
CreateWidgets
(
self
):
def
CreateWidgets
(
self
):
self
.
framePages
=
Frame
(
self
)
self
.
framePages
=
Frame
(
self
)
frameActionButtons
=
Frame
(
self
)
frameActionButtons
=
Frame
(
self
)
...
@@ -133,8 +151,10 @@ class ConfigDialog(Toplevel):
...
@@ -133,8 +151,10 @@ class ConfigDialog(Toplevel):
#action buttons
#action buttons
self
.
buttonHelp
=
Button
(
frameActionButtons
,
text
=
'Help'
,
self
.
buttonHelp
=
Button
(
frameActionButtons
,
text
=
'Help'
,
command
=
self
.
Help
,
takefocus
=
FALSE
)
command
=
self
.
Help
,
takefocus
=
FALSE
)
self
.
buttonSave
=
Button
(
frameActionButtons
,
text
=
'Save, Apply and Exit'
,
self
.
buttonOk
=
Button
(
frameActionButtons
,
text
=
'Ok'
,
command
=
self
.
Save
,
underline
=
0
,
takefocus
=
FALSE
)
command
=
self
.
Ok
,
takefocus
=
FALSE
)
self
.
buttonApply
=
Button
(
frameActionButtons
,
text
=
'Apply'
,
command
=
self
.
Apply
,
underline
=
0
,
takefocus
=
FALSE
)
self
.
buttonCancel
=
Button
(
frameActionButtons
,
text
=
'Cancel'
,
self
.
buttonCancel
=
Button
(
frameActionButtons
,
text
=
'Cancel'
,
command
=
self
.
Cancel
,
takefocus
=
FALSE
)
command
=
self
.
Cancel
,
takefocus
=
FALSE
)
#page buttons
#page buttons
...
@@ -165,19 +185,20 @@ class ConfigDialog(Toplevel):
...
@@ -165,19 +185,20 @@ class ConfigDialog(Toplevel):
framePageButtons
.
grid
(
row
=
0
,
column
=
0
,
sticky
=
W
)
framePageButtons
.
grid
(
row
=
0
,
column
=
0
,
sticky
=
W
)
for
page
in
self
.
pages
:
page
.
grid
(
row
=
1
,
column
=
0
,
sticky
=
(
N
,
S
,
E
,
W
))
for
page
in
self
.
pages
:
page
.
grid
(
row
=
1
,
column
=
0
,
sticky
=
(
N
,
S
,
E
,
W
))
self
.
buttonHelp
.
pack
(
side
=
RIGHT
,
padx
=
20
,
pady
=
5
)
self
.
buttonHelp
.
pack
(
side
=
RIGHT
,
padx
=
5
,
pady
=
5
)
self
.
buttonSave
.
pack
(
side
=
LEFT
,
padx
=
5
,
pady
=
5
)
self
.
buttonOk
.
pack
(
side
=
LEFT
,
padx
=
5
,
pady
=
5
)
self
.
buttonApply
.
pack
(
side
=
LEFT
,
padx
=
5
,
pady
=
5
)
self
.
buttonCancel
.
pack
(
side
=
LEFT
,
padx
=
5
,
pady
=
5
)
self
.
buttonCancel
.
pack
(
side
=
LEFT
,
padx
=
5
,
pady
=
5
)
frameActionButtons
.
pack
(
side
=
BOTTOM
)
frameActionButtons
.
pack
(
side
=
BOTTOM
)
self
.
framePages
.
pack
(
side
=
TOP
,
expand
=
TRUE
,
fill
=
BOTH
)
self
.
framePages
.
pack
(
side
=
TOP
,
expand
=
TRUE
,
fill
=
BOTH
)
def
CreatePageFontTab
(
self
):
def
CreatePageFontTab
(
self
):
#tkVars
#tkVars
self
.
fontName
=
StringVar
()
self
.
fontSize
=
StringVar
()
self
.
fontSize
=
StringVar
()
self
.
spaceNum
=
IntVar
()
self
.
spaceNum
=
IntVar
()
self
.
tabCols
=
IntVar
()
self
.
tabCols
=
IntVar
()
self
.
indentType
=
IntVar
()
self
.
indentType
=
IntVar
()
self
.
newFont
=
tkFont
.
Font
(
self
,(
'courier'
,
12
,
'normal'
))
##widget creation
##widget creation
#body frame
#body frame
frame
=
Frame
(
self
.
framePages
,
borderwidth
=
2
,
relief
=
SUNKEN
)
frame
=
Frame
(
self
.
framePages
,
borderwidth
=
2
,
relief
=
SUNKEN
)
...
@@ -187,21 +208,27 @@ class ConfigDialog(Toplevel):
...
@@ -187,21 +208,27 @@ class ConfigDialog(Toplevel):
#frameFont
#frameFont
labelFontTitle
=
Label
(
frameFont
,
text
=
'Set Base Editor Font'
)
labelFontTitle
=
Label
(
frameFont
,
text
=
'Set Base Editor Font'
)
frameFontName
=
Frame
(
frameFont
)
frameFontName
=
Frame
(
frameFont
)
frameFontSize
=
Frame
(
frameFont
)
frameFontSize
=
Frame
(
frameFont
Name
)
labelFontNameTitle
=
Label
(
frameFontName
,
justify
=
LEFT
,
labelFontNameTitle
=
Label
(
frameFontName
,
justify
=
LEFT
,
text
=
'Choose from available
\n
monospaced fonts :'
)
text
=
'Font :'
)
optFontName
=
OptionMenu
(
frameFontName
,
self
.
listFontName
=
Listbox
(
frameFontName
,
height
=
5
,
takefocus
=
FALSE
,
self
.
fontName
,
'Courier'
,
'Font Name 2'
,
'Font Name 3'
)
exportselection
=
FALSE
)
self
.
fontName
.
set
(
'Courier'
)
self
.
listFontName
.
bind
(
'<<ListboxSelect>>'
,
self
.
__SetFontSample
)
labelFontSizeTitle
=
Label
(
frameFontSize
,
text
=
'Choose font size :'
)
scrollFont
=
Scrollbar
(
frameFontName
)
optFontSize
=
OptionMenu
(
frameFontSize
,
self
.
__LoadFontList
()
self
.
fontSize
,
'8'
,
'10'
,
'12'
,
'14'
,
'16'
,
'18'
,
'20'
)
scrollFont
.
config
(
command
=
self
.
listFontName
.
yview
)
self
.
fontSize
.
set
(
'12'
)
self
.
listFontName
.
config
(
yscrollcommand
=
scrollFont
.
set
)
labelFontSizeTitle
=
Label
(
frameFontSize
,
text
=
'Size :'
)
sizes
=
(
'10'
,
'11'
,
'12'
,
'13'
,
'14'
,
'16'
,
'18'
,
'20'
,
'22'
)
args
=
(
frameFontSize
,
self
.
fontSize
)
+
sizes
keyArgs
=
{
'command'
:
self
.
__SetFontSample
}
optFontSize
=
apply
(
OptionMenu
,
args
,
keyArgs
)
#optFontSize.bind('<<MenuSelect>>',self.__SetFontSample)
frameFontSample
=
Frame
(
frameFont
,
relief
=
SOLID
,
borderwidth
=
1
,
frameFontSample
=
Frame
(
frameFont
,
relief
=
SOLID
,
borderwidth
=
1
,
bg
=
self
.
workingTestColours
[
'Foo-Bg'
])
bg
=
self
.
workingTestColours
[
'Foo-Bg'
])
labelFontSample
=
Label
(
frameFontSample
,
bg
=
self
.
workingTestColours
[
'Foo-Bg'
],
self
.
labelFontSample
=
Label
(
frameFontSample
,
bg
=
self
.
workingTestColours
[
'Foo-Bg'
],
fg
=
'#000000'
,
text
=
'
Font
\n
Sample'
,
justify
=
LEFT
,
fg
=
'#000000'
,
text
=
'
AaBbCcDdEe
\n
FfGgHhIiJjK
\n
1234567890
\n
#:+=(){}[]'
,
font
=
(
'courier'
,
12
,
''
)
)
justify
=
LEFT
,
font
=
self
.
newFont
)
#frameIndent
#frameIndent
labelIndentTitle
=
Label
(
frameIndent
,
text
=
'Set Indentation Defaults'
)
labelIndentTitle
=
Label
(
frameIndent
,
text
=
'Set Indentation Defaults'
)
frameIndentType
=
Frame
(
frameIndent
)
frameIndentType
=
Frame
(
frameIndent
)
...
@@ -225,18 +252,19 @@ class ConfigDialog(Toplevel):
...
@@ -225,18 +252,19 @@ class ConfigDialog(Toplevel):
#widget packing
#widget packing
#body
#body
frameFont
.
pack
(
side
=
LEFT
,
padx
=
5
,
pady
=
10
,
fill
=
Y
)
frameFont
.
pack
(
side
=
LEFT
,
padx
=
5
,
pady
=
10
,
expand
=
TRUE
,
fill
=
BOTH
)
frameIndent
.
pack
(
side
=
LEFT
,
padx
=
5
,
pady
=
10
,
expand
=
TRUE
,
fill
=
BOTH
)
frameIndent
.
pack
(
side
=
LEFT
,
padx
=
5
,
pady
=
10
,
fill
=
Y
)
#frameFont
#frameFont
labelFontTitle
.
pack
(
side
=
TOP
,
anchor
=
W
,
padx
=
5
,
pady
=
5
)
labelFontTitle
.
pack
(
side
=
TOP
,
anchor
=
W
,
padx
=
5
,
pady
=
5
)
frameFontName
.
pack
(
side
=
TOP
,
padx
=
5
,
pady
=
5
,
fill
=
X
)
frameFontName
.
pack
(
side
=
TOP
,
padx
=
5
,
pady
=
5
)
frameFontSize
.
pack
(
side
=
TOP
,
padx
=
5
,
pady
=
5
,
fill
=
BOTH
)
frameFontSize
.
pack
(
side
=
RIGHT
,
anchor
=
N
,
fill
=
X
)
labelFontNameTitle
.
pack
(
side
=
TOP
,
anchor
=
W
)
labelFontNameTitle
.
pack
(
side
=
TOP
,
anchor
=
W
)
optFontName
.
pack
(
side
=
TOP
,
pady
=
5
,
fill
=
X
)
self
.
listFontName
.
pack
(
side
=
LEFT
,
fill
=
Y
)
scrollFont
.
pack
(
side
=
LEFT
,
fill
=
Y
)
labelFontSizeTitle
.
pack
(
side
=
TOP
,
anchor
=
W
)
labelFontSizeTitle
.
pack
(
side
=
TOP
,
anchor
=
W
)
optFontSize
.
pack
(
side
=
TOP
,
pady
=
5
,
fill
=
X
)
optFontSize
.
pack
(
side
=
TOP
,
anchor
=
W
,
fill
=
X
)
frameFontSample
.
pack
(
side
=
TOP
,
padx
=
5
,
pady
=
5
,
expand
=
TRUE
,
fill
=
BOTH
)
frameFontSample
.
pack
(
side
=
TOP
,
padx
=
5
,
pady
=
5
,
expand
=
TRUE
,
fill
=
BOTH
)
labelFontSample
.
pack
(
expand
=
TRUE
,
fill
=
BOTH
)
self
.
labelFontSample
.
pack
(
expand
=
TRUE
,
fill
=
BOTH
)
#frameIndent
#frameIndent
labelIndentTitle
.
pack
(
side
=
TOP
,
anchor
=
W
,
padx
=
5
,
pady
=
5
)
labelIndentTitle
.
pack
(
side
=
TOP
,
anchor
=
W
,
padx
=
5
,
pady
=
5
)
frameIndentType
.
pack
(
side
=
TOP
,
padx
=
5
,
fill
=
X
)
frameIndentType
.
pack
(
side
=
TOP
,
padx
=
5
,
fill
=
X
)
...
@@ -260,7 +288,6 @@ class ConfigDialog(Toplevel):
...
@@ -260,7 +288,6 @@ class ConfigDialog(Toplevel):
self
.
fontName
=
StringVar
()
self
.
fontName
=
StringVar
()
self
.
fontBold
=
StringVar
()
self
.
fontBold
=
StringVar
()
self
.
fontItalic
=
StringVar
()
self
.
fontItalic
=
StringVar
()
self
.
fontSize
=
IntVar
()
self
.
themeType
=
IntVar
()
self
.
themeType
=
IntVar
()
##widget creation
##widget creation
#body frame
#body frame
...
@@ -367,6 +394,8 @@ class ConfigDialog(Toplevel):
...
@@ -367,6 +394,8 @@ class ConfigDialog(Toplevel):
labelTargetTitle
=
Label
(
frameTarget
,
text
=
'Action'
)
labelTargetTitle
=
Label
(
frameTarget
,
text
=
'Action'
)
scrollTarget
=
Scrollbar
(
frameTarget
)
scrollTarget
=
Scrollbar
(
frameTarget
)
listTarget
=
Listbox
(
frameTarget
)
listTarget
=
Listbox
(
frameTarget
)
scrollTarget
.
config
(
command
=
listTarget
.
yview
)
listTarget
.
config
(
yscrollcommand
=
scrollTarget
.
set
)
labelKeyBindTitle
=
Label
(
frameSet
,
text
=
'Binding'
)
labelKeyBindTitle
=
Label
(
frameSet
,
text
=
'Binding'
)
labelModifierTitle
=
Label
(
frameSet
,
text
=
'Modifier:'
)
labelModifierTitle
=
Label
(
frameSet
,
text
=
'Modifier:'
)
checkCtrl
=
Checkbutton
(
frameSet
,
text
=
'Ctrl'
)
checkCtrl
=
Checkbutton
(
frameSet
,
text
=
'Ctrl'
)
...
@@ -456,6 +485,8 @@ class ConfigDialog(Toplevel):
...
@@ -456,6 +485,8 @@ class ConfigDialog(Toplevel):
labelExtListTitle
=
Label
(
frameExtList
,
text
=
'Extension'
)
labelExtListTitle
=
Label
(
frameExtList
,
text
=
'Extension'
)
scrollExtList
=
Scrollbar
(
frameExtList
)
scrollExtList
=
Scrollbar
(
frameExtList
)
listExt
=
Listbox
(
frameExtList
,
height
=
5
)
listExt
=
Listbox
(
frameExtList
,
height
=
5
)
scrollExtList
.
config
(
command
=
listExt
.
yview
)
listExt
.
config
(
yscrollcommand
=
scrollExtList
.
set
)
labelExtSetTitle
=
Label
(
frameExtSet
,
text
=
'Settings'
)
labelExtSetTitle
=
Label
(
frameExtSet
,
text
=
'Settings'
)
radioEnableExt
=
Radiobutton
(
frameExtSet
,
variable
=
self
.
extState
,
radioEnableExt
=
Radiobutton
(
frameExtSet
,
variable
=
self
.
extState
,
value
=
1
,
text
=
"enable"
)
value
=
1
,
text
=
"enable"
)
...
...
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