[][src]Struct native_windows_gui::NumberSelect

pub struct NumberSelect {
    pub handle: ControlHandle,
    // some fields omitted
}

A NumberSelect control is a pair of arrow buttons that the user can click to increment or decrement a value. NumberSelect is implemented as a custom control because the one provided by winapi really sucks.

Requires the number-select feature.

Builder parameters:

  • parent: Required. The number select parent container.
  • value: The default value of the number select
  • size: The number select size.
  • position: The number select position.
  • enabled: If the number select can be used by the user. It also has a grayed out look if disabled.
  • flags: A combination of the NumberSelectFlags values.
  • font: The font used for the number select text

Control events:

  • MousePress(_): Generic mouse press events on the button
  • OnMouseMove: Generic mouse mouse event
use native_windows_gui as nwg;
fn build_number_select(num_select: &mut nwg::NumberSelect, window: &nwg::Window, font: &nwg::Font) {
    nwg::NumberSelect::builder()
        .font(Some(font))
        .parent(window)
        .build(num_select);
}

Fields

handle: ControlHandle

Implementations

impl NumberSelect[src]

pub fn builder<'a>() -> NumberSelectBuilder<'a>[src]

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

Returns the font of the control

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

Sets the font of the control

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

Returns true if the control currently has the keyboard focus

pub fn set_focus(&self)[src]

Sets the keyboard focus on the button.

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

Returns true if the control user can interact with the control, return false otherwise

pub fn set_enabled(&self, v: bool)[src]

Enable or disable the control

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

Returns true if the control is visible to the user. Will return true even if the control is outside of the parent client view (ex: at the position (10000, 10000))

pub fn set_visible(&self, v: bool)[src]

Show or hide the control to the user

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

Returns the size of the control in the parent window

pub fn set_size(&self, x: u32, y: u32)[src]

Sets the size of the control in the parent window

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

Returns the position of the control in the parent window

pub fn set_position(&self, x: i32, y: i32)[src]

Sets the position of the control in the parent window

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

Winapi class name used during control creation

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

Winapi base flags used during window creation

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

Winapi flags required by the control

Trait Implementations

impl Default for NumberSelect[src]

impl Drop for NumberSelect[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.