def RestoreOldDC(dc, oldPen, oldBrush, oldMode):
    """
    Restores the old settings for a :class:`wx.DC`.

    :param `dc`: an instance of :class:`wx.DC`;
    :param `oldPen`: an instance of :class:`wx.Pen`;
    :param `oldBrush`: an instance of :class:`wx.Brush`;
    :param `oldMode`: the :class:`wx.DC` drawing mode bit.
    """
    dc.SetPen(oldPen)
    dc.SetBrush(oldBrush)
    dc.SetLogicalFunction(oldMode)
