def GetMaxRow(panes, dock_direction, dock_layer):
    """
    This is an internal function which returns
    the highest layer inside the specified dock.

    :param `panes`: a list of :class:`AuiPaneInfo`;
    :param integer `dock_direction`: the :class:`AuiDockInfo` docking direction to analyze;
    :param integer `dock_layer`: the :class:`AuiDockInfo` layer to analyze.
    """
    max_row = 0
    for pane in panes:
        if (pane.dock_direction == dock_direction and pane.dock_layer ==
            dock_layer and pane.dock_row > max_row):
            max_row = pane.dock_row
    return max_row
