10void UISlider::setValue(
float value) {
12 if (
value != oldValue) {
24 if (!owner.mLastFramevalueValid) {
25 owner.mLastFrameValue = owner.value();
26 owner.mLastFramevalueValid =
true;
30 if (
value != owner.mLastFrameValue) {
31 owner.mCallbacks.invoke(*
mOwner);
32 owner.mLastFrameValue =
value;
37 bool clicked_this_frame = mOwner->clicked();
40 if (mOwner->mRealButton) {
41 if (mOwner->mRealButton->isPressed()) {
42 clicked_this_frame =
true;
47 const bool clicked_changed = (clicked_this_frame != mClickedLastFrame);
48 mClickedLastFrame = clicked_this_frame;
49 if (clicked_changed) {
52 mOwner->mCallbacks.invoke(*mOwner);
58 UICheckbox &owner = *mOwner;
59 if (!owner.mLastFrameValueValid) {
60 owner.mLastFrameValue = owner.value();
61 owner.mLastFrameValueValid =
true;
64 bool value = owner.value();
65 if (
value != owner.mLastFrameValue) {
66 owner.mCallbacks.invoke(owner);
67 owner.mLastFrameValue =
value;
72 UINumberField &owner = *mOwner;
73 if (!owner.mLastFrameValueValid) {
74 owner.mLastFrameValue = owner.value();
75 owner.mLastFrameValueValid =
true;
78 double value = owner.value();
79 if (
value != owner.mLastFrameValue) {
80 owner.mCallbacks.invoke(owner);
81 owner.mLastFrameValue =
value;
86 UIDropdown &owner = *mOwner;
89 bool shouldAdvance =
false;
90 if (owner.mNextButton) {
91 if (owner.mNextButton->clicked()) {
102 if (!owner.mLastFrameValueValid) {
103 owner.mLastFrameValue = owner.as_int();
104 owner.mLastFrameValueValid =
true;
107 int value = owner.as_int();
108 if (
value != owner.mLastFrameValue) {
109 owner.mCallbacks.invoke(owner);
110 owner.mLastFrameValue =
value;