| 127 | } |
| 128 | |
| 129 | JsonUiInternalPtr JsonUiManager::findUiComponent(const char* id_or_name) FL_NOEXCEPT { |
| 130 | auto components = getComponents(); |
| 131 | |
| 132 | for (auto &component : components) { |
| 133 | int id = component->id(); |
| 134 | string componentIdStr; |
| 135 | componentIdStr.append(id); |
| 136 | |
| 137 | if (fl::string::strcmp(componentIdStr.c_str(), id_or_name) == 0) { |
| 138 | //FL_WARN("*** Found component with ID " << id); |
| 139 | return component; |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | // If we didn't find it by id, try to find it by name |
| 144 | for (auto &component : components) { |
| 145 | if (fl::string::strcmp(component->name().c_str(), id_or_name) == 0) { |
| 146 | return component; |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | return JsonUiInternalPtr(); // Return null pointer if not found |
| 151 | } |
| 152 | |
| 153 | void JsonUiManager::updateUiComponents(const char* jsonStr) FL_NOEXCEPT { |
| 154 | //FL_WARN("*** JsonUiManager::updateUiComponents ENTRY ***"); |