Struct StatusBar

Source
pub struct StatusBar {
    pub handle: ControlHandle,
    /* private fields */
}
Expand description

A status bar is a horizontal window at the bottom of a parent window in which an application can display various kinds of status information. Status bar cannot stack, so there must be only one per window.

Requires the status-bar feature.

Builder parameters:

  • parent: Required. The status bar parent container.
  • text: The status bar text.
  • font: The font used for the status bar text

Control events:

  • MousePress(_): Generic mouse press events on the status bar
  • OnMouseMove: Generic mouse mouse event
  • OnMouseWheel: Generic mouse wheel event
use native_windows_gui as nwg;
fn build_status(status: &mut nwg::StatusBar, window: &nwg::Window, font: &nwg::Font) {
    nwg::StatusBar::builder()
        .text("Hello")
        .font(Some(font))
        .parent(window)
        .build(status);
}

Fields§

§handle: ControlHandle

Implementations§

Source§

impl StatusBar

Source

pub fn builder<'a>() -> StatusBarBuilder<'a>

Source

pub fn set_min_height(&self, height: u32)

Set the minimum height of the statusbar (in pixels)

Source

pub fn font(&self) -> Option<Font>

Return the font of the control

Source

pub fn set_font(&self, font: Option<&Font>)

Set the font of the control

Source

pub fn text<'a>(&self, index: u8) -> String

Return the text in one of the region of the status bar

Source

pub fn set_text<'a>(&self, index: u8, text: &'a str)

Set the text in one of the region of the status bar

Source

pub fn class_name(&self) -> &'static str

Winapi class name used during control creation

Source

pub fn flags(&self) -> u32

Winapi base flags used during window creation

Source

pub fn forced_flags(&self) -> u32

Winapi flags required by the control

Source

pub fn hook_parent_resize(&self)

Status bar do not resize automatically. Instead, a resize message must be manually sent by the parent window to trigger the resize action.

Trait Implementations§

Source§

impl Default for StatusBar

Source§

fn default() -> StatusBar

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

impl Drop for StatusBar

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl From<&StatusBar> for ControlHandle

Source§

fn from(control: &StatusBar) -> Self

Converts to this type from the input type.
Source§

impl From<&mut StatusBar> for ControlHandle

Source§

fn from(control: &mut StatusBar) -> Self

Converts to this type from the input type.
Source§

impl PartialEq<ControlHandle> for StatusBar

Source§

fn eq(&self, other: &ControlHandle) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<StatusBar> for ControlHandle

Source§

fn eq(&self, other: &StatusBar) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for StatusBar

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

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> 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, 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.