pub struct RadioGroup { /* private fields */ }Expand description
RadioGroup widget for selecting one option from multiple choices.
Implementations§
Source§impl RadioGroup
impl RadioGroup
Sourcepub fn option(self, option: RadioOption) -> Self
pub fn option(self, option: RadioOption) -> Self
Add an option.
Sourcepub fn options(self, options: impl IntoIterator<Item = RadioOption>) -> Self
pub fn options(self, options: impl IntoIterator<Item = RadioOption>) -> Self
Add multiple options.
Sourcepub fn selected_index(self, index: usize) -> Self
pub fn selected_index(self, index: usize) -> Self
Set selected index.
Sourcepub const fn orientation(self, orientation: RadioOrientation) -> Self
pub const fn orientation(self, orientation: RadioOrientation) -> Self
Set orientation.
Sourcepub fn radio_size(self, size: f32) -> Self
pub fn radio_size(self, size: f32) -> Self
Set radio button size.
Sourcepub const fn border_color(self, color: Color) -> Self
pub const fn border_color(self, color: Color) -> Self
Set border color.
Sourcepub const fn fill_color(self, color: Color) -> Self
pub const fn fill_color(self, color: Color) -> Self
Set fill color for selected state.
Sourcepub const fn label_color(self, color: Color) -> Self
pub const fn label_color(self, color: Color) -> Self
Set label text color.
Sourcepub fn accessible_name(self, name: impl Into<String>) -> Self
pub fn accessible_name(self, name: impl Into<String>) -> Self
Set accessible name.
Sourcepub fn get_options(&self) -> &[RadioOption]
pub fn get_options(&self) -> &[RadioOption]
Get the options.
Sourcepub fn get_selected(&self) -> Option<&str>
pub fn get_selected(&self) -> Option<&str>
Get selected value.
Sourcepub const fn get_selected_index(&self) -> Option<usize>
pub const fn get_selected_index(&self) -> Option<usize>
Get selected index.
Sourcepub fn get_selected_option(&self) -> Option<&RadioOption>
pub fn get_selected_option(&self) -> Option<&RadioOption>
Get selected option.
Sourcepub fn is_selected(&self, value: &str) -> bool
pub fn is_selected(&self, value: &str) -> bool
Check if a value is selected.
Sourcepub fn is_index_selected(&self, index: usize) -> bool
pub fn is_index_selected(&self, index: usize) -> bool
Check if an index is selected.
Sourcepub const fn has_selection(&self) -> bool
pub const fn has_selection(&self) -> bool
Check if any option is selected.
Sourcepub fn option_count(&self) -> usize
pub fn option_count(&self) -> usize
Get option count.
Sourcepub fn set_selected(&mut self, value: &str)
pub fn set_selected(&mut self, value: &str)
Set selection by value (mutable).
Sourcepub fn set_selected_index(&mut self, index: usize)
pub fn set_selected_index(&mut self, index: usize)
Set selection by index (mutable).
Sourcepub fn clear_selection(&mut self)
pub fn clear_selection(&mut self)
Clear selection.
Sourcepub fn select_next(&mut self)
pub fn select_next(&mut self)
Select next option.
Sourcepub fn select_prev(&mut self)
pub fn select_prev(&mut self)
Select previous option.
Trait Implementations§
Source§impl Brick for RadioGroup
impl Brick for RadioGroup
Source§fn brick_name(&self) -> &'static str
fn brick_name(&self) -> &'static str
Get the brick’s unique type name
Source§fn assertions(&self) -> &[BrickAssertion]
fn assertions(&self) -> &[BrickAssertion]
Get all assertions for this brick
Source§fn budget(&self) -> BrickBudget
fn budget(&self) -> BrickBudget
Get the performance budget
Source§fn verify(&self) -> BrickVerification
fn verify(&self) -> BrickVerification
Verify all assertions against current state Read more
Source§fn can_render(&self) -> bool
fn can_render(&self) -> bool
Check if this brick can be rendered (all assertions pass)
Source§impl Clone for RadioGroup
impl Clone for RadioGroup
Source§fn clone(&self) -> RadioGroup
fn clone(&self) -> RadioGroup
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RadioGroup
impl Debug for RadioGroup
Source§impl Default for RadioGroup
impl Default for RadioGroup
Source§impl<'de> Deserialize<'de> for RadioGroup
impl<'de> Deserialize<'de> for RadioGroup
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for RadioGroup
impl Serialize for RadioGroup
Source§impl Widget for RadioGroup
impl Widget for RadioGroup
Source§fn measure(&self, constraints: Constraints) -> Size
fn measure(&self, constraints: Constraints) -> Size
Compute intrinsic size constraints.
Source§fn layout(&mut self, bounds: Rect) -> LayoutResult
fn layout(&mut self, bounds: Rect) -> LayoutResult
Position children within allocated bounds.
Source§fn children_mut(&mut self) -> &mut [Box<dyn Widget>]
fn children_mut(&mut self) -> &mut [Box<dyn Widget>]
Get mutable child widgets.
Source§fn is_interactive(&self) -> bool
fn is_interactive(&self) -> bool
Check if this widget is interactive (can receive focus/events).
Source§fn is_focusable(&self) -> bool
fn is_focusable(&self) -> bool
Check if this widget can receive keyboard focus.
Source§fn accessible_name(&self) -> Option<&str>
fn accessible_name(&self) -> Option<&str>
Get the accessible name for screen readers.
Source§fn accessible_role(&self) -> AccessibleRole
fn accessible_role(&self) -> AccessibleRole
Get the accessible role.
Auto Trait Implementations§
impl Freeze for RadioGroup
impl RefUnwindSafe for RadioGroup
impl Send for RadioGroup
impl Sync for RadioGroup
impl Unpin for RadioGroup
impl UnwindSafe for RadioGroup
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more