| 328 | } |
| 329 | |
| 330 | void ExecuteCallback(bool hasValue) |
| 331 | { |
| 332 | if (HasParentWindow()) |
| 333 | { |
| 334 | if (hasValue) |
| 335 | { |
| 336 | auto w = GetParentWindow(); |
| 337 | if (w != nullptr) |
| 338 | { |
| 339 | w->onTextInput(_parentWidget.widgetIndex, _buffer); |
| 340 | } |
| 341 | } |
| 342 | } |
| 343 | else |
| 344 | { |
| 345 | if (hasValue) |
| 346 | { |
| 347 | if (_callback) |
| 348 | { |
| 349 | _callback(_buffer.data()); |
| 350 | } |
| 351 | } |
| 352 | else |
| 353 | { |
| 354 | if (_cancelCallback) |
| 355 | { |
| 356 | _cancelCallback(); |
| 357 | } |
| 358 | } |
| 359 | } |
| 360 | } |
| 361 | |
| 362 | bool HasParentWindow() const |
| 363 | { |
nothing calls this directly
no test coverage detected