Add support for frozen rows and columns to GridWithLabelRenderersMixin

This commit is contained in:
Jorge Moraleda
2023-07-09 21:50:38 -04:00
parent b67eef2589
commit 40f8595a0c

View File

@@ -95,12 +95,14 @@ class GridWithLabelRenderersMixin(object):
def _onPaintRowLabels(self, evt):
window = evt.GetEventObject()
dc = wx.PaintDC(window)
gridWindow = self.GetGridWindow()
rows = self.CalcRowLabelsExposed(window.GetUpdateRegion())
rows = self.CalcRowLabelsExposed(window.GetUpdateRegion(), gridWindow)
if rows == [-1]:
return
x, y = self.CalcUnscrolledPosition((0,0))
offset = self.GetGridWindowOffset(gridWindow)
x, y = self.CalcUnscrolledPosition(offset)
pt = dc.GetDeviceOrigin()
dc.SetDeviceOrigin(pt.x, pt.y-y)
for row in rows:
@@ -119,12 +121,14 @@ class GridWithLabelRenderersMixin(object):
def _onPaintColLabels(self, evt):
window = evt.GetEventObject()
dc = wx.PaintDC(window)
gridWindow = self.GetGridWindow()
cols = self.CalcColLabelsExposed(window.GetUpdateRegion())
cols = self.CalcColLabelsExposed(window.GetUpdateRegion(), gridWindow)
if cols == [-1]:
return
x, y = self.CalcUnscrolledPosition((0,0))
offset = self.GetGridWindowOffset(gridWindow)
x, y = self.CalcUnscrolledPosition(offset)
pt = dc.GetDeviceOrigin()
dc.SetDeviceOrigin(pt.x-x, pt.y)
for col in cols: