pub struct CheckBox(/* private fields */);
gui
only.Expand description
Implementations§
Source§impl CheckBox
impl CheckBox
Sourcepub fn on_subclass(&self) -> &WindowEvents
pub fn on_subclass(&self) -> &WindowEvents
Exposes the subclass events. If at least one event exists, the control will be subclassed.
Note: Subclassing may impact performance, use with care.
§Panics
Panics if the control or the parent window are already created. Events must be set before control and parent window creation.
Sourcepub fn on(&self) -> &ButtonEvents
pub fn on(&self) -> &ButtonEvents
Exposes the specific control events.
§Panics
Panics if the control is already created. Events must be set before control creation.
Source§impl CheckBox
impl CheckBox
Sourcepub fn new(parent: &(impl GuiParent + 'static), opts: CheckBoxOpts) -> Self
pub fn new(parent: &(impl GuiParent + 'static), opts: CheckBoxOpts) -> Self
Instantiates a new CheckBox
object, to be created on the parent window
with
HWND::CreateWindowEx
.
§Panics
Panics if the parent window was already created – that is, you cannot
dynamically create a CheckBox
in an event closure.
Sourcepub fn new_dlg(
parent: &(impl GuiParent + 'static),
ctrl_id: u16,
resize_behavior: (Horz, Vert),
) -> Self
pub fn new_dlg( parent: &(impl GuiParent + 'static), ctrl_id: u16, resize_behavior: (Horz, Vert), ) -> Self
Instantiates a new CheckBox
object, to be loaded from a dialog
resource with
HWND::GetDlgItem
.
§Panics
Panics if the parent dialog was already created – that is, you cannot
dynamically create a CheckBox
in an event closure.
Sourcepub fn is_checked(&self) -> bool
pub fn is_checked(&self) -> bool
Sends a bm::GetCheck
message and returns
true
if current state is co::BST::CHECKED
.
Sourcepub fn set_check(&self, check: bool)
pub fn set_check(&self, check: bool)
Sets or unsets the check mark by sending a
bm::SetCheck
message.
Sourcepub fn set_check_and_trigger(&self, check: bool) -> SysResult<()>
pub fn set_check_and_trigger(&self, check: bool) -> SysResult<()>
Sets the current check state by sending a
bm::SetCheck
message, then sends a
wm::Command
message to the parent, so it
can handle the event.
Sourcepub fn set_state(&self, state: BST)
pub fn set_state(&self, state: BST)
Sets the current check state by sending a
bm::SetCheck
message.
Sourcepub fn set_state_and_trigger(&self, state: BST) -> SysResult<()>
pub fn set_state_and_trigger(&self, state: BST) -> SysResult<()>
Sets the current check state by sending a
bm::SetCheck
message, then sends a
wm::Command
message to the parent, so it
can handle the event.
Sourcepub fn set_text_and_resize(&self, text: &str) -> SysResult<()>
pub fn set_text_and_resize(&self, text: &str) -> SysResult<()>
Calls HWND::SetWindowText
to set the text and resizes the control to exactly fit it.
Sourcepub fn state(&self) -> BST
pub fn state(&self) -> BST
Retrieves the current check state by sending a
bm::GetCheck
message.
Sourcepub fn trigger_click(&self)
pub fn trigger_click(&self)
Fires the click event for the check box by sending a
bm::Click
message.