33 w->children = std::move(elements);
40 w->children = std::move(elements);
48 FormLayoutElementPtr e =
new FormLayoutElement;
49 e->labelWidget = std::move(labelWidget);
50 e->child = std::move(child);
51 e->childIsSpanning =
false;
58 FormLayoutElementPtr e =
new FormLayoutElement;
59 e->label = std::move(name);
60 e->child = std::move(child);
61 e->childIsSpanning = spanning;
68 FormLayoutElementPtr e =
new FormLayoutElement;
69 if (ConfigWidgetPtr::dynamicCast(child))
71 e->label = ConfigWidgetPtr::dynamicCast(child)->name;
73 e->child = std::move(child);
74 e->childIsSpanning = spanning;
83 FormLayoutPtr
makeFormLayout(std::vector<std::pair<std::string, WidgetPtr> > elements)
85 FormLayoutPtr l =
new FormLayout;
86 l->children.reserve(elements.size());
87 for (
auto& elem : elements)
96 FormLayoutPtr l =
new FormLayout;
97 l->children.reserve(elements.size());
98 for (
auto& elem : elements)
108 w->child = std::move(child);
109 w->label = std::move(label);
116 child->framed =
true;
142 return new Label {
false, std::move(text)};
145 CheckBoxPtr
makeCheckBox(std::string name,
bool defaultValue, std::string label)
148 w->name = std::move(name);
149 w->label = std::move(label);
150 w->defaultValue = defaultValue;
156 w->name = std::move(name);
158 w->defaultValue = defaultValue;
165 w->name = std::move(name);
168 w->defaultValue = defaultValue;
175 w->name = std::move(name);
178 w->defaultValue = defaultValue;
180 w->decimals = decimals;
186 DoubleSpinBoxPtr w =
new DoubleSpinBox;
187 w->name = std::move(name);
190 w->defaultValue = defaultValue;
192 w->decimals = decimals;
199 w->name = std::move(name);
202 w->defaultValue = defaultValue;
209 w->name = std::move(name);
212 w->defaultValue = defaultValue;
218 DoubleSliderPtr w =
new DoubleSlider;
219 w->name = std::move(name);
222 w->defaultValue = defaultValue;
226 StringComboBoxPtr
makeStringComboBox(std::string name, std::vector<std::string> options,
long defaultIndex)
228 StringComboBoxPtr w =
new StringComboBox;
229 w->name = std::move(name);
230 w->options = std::move(options);
231 w->defaultIndex = defaultIndex;
238 w->name = std::move(name);
239 w->defaultValue = std::move(defaultValue);
245 FloatLineEditPtr w =
new FloatLineEdit;
246 w->name = std::move(name);
247 w->defaultValue = defaultValue;
253 DoubleLineEditPtr w =
new DoubleLineEdit;
254 w->name = std::move(name);
255 w->defaultValue = defaultValue;
261 const std::string& namePrefix,
271 FloatRange rangeRoll,
272 FloatRange rangePitch,
282 makeFloatSpinBox(namePrefix +
"Roll", rangeRoll.min, rangeRoll.max, initRoll, 2000),
283 makeFloatSpinBox(namePrefix +
"Pitch", rangePitch.min, rangePitch.max, initPitch, 2000),
284 makeFloatSpinBox(namePrefix +
"Yaw", rangeYaw.min, rangeYaw.max, initYaw, 2000)