Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Button.cpp
00001 #include "Button.h" 00002 #include "NextionSerial.h" 00003 00004 Button::Button(uint32_t aPage, uint32_t aId, const std::string& aObjectName, NextionSerial& aNextionSerial) : 00005 NextionUI(aPage, aId, aObjectName, aNextionSerial) 00006 { 00007 } 00008 00009 void Button::SetReleaseCallback(std::function<void()> aCallback) 00010 { 00011 iReleaseCallback = std::move(aCallback); 00012 } 00013 00014 void Button::SetPushCallback(std::function<void ()> aPushCallback) 00015 { 00016 iPushCallback = std::move(aPushCallback); 00017 } 00018 00019 void Button::PressReleaseTriggered(TEventType aEventType) 00020 { 00021 switch (aEventType) { 00022 case TEventType::EPress: 00023 { 00024 if (iPushCallback != nullptr) { iPushCallback(); } 00025 break; 00026 } 00027 case TEventType::ERelease: 00028 { 00029 if (iReleaseCallback != nullptr) { iReleaseCallback(); } 00030 break; 00031 } 00032 default: 00033 break; 00034 } 00035 }
Generated on Wed Jul 13 2022 10:35:08 by
1.7.2