tksheet 7.2.14__py3-none-any.whl → 7.2.15__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
tksheet/__init__.py CHANGED
@@ -4,7 +4,7 @@
4
4
  tksheet - A Python tkinter table widget
5
5
  """
6
6
 
7
- __version__ = "7.2.14"
7
+ __version__ = "7.2.15"
8
8
 
9
9
  from .colors import (
10
10
  color_map,
tksheet/sheet.py CHANGED
@@ -190,6 +190,7 @@ class Sheet(tk.Frame):
190
190
  show_selected_cells_border: bool = True,
191
191
  edit_cell_tab: Literal["right", "down", ""] = "right",
192
192
  edit_cell_return: Literal["right", "down", ""] = "down",
193
+ editor_del_key: Literal["forward", "backward", ""] = "forward",
193
194
  treeview: bool = False,
194
195
  treeview_indent: str | int = "6",
195
196
  rounded_boxes: bool = True,
tksheet/sheet_options.py CHANGED
@@ -98,7 +98,6 @@ def new_sheet_options() -> DotDict:
98
98
  ],
99
99
  "delete_bindings": [
100
100
  "<Delete>",
101
- "<Delete>",
102
101
  ],
103
102
  "select_all_bindings": [
104
103
  f"<{ctrl_key}-a>",
@@ -241,6 +240,7 @@ def new_sheet_options() -> DotDict:
241
240
  "show_selected_cells_border": True,
242
241
  "edit_cell_tab": "right",
243
242
  "edit_cell_return": "down",
243
+ "editor_del_key": "forward",
244
244
  "treeview": False,
245
245
  "treeview_indent": "6",
246
246
  "rounded_boxes": True,
tksheet/text_editor.py CHANGED
@@ -40,6 +40,7 @@ class TextEditorTkText(tk.Text):
40
40
  self.bind(rc_binding, self.rc)
41
41
  self.bind(f"<{ctrl_key}-a>", self.select_all)
42
42
  self.bind(f"<{ctrl_key}-A>", self.select_all)
43
+ self.bind("<Delete>", self.delete_key)
43
44
  self._orig = self._w + "_orig"
44
45
  self.tk.call("rename", self._w, self._orig)
45
46
  self.tk.createcommand(self._w, self._proxy)
@@ -62,6 +63,7 @@ class TextEditorTkText(tk.Text):
62
63
  insertbackground=fg,
63
64
  state=state,
64
65
  )
66
+ self.editor_del_key = sheet_ops.editor_del_key
65
67
  self.align = align
66
68
  self.rc_popup_menu.delete(0, "end")
67
69
  self.rc_popup_menu.add_command(
@@ -126,6 +128,19 @@ class TextEditorTkText(tk.Text):
126
128
  self.focus_set()
127
129
  self.rc_popup_menu.tk_popup(event.x_root, event.y_root)
128
130
 
131
+ def delete_key(self, event: object = None) -> None:
132
+ if self.editor_del_key == "forward":
133
+ return
134
+ elif not self.editor_del_key:
135
+ return "break"
136
+ elif self.editor_del_key == "backward":
137
+ if self.tag_ranges("sel"):
138
+ return
139
+ if self.index("insert") == "1.0":
140
+ return "break"
141
+ self.delete("insert-1c")
142
+ return "break"
143
+
129
144
  def select_all(self, event: object = None) -> Literal["break"]:
130
145
  self.tag_add(tk.SEL, "1.0", tk.END)
131
146
  self.mark_set(tk.INSERT, tk.END)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tksheet
3
- Version: 7.2.14
3
+ Version: 7.2.15
4
4
  Summary: Tkinter table / sheet widget
5
5
  Author-email: ragardner <github@ragardner.simplelogin.com>
6
6
  License: Copyright (c) 2019 ragardner and open source contributors
@@ -1,4 +1,4 @@
1
- tksheet/__init__.py,sha256=672mAjHqs4482JpEgBhfEbDZZ3EXSxz9vsMOuMGCJgY,2165
1
+ tksheet/__init__.py,sha256=7DsA4dnRJU4f9UyzWDd0-lHkvu9HCT28y5A2n7g4z3g,2165
2
2
  tksheet/colors.py,sha256=1k06VorynLmnC4FdJg8H4reIA6rXaeXBpdMwXLhN8oc,51594
3
3
  tksheet/column_headers.py,sha256=bHv67vRhRYxw_qyrw5akJo-b77vtN4y-mEO617FEqxE,102222
4
4
  tksheet/formatters.py,sha256=DXif00aq9DgFpXwkbiqD86KxtDg0Meop51hLY-KcGNQ,10037
@@ -6,15 +6,15 @@ tksheet/functions.py,sha256=wTWsTFZkTMJH-2qz--9qNaprWqhA7sYVzCEhuw_PRhs,42369
6
6
  tksheet/main_table.py,sha256=WeSemTwFb8zEu0v2QabPNGZqM06kkCs-IvP1HLSR1oM,328843
7
7
  tksheet/other_classes.py,sha256=HIKIDNXJRv0H5qbftcCtLVWW8NKSBAwyNXQOlmPWTDQ,15633
8
8
  tksheet/row_index.py,sha256=docjegBsQIO0qfPE7_zgTPkdTOHBMRJBpA9t6wqslj0,109630
9
- tksheet/sheet.py,sha256=5RiPYSWnEl1IqfFvMJkbOuJCdYAV2QGLucYFNxOqwR0,275476
10
- tksheet/sheet_options.py,sha256=DWinx6zZAhW0CajXxQ5EKIcSOttvprkn2HfwSKMEhMg,12429
11
- tksheet/text_editor.py,sha256=-QOO3belB0nGH3_XkO3aJ-SR-RRPZDMApyKUa7DWwAw,6549
9
+ tksheet/sheet.py,sha256=ffaVQmjBEFtDiDDif7L1ze7XIT2jMmFHhPerC4AqubU,275549
10
+ tksheet/sheet_options.py,sha256=d6o2TxGrHEJbdeFYfD67QPXM9irKSnLyNIiJI46gaw0,12442
11
+ tksheet/text_editor.py,sha256=lmmHOPb11S8tlNtC10vijF1QqVB5Ts2hUKnGJd_JkWA,7103
12
12
  tksheet/themes.py,sha256=ZO4RqnAhEpApsoA5ZGUkYvb7huaNHSmrV_ug2TWWzOE,14474
13
13
  tksheet/top_left_rectangle.py,sha256=ri7hb9CC5l37ynmxceprq11UuWWRpWEI_0AI42wzv0A,8444
14
14
  tksheet/types.py,sha256=IgoEHMbceKpakcZtanxKaKJ4RdCq7UW6EoEIIz5O59k,340
15
15
  tksheet/vars.py,sha256=86ubZZElsnQuC6Lv6bW2lt2NhD9wAp6PxtkK7ufKqq0,3452
16
- tksheet-7.2.14.dist-info/LICENSE.txt,sha256=ndbcCPe9SlHfweE_W2RAueWUe2k7yudyxYLq6WjFdn4,1101
17
- tksheet-7.2.14.dist-info/METADATA,sha256=BckcuH7pl09ls917ILrkCFZZuHX3okwCcbitDypm4bc,6263
18
- tksheet-7.2.14.dist-info/WHEEL,sha256=HiCZjzuy6Dw0hdX5R3LCFPDmFS4BWl8H-8W39XfmgX4,91
19
- tksheet-7.2.14.dist-info/top_level.txt,sha256=my61PXCcck_HHAc9cq3NAlyAr3A3FXxCy9gptEOaCN8,8
20
- tksheet-7.2.14.dist-info/RECORD,,
16
+ tksheet-7.2.15.dist-info/LICENSE.txt,sha256=ndbcCPe9SlHfweE_W2RAueWUe2k7yudyxYLq6WjFdn4,1101
17
+ tksheet-7.2.15.dist-info/METADATA,sha256=LvqFaxqVU3rN2hYis6Ur4XO_AehkY4bBjuhbkb5rvt8,6263
18
+ tksheet-7.2.15.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
19
+ tksheet-7.2.15.dist-info/top_level.txt,sha256=my61PXCcck_HHAc9cq3NAlyAr3A3FXxCy9gptEOaCN8,8
20
+ tksheet-7.2.15.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (72.2.0)
2
+ Generator: setuptools (74.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5