aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTectu <joel@unormal.org>2012-06-27 10:10:45 +0200
committerTectu <joel@unormal.org>2012-06-27 10:10:45 +0200
commitdb7d8d0aeacc61e1fe75072b802e5f8790591181 (patch)
tree431e0644433bda03d8a931d5ed86db5833ce095d
parent3d041a9d4b8c6592468b4b6e7dca29b4e243d795 (diff)
downloaduGFX-db7d8d0aeacc61e1fe75072b802e5f8790591181.tar.gz
uGFX-db7d8d0aeacc61e1fe75072b802e5f8790591181.tar.bz2
uGFX-db7d8d0aeacc61e1fe75072b802e5f8790591181.zip
added guiDeleteElement
-rw-r--r--gui.c10
-rw-r--r--gui.h8
2 files changed, 17 insertions, 1 deletions
diff --git a/gui.c b/gui.c
index 29a40564..a1dc3431 100644
--- a/gui.c
+++ b/gui.c
@@ -29,7 +29,7 @@ static uint16_t addNode(struct guiNode_t *newNode) {
return 1;
}
-static void deleteNode(char *name) {
+static uint8_t deleteNode(char *name) {
struct guiNode_t *pointer, *pointer1;
if(firstGUI != NULL) {
@@ -53,7 +53,11 @@ static void deleteNode(char *name) {
}
}
+
+ return 1; // successful
}
+
+ return 0; // not successful
}
void guiPrintNodes(BaseSequentialStream *chp) {
@@ -127,6 +131,10 @@ Thread *guiInit(uint16_t interval, tprio_t priority) {
return tp;
}
+uint8_t guiDeleteElement(char *name) {
+ return deleteNode(name);
+}
+
uint8_t guiDrawButton(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, char *str, uint16_t fontColor, uint16_t buttonColor, char *name, uint8_t *active, uint8_t *state) {
struct guiNode_t *newNode;
diff --git a/gui.h b/gui.h
index 5e08ac00..18251291 100644
--- a/gui.h
+++ b/gui.h
@@ -49,6 +49,14 @@ Thread *guiInit(uint16_t interval, tprio_t priority);
void guiPrintNode(BaseSequentialStream *chp);
/*
+ * Description: deletes a GUI element from the linked list
+ *
+ * param: - name: name of the element (parameter of each guiDrawXXX function)
+ *
+ * return: 1 if successful, 0 otherwise
+ */
+uint8_t guiDeleteElement(char *name);
+/*
* Description: draws a button on the screen and keeps it's state up to date
*
* param: - x0, y0, x1, y1: start and end coordinates of the button's rectangle