/// <summary> /// Initializes a new instance of <see cref="UndoPopup"/>. /// </summary> /// <param name="undoManager">The undo manager used to populate the action list.</param> /// <param name="mode">The mode the popup shows actions for.</param> public UndoPopup(UndoManager undoManager, UndoPopupMode mode) : base(new Control()) { // Set some defaults on the host control. Control.Margin = Padding.Empty; Control.Size = new Size(400, 300); Control.TabStop = false; // Add the listbox. _listBox = new ListBox { Dock = DockStyle.Fill, BorderStyle = BorderStyle.None, IntegralHeight = false, SelectionMode = SelectionMode.MultiSimple, HorizontalScrollbar = true }; _listBox.MouseDown += ListBox_MouseDown; _listBox.MouseMove += ListBox_MouseMove; Control.Controls.Add(_listBox); // Create tooltip. _tooltip = new ToolTip(); _mode = mode; UndoManager = undoManager; }
/// <summary> /// Initializes a new instance of <see cref="UndoPopup"/>. /// </summary> /// <param name="mode">The mode the popup shows actions for.</param> public UndoPopup(UndoPopupMode mode) : this(null, mode) { }
/// <summary> /// Initializes a new instance of <see cref="UndoPopupClickEventArgs"/>. /// </summary> /// <param name="count">The number of undo/redo actions selected.</param> /// <param name="mode">The mode (direction).</param> public UndoPopupClickEventArgs(int count, UndoPopupMode mode) { Count = count; Mode = mode; }