Skip to main content

Panel

Struct Panel 

Source
pub struct Panel { /* private fields */ }
Expand description

A Panel is a control within a window that groups other controls. It defines its own reference system, that is, if we move a panel all its descendants will move in unison since their locations will be relative to its origin. It will support other (sub)-panels as descendants, which allows to form a Window Hierarchy. A Panel is a control within a window that groups other controls.

§Remark

This type is managed by nappgui itself. Rust does not have its ownership. When the window object is dropped, all components assciated with it will be automatically released.

Implementations§

Source§

impl Panel

Source

pub fn new() -> Self

Create a panel.

Source

pub fn new_scroll(hscroll: bool, vscroll: bool) -> Self

Create a panel with scroll bars.

Source

pub fn new_custom(hscroll: bool, vscroll: bool, border: bool) -> Self

Create a fully configurable panel.

Trait Implementations§

Source§

impl Clone for Panel

Source§

fn clone(&self) -> Panel

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl ControlLayoutTrait for Panel

Source§

fn insert_in_layout<T>(&self, layout: T, col: u32, row: u32)
where T: LayoutTrait,

Insert the control to the layout
Source§

impl ControlTrait for Panel

Source§

fn as_control_ptr(&self) -> *mut GuiControl

Returns the pointer to the control.
Source§

fn from_control_ptr(ptr: *mut GuiControl) -> Option<Self>

Returns the control from the pointer.
Source§

fn tag(&self, tag: u32)
where Self: Sized,

Sets a tag for the control.
Source§

fn get_tag(&self) -> u32
where Self: Sized,

Gets a tag for the control.
Source§

impl Copy for Panel

Source§

impl Debug for Panel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PanelTrait for Panel

Source§

fn as_ptr(&self) -> *mut Panel

Returns a raw pointer to the panel object.
Source§

fn size(&self, width: f32, height: f32)

Sets the default size of the visible area of a panel.
Source§

fn layout<T>(&self, layout: T)
where T: LayoutTrait,

Add a layout to a panel.
Source§

fn get_layout(&self, index: usize) -> Option<Layout>

Get a layout of a panel.
Source§

fn visible_layout(&self, index: usize)

Set the active layout inside the panel. Read more
Source§

fn update(&self)

Update the window that contains the panel. Read more
Source§

fn scroll_width(&self) -> f32

Gets the width of the scroll bar of the associated panel. Read more
Source§

fn scroll_height(&self) -> f32

Gets the height of the scroll bar.

Auto Trait Implementations§

§

impl !Send for Panel

§

impl !Sync for Panel

§

impl Freeze for Panel

§

impl RefUnwindSafe for Panel

§

impl Unpin for Panel

§

impl UnsafeUnpin for Panel

§

impl UnwindSafe for Panel

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.