Merge pull request #5852 from PySimpleGUI/Dev-latest

Addition of starting_row_number to the Table element
This commit is contained in:
PySimpleGUI 2022-09-10 19:16:26 -04:00 committed by GitHub
commit 9805f004c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/python3 #!/usr/bin/python3
version = __version__ = "4.60.3.91 Unreleased" version = __version__ = "4.60.3.92 Unreleased"
_change_log = """ _change_log = """
Changelog since 4.60.0 released to PyPI on 8-May-2022 Changelog since 4.60.0 released to PyPI on 8-May-2022
@ -236,6 +236,8 @@ _change_log = """
Implemented the visible parameter for TabGroup. Was not being honored when creating element. Added TabGroup.update so it can be made visible. Implemented the visible parameter for TabGroup. Was not being honored when creating element. Added TabGroup.update so it can be made visible.
4.60.3.91 4.60.3.91
Added support for Custom Titlebar to the Window.set_title method Added support for Custom Titlebar to the Window.set_title method
4.60.3.92
Addition of starting_row_number parameter to the Table element. Sets the value for the first row in the table.
""" """
__version__ = version.split()[0] # For PEP 396 and PEP 345 __version__ = version.split()[0] # For PEP 396 and PEP 345
@ -8698,7 +8700,7 @@ Menubar = Menu # another name for Menu to make it clear it's the Menu Bar
class Table(Element): class Table(Element):
def __init__(self, values, headings=None, visible_column_map=None, col_widths=None, cols_justification=None, def_col_width=10, def __init__(self, values, headings=None, visible_column_map=None, col_widths=None, cols_justification=None, def_col_width=10,
auto_size_columns=True, max_col_width=20, select_mode=None, display_row_numbers=False, num_rows=None, auto_size_columns=True, max_col_width=20, select_mode=None, display_row_numbers=False, starting_row_number=0, num_rows=None,
row_height=None, font=None, justification='right', text_color=None, background_color=None, row_height=None, font=None, justification='right', text_color=None, background_color=None,
alternating_row_color=None, selected_row_colors=(None, None), header_text_color=None, header_background_color=None, header_font=None, header_border_width=None, header_relief=None, alternating_row_color=None, selected_row_colors=(None, None), header_text_color=None, header_background_color=None, header_font=None, header_border_width=None, header_relief=None,
row_colors=None, vertical_scroll_only=True, hide_vertical_scroll=False, border_width=None, row_colors=None, vertical_scroll_only=True, hide_vertical_scroll=False, border_width=None,
@ -8726,6 +8728,8 @@ class Table(Element):
:type select_mode: (enum) :type select_mode: (enum)
:param display_row_numbers: if True, the first column of the table will be the row # :param display_row_numbers: if True, the first column of the table will be the row #
:type display_row_numbers: (bool) :type display_row_numbers: (bool)
:param starting_row_number: The row number to use for the first row. All following rows will be based on this starting value. Default is 0.
:type starting_row_number: (bool)
:param num_rows: The number of rows of the table to display at a time :param num_rows: The number of rows of the table to display at a time
:type num_rows: (int) :type num_rows: (int)
:param row_height: height of a single row in pixels :param row_height: height of a single row in pixels
@ -8835,7 +8839,7 @@ class Table(Element):
self.SelectedRows = [] self.SelectedRows = []
self.ChangeSubmits = change_submits or enable_events self.ChangeSubmits = change_submits or enable_events
self.BindReturnKey = bind_return_key self.BindReturnKey = bind_return_key
self.StartingRowNumber = 0 # When displaying row numbers, where to start self.StartingRowNumber = starting_row_number # When displaying row numbers, where to start
self.RowHeaderText = 'Row' self.RowHeaderText = 'Row'
self.enable_click_events = enable_click_events self.enable_click_events = enable_click_events
self.right_click_selects = right_click_selects self.right_click_selects = right_click_selects