From bfd6888a4879744b364d8def7cdcb83c5cf4eaac Mon Sep 17 00:00:00 2001 From: Jyrki Berg <12322333+jyberg@users.noreply.github.com> Date: Fri, 24 Jul 2020 14:13:27 +0300 Subject: [PATCH] setVisible added for components and setVisibleAll for page --- NexObject.cpp | 16 ++++++++++++++++ NexObject.h | 8 ++++++++ NexPage.cpp | 15 +++++++++++++++ NexPage.h | 9 +++++++++ release_notes.md | 3 +++ version.txt | 2 +- 6 files changed, 52 insertions(+), 1 deletion(-) diff --git a/NexObject.cpp b/NexObject.cpp index 21757203..81c618ef 100644 --- a/NexObject.cpp +++ b/NexObject.cpp @@ -104,3 +104,19 @@ void NexObject::printObjInfo(void) dbSerialPrintln("]"); } +bool NexObject::setVisible(bool visible) +{ + String cmd = String("vis "); + cmd += __name; + cmd += ","; + if (flag) + { + cmd += "1"; + } else + { + cmd += "0"; + } + sendCommand(cmd.c_str()); + return recvRetCommandFinished(); +} + diff --git a/NexObject.h b/NexObject.h index adaa3c4d..273a7657 100644 --- a/NexObject.h +++ b/NexObject.h @@ -66,6 +66,14 @@ class NexObject */ void printObjInfo(void); + /** + * Hide or Show componen on current page + * + * @param visible - true Show component, false Hide component + * @return true if success, false for failure + */ + bool setVisible(bool visible) + protected: /* methods */ /* diff --git a/NexPage.cpp b/NexPage.cpp index 7a006479..9244826b 100644 --- a/NexPage.cpp +++ b/NexPage.cpp @@ -36,3 +36,18 @@ bool NexPage::show(void) return recvRetCommandFinished(); } +bool NexPage::setVisibleAll(bool visible) +{ + String cmd = String("vis "); + cmd += "255,"; + if (flag) + { + cmd += "1"; + } else + { + cmd += "0"; + } + sendCommand(cmd.c_str()); + return recvRetCommandFinished(); +} + diff --git a/NexPage.h b/NexPage.h index b875b06b..4f6ce3e5 100644 --- a/NexPage.h +++ b/NexPage.h @@ -43,6 +43,15 @@ class NexPage: public NexTouch * @return true if success, false for faileure. */ bool show(void); + + /** + * Hide or Show all componens on current page + * + * @param visible - true Show components, false Hide components + * @return true if success, false for failure + */ + bool setVisibleAll(bool visible) + }; /** * @} diff --git a/release_notes.md b/release_notes.md index b4cffb19..6d45a449 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,6 +1,9 @@ # Release Notes -------------------------------------------------------------------------------- +# Release v0.11.10 +- setVisible added for components and setVisibleAll for page + # Release v0.11.9 - NexConfig: standard (dafault) or fast timeout, you may use fast timeout in case of baudrate higher than 115200 diff --git a/version.txt b/version.txt index 61d147bd..d2cd2774 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.11.9 +0.11.10