| 301 | } |
| 302 | |
| 303 | HelpDisplay::UIControlTooltipInfo* HelpDisplay::FindControlInfo(IUIControl* control) |
| 304 | { |
| 305 | ModuleTooltipInfo* moduleInfo = nullptr; |
| 306 | IDrawableModule* parent = dynamic_cast<IDrawableModule*>(control->GetParent()); |
| 307 | if (parent != nullptr) |
| 308 | moduleInfo = FindModuleInfo(parent->GetTypeName()); |
| 309 | if (moduleInfo) |
| 310 | { |
| 311 | std::string controlName = control->Name(); |
| 312 | for (auto& info : moduleInfo->controlTooltips) |
| 313 | { |
| 314 | if (StringMatch(info.controlName, controlName)) |
| 315 | return &info; |
| 316 | } |
| 317 | } |
| 318 | |
| 319 | //didn't find it, try again with the "module parent" |
| 320 | parent = control->GetModuleParent(); |
| 321 | if (parent != nullptr) |
| 322 | moduleInfo = FindModuleInfo(parent->GetTypeName()); |
| 323 | if (moduleInfo) |
| 324 | { |
| 325 | std::string controlName = control->Name(); |
| 326 | for (auto& info : moduleInfo->controlTooltips) |
| 327 | { |
| 328 | if (StringMatch(info.controlName, controlName)) |
| 329 | return &info; |
| 330 | } |
| 331 | } |
| 332 | |
| 333 | return nullptr; |
| 334 | } |
| 335 | |
| 336 | std::string HelpDisplay::GetUIControlTooltip(IUIControl* control) |
| 337 | { |
nothing calls this directly
no test coverage detected