Simulation GUI: Add support for custom names (#2292)

This allows users to right click on just about any name in the GUI (e.g. "PWM[0]") and rename it (e.g. "Left Motor [0]"). The index portion is not editable. The name is saved into imgui.ini so it's persistent.
This commit is contained in:
Peter Johnson
2020-01-20 22:47:36 -08:00
committed by GitHub
parent bb184ed481
commit 9d7b087972
11 changed files with 232 additions and 97 deletions

View File

@@ -16,9 +16,14 @@ class NameInfo {
public:
NameInfo() { m_name[0] = '\0'; }
bool HasName() const { return m_name[0] != '\0'; }
const char* GetName() const { return m_name; }
void GetName(char* buf, size_t size, const char* defaultName, int index);
void GetName(char* buf, size_t size, const char* defaultName, int index,
int index2);
bool ReadIni(wpi::StringRef name, wpi::StringRef value);
void WriteIni(ImGuiTextBuffer* out);
void PushEditNameId(int index);
void PopupEditName(int index);
private: