tksheet 5.6.4__tar.gz → 5.6.6__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.
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tksheet
3
- Version: 5.6.4
3
+ Version: 5.6.6
4
4
  Summary: Tkinter table / sheet widget
5
5
  Home-page: https://github.com/ragardner/tksheet
6
- Download-URL: https://github.com/ragardner/tksheet/archive/5.6.4.tar.gz
6
+ Download-URL: https://github.com/ragardner/tksheet/archive/5.6.6.tar.gz
7
7
  Author: ragardner
8
8
  Author-email: github@ragardner.simplelogin.com
9
9
  License: MIT
@@ -16,7 +16,7 @@ Requires-Python: >=3.6
16
16
  Description-Content-Type: text/markdown
17
17
  License-File: LICENSE.txt
18
18
 
19
- # tksheet [![PyPI version shields.io](https://img.shields.io/pypi/v/tksheet.svg)](https://pypi.python.org/pypi/tksheet/) ![python](https://img.shields.io/badge/python-3.6+-blue) [![License: MIT](https://img.shields.io/badge/License-MIT%20-blue.svg)](https://github.com/ragardner/tksheet/blob/master/LICENSE.txt) [![GitHub Release Date](https://img.shields.io/github/release-date-pre/ragardner/tksheet.svg)](https://github.com/ragardner/tksheet/releases)
19
+ # tksheet [![PyPI version shields.io](https://img.shields.io/pypi/v/tksheet.svg)](https://pypi.python.org/pypi/tksheet/) ![python](https://img.shields.io/badge/python-3.6+-blue) [![License: MIT](https://img.shields.io/badge/License-MIT%20-blue.svg)](https://github.com/ragardner/tksheet/blob/master/LICENSE.txt) [![GitHub Release Date](https://img.shields.io/github/release-date-pre/ragardner/tksheet.svg)](https://github.com/ragardner/tksheet/releases) [![Downloads](https://img.shields.io/pypi/dm/tksheet.svg)](https://pypi.org/project/tksheet/)
20
20
 
21
21
 
22
22
  Python tkinter table widget
@@ -48,8 +48,8 @@ pip install tksheet --upgrade
48
48
 
49
49
  ### Light Blue Theme
50
50
 
51
- ![alt text](https://i.imgur.com/VaARHUp.png)
51
+ ![alt text](https://i.imgur.com/ojU3IQi.jpeg)
52
52
 
53
53
  ### Dark Theme
54
54
 
55
- ![alt text](https://i.imgur.com/ldzbkN9.png)
55
+ ![alt text](https://i.imgur.com/JeF9vJe.jpeg)
@@ -1,4 +1,4 @@
1
- # tksheet [![PyPI version shields.io](https://img.shields.io/pypi/v/tksheet.svg)](https://pypi.python.org/pypi/tksheet/) ![python](https://img.shields.io/badge/python-3.6+-blue) [![License: MIT](https://img.shields.io/badge/License-MIT%20-blue.svg)](https://github.com/ragardner/tksheet/blob/master/LICENSE.txt) [![GitHub Release Date](https://img.shields.io/github/release-date-pre/ragardner/tksheet.svg)](https://github.com/ragardner/tksheet/releases)
1
+ # tksheet [![PyPI version shields.io](https://img.shields.io/pypi/v/tksheet.svg)](https://pypi.python.org/pypi/tksheet/) ![python](https://img.shields.io/badge/python-3.6+-blue) [![License: MIT](https://img.shields.io/badge/License-MIT%20-blue.svg)](https://github.com/ragardner/tksheet/blob/master/LICENSE.txt) [![GitHub Release Date](https://img.shields.io/github/release-date-pre/ragardner/tksheet.svg)](https://github.com/ragardner/tksheet/releases) [![Downloads](https://img.shields.io/pypi/dm/tksheet.svg)](https://pypi.org/project/tksheet/)
2
2
 
3
3
 
4
4
  Python tkinter table widget
@@ -30,8 +30,8 @@ pip install tksheet --upgrade
30
30
 
31
31
  ### Light Blue Theme
32
32
 
33
- ![alt text](https://i.imgur.com/VaARHUp.png)
33
+ ![alt text](https://i.imgur.com/ojU3IQi.jpeg)
34
34
 
35
35
  ### Dark Theme
36
36
 
37
- ![alt text](https://i.imgur.com/ldzbkN9.png)
37
+ ![alt text](https://i.imgur.com/JeF9vJe.jpeg)
@@ -8,7 +8,7 @@ with open(path.join(this_directory, 'README.md'), encoding = 'utf-8') as f:
8
8
  setup(
9
9
  name = 'tksheet',
10
10
  packages = ['tksheet'],
11
- version = '5.6.4',
11
+ version = '5.6.6',
12
12
  python_requires = '>=3.6',
13
13
  license = 'MIT',
14
14
  description = 'Tkinter table / sheet widget',
@@ -17,7 +17,7 @@ setup(
17
17
  author = 'ragardner',
18
18
  author_email = 'github@ragardner.simplelogin.com',
19
19
  url = 'https://github.com/ragardner/tksheet',
20
- download_url = 'https://github.com/ragardner/tksheet/archive/5.6.4.tar.gz',
20
+ download_url = 'https://github.com/ragardner/tksheet/archive/5.6.6.tar.gz',
21
21
  keywords = ['tkinter', 'table', 'widget', 'sheet', 'grid', 'tk'],
22
22
  install_requires = [],
23
23
  classifiers = [
@@ -457,6 +457,8 @@ class Sheet(tk.Frame):
457
457
  self.MT.extra_end_edit_cell_func = func
458
458
  self.CH.extra_begin_edit_cell_func = func
459
459
  self.CH.extra_end_edit_cell_func = func
460
+ self.RI.extra_begin_edit_cell_func = func
461
+ self.RI.extra_end_edit_cell_func = func
460
462
 
461
463
  self.RI.ri_extra_end_drag_drop_func = func
462
464
  self.CH.ch_extra_end_drag_drop_func = func
@@ -918,13 +920,14 @@ class Sheet(tk.Frame):
918
920
  else:
919
921
  _rows = set(rows)
920
922
  self.MT.data[:] = [row for r, row in enumerate(self.MT.data) if r not in _rows]
923
+ rhs = tuple(int(b - a) for a, b in zip(self.MT.row_positions, islice(self.MT.row_positions, 1, len(self.MT.row_positions))))
921
924
  if self.MT.all_rows_displayed:
922
- self.set_row_heights(row_heights = (h for r, h in enumerate(tuple(int(b - a) for a, b in zip(self.MT.row_positions, islice(self.MT.row_positions, 1, len(self.MT.row_positions))))) if r not in _rows))
925
+ self.set_row_heights(row_heights = tuple(h for r, h in enumerate(rhs) if r not in _rows))
923
926
  else:
924
927
  dispset = set(self.MT.displayed_rows)
925
928
  heights_to_del = {i for i, r in enumerate(to_bis) if r in dispset}
926
929
  if heights_to_del:
927
- self.set_row_heights(row_heights = (h for r, h in enumerate(tuple(int(b - a) for a, b in zip(self.MT.row_positions, islice(self.MT.row_positions, 1, len(self.MT.row_positions))))) if r not in heights_to_del))
930
+ self.set_row_heights(row_heights = tuple(h for r, h in enumerate(rhs) if r not in heights_to_del))
928
931
  self.MT.displayed_rows = [r for r in self.MT.displayed_rows if r not in _rows]
929
932
  to_bis = sorted(_rows)
930
933
  self.MT.cell_options = {(r if not bisect.bisect_left(to_bis, r) else r - bisect.bisect_left(to_bis, r), c): v for (r, c), v in self.MT.cell_options.items() if r not in _rows}
@@ -1023,13 +1026,14 @@ class Sheet(tk.Frame):
1023
1026
  to_del = set(columns)
1024
1027
  self.MT.data[:] = [[e for c, e in enumerate(r) if c not in to_del] for r in self.MT.data]
1025
1028
  to_bis = sorted(to_del)
1029
+ cws = tuple(int(b - a) for a, b in zip(self.MT.col_positions, islice(self.MT.col_positions, 1, len(self.MT.col_positions))))
1026
1030
  if self.MT.all_columns_displayed:
1027
- self.set_column_widths(column_widths = (w for c, w in enumerate(tuple(int(b - a) for a, b in zip(self.MT.col_positions, islice(self.MT.col_positions, 1, len(self.MT.col_positions))))) if c not in to_del))
1031
+ self.set_column_widths(column_widths = tuple(w for c, w in enumerate(cws) if c not in to_del))
1028
1032
  else:
1029
1033
  dispset = set(self.MT.displayed_columns)
1030
1034
  widths_to_del = {i for i, c in enumerate(to_bis) if c in dispset}
1031
1035
  if widths_to_del:
1032
- self.set_column_widths(column_widths = (w for c, w in enumerate(tuple(int(b - a) for a, b in zip(self.MT.col_positions, islice(self.MT.col_positions, 1, len(self.MT.col_positions))))) if c not in widths_to_del))
1036
+ self.set_column_widths(column_widths = tuple(w for c, w in enumerate(cws) if c not in widths_to_del))
1033
1037
  self.MT.displayed_columns = [c if not bisect.bisect_left(to_bis, c) else c - bisect.bisect_left(to_bis, c) for c in self.MT.displayed_columns if c not in to_del]
1034
1038
  self.MT.cell_options = {(r, c if not bisect.bisect_left(to_bis, c) else c - bisect.bisect_left(to_bis, c)): v for (r, c), v in self.MT.cell_options.items() if c not in to_del}
1035
1039
  self.MT.col_options = {c if not bisect.bisect_left(to_bis, c) else c - bisect.bisect_left(to_bis, c): v for c, v in self.MT.col_options.items() if c not in to_del}
@@ -1288,6 +1292,12 @@ class Sheet(tk.Frame):
1288
1292
 
1289
1293
  def recreate_all_selection_boxes(self):
1290
1294
  self.MT.recreate_all_selection_boxes()
1295
+
1296
+ def cell_visible(self, r, c):
1297
+ return self.MT.cell_visible(r, c)
1298
+
1299
+ def cell_completely_visible(self, r, c, seperate_axes = False):
1300
+ return self.MT.cell_completely_visible(r, c, seperate_axes)
1291
1301
 
1292
1302
  def cell_selected(self, r, c):
1293
1303
  return self.MT.cell_selected(r, c)
@@ -1841,33 +1851,27 @@ class Sheet(tk.Frame):
1841
1851
  self.refresh()
1842
1852
 
1843
1853
  def change_theme(self, theme = "light blue", redraw = True):
1844
- if theme == "light blue":
1845
- self.MT.display_selected_fg_over_highlights = False
1854
+ if theme.lower() in ("light blue", "light_blue"):
1846
1855
  self.set_options(**theme_light_blue,
1847
1856
  redraw = redraw)
1848
1857
  self.config(bg = theme_light_blue['table_bg'])
1849
- elif theme == "dark":
1850
- self.MT.display_selected_fg_over_highlights = False
1858
+ elif theme.lower() == "dark":
1851
1859
  self.set_options(**theme_dark,
1852
1860
  redraw = redraw)
1853
1861
  self.config(bg = theme_dark['table_bg'])
1854
- elif theme == "light green":
1855
- self.MT.display_selected_fg_over_highlights = True
1862
+ elif theme.lower() in ("light green", "light_green"):
1856
1863
  self.set_options(**theme_light_green,
1857
1864
  redraw = redraw)
1858
1865
  self.config(bg = theme_light_green['table_bg'])
1859
- elif theme == "dark blue":
1860
- self.MT.display_selected_fg_over_highlights = True
1866
+ elif theme.lower() in ("dark blue", "dark_blue"):
1861
1867
  self.set_options(**theme_dark_blue,
1862
1868
  redraw = redraw)
1863
1869
  self.config(bg = theme_dark_blue['table_bg'])
1864
- elif theme == "dark green":
1865
- self.MT.display_selected_fg_over_highlights = True
1870
+ elif theme.lower() in ("dark green", "dark_green"):
1866
1871
  self.set_options(**theme_dark_green,
1867
1872
  redraw = redraw)
1868
1873
  self.config(bg = theme_dark_green['table_bg'])
1869
- elif theme == "black":
1870
- self.MT.display_selected_fg_over_highlights = False
1874
+ elif theme.lower() == "black":
1871
1875
  self.set_options(**theme_black,
1872
1876
  redraw = redraw)
1873
1877
  self.config(bg = theme_black['table_bg'])
@@ -2755,8 +2759,10 @@ class Sheet_Dropdown(Sheet):
2755
2759
  width = None,
2756
2760
  height = None,
2757
2761
  font = None,
2758
- bg = theme_light_blue['table_bg'],
2759
- fg = theme_light_blue['table_fg'],
2762
+ colors = {'bg': theme_light_blue['popup_menu_bg'],
2763
+ 'fg': theme_light_blue['popup_menu_fg'],
2764
+ 'highlight_bg': theme_light_blue['popup_menu_highlight_bg'],
2765
+ 'highlight_fg': theme_light_blue['popup_menu_highlight_fg']},
2760
2766
  outline_color = theme_light_blue['table_fg'],
2761
2767
  outline_thickness = 2,
2762
2768
  values = [],
@@ -2770,7 +2776,7 @@ class Sheet_Dropdown(Sheet):
2770
2776
  parent = parent,
2771
2777
  outline_thickness = outline_thickness,
2772
2778
  outline_color = outline_color,
2773
- table_grid_fg = outline_color,
2779
+ table_grid_fg = colors['fg'],
2774
2780
  show_horizontal_grid = True,
2775
2781
  show_vertical_grid = False,
2776
2782
  show_header = False,
@@ -2782,16 +2788,16 @@ class Sheet_Dropdown(Sheet):
2782
2788
  selected_rows_to_end_of_window = True,
2783
2789
  horizontal_grid_to_end_of_window = True,
2784
2790
  show_selected_cells_border = False,
2785
- table_selected_cells_border_fg = fg,
2786
- table_selected_cells_bg = fg,
2787
- table_selected_rows_border_fg = fg,
2788
- table_selected_rows_bg = fg,
2789
- table_selected_rows_fg = bg,
2791
+ table_selected_cells_border_fg = colors['fg'],
2792
+ table_selected_cells_bg = colors['highlight_bg'],
2793
+ table_selected_rows_border_fg = colors['fg'],
2794
+ table_selected_rows_bg = colors['highlight_bg'],
2795
+ table_selected_rows_fg = colors['highlight_fg'],
2790
2796
  width = width,
2791
2797
  height = height,
2792
2798
  font = font if font else get_font(),
2793
- table_fg = fg,
2794
- table_bg = bg)
2799
+ table_fg = colors['fg'],
2800
+ table_bg = colors['bg'])
2795
2801
  self.parent = parent
2796
2802
  self.hide_dropdown_window = hide_dropdown_window
2797
2803
  self.arrowkey_RIGHT = arrowkey_RIGHT
@@ -2800,8 +2806,6 @@ class Sheet_Dropdown(Sheet):
2800
2806
  self.w_ = width
2801
2807
  self.r = r
2802
2808
  self.c = c
2803
- self.bg = bg
2804
- self.fg = fg
2805
2809
  self.row = -1
2806
2810
  self.single_index = single_index
2807
2811
  self.bind("<Motion>", self.mouse_motion)