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
5c6e0a1a
Kaydet (Commit)
5c6e0a1a
authored
Kas 22, 2005
tarafından
Kurt B. Kaiser
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
1. Made advanced keybinding dialog functional.
2. Allow binding of movement keys
üst
e3faaeb1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
13 deletions
+27
-13
NEWS.txt
Lib/idlelib/NEWS.txt
+8
-1
keybindingDialog.py
Lib/idlelib/keybindingDialog.py
+19
-12
No files found.
Lib/idlelib/NEWS.txt
Dosyayı görüntüle @
5c6e0a1a
What's New in IDLE 1.2a0?
=======================
*Release date: XX-XXX-2005*
*Release date: XX-XXX-2006*
- Options / Keys / Advanced dialog made functional. Also, allow binding
of 'movement' keys.
- 'syntax' patch adds improved calltips and a new class attribute listbox.
MultiCall module allows binding multiple actions to an event.
Patch 906702 Noam Raphael
- Better indentation after first line of string continuation.
IDLEfork Patch 681992, Noam Raphael
...
...
Lib/idlelib/keybindingDialog.py
Dosyayı görüntüle @
5c6e0a1a
...
...
@@ -26,12 +26,13 @@ class GetKeysDialog(Toplevel):
self
.
result
=
''
self
.
keyString
=
StringVar
(
self
)
self
.
keyString
.
set
(
''
)
self
.
SetModifiersForPlatform
()
self
.
SetModifiersForPlatform
()
# set self.modifiers, self.modifier_label
self
.
modifier_vars
=
[]
for
modifier
in
self
.
modifiers
:
variable
=
StringVar
(
self
)
variable
.
set
(
''
)
self
.
modifier_vars
.
append
(
variable
)
self
.
advanced
=
False
self
.
CreateWidgets
()
self
.
LoadFinalKeyList
()
self
.
withdraw
()
#hide while setting geometry
...
...
@@ -136,7 +137,7 @@ class GetKeysDialog(Toplevel):
self
.
modifiers
=
[
'Shift'
,
'Control'
,
'Option'
,
'Command'
]
else
:
self
.
modifiers
=
[
'Control'
,
'Alt'
,
'Shift'
]
self
.
modifier_label
=
{
'Control'
:
'Ctrl'
}
self
.
modifier_label
=
{
'Control'
:
'Ctrl'
}
# short name
def
ToggleLevel
(
self
):
if
self
.
buttonLevel
.
cget
(
'text'
)[:
8
]
==
'Advanced'
:
...
...
@@ -145,11 +146,13 @@ class GetKeysDialog(Toplevel):
self
.
frameKeySeqAdvanced
.
lift
()
self
.
frameHelpAdvanced
.
lift
()
self
.
entryKeysAdvanced
.
focus_set
()
self
.
advanced
=
True
else
:
self
.
ClearKeySeq
()
self
.
buttonLevel
.
config
(
text
=
'Advanced Key Binding Entry >>'
)
self
.
frameKeySeqBasic
.
lift
()
self
.
frameControlsBasic
.
lift
()
self
.
advanced
=
False
def
FinalKeySelected
(
self
,
event
):
self
.
BuildKeyString
()
...
...
@@ -208,7 +211,7 @@ class GetKeysDialog(Toplevel):
return
key
def
OK
(
self
,
event
=
None
):
if
self
.
KeysOK
():
if
self
.
advanced
or
self
.
KeysOK
():
# doesn't check advanced string yet
self
.
result
=
self
.
keyString
.
get
()
self
.
destroy
()
...
...
@@ -217,7 +220,12 @@ class GetKeysDialog(Toplevel):
self
.
destroy
()
def
KeysOK
(
self
):
"Validity check on user's keybinding selection"
'''Validity check on user's 'basic' keybinding selection.
Doesn't check the string produced by the advanced dialog because
'modifiers' isn't set.
'''
keys
=
self
.
keyString
.
get
()
keys
.
strip
()
finalKey
=
self
.
listKeysFinal
.
get
(
ANCHOR
)
...
...
@@ -232,20 +240,19 @@ class GetKeysDialog(Toplevel):
elif
not
keys
.
endswith
(
'>'
):
tkMessageBox
.
showerror
(
title
=
title
,
parent
=
self
,
message
=
'Missing the final Key'
)
elif
not
modifiers
and
finalKey
not
in
self
.
functionKeys
:
elif
(
not
modifiers
and
finalKey
not
in
self
.
functionKeys
+
self
.
moveKeys
):
tkMessageBox
.
showerror
(
title
=
title
,
parent
=
self
,
message
=
'No modifier key(s) specified.'
)
elif
(
modifiers
==
[
'Shift'
])
\
and
(
finalKey
not
in
self
.
functionKeys
+
(
'Tab'
,
'Space'
)):
msg
=
'The shift modifier by itself may not be used with'
\
' this key symbol; only with F1-F12, Tab, or Space'
tkMessageBox
.
showerror
(
title
=
title
,
parent
=
self
,
message
=
msg
)
self
.
functionKeys
+
self
.
moveKeys
+
(
'Tab'
,
'Space'
)):
msg
=
'The shift modifier by itself may not be used with'
\
' this key symbol.'
tkMessageBox
.
showerror
(
title
=
title
,
parent
=
self
,
message
=
msg
)
elif
keySequence
in
self
.
currentKeySequences
:
msg
=
'This key combination is already in use.'
tkMessageBox
.
showerror
(
title
=
title
,
parent
=
self
,
message
=
msg
)
tkMessageBox
.
showerror
(
title
=
title
,
parent
=
self
,
message
=
msg
)
else
:
keysOK
=
True
return
keysOK
...
...
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