Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 6 additions & 17 deletions src/robotide/editor/gridbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,8 @@ def __init__(self, parent, num_rows, num_cols, popup_creator=None):
self.SetLabelBackgroundColour(Colour(self.color_secondary_background))
self.SetLabelTextColour(Colour(self.color_secondary_foreground))
self._popup_creator = popup_creator or PopupCreator()
"""
DEBUG: This block adds aditional scrollbars in mains Grid Editor, making hard to focus on cells keeping the
row numbers visible.
if hasattr(parent, 'SetupScrolling'):
parent.SetupScrolling(scrollToTop=True, scrollIntoView=True)
print("DEBUG: GridBase init at PARENT SetupScrolling\n")
elif
"""
if hasattr(self, 'SetupScrolling'):
self.SetupScrolling(scrollToTop=True, scrollIntoView=True)
# print("DEBUG: GridBase init at SELF SetupScrolling\n")
# else:
# print("DEBUG: GridBase init NO SetupScrolling\n")

def _bind_to_events(self):
self.Bind(grid.EVT_GRID_SELECT_CELL, self.on_select_cell)
Expand All @@ -99,12 +88,12 @@ def write_cell(self, row, col, value, update_history=True):
self.SetCellValue(row, col, value)

def _expand_if_necessary(self, row, col):
# Changed col and row fill because of blank spacing not changing color
# print(f"DEBUG: GridEditor ENTER_expand_if_necessary row={row}, col={col}")
while self.NumberRows <= max(1, row+1, 10-row): # DEBUG 25 makes slower rendering
self.AppendRows(1)
while self.NumberCols <= max(1, col+1, 10-col): # DEBUG 40 makes slower rendering
self.AppendCols(max(1, self._col_add_threshold)) # DEBUG: was infinite when value was 0
needed_rows = max(1, row + 2) - self.NumberRows
if needed_rows > 0:
self.AppendRows(needed_rows)
needed_cols = max(1, col + 2) - self.NumberCols
if needed_cols > 0:
self.AppendCols(max(needed_cols, self._col_add_threshold))

def has_focus(self):
return self.FindFocus() == self
Expand Down
Loading