@@ -127,10 +127,20 @@ TextBoxParameterEditor::TextBoxParameterEditor (Parameter* param, int rowHeightP
127127 label->setFont (labelFont);
128128 addAndMakeVisible (label.get ());
129129
130- if (param->getType () == Parameter::FLOAT_PARAM)
131- valueTextBox = std::make_unique<CustomTextBox> (param->getKey (), String (float (param->getValue ())), " 0123456789." , ((FloatParameter*) param)->getUnit ());
132- else if (param->getType () == Parameter::INT_PARAM)
133- valueTextBox = std::make_unique<CustomTextBox> (param->getKey (), String (int (param->getValue ())), " 0123456789" );
130+ if (param->getType () == Parameter::FLOAT_PARAM) {
131+ if (((FloatParameter*) param)->getMinValue () < 0 ) {
132+ valueTextBox = std::make_unique<CustomTextBox> (param->getKey (), String (float (param->getValue ())), " -0123456789." );
133+ } else {
134+ valueTextBox = std::make_unique<CustomTextBox> (param->getKey (), String (float (param->getValue ())), " 0123456789." );
135+ }
136+ }
137+ else if (param->getType () == Parameter::INT_PARAM) {
138+ if (((IntParameter*) param)->getMinValue () < 0 ) {
139+ valueTextBox = std::make_unique<CustomTextBox> (param->getKey (), String (int (param->getValue ())), " -0123456789" );
140+ } else {
141+ valueTextBox = std::make_unique<CustomTextBox> (param->getKey (), String (int (param->getValue ())), " 0123456789" );
142+ }
143+ }
134144 else
135145 valueTextBox = std::make_unique<CustomTextBox> (param->getKey (), param->getValue ().toString (), " " );
136146
0 commit comments