summaryrefslogtreecommitdiff
path: root/Runtime/IMGUI/NamedKeyControlList.h
diff options
context:
space:
mode:
Diffstat (limited to 'Runtime/IMGUI/NamedKeyControlList.h')
-rw-r--r--Runtime/IMGUI/NamedKeyControlList.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/Runtime/IMGUI/NamedKeyControlList.h b/Runtime/IMGUI/NamedKeyControlList.h
new file mode 100644
index 0000000..dc4dff7
--- /dev/null
+++ b/Runtime/IMGUI/NamedKeyControlList.h
@@ -0,0 +1,40 @@
+#ifndef NAMEDKEYCONTROLLIST_H
+#define NAMEDKEYCONTROLLIST_H
+
+namespace IMGUI
+{
+ struct NamedControl
+ {
+ int ID;
+ int windowID;
+ NamedControl ()
+ {
+ ID = 0;
+ windowID = -1;
+ }
+ NamedControl (int _ID, int _windowID)
+ {
+ ID = _ID;
+ windowID = _windowID;
+ }
+ };
+
+ class NamedKeyControlList
+ {
+ public:
+ void AddNamedControl (const std::string &str, int id, int windowID);
+
+ // Return ptr name of a given control, NULL if none.
+ std::string GetNameOfControl (int id);
+
+ // Return the ID of a named control.
+ // Used in GUIState::FocusControl
+ NamedControl* GetControlNamed (const std::string &name);
+
+ void Clear () { m_NamedControls.clear (); }
+ private:
+ std::map<std::string, NamedControl> m_NamedControls;
+ };
+};
+
+#endif \ No newline at end of file