From 15c137633abe3d5ec19fb5b45fb654f396cba9ee Mon Sep 17 00:00:00 2001 From: Bodmer Date: Thu, 6 Feb 2020 13:38:03 +0000 Subject: [PATCH] Raise version add comments for button update --- Extensions/Button.h | 24 +++++++++++++----------- TFT_eSPI.h | 2 +- library.json | 2 +- library.properties | 2 +- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Extensions/Button.h b/Extensions/Button.h index ce476f2..ae1381f 100644 --- a/Extensions/Button.h +++ b/Extensions/Button.h @@ -2,7 +2,8 @@ // The following button class has been ported over from the Adafruit_GFX library so // should be compatible. // A slightly different implementation in this TFT_eSPI library allows the button -// legends to be in any font +// legends to be in any font, allow longer labels and to adjust text positioning +// within button ***************************************************************************************/ class TFT_eSPI_Button { @@ -20,23 +21,24 @@ class TFT_eSPI_Button { uint16_t textcolor, char *label, uint8_t textsize); // Adjust text datum and x, y deltas - void setLabelDatum(int16_t x_delta, int16_t y_delta, uint8_t datum = MC_DATUM); + void setLabelDatum(int16_t x_delta, int16_t y_delta, uint8_t datum = MC_DATUM); void drawButton(bool inverted = false, String long_name = ""); - bool contains(int16_t x, int16_t y); + bool contains(int16_t x, int16_t y); void press(bool p); - bool isPressed(); - bool justPressed(); - bool justReleased(); + bool isPressed(); + bool justPressed(); + bool justReleased(); private: TFT_eSPI *_gfx; - int16_t _x1, _y1, _xd, _yd; // Coordinates of top-left corner - uint16_t _w, _h; - uint8_t _textsize, _textdatum; + int16_t _x1, _y1; // Coordinates of top-left corner of button + int16_t _xd, _yd; // Button text datum offsets (wrt center of button) + uint16_t _w, _h; // Width and height of button + uint8_t _textsize, _textdatum; // Text size multiplier and text datum for button uint16_t _outlinecolor, _fillcolor, _textcolor; - char _label[10]; + char _label[10]; // Button text is 9 chars maximum unless long_name used - bool currstate, laststate; + bool currstate, laststate; // Button states }; diff --git a/TFT_eSPI.h b/TFT_eSPI.h index 87406ee..113e2e5 100644 --- a/TFT_eSPI.h +++ b/TFT_eSPI.h @@ -16,7 +16,7 @@ #ifndef _TFT_eSPIH_ #define _TFT_eSPIH_ -#define TFT_ESPI_VERSION "2.0.2" +#define TFT_ESPI_VERSION "2.0.3" /*************************************************************************************** ** Section 1: Load required header files diff --git a/library.json b/library.json index 2ee491f..09b7503 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "TFT_eSPI", - "version": "2.0.2", + "version": "2.0.3", "keywords": "Arduino, tft, ePaper, display, STM32, ESP8266, NodeMCU, ESP32, M5Stack, ILI9341, ST7735, ILI9163, S6D02A1, ILI9486, ST7789, RM68140", "description": "A TFT and ePaper SPI graphics library with optimisation for ESP8266, ESP32 and STM32", "repository": diff --git a/library.properties b/library.properties index f9c169c..7ca1c51 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=TFT_eSPI -version=2.0.2 +version=2.0.3 author=Bodmer maintainer=Bodmer sentence=TFT graphics library for Arduino processors with performance optimisation for STM32, ESP8266 and ESP32