tksheet 7.5.0__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.0/tksheet.egg-info → tksheet-7.5.2}/PKG-INFO +1 -1
- {tksheet-7.5.0 → tksheet-7.5.2}/pyproject.toml +1 -1
- {tksheet-7.5.0 → tksheet-7.5.2}/tksheet/__init__.py +1 -1
- {tksheet-7.5.0 → tksheet-7.5.2}/tksheet/column_headers.py +14 -10
- {tksheet-7.5.0 → tksheet-7.5.2}/tksheet/constants.py +22 -22
- {tksheet-7.5.0 → tksheet-7.5.2}/tksheet/main_table.py +51 -23
- {tksheet-7.5.0 → tksheet-7.5.2}/tksheet/row_index.py +14 -10
- {tksheet-7.5.0 → tksheet-7.5.2}/tksheet/sheet.py +12 -4
- {tksheet-7.5.0 → tksheet-7.5.2/tksheet.egg-info}/PKG-INFO +1 -1
- {tksheet-7.5.0 → tksheet-7.5.2}/LICENSE.txt +0 -0
- {tksheet-7.5.0 → tksheet-7.5.2}/README.md +0 -0
- {tksheet-7.5.0 → tksheet-7.5.2}/setup.cfg +0 -0
- {tksheet-7.5.0 → tksheet-7.5.2}/tksheet/colors.py +0 -0
- {tksheet-7.5.0 → tksheet-7.5.2}/tksheet/find_window.py +0 -0
- {tksheet-7.5.0 → tksheet-7.5.2}/tksheet/formatters.py +0 -0
- {tksheet-7.5.0 → tksheet-7.5.2}/tksheet/functions.py +0 -0
- {tksheet-7.5.0 → tksheet-7.5.2}/tksheet/other_classes.py +0 -0
- {tksheet-7.5.0 → tksheet-7.5.2}/tksheet/sheet_options.py +0 -0
- {tksheet-7.5.0 → tksheet-7.5.2}/tksheet/sorting.py +0 -0
- {tksheet-7.5.0 → tksheet-7.5.2}/tksheet/text_editor.py +0 -0
- {tksheet-7.5.0 → tksheet-7.5.2}/tksheet/themes.py +0 -0
- {tksheet-7.5.0 → tksheet-7.5.2}/tksheet/tksheet_types.py +0 -0
- {tksheet-7.5.0 → tksheet-7.5.2}/tksheet/top_left_rectangle.py +0 -0
- {tksheet-7.5.0 → tksheet-7.5.2}/tksheet.egg-info/SOURCES.txt +0 -0
- {tksheet-7.5.0 → tksheet-7.5.2}/tksheet.egg-info/dependency_links.txt +0 -0
- {tksheet-7.5.0 → 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
|
|
@@ -427,31 +427,31 @@ ICON_PASTE = (
|
|
427
427
|
|
428
428
|
|
429
429
|
ICON_CLEAR = (
|
430
|
-
"""
|
431
|
-
"""
|
432
|
-
"""
|
433
|
-
"""
|
434
|
-
"""
|
435
|
-
"""
|
436
|
-
"""
|
437
|
-
"""
|
438
|
-
"""
|
439
|
-
"""
|
440
|
-
"""
|
430
|
+
"""iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAjRJREFUSEuNVotx"""
|
431
|
+
"""wjAMleC6R9gkTEIzBiF2yAcYo3QS2KSeozRxT/4kcuIAuYMzlqPPe3oyCOxBANDm97iiNYJ2+6GFvzt7"""
|
432
|
+
"""zRnJE1ta98+eMPQkIW70Xvle1ZyOiLgDgORZRnrmaKhSQd9XUhZXnrZZ1/XpE1b4FWQfSTdeQQg09n0m"""
|
433
|
+
"""5MEEQf9C3Z5vAJB2uttWQtyXoOM8jdzY3bK8JOsP+EHQShT5xrNpmKubsyFAFjlOqYxAO6FpPFG3F03B"""
|
434
|
+
"""rB/ryULU8gBLNL8ONQQQOYJGDlEYOd6CYcvGGmFWgckpApHHl7ihM38PzKpqr2gtDdbaNIQs8u0A6cxP"""
|
435
|
+
"""SDLjYMy/bi83AJ0CgOoeuCWLdY60d5Vinw0qdFBTEsJzwLooGsB2hqYOI20o80FIQYOS1CkTWkIOYiQb"""
|
436
|
+
"""csK+LsszD0JG63z6cIg8yZ6ounEkO4MfAmR3VRDmBAulpbpf3BInXLGUF1VAGYogQKRNfeWhc1QucAKA"""
|
437
|
+
"""qntAEGSupyckj9yMJBMsIyeYAGglRb55k+S4DmgArhB3gjlyQUrCShb7jCv/TSW7/L1IKEW35ndDXGjh"""
|
438
|
+
"""RLCjIiKQsI+sGN2XM0VUvcDlMIu4QOLT6MVNZxLlXTQZ1wiQ6l5n9sLwYliaP/PBVzZNusY1ifJuRwgX"""
|
439
|
+
"""WuzCmeG0NGUn+5Rkebh66ozVdMa6T2FFVybNGU/sADnX3ugxRE3pXn+X4nDkAhwO89sq7m2pJAfjrBEY"""
|
440
|
+
"""RGGRr29ej+/i/xAX7B9y8mgsRjNIxAAAAABJRU5ErkJggg=="""
|
441
441
|
)
|
442
442
|
|
443
443
|
ICON_DEL = (
|
444
|
-
"""
|
445
|
-
"""
|
446
|
-
"""+
|
447
|
-
"""
|
448
|
-
"""
|
449
|
-
"""
|
450
|
-
"""
|
451
|
-
"""
|
452
|
-
"""
|
453
|
-
"""
|
454
|
-
"""
|
444
|
+
"""iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAiJJREFUSEuNVdFh"""
|
445
|
+
"""ozAMlWCQdhQySZsxDIkJpuAxLpvQUTpIG9/ZFljGojl/JIAlPz1JT0bYFgKCA4cA9JO2xKdgCEB/R8Z+"""
|
446
|
+
"""+1cjM9n3fyf1APCaH+K+EHC4durOYgyYfKEcQGQzfNh3QPcnvsXF7f3z9wNOw1V9ysS95+bFKROAtQs8"""
|
447
|
+
"""oPmhQzhAP9qmrmABhE/dqtMeeE11BBBiCwwmGwLXnSI7qhPZm2mm/RZTbnKojYGZ7AIOmgjm/cgHhRLR"""
|
448
|
+
"""9mEXEKuVcThhMNOtqqp+V6PijCdNs9rf9UWdQ5MlB8p7kZasJ2IrC0k13s8B6Aulk5U0i9J8WAfoQHc+"""
|
449
|
+
"""r2wVVcxT9x8A8YRguBZWOPQo778DMDpS55h59u0IWqmTBzCzXUIQbXz3a5ys85FF5qmSmdA8TgRw0Hct"""
|
450
|
+
"""rmbcObVvnsZko3Z15erx0Qkp4t9SEKQPknDSBAfIuihSzQBIUOM0E/3oPIRG4ALM/fLOZAzk6Lhzi7LC"""
|
451
|
+
"""c5s0ZbNZdMxgPxJKlrzIlKJMB2wUSjoIBWQiijYAfae2RpBAQ3L20o+GeYcM43TDqnrRnTp7+xt7j7wR"""
|
452
|
+
"""eJGTVtYUMfWskaTo8purmEW8iwLLfLIW94FEX1ZvLnO5TXdFDl3kVepcA4Bnza9DYcCtEP04N3WFdPm0"""
|
453
|
+
"""pzQQBQBtbFPXbpHvA34RiM9FUMWo0Na+1g9oEOHNbRfQ0Yjbvn958vqi7vtZXt7JT896XhFu8RczqWgy"""
|
454
|
+
"""PKwKugAAAABJRU5ErkJggg=="""
|
455
455
|
)
|
456
456
|
|
457
457
|
|
@@ -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
|
@@ -286,19 +286,24 @@ class MainTable(tk.Canvas):
|
|
286
286
|
self.align = kwargs["align"]
|
287
287
|
self.PAR.ops.table_font = FontTuple(
|
288
288
|
self.PAR.ops.table_font[0],
|
289
|
-
max(1, int(self.PAR.ops.table_font[1] * kwargs["zoom"] / 100)),
|
289
|
+
max(1, int(round(self.PAR.ops.table_font[1]) * kwargs["zoom"] / 100)),
|
290
290
|
self.PAR.ops.table_font[2],
|
291
291
|
)
|
292
292
|
self.PAR.ops.index_font = FontTuple(
|
293
293
|
self.PAR.ops.index_font[0],
|
294
|
-
max(1, int(self.PAR.ops.index_font[1] * kwargs["zoom"] / 100)),
|
294
|
+
max(1, int(round(self.PAR.ops.index_font[1]) * kwargs["zoom"] / 100)),
|
295
295
|
self.PAR.ops.index_font[2],
|
296
296
|
)
|
297
297
|
self.PAR.ops.header_font = FontTuple(
|
298
298
|
self.PAR.ops.header_font[0],
|
299
|
-
max(1, int(self.PAR.ops.header_font[1] * kwargs["zoom"] / 100)),
|
299
|
+
max(1, int(round(self.PAR.ops.header_font[1]) * kwargs["zoom"] / 100)),
|
300
300
|
self.PAR.ops.header_font[2],
|
301
301
|
)
|
302
|
+
self.PAR.ops.popup_menu_font = FontTuple(
|
303
|
+
self.PAR.ops.popup_menu_font[0],
|
304
|
+
max(1, int(round(self.PAR.ops.popup_menu_font[1]) * kwargs["zoom"] / 100)),
|
305
|
+
self.PAR.ops.popup_menu_font[2],
|
306
|
+
)
|
302
307
|
self.txt_measure_canvas = tk.Canvas(self)
|
303
308
|
self.txt_measure_canvas_text = self.txt_measure_canvas.create_text(0, 0, text="", font=self.PAR.ops.table_font)
|
304
309
|
|
@@ -384,7 +389,7 @@ class MainTable(tk.Canvas):
|
|
384
389
|
|
385
390
|
def basic_bindings(self, enable: bool = True) -> None:
|
386
391
|
bindings = (
|
387
|
-
("<Enter>", self, self.
|
392
|
+
("<Enter>", self, self.enter),
|
388
393
|
("<Configure>", self, self.window_configured),
|
389
394
|
("<ButtonPress-1>", self, self.b1_press),
|
390
395
|
("<B1-Motion>", self, self.b1_motion),
|
@@ -3657,11 +3662,11 @@ class MainTable(tk.Canvas):
|
|
3657
3662
|
self.CH.rsz_w = None
|
3658
3663
|
self.CH.rsz_h = None
|
3659
3664
|
|
3660
|
-
def
|
3665
|
+
def enter(self, event: Any) -> None:
|
3661
3666
|
self.config(cursor="")
|
3662
3667
|
self.current_cursor = ""
|
3663
3668
|
self.reset_resize_vars()
|
3664
|
-
try_binding(self.
|
3669
|
+
try_binding(self.extra_enter_func, event)
|
3665
3670
|
|
3666
3671
|
def not_currently_resizing(self) -> bool:
|
3667
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))
|
@@ -4277,16 +4282,23 @@ class MainTable(tk.Canvas):
|
|
4277
4282
|
(self.PAR.ops.table_font[0], self.PAR.ops.table_font[1] + 1, self.PAR.ops.table_font[2]),
|
4278
4283
|
(self.PAR.ops.index_font[0], self.PAR.ops.index_font[1] + 1, self.PAR.ops.index_font[2]),
|
4279
4284
|
(self.PAR.ops.header_font[0], self.PAR.ops.header_font[1] + 1, self.PAR.ops.header_font[2]),
|
4285
|
+
(self.PAR.ops.popup_menu_font[0], self.PAR.ops.popup_menu_font[1] + 1, self.PAR.ops.popup_menu_font[2]),
|
4280
4286
|
"in",
|
4281
4287
|
)
|
4282
4288
|
|
4283
4289
|
def zoom_out(self, event: Any = None) -> None:
|
4284
|
-
if
|
4290
|
+
if (
|
4291
|
+
self.PAR.ops.table_font[1] < 2
|
4292
|
+
or self.PAR.ops.index_font[1] < 2
|
4293
|
+
or self.PAR.ops.header_font[1] < 2
|
4294
|
+
or self.PAR.ops.popup_menu_font[1] < 2
|
4295
|
+
):
|
4285
4296
|
return
|
4286
4297
|
self.zoom_font(
|
4287
4298
|
(self.PAR.ops.table_font[0], self.PAR.ops.table_font[1] - 1, self.PAR.ops.table_font[2]),
|
4288
4299
|
(self.PAR.ops.index_font[0], self.PAR.ops.index_font[1] - 1, self.PAR.ops.index_font[2]),
|
4289
4300
|
(self.PAR.ops.header_font[0], self.PAR.ops.header_font[1] - 1, self.PAR.ops.header_font[2]),
|
4301
|
+
(self.PAR.ops.popup_menu_font[0], self.PAR.ops.popup_menu_font[1] - 1, self.PAR.ops.popup_menu_font[2]),
|
4290
4302
|
"out",
|
4291
4303
|
)
|
4292
4304
|
|
@@ -4295,6 +4307,7 @@ class MainTable(tk.Canvas):
|
|
4295
4307
|
table_font: FontTuple,
|
4296
4308
|
index_font: FontTuple,
|
4297
4309
|
header_font: FontTuple,
|
4310
|
+
popup_font: FontTuple,
|
4298
4311
|
zoom: Literal["in", "out"],
|
4299
4312
|
) -> None:
|
4300
4313
|
self.saved_column_widths = {}
|
@@ -4317,6 +4330,7 @@ class MainTable(tk.Canvas):
|
|
4317
4330
|
self.set_table_font(table_font, row_heights=False)
|
4318
4331
|
self.set_index_font(index_font, row_heights=False)
|
4319
4332
|
self.set_header_font(header_font)
|
4333
|
+
self.PAR.ops.popup_menu_font = FontTuple(*popup_font)
|
4320
4334
|
if self.PAR.ops.set_cell_sizes_on_zoom:
|
4321
4335
|
self.set_all_cell_sizes_to_text()
|
4322
4336
|
self.main_table_redraw_grid_and_text(redraw_header=True, redraw_row_index=True)
|
@@ -4336,6 +4350,7 @@ class MainTable(tk.Canvas):
|
|
4336
4350
|
r_pc=r_pc,
|
4337
4351
|
c_pc=c_pc,
|
4338
4352
|
)
|
4353
|
+
self.create_rc_menus()
|
4339
4354
|
|
4340
4355
|
def get_txt_w(self, txt: str, font: None | FontTuple = None) -> int:
|
4341
4356
|
self.txt_measure_canvas.itemconfig(
|
@@ -4414,7 +4429,7 @@ class MainTable(tk.Canvas):
|
|
4414
4429
|
not isinstance(newfont, tuple)
|
4415
4430
|
or len(newfont) != 3
|
4416
4431
|
or not isinstance(newfont[0], str)
|
4417
|
-
or not isinstance(newfont[1], int)
|
4432
|
+
or not isinstance(newfont[1], (int, float))
|
4418
4433
|
or not isinstance(newfont[2], str)
|
4419
4434
|
):
|
4420
4435
|
raise ValueError(font_value_error)
|
@@ -4422,7 +4437,7 @@ class MainTable(tk.Canvas):
|
|
4422
4437
|
def set_table_font(self, newfont: tuple | None = None, row_heights: bool = True) -> tuple[str, int, str]:
|
4423
4438
|
if newfont:
|
4424
4439
|
self.check_font(newfont)
|
4425
|
-
self.PAR.ops.table_font = FontTuple(*newfont)
|
4440
|
+
self.PAR.ops.table_font = FontTuple(*(newfont[0], int(round(newfont[1])), newfont[2]))
|
4426
4441
|
old_min_row_height = int(self.min_row_height)
|
4427
4442
|
old_default_row_height = int(self.get_default_row_height())
|
4428
4443
|
self.set_table_font_help()
|
@@ -4463,7 +4478,7 @@ class MainTable(tk.Canvas):
|
|
4463
4478
|
def set_index_font(self, newfont: tuple | None = None, row_heights: bool = True) -> tuple[str, int, str]:
|
4464
4479
|
if newfont:
|
4465
4480
|
self.check_font(newfont)
|
4466
|
-
self.PAR.ops.index_font = FontTuple(*newfont)
|
4481
|
+
self.PAR.ops.index_font = FontTuple(*(newfont[0], int(round(newfont[1])), newfont[2]))
|
4467
4482
|
old_min_row_height = int(self.min_row_height)
|
4468
4483
|
old_default_row_height = int(self.get_default_row_height())
|
4469
4484
|
self.set_index_font_help()
|
@@ -4507,7 +4522,7 @@ class MainTable(tk.Canvas):
|
|
4507
4522
|
def set_header_font(self, newfont: tuple | None = None) -> tuple[str, int, str]:
|
4508
4523
|
if newfont:
|
4509
4524
|
self.check_font(newfont)
|
4510
|
-
self.PAR.ops.header_font = FontTuple(*newfont)
|
4525
|
+
self.PAR.ops.header_font = FontTuple(*(newfont[0], int(round(newfont[1])), newfont[2]))
|
4511
4526
|
self.set_header_font_help()
|
4512
4527
|
self.recreate_all_selection_boxes()
|
4513
4528
|
return self.PAR.ops.header_font
|
@@ -8203,18 +8218,30 @@ class MainTable(tk.Canvas):
|
|
8203
8218
|
return value
|
8204
8219
|
|
8205
8220
|
def get_value_for_empty_cell(self, datarn: int, datacn: int, r_ops: bool = True, c_ops: bool = True) -> Any:
|
8206
|
-
|
8221
|
+
if self.get_cell_kwargs(
|
8207
8222
|
datarn,
|
8208
8223
|
datacn,
|
8209
|
-
key=
|
8224
|
+
key="checkbox",
|
8210
8225
|
cell=r_ops and c_ops,
|
8211
8226
|
row=r_ops,
|
8212
8227
|
column=c_ops,
|
8213
|
-
)
|
8214
|
-
if "checkbox" in kwargs:
|
8228
|
+
):
|
8215
8229
|
return False
|
8216
|
-
elif
|
8217
|
-
|
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]
|
8218
8245
|
else:
|
8219
8246
|
return self.format_value(datarn, datacn, "")
|
8220
8247
|
|
@@ -8400,16 +8427,17 @@ class MainTable(tk.Canvas):
|
|
8400
8427
|
check_readonly: bool = True,
|
8401
8428
|
ignore_empty: bool = False,
|
8402
8429
|
) -> bool:
|
8403
|
-
|
8404
|
-
if check_readonly and "readonly" in kwargs:
|
8430
|
+
if check_readonly and self.get_cell_kwargs(datarn, datacn, key="readonly"):
|
8405
8431
|
return False
|
8406
|
-
elif "format"
|
8432
|
+
elif self.get_cell_kwargs(datarn, datacn, key="format"):
|
8407
8433
|
return True
|
8408
8434
|
elif self.cell_equal_to(datarn, datacn, value, ignore_empty=ignore_empty, check_fmt=False) or (
|
8409
|
-
|
8435
|
+
(kwargs := self.get_cell_kwargs(datarn, datacn, key="dropdown"))
|
8436
|
+
and kwargs["validate_input"]
|
8437
|
+
and value not in kwargs["values"]
|
8410
8438
|
):
|
8411
8439
|
return False
|
8412
|
-
elif "checkbox"
|
8440
|
+
elif self.get_cell_kwargs(datarn, datacn, key="checkbox"):
|
8413
8441
|
return is_bool_like(value)
|
8414
8442
|
else:
|
8415
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)
|
@@ -2703,6 +2706,11 @@ class Sheet(tk.Frame):
|
|
2703
2706
|
def index_font(self, newfont: tuple[str, int, str] | None = None) -> tuple[str, int, str]:
|
2704
2707
|
return self.MT.set_index_font(newfont)
|
2705
2708
|
|
2709
|
+
def popup_menu_font(self, newfont: tuple[str, int, str] | None = None) -> tuple[str, int, str]:
|
2710
|
+
if newfont:
|
2711
|
+
self.ops.popup_menu_font = FontTuple(*(newfont[0], int(round(newfont[1])), newfont[2]))
|
2712
|
+
return self.ops.popup_menu_font
|
2713
|
+
|
2706
2714
|
def table_align(
|
2707
2715
|
self,
|
2708
2716
|
align: str | None = None,
|
@@ -4142,7 +4150,7 @@ class Sheet(tk.Frame):
|
|
4142
4150
|
if "show_top_left" in kwargs:
|
4143
4151
|
self.show("top_left")
|
4144
4152
|
if "popup_menu_font" in kwargs:
|
4145
|
-
self.
|
4153
|
+
self.popup_menu_font(self.ops.popup_menu_font)
|
4146
4154
|
if "font" in kwargs:
|
4147
4155
|
self.MT.set_table_font(kwargs["font"])
|
4148
4156
|
elif "table_font" in kwargs:
|
@@ -4176,10 +4184,10 @@ class Sheet(tk.Frame):
|
|
4176
4184
|
)
|
4177
4185
|
if any(k in kwargs for k in scrollbar_options_keys):
|
4178
4186
|
self.set_scrollbar_options()
|
4179
|
-
self.MT.create_rc_menus()
|
4180
4187
|
if "treeview" in kwargs:
|
4181
4188
|
self.index_align("nw", redraw=False)
|
4182
4189
|
self.ops.paste_can_expand_y = False
|
4190
|
+
self.MT.create_rc_menus()
|
4183
4191
|
return self.set_refresh_timer(redraw)
|
4184
4192
|
|
4185
4193
|
def set_scrollbar_options(self) -> Sheet:
|
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
|