| 16 | UIDropdown::~UIDropdown() FL_NOEXCEPT {} |
| 17 | |
| 18 | void UIDropdown::Listener::onBeginFrame() FL_NOEXCEPT { |
| 19 | UIDropdown &owner = *mOwner; |
| 20 | |
| 21 | // Seed baseline before any first-frame advance so a nextOption() triggered |
| 22 | // on the very first frame still produces a change callback. |
| 23 | if (!owner.mLastFrameValueValid) { |
| 24 | owner.mLastFrameValue = owner.as_int(); |
| 25 | owner.mLastFrameValueValid = true; |
| 26 | } |
| 27 | |
| 28 | // Check the next button if one is attached (via IButtonInput interface) |
| 29 | if (owner.mNextButton && owner.mNextButton->clicked()) { |
| 30 | owner.nextOption(); |
| 31 | } |
| 32 | |
| 33 | int value = owner.as_int(); |
| 34 | if (value != owner.mLastFrameValue) { |
| 35 | owner.mCallbacks.invoke(owner); |
| 36 | owner.mLastFrameValue = value; |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | } // namespace fl |
nothing calls this directly
no test coverage detected