pub struct CheckBox(/* private fields */);
gui
only.Expand description
Implementations§
source§impl CheckBox
impl CheckBox
sourcepub fn new(parent: &impl GuiParent, opts: CheckBoxOpts) -> Self
pub fn new(parent: &impl GuiParent, 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,
ctrl_id: u16,
resize_behavior: (Horz, Vert)
) -> Self
pub fn new_dlg( parent: &impl GuiParent, 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 check_state(&self) -> CheckState
pub fn check_state(&self) -> CheckState
Retrieves the current check state by sending a
bm::GetCheck
message.
sourcepub fn emulate_click(&self)
pub fn emulate_click(&self)
Emulates the click event for the check box by sending a
bm::Click
message.
sourcepub fn is_checked(&self) -> bool
pub fn is_checked(&self) -> bool
Calls check_state
and compares
the result with
CheckState::Checked
.
sourcepub fn set_check_state(&self, state: CheckState)
pub fn set_check_state(&self, state: CheckState)
Sets the current check state by sending a
bm::SetCheck
message.
sourcepub fn set_check_state_and_trigger(&self, state: CheckState)
pub fn set_check_state_and_trigger(&self, state: CheckState)
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)
pub fn set_text_and_resize(&self, text: &str)
Calls set_text
and resizes
the control to exactly fit the new text.
Trait Implementations§
source§impl GuiChildFocus for CheckBox
impl GuiChildFocus for CheckBox
source§fn focus(&self)
fn focus(&self)
HWND:SetFocus
. Read moresource§impl GuiNativeControl for CheckBox
impl GuiNativeControl for CheckBox
source§fn on_subclass(&self) -> &WindowEvents
fn on_subclass(&self) -> &WindowEvents
source§impl GuiNativeControlEvents<ButtonEvents> for CheckBox
impl GuiNativeControlEvents<ButtonEvents> for CheckBox
source§fn on(&self) -> &ButtonEvents
fn on(&self) -> &ButtonEvents
source§impl GuiWindowText for CheckBox
impl GuiWindowText for CheckBox
source§fn set_text(&self, text: &str)
fn set_text(&self, text: &str)
HWND::SetWindowText
.source§fn text(&self) -> String
fn text(&self) -> String
HWND::GetWindowText
.