From 95855b1a095693edd2d156ccf0403df36c9ea1e3 Mon Sep 17 00:00:00 2001 From: Eduardo Gonzalez Date: Mon, 5 Apr 2021 21:10:30 -0300 Subject: [PATCH 1/2] Added function getLabel() to expose the button label. --- Adafruit_GFX.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Adafruit_GFX.h b/Adafruit_GFX.h index b9d63c6..8d08008 100644 --- a/Adafruit_GFX.h +++ b/Adafruit_GFX.h @@ -291,6 +291,14 @@ public: /**********************************************************************/ bool isPressed(void) { return currstate; }; + /**********************************************************************/ + /*! + @brief Get the label text + @returns the const char pointer of the buttoś label + */ + /**********************************************************************/ + char *getLabel(void) const { return _label; }; + private: Adafruit_GFX *_gfx; int16_t _x1, _y1; // Coordinates of top-left corner From 09feb78a570024269b0a49eeabe29fe643b2631d Mon Sep 17 00:00:00 2001 From: Eduardo Gonzalez Date: Sun, 11 Apr 2021 14:55:40 -0300 Subject: [PATCH 2/2] Fixed warning const char* on return value --- Adafruit_GFX.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Adafruit_GFX.h b/Adafruit_GFX.h index 8d08008..df540c7 100644 --- a/Adafruit_GFX.h +++ b/Adafruit_GFX.h @@ -297,7 +297,7 @@ public: @returns the const char pointer of the buttoś label */ /**********************************************************************/ - char *getLabel(void) const { return _label; }; + const char *getLabel(void) const { return _label; }; private: Adafruit_GFX *_gfx;