Merge pull request #663 from MikeTheWatchGuy/Dev-latest
Ability to set the starting row number to be displayed
This commit is contained in:
commit
5ee68db7b1
|
@ -1417,13 +1417,6 @@ class Button(Element):
|
||||||
self.TKButton['state'] = 'disabled'
|
self.TKButton['state'] = 'disabled'
|
||||||
elif disabled == False:
|
elif disabled == False:
|
||||||
self.TKButton['state'] = 'normal'
|
self.TKButton['state'] = 'normal'
|
||||||
# if image_data is not None:
|
|
||||||
# if type(image_data) is bytes:
|
|
||||||
# image = tk.PhotoImage(data=image_data)
|
|
||||||
# else:
|
|
||||||
# image = image_data
|
|
||||||
# width, height = image.width, image.height
|
|
||||||
# self.TKButton.config(image=image, width=width, height=height)
|
|
||||||
if image_data is not None:
|
if image_data is not None:
|
||||||
image = tk.PhotoImage(data=image_data)
|
image = tk.PhotoImage(data=image_data)
|
||||||
width, height = image.width(), image.height()
|
width, height = image.width(), image.height()
|
||||||
|
@ -2569,6 +2562,7 @@ class Table(Element):
|
||||||
self.SelectedRows = []
|
self.SelectedRows = []
|
||||||
self.ChangeSubmits = change_submits
|
self.ChangeSubmits = change_submits
|
||||||
self.BindReturnKey = bind_return_key
|
self.BindReturnKey = bind_return_key
|
||||||
|
self.StartingRowNumber = 0 # When displaying row numbers, where to start
|
||||||
|
|
||||||
super().__init__(ELEM_TYPE_TABLE, text_color=text_color, background_color=background_color, font=font,
|
super().__init__(ELEM_TYPE_TABLE, text_color=text_color, background_color=background_color, font=font,
|
||||||
size=size, pad=pad, key=key, tooltip=tooltip)
|
size=size, pad=pad, key=key, tooltip=tooltip)
|
||||||
|
@ -4655,7 +4649,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
||||||
# Insert values into the tree
|
# Insert values into the tree
|
||||||
for i, value in enumerate(element.Values):
|
for i, value in enumerate(element.Values):
|
||||||
if element.DisplayRowNumbers:
|
if element.DisplayRowNumbers:
|
||||||
value = [i] + value
|
value = [i+element.StartingRowNumber] + value
|
||||||
id = treeview.insert('', 'end', text=value, iid=i + 1, values=value, tag=i % 2)
|
id = treeview.insert('', 'end', text=value, iid=i + 1, values=value, tag=i % 2)
|
||||||
if element.AlternatingRowColor is not None:
|
if element.AlternatingRowColor is not None:
|
||||||
treeview.tag_configure(1, background=element.AlternatingRowColor)
|
treeview.tag_configure(1, background=element.AlternatingRowColor)
|
||||||
|
|
Loading…
Reference in New Issue