@@ -192,6 +192,10 @@ def __init__(self, parent, controller, tree):
192192 self ._namespace_updated = None
193193 self .InheritAttributes ()
194194 self .col_label_element = None
195+ if hasattr (self , 'SetupScrolling' ):
196+ self .SetupScrolling (scrollToTop = True , scrollIntoView = True )
197+ self .ShowScrollbars (wx .SHOW_SB_ALWAYS , wx .SHOW_SB_ALWAYS )
198+ print ("DEBUG: GridBase init at SELF SetupScrolling\n " )
195199 # self.Refresh()
196200 PUBLISHER .subscribe (self ._before_saving , RideBeforeSaving )
197201 PUBLISHER .subscribe (self ._data_changed , RideItemStepsChanged )
@@ -466,9 +470,6 @@ def _col_label_left_click(self, event):
466470 self .SelectCol (event .Col , addToSelected = False )
467471 self .SetGridCursor (0 , event .Col )
468472
469- def on_move_cursor_down (self , event = None ):
470- self ._move_cursor_down (event )
471-
472473 def on_insert_rows (self , event ):
473474 self ._execute (add_rows (self .selection .rows ()))
474475 self .ClearSelection ()
@@ -842,6 +843,16 @@ def _call_direct_function(self, event: wx.KeyEvent, keycode: int):
842843 return False # event must not be skipped in this case
843844 elif keycode == wx .WXK_F2 :
844845 self .open_cell_editor ()
846+ elif keycode in [wx .WXK_DOWN , wx .WXK_UP ]:
847+ # This block exists to ty to make cells visible
848+ # on arrow_down because the mouse scroll does not work
849+ # unfortunatelly IsVisible it always True.
850+ delta = 1 if keycode == wx .WXK_DOWN else - 1
851+ cursor = (self .GetGridCursorRow (), self .GetGridCursorCol ())
852+ cursor = (cursor [0 ] + delta if cursor [0 ] + delta >= 0 else 0 , cursor [1 ])
853+ # print(f"DEBUG: call MakeCellVisible cursor={cursor}")
854+ self .MakeCellVisible (cursor )
855+ # print(f"DEBUG: IsCellVisible cursor={self.IsVisible(cursor)}")
845856 return True
846857
847858 def _call_alt_function (self , event , keycode : int ):
0 commit comments