blob: dc4dff7685df5a19d1f98bfc0682f7e2b576a547 (
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
|
#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
|