A window's GUI panels (see the module documentation).
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(c_ptr), | public | :: | handle | = | c_null_ptr |
the window's GUI in the C++ layer (null: none) |
A panel titled title, with the widgets up to end_panel. A title
starting with ## (e.g. '##callout') gives a panel with no title bar,
e.g. a callout next to an object: what follows ## still names the
panel (Dear ImGui tells panels apart and keeps their state by it), but
isn't shown. position ([x, y], 0 to 1 across the window, y up; default:
where ImGui puts it) is where its point pivot is ([0, 0], the default:
its top left; [0.5, 1]: the middle of its bottom); with follow, every
frame (and it can't be moved), else at first.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Gui), | intent(inout) | :: | self | |||
| character(len=*), | intent(in) | :: | title |
the title ('##' then a name: no title bar) |
||
| real(kind=wp), | intent(in), | optional | :: | position(2) |
[x, y] (0 to 1 across the window, y up) |
|
| real(kind=wp), | intent(in), | optional | :: | pivot(2) |
the panel's point at |
|
| logical, | intent(in), | optional | :: | follow |
place it every frame (default false: at first) |
A checkbox showing value: true (and value changed) after the user
changed it.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Gui), | intent(inout) | :: | self | |||
| character(len=*), | intent(in) | :: | label |
the text next to it |
||
| logical, | intent(inout) | :: | value |
checked or not (changed by the user) |
A combo box (a drop-down menu) of items (trailing blanks trimmed),
showing item index (1-based): true (and index changed) after the
user chose another.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Gui), | intent(inout) | :: | self | |||
| character(len=*), | intent(in) | :: | label |
the text next to it |
||
| integer, | intent(inout) | :: | index |
the item shown (1-based; changed by the user) |
||
| character(len=*), | intent(in) | :: | items(:) |
the menu's items (trailing blanks trimmed) |
End the panel started by begin_panel.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Gui), | intent(inout) | :: | self |
A slider showing value, from low to high: true (and value
changed) after the user moved it. format: how the value is shown
(printf's, e.g. '%.0f km'; default '%.4g').
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Gui), | intent(inout) | :: | self | |||
| character(len=*), | intent(in) | :: | label |
the text next to it |
||
| real(kind=wp), | intent(inout) | :: | value |
shown, and changed by the user |
||
| real(kind=wp), | intent(in) | :: | low |
the slider's range |
||
| real(kind=wp), | intent(in) | :: | high |
the slider's range |
||
| character(len=*), | intent(in), | optional | :: | format |
printf's (default '%.4g') |
type, public :: Gui type(c_ptr) :: handle = c_null_ptr !! the window's GUI in the C++ layer (null: none) contains procedure :: begin_panel, end_panel procedure :: text, button, checkbox, slider, combo, separator, same_line procedure :: is_valid end type Gui