Skip to main content

FileDialog

Struct FileDialog 

Source
pub struct FileDialog {
    pub mode: DialogMode,
    pub title: String,
    pub files: Vec<String>,
    pub selected_idx: Option<usize>,
    pub filename_input: String,
    pub is_open: bool,
    pub result: Option<String>,
    pub offset_y: usize,
}

Fields§

§mode: DialogMode§title: String§files: Vec<String>§selected_idx: Option<usize>§filename_input: String§is_open: bool§result: Option<String>§offset_y: usize

Implementations§

Source§

impl FileDialog

Source

pub fn new() -> Self

Source

pub fn open(&mut self, mode: DialogMode, default_filename: &str)

Source

pub fn refresh_files(&mut self)

Source

pub fn close(&mut self)

Source

pub fn handle_mouse( &mut self, mx: i32, my: i32, left_click: bool, screen_width: u32, screen_height: u32, ) -> bool

Source

pub fn handle_key(&mut self, keycode: u8, c: Option<char>) -> bool

Source

pub fn draw(&self, screen: &mut Screen)

Trait Implementations§

Source§

impl Default for FileDialog

Source§

fn default() -> Self

Returns the “default value” for a type. 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> Same for T

Source§

type Output = T

Should always be Self
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.