Struct native_windows_gui::CheckBox [−][src]
pub struct CheckBox { pub handle: ControlHandle, // some fields omitted }
Expand description
A check box consists of a square box and an application-defined labe that indicates a choice the user can make by selecting the button. Applications typically display check boxes to enable the user to choose one or more options that are not mutually exclusive.
CheckBox is not behind any features.
Builder parameters:
parent
: Required. The checkbox parent container.text
: The checkbox text.size
: The checkbox size.position
: The checkbox position.enabled
: If the checkbox can be used by the user. It also has a grayed out look if disabled.flags
: A combination of the CheckBoxFlags values.ex_flags
: A combination of win32 window extended flags. Unlikeflags
, ex_flags must be used straight from winapifont
: The font used for the checkbox textbackground_color
: The background color of the checkbox. Defaults to the default window background (light gray)check_state
: The default check statefocus
: The control receive focus after being created
Control events:
OnButtonClick
: When the checkbox is clicked once by the userOnButtonDoubleClick
: When the checkbox is clicked twice rapidly by the userMousePress(_)
: Generic mouse press events on the checkboxOnMouseMove
: Generic mouse mouse eventOnMouseWheel
: Generic mouse wheel event
use native_windows_gui as nwg; fn build_checkbox(button: &mut nwg::CheckBox, window: &nwg::Window, font: &nwg::Font) { nwg::CheckBox::builder() .text("Hello") .flags(nwg::CheckBoxFlags::VISIBLE) .font(Some(font)) .parent(window) .build(button); }
Fields
handle: ControlHandle
Implementations
Return true
if the checkbox can have a third state or false
otherwise
Sets or unsets the checkbox as tristate
Return the check state of the check box
Sets the check state of the check box
Return true if the control user can interact with the control, return false otherwise
Enable or disable the control
Return 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))
Show or hide the control to the user
Set the position of the check box in the parent window
Winapi class name used during control creation
Winapi flags required by the control
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for CheckBox
impl UnwindSafe for CheckBox