Trait DropActionExt

Source
pub trait DropActionExt: 'static {
    // Required methods
    fn connect_can_drop<F: Fn(&Self, &Actor, f32, f32) -> bool + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;
    fn connect_drop<F: Fn(&Self, &Actor, f32, f32) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;
    fn connect_drop_cancel<F: Fn(&Self, &Actor, f32, f32) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;
    fn connect_over_in<F: Fn(&Self, &Actor) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;
    fn connect_over_out<F: Fn(&Self, &Actor) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId;
}
Expand description

Trait containing all DropAction methods.

§Implementors

DropAction

Required Methods§

Source

fn connect_can_drop<F: Fn(&Self, &Actor, f32, f32) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId

The ::can-drop signal is emitted when the dragged actor is dropped on actor. The return value of the ::can-drop signal will determine whether or not the DropAction::drop signal is going to be emitted on action.

The default implementation of DropAction returns true for this signal.

§actor

the Actor attached to the action

§event_x

the X coordinate (in stage space) of the drop event

§event_y

the Y coordinate (in stage space) of the drop event

§Returns

true if the drop is accepted, and false otherwise

Source

fn connect_drop<F: Fn(&Self, &Actor, f32, f32) + 'static>( &self, f: F, ) -> SignalHandlerId

The ::drop signal is emitted when the dragged actor is dropped on actor. This signal is only emitted if at least an handler of DropAction::can-drop returns true.

§actor

the Actor attached to the action

§event_x

the X coordinate (in stage space) of the drop event

§event_y

the Y coordinate (in stage space) of the drop event

Source

fn connect_drop_cancel<F: Fn(&Self, &Actor, f32, f32) + 'static>( &self, f: F, ) -> SignalHandlerId

The ::drop-cancel signal is emitted when the drop is refused by an emission of the DropAction::can-drop signal.

After the ::drop-cancel signal is fired the active drag is terminated.

§actor

the Actor attached to the action

§event_x

the X coordinate (in stage space) of the drop event

§event_y

the Y coordinate (in stage space) of the drop event

Source

fn connect_over_in<F: Fn(&Self, &Actor) + 'static>( &self, f: F, ) -> SignalHandlerId

The ::over-in signal is emitted when the dragged actor crosses into actor.

§actor

the Actor attached to the action

Source

fn connect_over_out<F: Fn(&Self, &Actor) + 'static>( &self, f: F, ) -> SignalHandlerId

The ::over-out signal is emitted when the dragged actor crosses outside actor.

§actor

the Actor attached to the action

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§