tksheet 7.5.1__tar.gz → 7.5.2__tar.gz
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-7.5.1/tksheet.egg-info → tksheet-7.5.2}/PKG-INFO +1 -1
- {tksheet-7.5.1 → tksheet-7.5.2}/pyproject.toml +1 -1
- {tksheet-7.5.1 → tksheet-7.5.2}/tksheet/__init__.py +1 -1
- {tksheet-7.5.1 → tksheet-7.5.2}/tksheet/column_headers.py +14 -10
- {tksheet-7.5.1 → tksheet-7.5.2}/tksheet/main_table.py +28 -15
- {tksheet-7.5.1 → tksheet-7.5.2}/tksheet/row_index.py +14 -10
- {tksheet-7.5.1 → tksheet-7.5.2}/tksheet/sheet.py +5 -2
- {tksheet-7.5.1 → tksheet-7.5.2/tksheet.egg-info}/PKG-INFO +1 -1
- {tksheet-7.5.1 → tksheet-7.5.2}/LICENSE.txt +0 -0
- {tksheet-7.5.1 → tksheet-7.5.2}/README.md +0 -0
- {tksheet-7.5.1 → tksheet-7.5.2}/setup.cfg +0 -0
- {tksheet-7.5.1 → tksheet-7.5.2}/tksheet/colors.py +0 -0
- {tksheet-7.5.1 → tksheet-7.5.2}/tksheet/constants.py +0 -0
- {tksheet-7.5.1 → tksheet-7.5.2}/tksheet/find_window.py +0 -0
- {tksheet-7.5.1 → tksheet-7.5.2}/tksheet/formatters.py +0 -0
- {tksheet-7.5.1 → tksheet-7.5.2}/tksheet/functions.py +0 -0
- {tksheet-7.5.1 → tksheet-7.5.2}/tksheet/other_classes.py +0 -0
- {tksheet-7.5.1 → tksheet-7.5.2}/tksheet/sheet_options.py +0 -0
- {tksheet-7.5.1 → tksheet-7.5.2}/tksheet/sorting.py +0 -0
- {tksheet-7.5.1 → tksheet-7.5.2}/tksheet/text_editor.py +0 -0
- {tksheet-7.5.1 → tksheet-7.5.2}/tksheet/themes.py +0 -0
- {tksheet-7.5.1 → tksheet-7.5.2}/tksheet/tksheet_types.py +0 -0
- {tksheet-7.5.1 → tksheet-7.5.2}/tksheet/top_left_rectangle.py +0 -0
- {tksheet-7.5.1 → tksheet-7.5.2}/tksheet.egg-info/SOURCES.txt +0 -0
- {tksheet-7.5.1 → tksheet-7.5.2}/tksheet.egg-info/dependency_links.txt +0 -0
- {tksheet-7.5.1 → tksheet-7.5.2}/tksheet.egg-info/top_level.txt +0 -0
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
|
|
6
6
|
name = "tksheet"
|
7
7
|
description = "Tkinter table / sheet and treeview widget"
|
8
8
|
readme = "README.md"
|
9
|
-
version = "7.5.
|
9
|
+
version = "7.5.2"
|
10
10
|
authors = [{ name = "ragardner", email = "github@ragardner.simplelogin.com" }]
|
11
11
|
requires-python = ">=3.8"
|
12
12
|
license = {file = "LICENSE.txt"}
|
@@ -2245,17 +2245,18 @@ class ColumnHeaders(tk.Canvas):
|
|
2245
2245
|
self.MT._headers[datacn] = value
|
2246
2246
|
|
2247
2247
|
def input_valid_for_cell(self, datacn: int, value: Any, check_readonly: bool = True) -> bool:
|
2248
|
-
|
2249
|
-
if check_readonly and "readonly" in kwargs:
|
2248
|
+
if check_readonly and self.get_cell_kwargs(datacn, key="readonly"):
|
2250
2249
|
return False
|
2251
|
-
elif "checkbox"
|
2250
|
+
elif self.get_cell_kwargs(datacn, key="checkbox"):
|
2252
2251
|
return is_bool_like(value)
|
2253
2252
|
else:
|
2254
2253
|
return not (
|
2255
2254
|
self.cell_equal_to(datacn, value)
|
2256
|
-
or (
|
2257
|
-
|
2258
|
-
|
2255
|
+
or (
|
2256
|
+
(kwargs := self.get_cell_kwargs(datacn, key="dropdown"))
|
2257
|
+
and kwargs["validate_input"]
|
2258
|
+
and value not in kwargs["values"]
|
2259
|
+
)
|
2259
2260
|
)
|
2260
2261
|
|
2261
2262
|
def cell_equal_to(self, datacn: int, value: Any) -> bool:
|
@@ -2311,11 +2312,14 @@ class ColumnHeaders(tk.Canvas):
|
|
2311
2312
|
return value
|
2312
2313
|
|
2313
2314
|
def get_value_for_empty_cell(self, datacn: int, c_ops: bool = True) -> Any:
|
2314
|
-
|
2315
|
-
if "checkbox" in kwargs:
|
2315
|
+
if self.get_cell_kwargs(datacn, key="checkbox", cell=c_ops):
|
2316
2316
|
return False
|
2317
|
-
elif
|
2318
|
-
|
2317
|
+
elif (
|
2318
|
+
(kwargs := self.get_cell_kwargs(datacn, key="dropdown", cell=c_ops))
|
2319
|
+
and kwargs["validate_input"]
|
2320
|
+
and kwargs["values"]
|
2321
|
+
):
|
2322
|
+
return kwargs["values"][0]
|
2319
2323
|
else:
|
2320
2324
|
return ""
|
2321
2325
|
|
@@ -189,7 +189,7 @@ class MainTable(tk.Canvas):
|
|
189
189
|
self.min_row_height = 0
|
190
190
|
self.min_header_height = 0
|
191
191
|
self.being_drawn_item = None
|
192
|
-
self.
|
192
|
+
self.extra_enter_func = None
|
193
193
|
self.extra_b1_press_func = None
|
194
194
|
self.extra_b1_motion_func = None
|
195
195
|
self.extra_b1_release_func = None
|
@@ -389,7 +389,7 @@ class MainTable(tk.Canvas):
|
|
389
389
|
|
390
390
|
def basic_bindings(self, enable: bool = True) -> None:
|
391
391
|
bindings = (
|
392
|
-
("<Enter>", self, self.
|
392
|
+
("<Enter>", self, self.enter),
|
393
393
|
("<Configure>", self, self.window_configured),
|
394
394
|
("<ButtonPress-1>", self, self.b1_press),
|
395
395
|
("<B1-Motion>", self, self.b1_motion),
|
@@ -3662,11 +3662,11 @@ class MainTable(tk.Canvas):
|
|
3662
3662
|
self.CH.rsz_w = None
|
3663
3663
|
self.CH.rsz_h = None
|
3664
3664
|
|
3665
|
-
def
|
3665
|
+
def enter(self, event: Any) -> None:
|
3666
3666
|
self.config(cursor="")
|
3667
3667
|
self.current_cursor = ""
|
3668
3668
|
self.reset_resize_vars()
|
3669
|
-
try_binding(self.
|
3669
|
+
try_binding(self.extra_enter_func, event)
|
3670
3670
|
|
3671
3671
|
def not_currently_resizing(self) -> bool:
|
3672
3672
|
return all(v is None for v in (self.RI.rsz_h, self.RI.rsz_w, self.CH.rsz_h, self.CH.rsz_w))
|
@@ -8218,18 +8218,30 @@ class MainTable(tk.Canvas):
|
|
8218
8218
|
return value
|
8219
8219
|
|
8220
8220
|
def get_value_for_empty_cell(self, datarn: int, datacn: int, r_ops: bool = True, c_ops: bool = True) -> Any:
|
8221
|
-
|
8221
|
+
if self.get_cell_kwargs(
|
8222
8222
|
datarn,
|
8223
8223
|
datacn,
|
8224
|
-
key=
|
8224
|
+
key="checkbox",
|
8225
8225
|
cell=r_ops and c_ops,
|
8226
8226
|
row=r_ops,
|
8227
8227
|
column=c_ops,
|
8228
|
-
)
|
8229
|
-
if "checkbox" in kwargs:
|
8228
|
+
):
|
8230
8229
|
return False
|
8231
|
-
elif
|
8232
|
-
|
8230
|
+
elif (
|
8231
|
+
(
|
8232
|
+
kwargs := self.get_cell_kwargs(
|
8233
|
+
datarn,
|
8234
|
+
datacn,
|
8235
|
+
key="dropdown",
|
8236
|
+
cell=r_ops and c_ops,
|
8237
|
+
row=r_ops,
|
8238
|
+
column=c_ops,
|
8239
|
+
)
|
8240
|
+
)
|
8241
|
+
and kwargs["validate_input"]
|
8242
|
+
and kwargs["values"]
|
8243
|
+
):
|
8244
|
+
return kwargs["values"][0]
|
8233
8245
|
else:
|
8234
8246
|
return self.format_value(datarn, datacn, "")
|
8235
8247
|
|
@@ -8415,16 +8427,17 @@ class MainTable(tk.Canvas):
|
|
8415
8427
|
check_readonly: bool = True,
|
8416
8428
|
ignore_empty: bool = False,
|
8417
8429
|
) -> bool:
|
8418
|
-
|
8419
|
-
if check_readonly and "readonly" in kwargs:
|
8430
|
+
if check_readonly and self.get_cell_kwargs(datarn, datacn, key="readonly"):
|
8420
8431
|
return False
|
8421
|
-
elif "format"
|
8432
|
+
elif self.get_cell_kwargs(datarn, datacn, key="format"):
|
8422
8433
|
return True
|
8423
8434
|
elif self.cell_equal_to(datarn, datacn, value, ignore_empty=ignore_empty, check_fmt=False) or (
|
8424
|
-
|
8435
|
+
(kwargs := self.get_cell_kwargs(datarn, datacn, key="dropdown"))
|
8436
|
+
and kwargs["validate_input"]
|
8437
|
+
and value not in kwargs["values"]
|
8425
8438
|
):
|
8426
8439
|
return False
|
8427
|
-
elif "checkbox"
|
8440
|
+
elif self.get_cell_kwargs(datarn, datacn, key="checkbox"):
|
8428
8441
|
return is_bool_like(value)
|
8429
8442
|
else:
|
8430
8443
|
return True
|
@@ -2414,17 +2414,18 @@ class RowIndex(tk.Canvas):
|
|
2414
2414
|
self.MT._row_index[datarn] = value
|
2415
2415
|
|
2416
2416
|
def input_valid_for_cell(self, datarn: int, value: Any, check_readonly: bool = True) -> bool:
|
2417
|
-
|
2418
|
-
if check_readonly and "readonly" in kwargs:
|
2417
|
+
if check_readonly and self.get_cell_kwargs(datarn, key="readonly"):
|
2419
2418
|
return False
|
2420
|
-
elif "checkbox"
|
2419
|
+
elif self.get_cell_kwargs(datarn, key="checkbox"):
|
2421
2420
|
return is_bool_like(value)
|
2422
2421
|
else:
|
2423
2422
|
return not (
|
2424
2423
|
self.cell_equal_to(datarn, value)
|
2425
|
-
or (
|
2426
|
-
|
2427
|
-
|
2424
|
+
or (
|
2425
|
+
(kwargs := self.get_cell_kwargs(datarn, key="dropdown"))
|
2426
|
+
and kwargs["validate_input"]
|
2427
|
+
and value not in kwargs["values"]
|
2428
|
+
)
|
2428
2429
|
)
|
2429
2430
|
|
2430
2431
|
def cell_equal_to(self, datarn: int, value: Any) -> bool:
|
@@ -2487,11 +2488,14 @@ class RowIndex(tk.Canvas):
|
|
2487
2488
|
if self.ops.treeview:
|
2488
2489
|
iid = self.new_iid()
|
2489
2490
|
return Node(text=iid, iid=iid, parent=self.get_row_parent(datarn))
|
2490
|
-
|
2491
|
-
if "checkbox" in kwargs:
|
2491
|
+
if self.get_cell_kwargs(datarn, key="checkbox", cell=r_ops):
|
2492
2492
|
return False
|
2493
|
-
elif
|
2494
|
-
|
2493
|
+
elif (
|
2494
|
+
(kwargs := self.get_cell_kwargs(datarn, key="dropdown", cell=r_ops))
|
2495
|
+
and kwargs["validate_input"]
|
2496
|
+
and kwargs["values"]
|
2497
|
+
):
|
2498
|
+
return kwargs["values"][0]
|
2495
2499
|
else:
|
2496
2500
|
return ""
|
2497
2501
|
|
@@ -703,7 +703,7 @@ class Sheet(tk.Frame):
|
|
703
703
|
self.RI.extra_double_b1_func = func
|
704
704
|
self.TL.extra_double_b1_func = func
|
705
705
|
elif binding == "<Motion>":
|
706
|
-
self.MT.
|
706
|
+
self.MT.bind("<Motion>", func, add=add)
|
707
707
|
self.CH.extra_motion_func = func
|
708
708
|
self.RI.extra_motion_func = func
|
709
709
|
self.TL.extra_motion_func = func
|
@@ -718,7 +718,10 @@ class Sheet(tk.Frame):
|
|
718
718
|
else:
|
719
719
|
self.bound_events[binding] = [func]
|
720
720
|
else:
|
721
|
-
|
721
|
+
if binding == "<Enter>":
|
722
|
+
self.MT.extra_enter_func = func
|
723
|
+
else:
|
724
|
+
self.MT.bind(binding, func, add=add)
|
722
725
|
self.CH.bind(binding, func, add=add)
|
723
726
|
self.RI.bind(binding, func, add=add)
|
724
727
|
self.TL.bind(binding, func, add=add)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|