[−][src]Struct native_windows_gui::NumberSelect
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 selectsize
: 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 buttonOnMouseMove
: 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
Auto Trait Implementations
impl !RefUnwindSafe for NumberSelect
impl !Send for NumberSelect
impl !Sync for NumberSelect
impl Unpin for NumberSelect
impl !UnwindSafe for NumberSelect
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,