Commit bd655e50 authored by w4t's avatar w4t

Add Text helper and no label option to AddText() method

parent 645f3a6d
...@@ -149,6 +149,9 @@ namespace ofxImGui ...@@ -149,6 +149,9 @@ namespace ofxImGui
template<typename ParameterType> template<typename ParameterType>
bool AddParameter(ofParameter<ParameterType>& parameter); bool AddParameter(ofParameter<ParameterType>& parameter);
template<typename ParameterType>
bool AddText(ofParameter<ParameterType>& parameter, bool label = true);
bool AddRadio(ofParameter<int>& parameter, std::vector<std::string> labels, int columns = 1); bool AddRadio(ofParameter<int>& parameter, std::vector<std::string> labels, int columns = 1);
bool AddCombo(ofParameter<int>& parameter, std::vector<std::string> labels); bool AddCombo(ofParameter<int>& parameter, std::vector<std::string> labels);
bool AddStepper(ofParameter<int>& parameter, int step = 1, int stepFast = 100); bool AddStepper(ofParameter<int>& parameter, int step = 1, int stepFast = 100);
...@@ -239,6 +242,21 @@ bool ofxImGui::AddParameter(ofParameter<ParameterType>& parameter) ...@@ -239,6 +242,21 @@ bool ofxImGui::AddParameter(ofParameter<ParameterType>& parameter)
return false; return false;
} }
//--------------------------------------------------------------
template<typename ParameterType>
bool ofxImGui::AddText(ofParameter<ParameterType>& parameter, bool label)
{
if (label)
{
ImGui::LabelText(parameter.getName().c_str(), ofToString(parameter.get()).c_str());
}
else
{
ImGui::Text(ofToString(parameter.get()).c_str());
}
return true;
}
//-------------------------------------------------------------- //--------------------------------------------------------------
template<typename DataType> template<typename DataType>
bool ofxImGui::AddValues(const std::string& name, std::vector<DataType>& values, DataType minValue, DataType maxValue) bool ofxImGui::AddValues(const std::string& name, std::vector<DataType>& values, DataType minValue, DataType maxValue)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment