Struct RadiobuttonSet

Source
pub struct RadiobuttonSet { /* private fields */ }
Expand description

A convenience wrapper for managing Radiobuttons.

Implementations§

Source§

impl RadiobuttonSet

Source

pub fn new() -> RadiobuttonSet

Create an empty RadiobuttonSet.

Source

pub fn add_radiobutton(&mut self, left: i32, top: i32, text: &str) -> usize

Add a Radiobutton to the RadiobuttonSet.

  • left - The left-most position of the Radiobutton.
  • top - The top-most position of the Radiobutton.
  • text - The text to be displayed as the label of the Radiobutton.

Returns the index number of the Radiobutton that was added to the RadiobuttonSet.

Source

pub fn len(&self) -> usize

Get the number of Radiobuttons in the RadiobuttonSet.

Returns the number of Radiobuttons in the RadiobuttonSet.

Source

pub fn add_to_form<'a>( &'a self, form: &mut Form<'a>, ) -> Result<(), &'static str>

Add all Radiobuttons in the RadiobuttonSet to a Form.

  • form - The Form to add the Radiobuttons to.
Source

pub fn get_current(&self) -> usize

Get the currently selected Radiobutton from the RadiobuttonSet.

Returns the index of the currently selected Radiobutton.

Source

pub fn set_current(&self, index: usize)

Set the currently selected Radiobutton in the RadiobuttonSet.

  • index - The index number of the Radiobutton in the RadiobuttonSet to be selected.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.