Struct HalfDial

Source
pub struct HalfDial { /* private fields */ }

Implementations§

Source§

impl HalfDial

Source

pub fn new(x: i32, y: i32, w: i32, h: i32, label: &str) -> Self

Source

pub fn set_value(&mut self, val: i32)

Examples found in repository?
examples/dials.rs (line 18)
4fn main() {
5    let a = app::App::default();
6    app::set_background_color(0, 0, 0);
7    app::set_foreground_color(255, 255, 255);
8    app::set_background2_color(128, 128, 128);
9    let mut w = window::Window::default().with_size(400, 300);
10    let col = group::Flex::default()
11        .column()
12        .with_size(100, 200)
13        .center_of_parent();
14    let mut dial = Dial::default();
15    dial.modifiable(false);
16    dial.set_value(75);
17    let mut halfdial = HalfDial::default();
18    halfdial.set_value(23);
19    col.end();
20    w.end();
21    w.show();
22    a.run().unwrap();
23}
Source§

impl HalfDial

Source

pub fn with_pos(self, x: i32, y: i32) -> Self

Initialize to position x, y

Source

pub fn with_size(self, width: i32, height: i32) -> Self

Initialize to size width, height

Source

pub fn with_label(self, title: &str) -> Self

Initialize with a label

Source

pub fn with_align(self, align: Align) -> Self

Initialize with alignment

Source

pub fn with_type<T: WidgetType>(self, typ: T) -> Self

Initialize with type

Source

pub fn below_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self

Initialize at bottom of another widget

Source

pub fn above_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self

Initialize above of another widget

Source

pub fn right_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self

Initialize right of another widget

Source

pub fn left_of<W: WidgetExt>(self, wid: &W, padding: i32) -> Self

Initialize left of another widget

Source

pub fn center_of<W: WidgetExt>(self, w: &W) -> Self

Initialize center of another widget

Source

pub fn center_x<W: WidgetExt>(self, w: &W) -> Self

Initialize center of another widget on the x axis

Source

pub fn center_y<W: WidgetExt>(self, w: &W) -> Self

Initialize center of another widget on the y axis

Source

pub fn center_of_parent(self) -> Self

Initialize center of parent

Source

pub fn size_of<W: WidgetExt>(self, w: &W) -> Self

Initialize to the size of another widget

Source

pub fn size_of_parent(self) -> Self

Initialize to the size of the parent

Methods from Deref<Target = Flex>§

Source

pub fn add<W>(&mut self, widget: &W)
where W: WidgetExt,

Add a widget to the Flex box

Source

pub fn insert<W>(&mut self, widget: &W, idx: i32)
where W: WidgetExt,

Add a widget to the Flex box

Source

pub fn set_size<W>(&mut self, w: &W, size: i32)
where W: WidgetExt,

👎Deprecated since 1.4.8: please use fixed instead

Set the size of the widget, same as fixed (before it was changed in FLTK 1.4)

Source

pub fn fixed<W>(&mut self, w: &W, size: i32)
where W: WidgetExt,

Set the size of the widget, same as set_size, but more inline with the new FLTK Fl_Flex api

Source

pub fn recalc(&self)

Recalculate children’s coords and sizes

Source

pub fn layout(&self)

Recalculate children’s coords and sizes

Source

pub fn set_margin(&mut self, m: i32)

Set the margin

Source

pub fn margin(&self) -> i32

Get the margin

Source

pub fn set_pad(&mut self, p: i32)

Set the padding

Source

pub fn pad(&self) -> i32

Get the padding

Source

pub fn set_margins(&mut self, left: i32, top: i32, right: i32, bottom: i32)

Set the margins

Source

pub fn margins(&self) -> (i32, i32, i32, i32)

Get the margins -> returns (left, top, right, bottom)

Trait Implementations§

Source§

impl Clone for HalfDial

Source§

fn clone(&self) -> HalfDial

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for HalfDial

Source§

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

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

impl Default for HalfDial

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Deref for HalfDial

Source§

type Target = Flex

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for HalfDial

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.