diff options
author | Tectu <joel@unormal.org> | 2012-06-27 10:10:45 +0200 |
---|---|---|
committer | Tectu <joel@unormal.org> | 2012-06-27 10:10:45 +0200 |
commit | db7d8d0aeacc61e1fe75072b802e5f8790591181 (patch) | |
tree | 431e0644433bda03d8a931d5ed86db5833ce095d | |
parent | 3d041a9d4b8c6592468b4b6e7dca29b4e243d795 (diff) | |
download | uGFX-db7d8d0aeacc61e1fe75072b802e5f8790591181.tar.gz uGFX-db7d8d0aeacc61e1fe75072b802e5f8790591181.tar.bz2 uGFX-db7d8d0aeacc61e1fe75072b802e5f8790591181.zip |
added guiDeleteElement
-rw-r--r-- | gui.c | 10 | ||||
-rw-r--r-- | gui.h | 8 |
2 files changed, 17 insertions, 1 deletions
@@ -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; @@ -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 |