MCPcopy Create free account
hub / github.com/SatDump/SatDump / draw

Method draw

src-core/core/params.cpp:169–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167 }
168
169 void EditableParameter::draw()
170 {
171 ImGui::TableNextRow();
172 ImGui::TableSetColumnIndex(0);
173 ImGui::Text("%s", d_name.c_str());
174 if (ImGui::IsItemHovered() && d_description.size() > 0)
175 ImGui::SetTooltip("%s", d_description.c_str());
176 ImGui::TableSetColumnIndex(1);
177
178 if (d_type == PARAM_STRING)
179 ImGui::InputText(d_id.c_str(), &p_string);
180 else if (d_type == PARAM_PASSWORD)
181 ImGui::InputText(d_id.c_str(), &p_string, ImGuiInputTextFlags_Password);
182 else if (d_type == PARAM_INT)
183 ImGui::InputInt(d_id.c_str(), &p_int, 0);
184 else if (d_type == PARAM_FLOAT)
185 ImGui::InputDouble(d_id.c_str(), &p_float);
186 else if (d_type == PARAM_BOOL)
187 ImGui::Checkbox(d_id.c_str(), &p_bool);
188 else if (d_type == PARAM_OPTIONS)
189 ImGui::Combo(d_id.c_str(), &d_option, d_options_str.c_str());
190 else if (d_type == PARAM_PATH)
191 file_select->draw();
192 else if (d_type == PARAM_TIMESTAMP)
193 date_time_picker->draw();
194 else if (d_type == PARAM_NOTATED_INT)
195 notated_int->draw();
196 else if (d_type == PARAM_COLOR)
197 ImGui::ColorEdit3(d_id.c_str(), (float *)p_color, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel);
198 else if (d_type == PARAM_BASEBAND_TYPE)
199 baseband_type.draw_playback_combo(d_id.c_str());
200 else if (d_type == PARAM_LABELED_OPTIONS)
201 {
202 if (ImGui::Combo(d_id.c_str(), &d_option, d_options_str.c_str()) && d_option != (int)d_labeled_opts.size())
203 p_string = d_labeled_opts[d_option].first;
204
205 if (p_bool) // Allow Manual
206 {
207 if (d_option != (int)d_labeled_opts.size())
208 ImGui::BeginDisabled();
209 ImGui::InputText(std::string(d_id + "_custom").c_str(), &p_string);
210 if (d_option != (int)d_labeled_opts.size())
211 ImGui::EndDisabled();
212 }
213 }
214 }
215
216 nlohmann::json EditableParameter::getValue()
217 {

Callers 3

drawUIMethod · 0.45
drawFFTMethod · 0.45
drawUIMethod · 0.45

Calls 14

TableNextRowFunction · 0.85
TableSetColumnIndexFunction · 0.85
InputIntFunction · 0.85
InputDoubleFunction · 0.85
BeginDisabledFunction · 0.85
EndDisabledFunction · 0.85
c_strMethod · 0.80
draw_playback_comboMethod · 0.80
TextFunction · 0.50
InputTextFunction · 0.50
CheckboxFunction · 0.50
ComboFunction · 0.50

Tested by

no test coverage detected