FastLED 3.10.9
Loading...
Searching...
No Matches

◆ onBeginFrame()

void fl::UIDropdown::Listener::onBeginFrame ( )
overridevirtual

Reimplemented from fl::EngineEvents::Listener.

Definition at line 18 of file dropdown.cpp.hpp.

18 {
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}
fl::string value() const FL_NO_EXCEPT
Definition dropdown.h:126
UIDropdown(const char *name, fl::initializer_list< fl::string > options) FL_NO_EXCEPT

References fl::UIDropdown::UIDropdown(), fl::UIDropdown::as_int(), fl::UIDropdown::FL_NO_EXCEPT, fl::UIDropdown::mCallbacks, fl::UIDropdown::mLastFrameValue, fl::UIDropdown::mLastFrameValueValid, fl::UIDropdown::mNextButton, mOwner, fl::UIDropdown::nextOption(), and fl::UIDropdown::value().

+ Here is the call graph for this function: