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.h@0:87b7b2ae63c3, 2021-03-03 (annotated)
- Committer:
- Ocky Kristanto 
- Date:
- Wed Mar 03 09:01:07 2021 +0100
- Revision:
- 0:87b7b2ae63c3
feat: initial version
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| Ocky Kristanto | 0:87b7b2ae63c3 | 1 | #pragma once | 
| Ocky Kristanto | 0:87b7b2ae63c3 | 2 | |
| Ocky Kristanto | 0:87b7b2ae63c3 | 3 | #include "NextionUI.h" | 
| Ocky Kristanto | 0:87b7b2ae63c3 | 4 | |
| Ocky Kristanto | 0:87b7b2ae63c3 | 5 | #include <cstdint> | 
| Ocky Kristanto | 0:87b7b2ae63c3 | 6 | #include <functional> | 
| Ocky Kristanto | 0:87b7b2ae63c3 | 7 | #include <string> | 
| Ocky Kristanto | 0:87b7b2ae63c3 | 8 | |
| Ocky Kristanto | 0:87b7b2ae63c3 | 9 | class NextionSerial; | 
| Ocky Kristanto | 0:87b7b2ae63c3 | 10 | |
| Ocky Kristanto | 0:87b7b2ae63c3 | 11 | class Button : public NextionUI | 
| Ocky Kristanto | 0:87b7b2ae63c3 | 12 | { | 
| Ocky Kristanto | 0:87b7b2ae63c3 | 13 | public: | 
| Ocky Kristanto | 0:87b7b2ae63c3 | 14 | explicit Button(uint32_t aPage, uint32_t aId, const std::string& aObjectName, NextionSerial& aNextionSerial); | 
| Ocky Kristanto | 0:87b7b2ae63c3 | 15 | |
| Ocky Kristanto | 0:87b7b2ae63c3 | 16 | void SetPushCallback(std::function<void()> aPushCallback); | 
| Ocky Kristanto | 0:87b7b2ae63c3 | 17 | void SetReleaseCallback(std::function<void()> aReleaseCallback); | 
| Ocky Kristanto | 0:87b7b2ae63c3 | 18 | |
| Ocky Kristanto | 0:87b7b2ae63c3 | 19 | void PressReleaseTriggered(TEventType aEventType) override; | 
| Ocky Kristanto | 0:87b7b2ae63c3 | 20 | |
| Ocky Kristanto | 0:87b7b2ae63c3 | 21 | private: | 
| Ocky Kristanto | 0:87b7b2ae63c3 | 22 | std::function<void()> iPushCallback {nullptr}; | 
| Ocky Kristanto | 0:87b7b2ae63c3 | 23 | std::function<void()> iReleaseCallback {nullptr}; | 
| Ocky Kristanto | 0:87b7b2ae63c3 | 24 | }; | 
| Ocky Kristanto | 0:87b7b2ae63c3 | 25 |