public CellsMergingEventArgs(DrawnTableCell firstCell, DrawnTableCell secondCell, DrawnTableCell resultCell) { FirstCell = firstCell; SecondCell = secondCell; ResultCell = resultCell; }
public CellPastedEventArgs(DrawnTableCell copiedFrom, CellLocation location) : base(location) { CopiedFrom = copiedFrom; }
protected override void OnMouseDown(MouseEventArgs e) { if (!Table.IsEnabled || mouseDown == null) { base.OnMouseDown(e); return; } copyMode_DrugDrop = false; copySource = null; action = InteractAction.None; allowDrop = true; dragCoord = Table.GetCellLocation(e.Location); interactWith = Table.Cells[e.Location]; if (interactWith != null && interactWith.Enabled) { if (interactWith is DrawnTableCell && Table.CellCopyMode == DrawnTableCopyMode.CtrlAndDrag && ModifierKeys.HasFlag(Keys.Control)) { copySource = interactWith; DrawnTableCell clone = (DrawnTableCell)interactWith.Clone(); Table.OnCellCopied(new CellCopiedEventArgs(clone)); interactWith = clone; copyMode_DrugDrop = true; } action = InteractAction.Click; dragCoord = interactWith.Location; if (Table.AllowDragDrop) // || copyMode_DrugDrop { Table.dRedrawEx.Join(); Table.dRedrawEx.Pause(); lock (Table.table) { dragBackground = (Bitmap)Table.table.Clone(); } using Graphics g = GetGraphics(dragBackground); Table.DrawBackColors(g); // Drawing cells foreach (DrawnTableCell item in Table.Cells) { if (item == interactWith && !copyMode_DrugDrop) { continue; } Table.DrawCell(item, g); } Table.dRedrawEx.Resume(); } } else if (Table.AllowCreateNewCells) { CellLocation?cLoc = Table.GetCellLocation(e.Location); if (cLoc != null && Table.Cells[(CellLocation)cLoc] == null) { DrawnTableCell cell = new(cLoc.Value); Table.Cells.Add(cell, false); CellChangedEventArgs args = new(cLoc.Value); Table.OnCellCreating(args); if (!args.Handled) { action = InteractAction.CellCreating; interactWith = Table.Cells[cLoc.Value]; Table.Redraw(); } else { Table.Cells.Remove(cLoc.Value); } } } startDrag = e.Location; mouseDown = true; base.OnMouseDown(e); }
public CellCopiedEventArgs(DrawnTableCell copiedCell) { CopiedCell = copiedCell; }