Struct winsafe::gui::RadioGroup
source · pub struct RadioGroup(/* private fields */);
gui
only.Expand description
A group of native RadioButton
controls.
Implementations§
source§impl RadioGroup
impl RadioGroup
sourcepub fn new(parent: &impl GuiParent, opts: &[RadioButtonOpts]) -> Self
pub fn new(parent: &impl GuiParent, opts: &[RadioButtonOpts]) -> Self
Instantiates a new RadioGroup
object, each RadioButton
to be created
on the parent window with
HWND::CreateWindowEx
.
§Panics
Panics if opts
is empty.
Panics if the parent window was already created – that is, you cannot
dynamically create a RadioGroup
in an event closure.
sourcepub fn new_dlg(parent: &impl GuiParent, ctrls: &[(u16, Horz, Vert)]) -> Self
pub fn new_dlg(parent: &impl GuiParent, ctrls: &[(u16, Horz, Vert)]) -> Self
Instantiates a new RadioGroup
object, to be loaded from a dialog
resource with
HWND::GetDlgItem
.
§Panics
Panics if ctrls
is empty.
Panics if the parent dialog was already created – that is, you cannot
dynamically create a RadioGroup
in an event closure.
sourcepub fn iter(&self) -> Iter<'_, RadioButton>
pub fn iter(&self) -> Iter<'_, RadioButton>
Returns an iterator over the internal
RadioButton
slice.
§Example
Changing the text of all radio buttons to "One"
:
use winsafe::{self as w, prelude::*, gui};
let radio_group: gui::RadioGroup; // initialized somewhere
for single_radio in radio_group.iter() {
single_radio.hwnd().SetWindowText("One");
}
sourcepub fn checked(&self) -> Option<&RadioButton>
pub fn checked(&self) -> Option<&RadioButton>
Returns the currently checked RadioButton
of this group, if any.
sourcepub fn checked_index(&self) -> Option<usize>
pub fn checked_index(&self) -> Option<usize>
Returns the index of the currently selected
RadioButton
of this group, if any.
sourcepub fn count(&self) -> usize
pub fn count(&self) -> usize
Returns the number of RadioButton
controls
in this group.
Trait Implementations§
source§impl Clone for RadioGroup
impl Clone for RadioGroup
source§fn clone(&self) -> RadioGroup
fn clone(&self) -> RadioGroup
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more