Enum fltk::enums::FrameType

source ·
#[non_exhaustive]
#[repr(i32)]
pub enum FrameType {
Show 58 variants NoBox, FlatBox, UpBox, DownBox, UpFrame, DownFrame, ThinUpBox, ThinDownBox, ThinUpFrame, ThinDownFrame, EngravedBox, EmbossedBox, EngravedFrame, EmbossedFrame, BorderBox, ShadowBox, BorderFrame, ShadowFrame, RoundedBox, RShadowBox, RoundedFrame, RFlatBox, RoundUpBox, RoundDownBox, DiamondUpBox, DiamondDownBox, OvalBox, OShadowBox, OvalFrame, OFlatFrame, PlasticUpBox, PlasticDownBox, PlasticUpFrame, PlasticDownFrame, PlasticThinUpBox, PlasticThinDownBox, PlasticRoundUpBox, PlasticRoundDownBox, GtkUpBox, GtkDownBox, GtkUpFrame, GtkDownFrame, GtkThinUpBox, GtkThinDownBox, GtkThinUpFrame, GtkThinDownFrame, GtkRoundUpFrame, GtkRoundDownFrame, GleamUpBox, GleamDownBox, GleamUpFrame, GleamDownFrame, GleamThinUpBox, GleamThinDownBox, GleamRoundUpBox, GleamRoundDownBox, FreeBoxType, UserFrameType(UnmappedFrameType),
}
Expand description

Defines the frame types which can be set using the set_frame() and set_down_frame() methods

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

NoBox

No Box

§

FlatBox

Flat Box

§

UpBox

Up Box

§

DownBox

Down Box

§

UpFrame

Up Frame

§

DownFrame

Down Frame

§

ThinUpBox

Thin Up Box

§

ThinDownBox

Thin Down Box

§

ThinUpFrame

Thin Up Frame

§

ThinDownFrame

Thin Down Frame

§

EngravedBox

Engraved Box

§

EmbossedBox

Embossed Box

§

EngravedFrame

Engraved Frame

§

EmbossedFrame

Embossed Frame

§

BorderBox

Border Box

§

ShadowBox

Shadow Box

§

BorderFrame

Border Frame

§

ShadowFrame

Shadow Frame

§

RoundedBox

Rounded Box

§

RShadowBox

Rounded Shadow Box

§

RoundedFrame

Rounded Frame

§

RFlatBox

Rounded Flat Box

§

RoundUpBox

Round Up Box

§

RoundDownBox

Round Down Box

§

DiamondUpBox

Diamond Up Box

§

DiamondDownBox

Diamond Down Box

§

OvalBox

Oval Box

§

OShadowBox

Oval Shadow Box

§

OvalFrame

Oval Frame

§

OFlatFrame

Oval Flat Frame

§

PlasticUpBox

Plastic Up Box

§

PlasticDownBox

Plastic Down Box

§

PlasticUpFrame

Plastic Up Frame

§

PlasticDownFrame

Plastic Down Frame

§

PlasticThinUpBox

Plastic Thin Up Box

§

PlasticThinDownBox

Plastic Thin Down Box

§

PlasticRoundUpBox

Plastic Round Up Box

§

PlasticRoundDownBox

Plastic Round Down Box

§

GtkUpBox

Gtk Up Box

§

GtkDownBox

Gtk Down Box

§

GtkUpFrame

Gtk Up Frame

§

GtkDownFrame

Gtk Down Frame

§

GtkThinUpBox

Gtk Thin Up Box

§

GtkThinDownBox

Gtk Thin Down Box

§

GtkThinUpFrame

Gtk Thin Up Frame

§

GtkThinDownFrame

Gtk Thin Down Frame

§

GtkRoundUpFrame

Gtk Round Up Frame

§

GtkRoundDownFrame

Gtk Round Down Frame

§

GleamUpBox

Gleam Up Box

§

GleamDownBox

Gleam Down Box

§

GleamUpFrame

Gleam Up Frame

§

GleamDownFrame

Gleam Down Frame

§

GleamThinUpBox

Gleam Thin Up Box

§

GleamThinDownBox

Gleam Thin Down Box

§

GleamRoundUpBox

Gleam Round Up Box

§

GleamRoundDownBox

Gleam Round Down Box

§

FreeBoxType

Free BoxType

§

UserFrameType(UnmappedFrameType)

User-defined frame types

Implementations§

source§

impl FrameType

source

pub const OFlatBox: FrameType = FrameType::OFlatFrame

Alias OFlatFrame as OFlatBox

source

pub const GtkRoundDownBox: FrameType = FrameType::GtkRoundDownFrame

Alias GtkRoundDownFrame as GtkRoundDownBox

source

pub fn as_i32(&self) -> i32

Get the discriminant value or the user defined frame type

source

pub fn by_index(idx: usize) -> FrameType

Gets the Frame type by index

Examples found in repository?
examples/frames.rs (line 13)
9
10
11
12
13
14
15
16
17
18
19
    pub fn new(idx: usize) -> MyFrame {
        let mut f = frame::Frame::default();
        // Normally you would use the FrameType enum, for example:
        // some_widget.set_frame(FrameType::DownBox);
        f.set_frame(enums::FrameType::by_index(idx));
        f.set_color(enums::Color::from_u32(0x7FFFD4));
        let f_name = format!("{:?}", f.frame());
        f.set_label(&f_name);
        f.set_label_size(12);
        Self { f }
    }
source

pub fn dx(self) -> i32

Get the frame’s x offset

source

pub fn dy(self) -> i32

Get the frame’s y offset

source

pub fn dw(self) -> i32

Get the frame’s width offset

source

pub fn dh(self) -> i32

Get the frame’s height offset

source

pub fn swap_frames(old_frame: FrameType, new_frame: FrameType)

Swap frames

Trait Implementations§

source§

impl Clone for FrameType

source§

fn clone(&self) -> FrameType

Returns a copy 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 FrameType

source§

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

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

impl PartialEq for FrameType

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for FrameType

source§

impl Eq for FrameType

source§

impl StructuralPartialEq for FrameType

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

§

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>,

§

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>,

§

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.