| 449 | } |
| 450 | |
| 451 | IUIControl* ModuleContainer::FindUIControl(std::string path) |
| 452 | { |
| 453 | /*string ownerPath = ""; |
| 454 | if (mOwner) |
| 455 | ownerPath = mOwner->Path(); |
| 456 | if (strstr(path.c_str(), ownerPath.c_str()) != path.c_str()) //path doesn't start with ownerPath |
| 457 | return nullptr; |
| 458 | |
| 459 | path = path.substr(ownerPath.length());*/ |
| 460 | |
| 461 | if (path == "") |
| 462 | return nullptr; |
| 463 | |
| 464 | std::vector<std::string> tokens = ofSplitString(path, "~"); |
| 465 | std::string control = tokens[tokens.size() - 1]; |
| 466 | std::string modulePath = path.substr(0, path.length() - (control.length() + 1)); |
| 467 | IDrawableModule* module = FindModule(modulePath, false); |
| 468 | |
| 469 | if (module) |
| 470 | { |
| 471 | try |
| 472 | { |
| 473 | module->OnUIControlRequested(control.c_str()); |
| 474 | return module->FindUIControl(control.c_str()); |
| 475 | } |
| 476 | catch (UnknownUIControlException& e) |
| 477 | { |
| 478 | TheSynth->LogEvent("Couldn't find UI control at path \"" + path + "\"", kLogEventType_Error); |
| 479 | return nullptr; |
| 480 | } |
| 481 | } |
| 482 | |
| 483 | TheSynth->LogEvent("Couldn't find module at path \"" + modulePath + "\"", kLogEventType_Error); |
| 484 | return nullptr; |
| 485 | } |
| 486 | |
| 487 | bool ModuleContainer::IsHigherThan(IDrawableModule* checkFor, IDrawableModule* checkAgainst) const |
| 488 | { |
nothing calls this directly
no test coverage detected