35 im::Menu(
"Connectors", motherBoard !=
nullptr, [&]{
39 for (
const auto* connector : pluggingController.getConnectors()) {
40 if (ImGui::TableNextColumn()) {
43 if (ImGui::TableNextColumn()) {
44 const auto& connectorName = connector->getName();
45 auto connectorClass = connector->getClass();
46 const auto& currentPluggable = connector->getPlugged();
47 ImGui::SetNextItemWidth(ImGui::GetFontSize() * 12.0f);
48 im::Combo(
tmpStrCat(
"##", connectorName).c_str(), pluggableToGuiString(currentPluggable.getName()).c_str(), [&]{
49 if (!currentPluggable.getName().empty()) {
50 if (ImGui::Selectable(
"[unplug]")) {
51 manager.executeDelayed(makeTclList(
"unplug", connectorName));
54 for (
auto& plug : pluggables) {
55 if (plug->getClass() != connectorClass)
continue;
56 auto plugName = plug->getName();
57 bool selected = plug.get() == ¤tPluggable;
58 int flags = !selected && plug->getConnector() ? ImGuiSelectableFlags_Disabled : 0;
59 if (ImGui::Selectable(pluggableToGuiString(plugName).c_str(), selected, flags)) {
64 ImGui::SetItemDefaultFocus();
68 if (
const auto& desc = currentPluggable.getDescription(); !desc.empty()) {
void Table(const char *str_id, int column, ImGuiTableFlags flags, const ImVec2 &outer_size, float inner_width, std::invocable<> auto next)