Skip to main content

RowDropPolicy

Trait RowDropPolicy 

Source
pub trait RowDropPolicy<R: GridRow>: 'static {
    // Required method
    fn place(&self, drop: &RowDropContext<'_, R>) -> Option<DropTarget<R::Key>>;

    // Provided methods
    fn is_enabled(&self) -> bool { ... }
    fn is_copy(&self, modifiers: Modifiers) -> bool { ... }
}
Expand description

Where a drag over the rows would land, or whether the grid refuses it. Asked on every move of a drag over the rows and once more at the drop; pinned bands, group footers and totals refuse without asking.

The default is NoRowDrop: the grid takes no drop. DropOnRows and DropBetweenRows are built in.

Required Methods§

Source

fn place(&self, drop: &RowDropContext<'_, R>) -> Option<DropTarget<R::Key>>

Where a drop at drop lands; None refuses it.

Provided Methods§

Source

fn is_enabled(&self) -> bool

Returns false if the grid takes no drop at all: it then installs no drop listener. Default: true.

Source

fn is_copy(&self, modifiers: Modifiers) -> bool

Returns true if a drop with modifiers held copies rather than moves: the grid then shows the copy cursor over a target. What a drop does stays the application’s, which reads the modifiers of LiveGridEvent::Drop. Default: Option (Alt) or Ctrl, on every platform.

Implementors§