38#include "imgui_stdlib.h"
53 virtual bool DoRender() =0;
55 const std::string& GetID()
58 std::string GetTitleAndID()
59 {
return m_title +
"###" + m_id; }
62 static bool Combo(
const std::string& label,
const std::vector<std::string>&
items,
int&
selection,
bool*
open =
nullptr);
64 const std::string& label,
69 const std::string& label,
74 const std::string& label,
78 static bool TextInputWithImplicitApply(
79 const std::string& label,
87 const std::string& label,
101 static void HelpMarker(
const std::string&
str);
102 static void HelpMarker(
const std::string&
header,
const std::vector<std::string>&
bullets);
117 std::string m_errorPopupTitle;
118 std::string m_errorPopupMessage;
Definition AcceleratorBuffer.h:204
Generic dialog box or other popup window.
Definition Dialog.h:46
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:374
ImGuiID m_editedItemId
Id of the item currently beeing edited.
Definition Dialog.h:127
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:276
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:194
void Render7SegmentDigit(ImDrawList *drawList, uint8_t digit, ImVec2 size, ImVec2 position, float thikness, ImU32 colorOn, ImU32 colorOff)
Render a single digit in 7 segment display style.
Definition Dialog.cpp:844
void renderReadOnlyProperty(float width, const std::string &label, const std::string &value, const char *tooltip=nullptr)
Render a read-only instrument property value.
Definition Dialog.cpp:473
void RenderAsChild()
Runs the dialog's contents directly into a parent window.
Definition Dialog.cpp:101
void renderNumericValue(const std::string &value, bool &clicked, bool &hovered, std::optional< ImVec4 > optcolor=std::nullopt, bool allow7SegmentDisplay=false, float digitHeight=0, bool clickable=true)
Render a numeric value.
Definition Dialog.cpp:393
static bool Combo(const std::string &label, const std::vector< std::string > &items, int &selection, bool *open=nullptr)
Displays a combo box from a vector<string>
Definition Dialog.cpp:142
void ShowErrorPopup(const std::string &title, const std::string &msg)
Opens the error popup.
Definition Dialog.cpp:112
ImGuiID m_lastEditedItemId
Id of the last edited item.
Definition Dialog.h:130
virtual bool Render()
Renders the dialog and handles UI events.
Definition Dialog.cpp:71
void renderBadge(float width, ImVec4 color, const std::string &label)
Render a badge with text inside.
Definition Dialog.cpp:797
void Render7SegmentValue(const std::string &value, ImVec4 color, float digitHeight)
Render a numeric value with a 7 segment display style.
Definition Dialog.cpp:925
bool renderEditablePropertyWithExplicitApply(float width, const std::string &label, std::string ¤tValue, T &committedValue, Unit unit, const char *tooltip=nullptr, std::optional< ImVec4 > optcolor=std::nullopt, bool allow7SegmentDisplay=false)
Render an editable numeric value with explicit apply (if the input value needs to explicitly be appli...
Definition Dialog.cpp:781
void RenderErrorPopup()
Popup message when we fail to connect.
Definition Dialog.cpp:122
MainWindow * m_parent
optional reference to parent MainWindow
Definition Dialog.h:124
Session * m_session
optional reference to session
Definition Dialog.h:121
Top level application window.
Definition MainWindow.h:168
A Session stores all of the instrument configuration and other state the user has open.
Definition Session.h:126
A unit of measurement, plus conversion to pretty-printed output.
Definition Unit.h:59