RAII guard that pushes ImGuiItemFlags_ReadOnly. More...
#include <style_guard.h>
Public Member Functions | |
| ReadOnlyScope (bool read_only=true) | |
| ~ReadOnlyScope () | |
| ReadOnlyScope (const ReadOnlyScope &)=delete | |
| ReadOnlyScope & | operator= (const ReadOnlyScope &)=delete |
RAII guard that pushes ImGuiItemFlags_ReadOnly.
Read-only items still hover and show tooltips, and are not dimmed, but their value does not change. ImGui 1.93 marks the flag [ALPHA]. Only Drag and Slider widgets, InputText, ColorEdit4, and ColorPicker4 honor it; Button, Checkbox, and Combo still react to clicks, so use DisabledScope for those.
Usage: ReadOnlyScope read_only(!can_edit); ImGui::DragInt("Room", &room_id);
Definition at line 193 of file style_guard.h.
|
inlineexplicit |
Definition at line 195 of file style_guard.h.
|
inline |
Definition at line 199 of file style_guard.h.
|
delete |
|
delete |