From 0046300733c1172119cc113ab7d93fe4a2013a7c Mon Sep 17 00:00:00 2001 From: Arjan Mels Date: Fri, 28 Jun 2019 11:57:03 +0200 Subject: [PATCH] Add option to reverse checkbox and label order --- src/AutoConnectDefs.h | 2 +- src/AutoConnectElementBasis.h | 1 + src/AutoConnectElementBasisImpl.h | 10 ++++++---- src/AutoConnectElementJson.h | 4 +++- src/AutoConnectElementJsonImpl.h | 5 ++++- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/AutoConnectDefs.h b/src/AutoConnectDefs.h index bde08d6..cfe56f7 100644 --- a/src/AutoConnectDefs.h +++ b/src/AutoConnectDefs.h @@ -11,7 +11,7 @@ #define _AUTOCONNECTDEFS_H_ // Uncomment the following AC_DEBUG to enable debug output. -#define AC_DEBUG +// #define AC_DEBUG // Debug output destination can be defined externally with AC_DEBUG_PORT #ifndef AC_DEBUG_PORT diff --git a/src/AutoConnectElementBasis.h b/src/AutoConnectElementBasis.h index 77ccb0c..d84b8f0 100644 --- a/src/AutoConnectElementBasis.h +++ b/src/AutoConnectElementBasis.h @@ -109,6 +109,7 @@ class AutoConnectCheckboxBasis : virtual public AutoConnectElementBasis { String label; /**< A label for a subsequent input box */ bool checked; /**< The element should be pre-selected */ + bool labelFirst; /**< Output label before the checkbox */ }; /** diff --git a/src/AutoConnectElementBasisImpl.h b/src/AutoConnectElementBasisImpl.h index ac0ac86..37ff19e 100644 --- a/src/AutoConnectElementBasisImpl.h +++ b/src/AutoConnectElementBasisImpl.h @@ -62,12 +62,14 @@ const String AutoConnectCheckboxBasis::toHTML(void) const { String html = String(""); if (enable) { - html = String(F("")) + label + String(F("")); + html += String(F("