#file #open #save #dialog #windows

wfd

A simple to use abstraction over the Open and Save dialogs in the Windows API

6 releases

0.1.6 Dec 10, 2020
0.1.5 Dec 10, 2020
0.1.4 Jul 21, 2020
0.1.3 Nov 18, 2019

#18 in Windows APIs

Download history 702/week @ 2020-10-02 667/week @ 2020-10-09 452/week @ 2020-10-16 365/week @ 2020-10-23 246/week @ 2020-10-30 215/week @ 2020-11-06 219/week @ 2020-11-13 222/week @ 2020-11-20 327/week @ 2020-11-27 262/week @ 2020-12-04 308/week @ 2020-12-11 258/week @ 2020-12-18 75/week @ 2020-12-25 172/week @ 2021-01-01 262/week @ 2021-01-08 197/week @ 2021-01-15

1,730 downloads per month
Used in 3 crates (via native-dialog)

MIT license

24KB
304 lines

wfd

Build Status Crates.io License: MIT

This crate provides a simple to use abstraction over the Open and Save dialogs in the Windows API, usable under both GNU and MSVC toolchains, with minimal dependencies.

Examples

Standard open dialog

let dialog_result = wfd::open_dialog(Default::default())?;

Folder picker open dialog

use wfd::{DialogParams};

let params = DialogParams {
    options: FOS_PICKFOLDERS,
    .. Default::default()
};

let dialog_result = wfd::open_dialog(params)?;

Save dialog with custom file extension filters

use wfd::{DialogParams};

let params = DialogParams {
    title: "Select an image to open",
    file_types: vec![("JPG Files", "*.jpg;*.jpeg"), ("PNG Files", "*.png"), ("Bitmap Files", "*.bmp")],
    default_extension: "jpg",
    ..Default::default()
};

let dialog_result = wfd::save_dialog(params)?;

Further examples can be found in src\examples

Dependencies

~54KB