Trait ux::DragActionExt[][src]

pub trait DragActionExt: 'static {
Show methods pub fn get_drag_area(&self) -> Option<InternalRect>;
pub fn get_drag_axis(&self) -> DragAxis;
pub fn get_drag_handle(&self) -> Option<Actor>;
pub fn get_drag_threshold(&self) -> (u32, u32);
pub fn get_motion_coords(&self) -> (f32, f32);
pub fn get_press_coords(&self) -> (f32, f32);
pub fn set_drag_area(&self, drag_area: Option<&InternalRect>);
pub fn set_drag_axis(&self, axis: DragAxis);
pub fn set_drag_handle<P>(&self, handle: Option<&P>)
    where
        P: IsA<Actor>
;
pub fn set_drag_threshold(&self, x_threshold: i32, y_threshold: i32);
pub fn get_property_drag_area_set(&self) -> bool;
pub fn get_property_x_drag_threshold(&self) -> i32;
pub fn set_property_x_drag_threshold(&self, x_drag_threshold: i32);
pub fn get_property_y_drag_threshold(&self) -> i32;
pub fn set_property_y_drag_threshold(&self, y_drag_threshold: i32);
pub fn connect_drag_begin<F>(&self, f: F) -> SignalHandlerId
    where
        F: 'static + Fn(&Self, &Actor, f32, f32, ModifierType)
;
pub fn connect_drag_end<F>(&self, f: F) -> SignalHandlerId
    where
        F: 'static + Fn(&Self, &Actor, f32, f32, ModifierType)
;
pub fn connect_drag_motion<F>(&self, f: F) -> SignalHandlerId
    where
        F: 'static + Fn(&Self, &Actor, f32, f32)
;
pub fn connect_drag_progress<F>(&self, f: F) -> SignalHandlerId
    where
        F: 'static + Fn(&Self, &Actor, f32, f32) -> bool
;
pub fn connect_property_drag_area_notify<F>(&self, f: F) -> SignalHandlerId
    where
        F: 'static + Fn(&Self)
;
pub fn connect_property_drag_area_set_notify<F>(
        &self,
        f: F
    ) -> SignalHandlerId
    where
        F: 'static + Fn(&Self)
;
pub fn connect_property_drag_axis_notify<F>(&self, f: F) -> SignalHandlerId
    where
        F: 'static + Fn(&Self)
;
pub fn connect_property_drag_handle_notify<F>(
        &self,
        f: F
    ) -> SignalHandlerId
    where
        F: 'static + Fn(&Self)
;
pub fn connect_property_x_drag_threshold_notify<F>(
        &self,
        f: F
    ) -> SignalHandlerId
    where
        F: 'static + Fn(&Self)
;
pub fn connect_property_y_drag_threshold_notify<F>(
        &self,
        f: F
    ) -> SignalHandlerId
    where
        F: 'static + Fn(&Self)
;
}

Trait containing all DragAction methods.

Implementors

DragAction

Required methods

pub fn get_drag_area(&self) -> Option<InternalRect>[src]

Retrieves the “drag area” associated with self, that is a Rect that constrains the actor movements, in parents coordinates.

drag_area

a Rect to be filled

Returns

true if the actor is actually constrained (and thus drag_area is valid), false otherwise

pub fn get_drag_axis(&self) -> DragAxis[src]

Retrieves the axis constraint set by DragActionExt::set_drag_axis

Returns

the axis constraint

pub fn get_drag_handle(&self) -> Option<Actor>[src]

Retrieves the drag handle set by DragActionExt::set_drag_handle

Returns

a Actor, used as the drag handle, or None if none was set

pub fn get_drag_threshold(&self) -> (u32, u32)[src]

Retrieves the values set by DragActionExt::set_drag_threshold.

If the DragAction:x-drag-threshold property or the DragAction:y-drag-threshold property have been set to -1 then this function will return the default drag threshold value as stored by the Settings:dnd-drag-threshold property of Settings.

x_threshold

return location for the horizontal drag threshold value, in pixels

y_threshold

return location for the vertical drag threshold value, in pixels

pub fn get_motion_coords(&self) -> (f32, f32)[src]

Retrieves the coordinates, in stage space, of the latest motion event during the dragging

motion_x

return location for the latest motion event’s X coordinate

motion_y

return location for the latest motion event’s Y coordinate

pub fn get_press_coords(&self) -> (f32, f32)[src]

Retrieves the coordinates, in stage space, of the press event that started the dragging

press_x

return location for the press event’s X coordinate

press_y

return location for the press event’s Y coordinate

pub fn set_drag_area(&self, drag_area: Option<&InternalRect>)[src]

Sets drag_area to constrain the dragging of the actor associated with self, so that it position is always within drag_area, expressed in parent’s coordinates. If drag_area is None, the actor is not constrained.

drag_area

a Rect

pub fn set_drag_axis(&self, axis: DragAxis)[src]

Restricts the dragging action to a specific axis

axis

the axis to constraint the dragging to

pub fn set_drag_handle<P>(&self, handle: Option<&P>) where
    P: IsA<Actor>, 
[src]

Sets the actor to be used as the drag handle.

handle

a Actor, or None to unset

pub fn set_drag_threshold(&self, x_threshold: i32, y_threshold: i32)[src]

Sets the horizontal and vertical drag thresholds that must be cleared by the pointer before self can begin the dragging.

If x_threshold or y_threshold are set to -1 then the default drag threshold stored in the Settings:dnd-drag-threshold property of Settings will be used.

x_threshold

a distance on the horizontal axis, in pixels, or -1 to use the default drag threshold from Settings

y_threshold

a distance on the vertical axis, in pixels, or -1 to use the default drag threshold from Settings

pub fn get_property_drag_area_set(&self) -> bool[src]

Whether the DragAction:drag-area property has been set.

pub fn get_property_x_drag_threshold(&self) -> i32[src]

The horizontal threshold, in pixels, that the cursor must travel in order to begin a drag action.

When set to a positive value, DragAction will only emit DragAction::drag-begin if the pointer has moved horizontally at least of the given amount of pixels since the button press event.

When set to -1, DragAction will use the default threshold stored in the Settings:dnd-drag-threshold property of Settings.

When read, this property will always return a valid drag threshold, either as set or the default one.

pub fn set_property_x_drag_threshold(&self, x_drag_threshold: i32)[src]

The horizontal threshold, in pixels, that the cursor must travel in order to begin a drag action.

When set to a positive value, DragAction will only emit DragAction::drag-begin if the pointer has moved horizontally at least of the given amount of pixels since the button press event.

When set to -1, DragAction will use the default threshold stored in the Settings:dnd-drag-threshold property of Settings.

When read, this property will always return a valid drag threshold, either as set or the default one.

pub fn get_property_y_drag_threshold(&self) -> i32[src]

The vertical threshold, in pixels, that the cursor must travel in order to begin a drag action.

When set to a positive value, DragAction will only emit DragAction::drag-begin if the pointer has moved vertically at least of the given amount of pixels since the button press event.

When set to -1, DragAction will use the value stored in the Settings:dnd-drag-threshold property of Settings.

When read, this property will always return a valid drag threshold, either as set or the default one.

pub fn set_property_y_drag_threshold(&self, y_drag_threshold: i32)[src]

The vertical threshold, in pixels, that the cursor must travel in order to begin a drag action.

When set to a positive value, DragAction will only emit DragAction::drag-begin if the pointer has moved vertically at least of the given amount of pixels since the button press event.

When set to -1, DragAction will use the value stored in the Settings:dnd-drag-threshold property of Settings.

When read, this property will always return a valid drag threshold, either as set or the default one.

pub fn connect_drag_begin<F>(&self, f: F) -> SignalHandlerId where
    F: 'static + Fn(&Self, &Actor, f32, f32, ModifierType), 
[src]

The ::drag-begin signal is emitted when the DragAction starts the dragging

The emission of this signal can be delayed by using the DragAction:x-drag-threshold and DragAction:y-drag-threshold properties

actor

the Actor attached to the action

event_x

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

event_y

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

modifiers

the modifiers of the press event

pub fn connect_drag_end<F>(&self, f: F) -> SignalHandlerId where
    F: 'static + Fn(&Self, &Actor, f32, f32, ModifierType), 
[src]

The ::drag-end signal is emitted at the end of the dragging, when the pointer button’s is released

This signal is emitted if and only if the DragAction::drag-begin signal has been emitted first

actor

the Actor attached to the action

event_x

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

event_y

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

modifiers

the modifiers of the release event

pub fn connect_drag_motion<F>(&self, f: F) -> SignalHandlerId where
    F: 'static + Fn(&Self, &Actor, f32, f32), 
[src]

The ::drag-motion signal is emitted for each motion event after the DragAction::drag-begin signal has been emitted.

The components of the distance between the press event and the latest motion event are computed in the actor’s coordinate space, to take into account eventual transformations. If you want the stage coordinates of the latest motion event you can use DragActionExt::get_motion_coords.

The default handler of the signal will call ActorExt::move_by either on actor or, if set, of DragAction:drag-handle using the delta_x and delta_y components of the dragging motion. If you want to override the default behaviour, you can connect to the DragAction::drag-progress signal and return false from the handler.

actor

the Actor attached to the action

delta_x

the X component of the distance between the press event that began the dragging and the current position of the pointer, as of the latest motion event

delta_y

the Y component of the distance between the press event that began the dragging and the current position of the pointer, as of the latest motion event

pub fn connect_drag_progress<F>(&self, f: F) -> SignalHandlerId where
    F: 'static + Fn(&Self, &Actor, f32, f32) -> bool
[src]

The ::drag-progress signal is emitted for each motion event after the DragAction::drag-begin signal has been emitted.

The components of the distance between the press event and the latest motion event are computed in the actor’s coordinate space, to take into account eventual transformations. If you want the stage coordinates of the latest motion event you can use DragActionExt::get_motion_coords.

The default handler will emit DragAction::drag-motion, if DragAction::drag-progress emission returns true.

actor

the Actor attached to the action

delta_x

the X component of the distance between the press event that began the dragging and the current position of the pointer, as of the latest motion event

delta_y

the Y component of the distance between the press event that began the dragging and the current position of the pointer, as of the latest motion event

Returns

true if the drag should continue, and false if it should be stopped.

pub fn connect_property_drag_area_notify<F>(&self, f: F) -> SignalHandlerId where
    F: 'static + Fn(&Self), 
[src]

pub fn connect_property_drag_area_set_notify<F>(&self, f: F) -> SignalHandlerId where
    F: 'static + Fn(&Self), 
[src]

pub fn connect_property_drag_axis_notify<F>(&self, f: F) -> SignalHandlerId where
    F: 'static + Fn(&Self), 
[src]

pub fn connect_property_drag_handle_notify<F>(&self, f: F) -> SignalHandlerId where
    F: 'static + Fn(&Self), 
[src]

pub fn connect_property_x_drag_threshold_notify<F>(
    &self,
    f: F
) -> SignalHandlerId where
    F: 'static + Fn(&Self), 
[src]

pub fn connect_property_y_drag_threshold_notify<F>(
    &self,
    f: F
) -> SignalHandlerId where
    F: 'static + Fn(&Self), 
[src]

Loading content...

Implementors

impl<O> DragActionExt for O where
    O: IsA<DragAction>, 
[src]

Loading content...