FastLED 3.10.8
Loading...
Searching...
No Matches
checkbox.cpp.hpp
Go to the documentation of this file.
1#include "fl/ui/checkbox.h"
2#include "fl/stl/noexcept.h"
3
4namespace fl {
5
7 : mImpl(name, value), mLastFrameValue(false), mLastFrameValueValid(false), mListener(this) {
8 mListener.addToEngineEventsOnce();
9}
10
12
14 UICheckbox &owner = *mOwner;
15 if (!owner.mLastFrameValueValid) {
16 owner.mLastFrameValue = owner.value();
17 owner.mLastFrameValueValid = true;
18 return;
19 }
20 bool value = owner.value();
21 if (value != owner.mLastFrameValue) {
22 owner.mCallbacks.invoke(owner);
23 owner.mLastFrameValue = value;
24 }
25}
26
27} // namespace fl
Listener mListener
Definition checkbox.h:105
~UICheckbox() FL_NO_EXCEPT
function_list< void(UICheckbox &)> mCallbacks
Definition checkbox.h:102
bool mLastFrameValue
Definition checkbox.h:103
UICheckbox(const char *name, bool value=false) FL_NO_EXCEPT
bool value() const FL_NO_EXCEPT
Definition checkbox.h:59
UICheckboxImpl mImpl
Definition checkbox.h:76
bool mLastFrameValueValid
Definition checkbox.h:104
u8 u8 fract8 blur_amount FL_NO_EXCEPT
Definition blur.h:186
Base definition for an LED controller.
Definition crgb.hpp:179
UICheckbox * mOwner
Definition checkbox.h:97
void onBeginFrame() FL_NO_EXCEPT override