tksheet 7.2.0__tar.gz → 7.2.1__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.
Files changed (24) hide show
  1. {tksheet-7.2.0/tksheet.egg-info → tksheet-7.2.1}/PKG-INFO +1 -1
  2. {tksheet-7.2.0 → tksheet-7.2.1}/pyproject.toml +1 -1
  3. {tksheet-7.2.0 → tksheet-7.2.1}/tksheet/__init__.py +1 -1
  4. {tksheet-7.2.0 → tksheet-7.2.1}/tksheet/column_headers.py +26 -11
  5. {tksheet-7.2.0 → tksheet-7.2.1}/tksheet/main_table.py +17 -7
  6. {tksheet-7.2.0 → tksheet-7.2.1}/tksheet/row_index.py +13 -4
  7. {tksheet-7.2.0 → tksheet-7.2.1}/tksheet/sheet.py +18 -2
  8. {tksheet-7.2.0 → tksheet-7.2.1/tksheet.egg-info}/PKG-INFO +1 -1
  9. {tksheet-7.2.0 → tksheet-7.2.1}/LICENSE.txt +0 -0
  10. {tksheet-7.2.0 → tksheet-7.2.1}/README.md +0 -0
  11. {tksheet-7.2.0 → tksheet-7.2.1}/setup.cfg +0 -0
  12. {tksheet-7.2.0 → tksheet-7.2.1}/tksheet/colors.py +0 -0
  13. {tksheet-7.2.0 → tksheet-7.2.1}/tksheet/formatters.py +0 -0
  14. {tksheet-7.2.0 → tksheet-7.2.1}/tksheet/functions.py +0 -0
  15. {tksheet-7.2.0 → tksheet-7.2.1}/tksheet/other_classes.py +0 -0
  16. {tksheet-7.2.0 → tksheet-7.2.1}/tksheet/sheet_options.py +0 -0
  17. {tksheet-7.2.0 → tksheet-7.2.1}/tksheet/text_editor.py +0 -0
  18. {tksheet-7.2.0 → tksheet-7.2.1}/tksheet/themes.py +0 -0
  19. {tksheet-7.2.0 → tksheet-7.2.1}/tksheet/top_left_rectangle.py +0 -0
  20. {tksheet-7.2.0 → tksheet-7.2.1}/tksheet/types.py +0 -0
  21. {tksheet-7.2.0 → tksheet-7.2.1}/tksheet/vars.py +0 -0
  22. {tksheet-7.2.0 → tksheet-7.2.1}/tksheet.egg-info/SOURCES.txt +0 -0
  23. {tksheet-7.2.0 → tksheet-7.2.1}/tksheet.egg-info/dependency_links.txt +0 -0
  24. {tksheet-7.2.0 → tksheet-7.2.1}/tksheet.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tksheet
3
- Version: 7.2.0
3
+ Version: 7.2.1
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
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
  name = "tksheet"
7
7
  description = "Tkinter table / sheet widget"
8
8
  readme = "README.md"
9
- version = "7.2.0"
9
+ version = "7.2.1"
10
10
  authors = [{ name = "ragardner", email = "github@ragardner.simplelogin.com" }]
11
11
  requires-python = ">=3.8"
12
12
  license = {file = "LICENSE.txt"}
@@ -4,7 +4,7 @@
4
4
  tksheet - A Python tkinter table widget
5
5
  """
6
6
 
7
- __version__ = "7.2.0"
7
+ __version__ = "7.2.1"
8
8
 
9
9
  from .colors import (
10
10
  color_map,
@@ -903,12 +903,13 @@ class ColumnHeaders(tk.Canvas):
903
903
 
904
904
  def toggle_select_col(
905
905
  self,
906
- column,
907
- add_selection=True,
908
- redraw=True,
909
- run_binding_func=True,
910
- set_as_current=True,
911
- ):
906
+ column: int,
907
+ add_selection: bool = True,
908
+ redraw: bool = True,
909
+ run_binding_func: bool = True,
910
+ set_as_current: bool = True,
911
+ ext: bool = False,
912
+ ) -> int:
912
913
  if add_selection:
913
914
  if self.MT.col_selected(column):
914
915
  fill_iid = self.MT.deselect(c=column, redraw=redraw)
@@ -918,26 +919,40 @@ class ColumnHeaders(tk.Canvas):
918
919
  redraw=redraw,
919
920
  run_binding_func=run_binding_func,
920
921
  set_as_current=set_as_current,
922
+ ext=ext,
921
923
  )
922
924
  else:
923
925
  if self.MT.col_selected(column):
924
926
  fill_iid = self.MT.deselect(c=column, redraw=redraw)
925
927
  else:
926
- fill_iid = self.select_col(column, redraw=redraw)
928
+ fill_iid = self.select_col(column, redraw=redraw, ext=ext)
927
929
  return fill_iid
928
930
 
929
- def select_col(self, c, redraw=False, run_binding_func=True):
931
+ def select_col(
932
+ self,
933
+ c: int,
934
+ redraw: bool = False,
935
+ run_binding_func: bool = True,
936
+ ext: bool = False,
937
+ ) -> int:
930
938
  self.MT.deselect("all", redraw=False)
931
- fill_iid = self.MT.create_selection_box(0, c, len(self.MT.row_positions) - 1, c + 1, "columns")
939
+ fill_iid = self.MT.create_selection_box(0, c, len(self.MT.row_positions) - 1, c + 1, "columns", ext=ext)
932
940
  if redraw:
933
941
  self.MT.main_table_redraw_grid_and_text(redraw_header=True, redraw_row_index=True)
934
942
  if run_binding_func:
935
943
  self.MT.run_selection_binding("columns")
936
944
  return fill_iid
937
945
 
938
- def add_selection(self, c, redraw=False, run_binding_func=True, set_as_current=True):
946
+ def add_selection(
947
+ self,
948
+ c: int,
949
+ redraw: bool = False,
950
+ run_binding_func: bool = True,
951
+ set_as_current: bool = True,
952
+ ext: bool = False,
953
+ ) -> int:
939
954
  box = (0, c, len(self.MT.row_positions) - 1, c + 1, "columns")
940
- fill_iid = self.MT.create_selection_box(*box, set_current=set_as_current)
955
+ fill_iid = self.MT.create_selection_box(*box, set_current=set_as_current, ext=ext)
941
956
  if redraw:
942
957
  self.MT.main_table_redraw_grid_and_text(redraw_header=True, redraw_row_index=True)
943
958
  if run_binding_func:
@@ -1851,9 +1851,10 @@ class MainTable(tk.Canvas):
1851
1851
  c: int,
1852
1852
  redraw: bool = False,
1853
1853
  run_binding_func: bool = True,
1854
+ ext: bool = False,
1854
1855
  ) -> int:
1855
1856
  self.deselect("all", redraw=False)
1856
- fill_iid = self.create_selection_box(r, c, r + 1, c + 1, state="hidden")
1857
+ fill_iid = self.create_selection_box(r, c, r + 1, c + 1, state="hidden", ext=ext)
1857
1858
  if redraw:
1858
1859
  self.main_table_redraw_grid_and_text(redraw_header=True, redraw_row_index=True)
1859
1860
  if run_binding_func:
@@ -1867,8 +1868,9 @@ class MainTable(tk.Canvas):
1867
1868
  redraw: bool = False,
1868
1869
  run_binding_func: bool = True,
1869
1870
  set_as_current: bool = False,
1871
+ ext: bool = False,
1870
1872
  ) -> int:
1871
- fill_iid = self.create_selection_box(r, c, r + 1, c + 1, state="hidden", set_current=set_as_current)
1873
+ fill_iid = self.create_selection_box(r, c, r + 1, c + 1, state="hidden", set_current=set_as_current, ext=ext)
1872
1874
  if redraw:
1873
1875
  self.main_table_redraw_grid_and_text(redraw_header=True, redraw_row_index=True)
1874
1876
  if run_binding_func:
@@ -1883,6 +1885,7 @@ class MainTable(tk.Canvas):
1883
1885
  redraw: bool = True,
1884
1886
  run_binding_func: bool = True,
1885
1887
  set_as_current: bool = True,
1888
+ ext: bool = False,
1886
1889
  ) -> int | None:
1887
1890
  if add_selection:
1888
1891
  if self.cell_selected(row, column, inc_rows=True, inc_cols=True):
@@ -1894,12 +1897,13 @@ class MainTable(tk.Canvas):
1894
1897
  redraw=redraw,
1895
1898
  run_binding_func=run_binding_func,
1896
1899
  set_as_current=set_as_current,
1900
+ ext=ext,
1897
1901
  )
1898
1902
  else:
1899
1903
  if self.cell_selected(row, column, inc_rows=True, inc_cols=True):
1900
1904
  fill_iid = self.deselect(r=row, c=column, redraw=redraw)
1901
1905
  else:
1902
- fill_iid = self.select_cell(row, column, redraw=redraw)
1906
+ fill_iid = self.select_cell(row, column, redraw=redraw, ext=ext)
1903
1907
  return fill_iid
1904
1908
 
1905
1909
  def get_select_event(self, being_drawn_item: None | int = None) -> EventDataDict:
@@ -3527,7 +3531,7 @@ class MainTable(tk.Canvas):
3527
3531
  self.table_first_ln_ins = self.table_half_txt_height + 2
3528
3532
  else:
3529
3533
  self.table_first_ln_ins = self.table_half_txt_height + 3
3530
- self.min_row_height = int(self.table_first_ln_ins * 2.25)
3534
+ self.min_row_height = int(self.table_first_ln_ins * 2.22)
3531
3535
  self.table_xtra_lines_increment = int(self.table_txt_height)
3532
3536
  if self.min_row_height < 12:
3533
3537
  self.min_row_height = 12
@@ -3556,7 +3560,7 @@ class MainTable(tk.Canvas):
3556
3560
  else:
3557
3561
  self.header_first_ln_ins = self.header_half_txt_height + 3
3558
3562
  self.header_xtra_lines_increment = self.header_txt_height
3559
- self.min_header_height = int(self.header_first_ln_ins * 2.25)
3563
+ self.min_header_height = int(self.header_first_ln_ins * 2.22)
3560
3564
  if (
3561
3565
  isinstance(self.PAR.ops.default_header_height, int)
3562
3566
  and self.PAR.ops.default_header_height < self.min_header_height
@@ -5935,7 +5939,7 @@ class MainTable(tk.Canvas):
5935
5939
  self.hidd_boxes.add(item)
5936
5940
  self.itemconfig(item, state="hidden")
5937
5941
 
5938
- def hide_selection_box(self, item: int | None, set_current: bool = True) -> bool:
5942
+ def hide_selection_box(self, item: int | None) -> bool:
5939
5943
  if item is None or item is True:
5940
5944
  return
5941
5945
  box = self.selection_boxes.pop(item)
@@ -5948,6 +5952,10 @@ class MainTable(tk.Canvas):
5948
5952
  self.set_current_to_last()
5949
5953
  if item == self.being_drawn_item:
5950
5954
  self.being_drawn_item = None
5955
+ elif item == self.RI.being_drawn_item:
5956
+ self.RI.being_drawn_item = None
5957
+ elif item == self.CH.being_drawn_item:
5958
+ self.CH.being_drawn_item = None
5951
5959
  return True
5952
5960
 
5953
5961
  def hide_selected(self) -> None:
@@ -5965,6 +5973,7 @@ class MainTable(tk.Canvas):
5965
5973
  state: str = "normal",
5966
5974
  set_current: bool | tuple[int, int] = True,
5967
5975
  run_binding: bool = False,
5976
+ ext: bool = False,
5968
5977
  ) -> int:
5969
5978
  if self.col_positions == [0]:
5970
5979
  c1 = 0
@@ -6019,7 +6028,8 @@ class MainTable(tk.Canvas):
6019
6028
  )
6020
6029
  bd_iid = None
6021
6030
  if self.PAR.ops.show_selected_cells_border and (
6022
- (self.being_drawn_item is None and self.RI.being_drawn_item is None and self.CH.being_drawn_item is None)
6031
+ ext
6032
+ or (self.being_drawn_item is None and self.RI.being_drawn_item is None and self.CH.being_drawn_item is None)
6023
6033
  or self.selection_boxes
6024
6034
  ):
6025
6035
  bd_iid = self.display_box(
@@ -921,6 +921,7 @@ class RowIndex(tk.Canvas):
921
921
  redraw: bool = True,
922
922
  run_binding_func: bool = True,
923
923
  set_as_current: bool = True,
924
+ ext: bool = False,
924
925
  ) -> int | None:
925
926
  if add_selection:
926
927
  if self.MT.row_selected(row):
@@ -931,18 +932,25 @@ class RowIndex(tk.Canvas):
931
932
  redraw=redraw,
932
933
  run_binding_func=run_binding_func,
933
934
  set_as_current=set_as_current,
935
+ ext=ext,
934
936
  )
935
937
  else:
936
938
  if self.MT.row_selected(row):
937
939
  fill_iid = self.MT.deselect(r=row, redraw=redraw)
938
940
  else:
939
- fill_iid = self.select_row(row, redraw=redraw)
941
+ fill_iid = self.select_row(row, redraw=redraw, ext=ext)
940
942
  return fill_iid
941
943
 
942
- def select_row(self, r: int, redraw: bool = False, run_binding_func: bool = True) -> int:
944
+ def select_row(
945
+ self,
946
+ r: int,
947
+ redraw: bool = False,
948
+ run_binding_func: bool = True,
949
+ ext: bool = False,
950
+ ) -> int:
943
951
  self.MT.deselect("all", redraw=False)
944
952
  box = (r, 0, r + 1, len(self.MT.col_positions) - 1, "rows")
945
- fill_iid = self.MT.create_selection_box(*box)
953
+ fill_iid = self.MT.create_selection_box(*box, ext=ext)
946
954
  if redraw:
947
955
  self.MT.main_table_redraw_grid_and_text(redraw_header=True, redraw_row_index=True)
948
956
  if run_binding_func:
@@ -955,9 +963,10 @@ class RowIndex(tk.Canvas):
955
963
  redraw: bool = False,
956
964
  run_binding_func: bool = True,
957
965
  set_as_current: bool = True,
966
+ ext: bool = False,
958
967
  ) -> int:
959
968
  box = (r, 0, r + 1, len(self.MT.col_positions) - 1, "rows")
960
- fill_iid = self.MT.create_selection_box(*box, set_current=set_as_current)
969
+ fill_iid = self.MT.create_selection_box(*box, set_current=set_as_current, ext=ext)
961
970
  if redraw:
962
971
  self.MT.main_table_redraw_grid_and_text(redraw_header=False, redraw_row_index=True)
963
972
  if run_binding_func:
@@ -21,7 +21,6 @@ from .functions import (
21
21
  dropdown_search_function,
22
22
  event_dict,
23
23
  fix_format_kwargs,
24
- new_tk_event,
25
24
  force_bool,
26
25
  get_checkbox_dict,
27
26
  get_checkbox_kwargs,
@@ -30,6 +29,7 @@ from .functions import (
30
29
  idx_param_to_int,
31
30
  is_iterable,
32
31
  key_to_span,
32
+ new_tk_event,
33
33
  num2alpha,
34
34
  pickled_event_dict,
35
35
  pop_positions,
@@ -3137,6 +3137,7 @@ class Sheet(tk.Frame):
3137
3137
  row if isinstance(row, int) else int(row),
3138
3138
  redraw=False,
3139
3139
  run_binding_func=run_binding_func,
3140
+ ext=True,
3140
3141
  )
3141
3142
  return self.set_refresh_timer(redraw)
3142
3143
 
@@ -3145,6 +3146,7 @@ class Sheet(tk.Frame):
3145
3146
  column if isinstance(column, int) else int(column),
3146
3147
  redraw=False,
3147
3148
  run_binding_func=run_binding_func,
3149
+ ext=True,
3148
3150
  )
3149
3151
  return self.set_refresh_timer(redraw)
3150
3152
 
@@ -3154,6 +3156,7 @@ class Sheet(tk.Frame):
3154
3156
  column if isinstance(column, int) else int(column),
3155
3157
  redraw=False,
3156
3158
  run_binding_func=run_binding_func,
3159
+ ext=True,
3157
3160
  )
3158
3161
  return self.set_refresh_timer(redraw)
3159
3162
 
@@ -3175,6 +3178,7 @@ class Sheet(tk.Frame):
3175
3178
  redraw=False,
3176
3179
  run_binding_func=run_binding_func,
3177
3180
  set_as_current=set_as_current,
3181
+ ext=True,
3178
3182
  )
3179
3183
  return self.set_refresh_timer(redraw)
3180
3184
 
@@ -3190,6 +3194,7 @@ class Sheet(tk.Frame):
3190
3194
  redraw=False,
3191
3195
  run_binding_func=run_binding_func,
3192
3196
  set_as_current=set_as_current,
3197
+ ext=True,
3193
3198
  )
3194
3199
  return self.set_refresh_timer(redraw)
3195
3200
 
@@ -3205,6 +3210,7 @@ class Sheet(tk.Frame):
3205
3210
  redraw=False,
3206
3211
  run_binding_func=run_binding_func,
3207
3212
  set_as_current=set_as_current,
3213
+ ext=True,
3208
3214
  )
3209
3215
  return self.set_refresh_timer(redraw)
3210
3216
 
@@ -3224,6 +3230,7 @@ class Sheet(tk.Frame):
3224
3230
  redraw=False,
3225
3231
  run_binding_func=run_binding_func,
3226
3232
  set_as_current=set_as_current,
3233
+ ext=True,
3227
3234
  )
3228
3235
  return self.set_refresh_timer(redraw)
3229
3236
 
@@ -3241,6 +3248,7 @@ class Sheet(tk.Frame):
3241
3248
  redraw=False,
3242
3249
  run_binding_func=run_binding_func,
3243
3250
  set_as_current=set_as_current,
3251
+ ext=True,
3244
3252
  )
3245
3253
  return self.set_refresh_timer(redraw)
3246
3254
 
@@ -3258,6 +3266,7 @@ class Sheet(tk.Frame):
3258
3266
  redraw=False,
3259
3267
  run_binding_func=run_binding_func,
3260
3268
  set_as_current=set_as_current,
3269
+ ext=True,
3261
3270
  )
3262
3271
  return self.set_refresh_timer(redraw)
3263
3272
 
@@ -3269,7 +3278,14 @@ class Sheet(tk.Frame):
3269
3278
  c2: int,
3270
3279
  type_: Literal["cells", "rows", "columns", "cols"] = "cells",
3271
3280
  ) -> int:
3272
- return self.MT.create_selection_box(r1=r1, c1=c1, r2=r2, c2=c2, type_="columns" if type_ == "cols" else type_)
3281
+ return self.MT.create_selection_box(
3282
+ r1=r1,
3283
+ c1=c1,
3284
+ r2=r2,
3285
+ c2=c2,
3286
+ type_="columns" if type_ == "cols" else type_,
3287
+ ext=True,
3288
+ )
3273
3289
 
3274
3290
  def recreate_all_selection_boxes(self) -> Sheet:
3275
3291
  self.MT.recreate_all_selection_boxes()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tksheet
3
- Version: 7.2.0
3
+ Version: 7.2.1
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
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