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
46
47
48
49
50
51
52
53
//! This is the code that will be generated by the macro (a simplified version):
//!
//! ```no_run
//! #[derive(Default, Debug)]
//! struct Example {
//! foo: bool,
//! bar: [f32; 2],
//! }
//!
//! struct __Example_Events {
//! foo: bool,
//! bar: bool,
//! click: bool,
//! }
//!
//! impl imgui_ext::Gui for Example {
//! type Events = __Example_Events;
//! fn draw_gui(ui: &imgui::Ui, ext: &mut Self) -> Self::Events {
//! let foo_params = imgui_ext::CheckboxParams {
//! label: imgui::im_str!("foo"),
//! };
//! let bar_params = imgui_ext::SliderParams {
//! label: imgui::im_str!("bar"),
//! min: -1.0,
//! max: 1.0,
//! power: None,
//! format: None,
//! };
//!
//! __Example_Events {
//! foo: imgui_ext::Checkbox::build(ui, &mut ext.foo, foo_params),
//! bar: imgui_ext::Slider::build(ui, &mut ext.bar, bar_params),
//! click: ui.button(imgui::im_str!("Click")),
//! }
//! }
//! }
//! ```