blob: 162666edf8a5e153d01060f607e288816f500b23 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
mod window_state;
mod compute_window;
mod decrypt_window;
mod encrypt_window;
mod generate_window;
mod utils;
use crate::window_state::WindowState;
use eframe::egui;
fn main() {
let options = eframe::NativeOptions::default();
eframe::run_native(
"Криптографические методы защиты информации",
options,
Box::new(|_cc| Box::new(Application::default())),
);
}
struct Application {
labs: Vec<Box<dyn WindowState>>,
}
impl Default for Application {
fn default() -> Self {
Self {
labs: vec![
Box::new(generate_window::Window::default()),
Box::new(encrypt_window::Window::default()),
Box::new(decrypt_window::Window::default()),
Box::new(compute_window::Window::default()),
],
}
}
}
impl eframe::App for Application {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
for window in &mut self.labs {
egui::Window::new(window.get_name()).show(ctx, |ui| window.update(ui));
}
}
}
|