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.
Diff: Button.h
- Revision:
- 0:87b7b2ae63c3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Button.h Wed Mar 03 09:01:07 2021 +0100
@@ -0,0 +1,25 @@
+#pragma once
+
+#include "NextionUI.h"
+
+#include <cstdint>
+#include <functional>
+#include <string>
+
+class NextionSerial;
+
+class Button : public NextionUI
+{
+public:
+ explicit Button(uint32_t aPage, uint32_t aId, const std::string& aObjectName, NextionSerial& aNextionSerial);
+
+ void SetPushCallback(std::function<void()> aPushCallback);
+ void SetReleaseCallback(std::function<void()> aReleaseCallback);
+
+ void PressReleaseTriggered(TEventType aEventType) override;
+
+private:
+ std::function<void()> iPushCallback {nullptr};
+ std::function<void()> iReleaseCallback {nullptr};
+};
+