def METHOD_NAME(self, event):
    paint_dc = wx.BufferedPaintDC(self.matrix_ctrl)
    matrix = self.setting.get_matrix()
    h = len(matrix)
    w = len(matrix[0])
    bx, ex, dx, by, ey, dy = [
        wx.SystemSettings.GetMetric(m)
        for m in (
            wx.SYS_BORDER_X,
            wx.SYS_EDGE_X,
            wx.SYS_SMALLICON_X,
            wx.SYS_BORDER_Y,
            wx.SYS_EDGE_Y,
            wx.SYS_SMALLICON_Y,
        )
    ]
    paint_dc.SetBackground(wx.Brush(get_background_color()))
    paint_dc.Clear()
    pShadow = wx.Pen(
        wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNSHADOW), 1, wx.PENSTYLE_SOLID
    )
    pHighlight = wx.Pen(
        wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNHIGHLIGHT),
        1,
        wx.PENSTYLE_SOLID,
    )
    bBackground, bForeground = [
        wx.Brush(color) for color in (wx.Colour(80, 80, 80, 255), wx.WHITE)
    ]
    rw = 2 * ex + dx
    rh = 2 * ey + dy
    for x in range(w):
        for y in range(h):
            rx = x * rw + x * bx
            ry = y * rh + y * by
            value = matrix[y][x]
            paint_dc.SetPen(pHighlight if value else pShadow)
            for k in range(ex):
                paint_dc.DrawLine(rx + k, ry + k, rx + rw - k - 1, ry + k)
                paint_dc.DrawLine(rx + k, ry + k, rx + k, ry + rh - k - 1)
            paint_dc.SetPen(pShadow if value else pHighlight)
            for k in range(ex):
                paint_dc.DrawLine(
                    rx + k, ry + rh - k - 1, rx + rw - k - 1, ry + rh - k - 1
                )
                paint_dc.DrawLine(
                    rx + rw - k - 1, ry + k, rx + rw - k - 1, ry + rh - k - 1
                )
            paint_dc.SetPen(wx.TRANSPARENT_PEN)
            paint_dc.SetBrush(bForeground if value else bBackground)
            paint_dc.DrawRectangle(rx + ex, ry + ey, dx, dy)
    event.Skip()