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
bfcd6533
Kaydet (Commit)
bfcd6533
authored
Kas 02, 2002
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add ESC key binding -- undo current cell editing.
üst
3669242a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
12 deletions
+19
-12
ss1.py
Demo/tkinter/guido/ss1.py
+19
-12
No files found.
Demo/tkinter/guido/ss1.py
Dosyayı görüntüle @
bfcd6533
...
...
@@ -538,6 +538,7 @@ class SheetGUI:
self
.
entry
.
bind
(
"<Tab>"
,
self
.
tab_event
)
self
.
entry
.
bind
(
"<Shift-Tab>"
,
self
.
shift_tab_event
)
self
.
entry
.
bind
(
"<Delete>"
,
self
.
delete_event
)
self
.
entry
.
bind
(
"<Escape>"
,
self
.
escape_event
)
# Now create the cell grid
self
.
makegrid
(
rows
,
columns
)
# Select the top-left cell
...
...
@@ -556,6 +557,22 @@ class SheetGUI:
self
.
entry
.
delete
(
0
,
'end'
)
return
"break"
def
escape_event
(
self
,
event
):
x
,
y
=
self
.
currentxy
self
.
load_entry
(
x
,
y
)
def
load_entry
(
self
,
x
,
y
):
cell
=
self
.
sheet
.
getcell
(
x
,
y
)
if
cell
is
None
:
text
=
""
elif
isinstance
(
cell
,
FormulaCell
):
text
=
'='
+
cell
.
formula
else
:
text
,
alignment
=
cell
.
format
()
self
.
entry
.
delete
(
0
,
'end'
)
self
.
entry
.
insert
(
0
,
text
)
self
.
entry
.
selection_range
(
0
,
'end'
)
def
makegrid
(
self
,
rows
,
columns
):
"""Helper to create the grid of GUI cells.
...
...
@@ -653,18 +670,8 @@ class SheetGUI:
if
self
.
currentxy
is
not
None
:
self
.
change_cell
()
self
.
clearfocus
()
name
=
cellname
(
x
,
y
)
cell
=
self
.
sheet
.
getcell
(
x
,
y
)
if
cell
is
None
:
text
=
""
elif
isinstance
(
cell
,
FormulaCell
):
text
=
'='
+
cell
.
formula
else
:
text
,
alignment
=
cell
.
format
()
self
.
beacon
[
'text'
]
=
name
self
.
entry
.
delete
(
0
,
'end'
)
self
.
entry
.
insert
(
0
,
text
)
self
.
entry
.
selection_range
(
0
,
'end'
)
self
.
beacon
[
'text'
]
=
cellname
(
x
,
y
)
self
.
load_entry
(
x
,
y
)
self
.
entry
.
focus_set
()
self
.
currentxy
=
x
,
y
self
.
cornerxy
=
None
...
...
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