Struct DynLayout

Source
pub struct DynLayout { /* private fields */ }

Implementations§

Source§

impl DynLayout

Source

pub fn builder() -> DynLayoutBuilder

Source

pub fn parent<W: Into<ControlHandle>>(&self, p: W)

Set the layout parent. The handle must be a window object otherwise the function will panic

Source

pub fn add_child<W: Into<ControlHandle>>( &self, m: (i32, i32), s: (i32, i32), c: W, )

Add a children control to the layout. This is a simplified interface over add_child_item

Panic:

  • If the layout is not initialized
  • If the control is not window-like (HWND handle)
Source

pub fn add_child_item(&self, i: DynLayoutItem)

Add a children control to the layout.

Panic: - If the layout is not initialized - If the control is not window-like (HWND handle)

Source

pub fn remove_child<W: Into<ControlHandle>>(&self, c: W)

Remove the children control in the layout. See also remove_child_by_pos. Note that the child control won’t be hidden after being removed from the control.

This method won’t do anything if there is no control at the specified position.

Panic:

  • If the layout is not initialized
Source

pub fn has_child<W: Into<ControlHandle>>(&self, c: W) -> bool

Check if a window control is a children of the layout

Panic:

  • If the layout is not initialized
  • If the child is not a window-like control
Source

pub fn resize(&self, w: u32, h: u32)

Resize the layout as if the parent window had the specified size.

Arguments: w: New width of the layout h: New height of the layout

Panic:

  • The layout must have been successfully built otherwise this function will panic.
Source

pub fn fit(&self)

Resize the layout to fit the parent window size

Panic:

  • The layout must have been successfully built otherwise this function will panic.

Trait Implementations§

Source§

impl Clone for DynLayout

Source§

fn clone(&self) -> DynLayout

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for DynLayout

Source§

fn default() -> DynLayout

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.