pub struct DragMode {
pub drag_move: bool,
pub drag_grow: bool,
pub drag_grow_left: bool,
pub limit_lo_x: bool,
pub limit_lo_y: bool,
pub limit_hi_x: bool,
pub limit_hi_y: bool,
}Expand description
Drag-mode flags — control whether a view can be moved or resized interactively and the owner-boundary limits applied during the drag.
Set DragMode on a ViewState (via state_mut().drag_mode = …) during
construction. Window sets both drag_move and drag_grow
with limit_lo_y = true by default so windows can be moved and resized within
the desktop. A plain embedded widget typically leaves all fields false.
The limit_* fields are combined with the drag rectangle at each mouse-move
step: a true limit_lo_x means the view’s left edge cannot move past the
owner’s left edge, and so on. Use DragMode::limit_all for the common case
of clamping all four edges.
§Turbo Vision heritage
Ports the dm* flag family (views.h) as a struct-of-bools (deviation D5);
each field names its dm* source.
Fields§
§drag_move: booldmDragMove — the view can be moved by dragging.
drag_grow: booldmDragGrow — the view can be resized by dragging.
drag_grow_left: booldmDragGrowLeft — resize by dragging the left edge.
limit_lo_x: booldmLimitLoX — clamp the left edge to the owner’s left edge.
limit_lo_y: booldmLimitLoY — clamp the top edge to the owner’s top edge (ctor default).
limit_hi_x: booldmLimitHiX — clamp the right edge to the owner’s right edge.
limit_hi_y: booldmLimitHiY — clamp the bottom edge to the owner’s bottom edge.
Implementations§
Trait Implementations§
impl Copy for DragMode
impl Eq for DragMode
impl StructuralPartialEq for DragMode
Auto Trait Implementations§
impl Freeze for DragMode
impl RefUnwindSafe for DragMode
impl Send for DragMode
impl Sync for DragMode
impl Unpin for DragMode
impl UnsafeUnpin for DragMode
impl UnwindSafe for DragMode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.