38#include "imgui_stdlib.h"
46 Dialog(
const std::string& title,
const std::string&
id, ImVec2 defaultSize = ImVec2(300, 100) );
51 virtual bool DoRender() =0;
53 const std::string& GetID()
56 std::string GetTitleAndID()
57 {
return m_title +
"###" + m_id; }
60 static bool Combo(
const std::string& label,
const std::vector<std::string>& items,
int& selection);
62 const std::string& label,
63 std::string& currentValue,
64 float& committedValue,
67 const std::string& label,
68 std::string& currentValue,
69 double& committedValue,
72 const std::string& label,
73 std::string& currentValue,
74 int64_t& committedValue,
76 static bool TextInputWithImplicitApply(
77 const std::string& label,
78 std::string& currentValue,
79 std::string& committedValue);
83 bool TextInputWithApplyButton(
const std::string& label, std::string& currentValue, std::string& committedValue);
84 bool IntInputWithImplicitApply(
const std::string& label,
int& currentValue,
int& committedValue);
86 const std::string& label,
87 std::string& currentValue,
88 float& committedValue,
91 static void Tooltip(
const std::string& str,
bool allowDisabled =
false);
92 static void HelpMarker(
const std::string& str);
93 static void HelpMarker(
const std::string& header,
const std::vector<std::string>& bullets);
97 void ShowErrorPopup(
const std::string& title,
const std::string& msg);
102 ImVec2 m_defaultSize;
104 std::string m_errorPopupTitle;
105 std::string m_errorPopupMessage;
Generic dialog box or other popup window.
Definition: Dialog.h:44
bool UnitInputWithExplicitApply(const std::string &label, std::string ¤tValue, float &committedValue, Unit unit)
Input box for a floating point value with an associated unit and an "apply" button.
Definition: Dialog.cpp:399
static bool UnitInputWithImplicitApply(const std::string &label, std::string ¤tValue, float &committedValue, Unit unit)
Input box for a floating point value with an associated unit.
Definition: Dialog.cpp:302
bool FloatInputWithApplyButton(const std::string &label, float ¤tValue, float &committedValue)
Helper for displaying a floating-point input box with an "apply" button.
Definition: Dialog.cpp:218
static void Tooltip(const std::string &str, bool allowDisabled=false)
Helper based on imgui demo for displaying tooltip text over the previously rendered widget.
Definition: Dialog.cpp:180
void RenderAsChild()
Runs the dialog's contents directly into a parent window.
Definition: Dialog.cpp:94
void ShowErrorPopup(const std::string &title, const std::string &msg)
Opens the error popup.
Definition: Dialog.cpp:105
virtual bool Render()
Renders the dialog and handles UI events.
Definition: Dialog.cpp:64
static bool Combo(const std::string &label, const std::vector< std::string > &items, int &selection)
Displays a combo box from a vector<string>
Definition: Dialog.cpp:133
void RenderErrorPopup()
Popup message when we fail to connect.
Definition: Dialog.cpp:115
A unit of measurement, plus conversion to pretty-printed output.
Definition: Unit.h:57