egui/egui_demo_lib/src/apps/demo/mod.rs

47 lines
1.1 KiB
Rust
Raw Normal View History

//! Demo-code for showing how egui is used.
2021-01-01 16:11:05 +00:00
//!
//! The demo-code is also used in benchmarks and tests.
// ----------------------------------------------------------------------------
mod app;
pub mod dancing_strings;
2021-05-09 08:53:35 +00:00
pub mod demo_app_windows;
pub mod drag_and_drop;
pub mod font_book;
2021-01-01 16:11:05 +00:00
pub mod font_contents_emoji;
pub mod font_contents_ubuntu;
2021-01-25 19:52:47 +00:00
pub mod layout_test;
2021-05-09 08:53:35 +00:00
pub mod misc_demo_window;
pub mod multi_touch;
pub mod painting;
pub mod password;
2021-02-14 20:39:04 +00:00
pub mod plot_demo;
pub mod scrolling;
2021-01-25 19:14:39 +00:00
pub mod sliders;
pub mod tests;
2021-01-01 16:11:05 +00:00
pub mod toggle_switch;
pub mod widget_gallery;
pub mod window_options;
2021-01-01 16:11:05 +00:00
2021-05-09 08:53:35 +00:00
pub use {
app::DemoApp, demo_app_windows::DemoWindows, misc_demo_window::MiscDemoWindow,
widget_gallery::WidgetGallery,
};
2021-01-01 16:11:05 +00:00
// ----------------------------------------------------------------------------
/// Something to view in the demo windows
pub trait View {
fn ui(&mut self, ui: &mut egui::Ui);
}
/// Something to view
pub trait Demo {
/// `&'static` so we can also use it as a key to store open/close state.
fn name(&self) -> &'static str;
2021-01-01 16:11:05 +00:00
/// Show windows, etc
fn show(&mut self, ctx: &egui::CtxRef, open: &mut bool);
}