Struct Checkbox

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

A widget displaying a box which can be cycled through various checked states.

Implementations§

Source§

impl Checkbox

Source

pub fn new( left: i32, top: i32, text: &str, default: Option<char>, sequence: Option<&[char]>, ) -> Checkbox

Create a new Checkbox widget.

  • left - The left-most position of the Checkbox.
  • top - The top-most position of the Checkbox.
  • text - The label to be displayed with the Checkbox.
  • default - The optional default state of the Checkbox. (The default value to be held from the sequence of possible values).
  • sequence - The optional sequence of values possible in the Checkbox. (Defaults to and * if not provided).
Source

pub fn get_value(&self) -> char

Get the current value of the Checkbox.

Source

pub fn set_value(&self, value: char)

Set the current value of the Checkbox.

  • value - The value to set the Checkbox to. It does not necessarily need to be one specified in sequence during the Checkbox creation.
Source

pub fn set_flags(&self, flags: i32, sense: FlagsSense)

Set flags modifying the Checkbox behavior.

See flags for possible flags.

  • flags - A logical ored list of flags.
  • sense - The operation used to set the flags (Set, Reset, or Toggle).

Trait Implementations§

Source§

impl Component for Checkbox

Source§

fn co(&self) -> newtComponent

Return newtComponent pointer.
Source§

impl Debug for Checkbox

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for Checkbox

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl PartialEq<Box<dyn Component>> for Checkbox

Source§

fn eq(&self, other: &Box<dyn Component>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<ExitReason> for Checkbox

Source§

fn eq(&self, other: &ExitReason) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<Rhs: Component> PartialEq<Rhs> for Checkbox

Source§

fn eq(&self, other: &Rhs) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl WidgetFns for Checkbox

Source§

fn takes_focus(&self, value: bool)

Allow the widget to be focused when its parent Form is run.
Source§

fn get_position(&self) -> (i32, i32)

Get the position of the widget’s top left corner. Read more
Source§

fn get_size(&self) -> (i32, i32)

Get the widget’s width and height. Read more

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.