From d4e0ce8b70d58e1e39cf58d681486b4d8657820b Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Mon, 20 May 2013 07:01:20 +0200 Subject: added gwin enabled parameter and implemented button enable/disable functions --- include/gwin/gwin.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/gwin/gwin.h') diff --git a/include/gwin/gwin.h b/include/gwin/gwin.h index 43095643..c7b20008 100644 --- a/include/gwin/gwin.h +++ b/include/gwin/gwin.h @@ -45,6 +45,7 @@ typedef struct GWindowObject_t { coord_t x, y; // Screen relative position coord_t width, height; // Dimensions of this window color_t color, bgcolor; // Current drawing colors + bool_t enabled; // Enabled/Disabled state #if GDISP_NEED_TEXT font_t font; // Current font #endif -- cgit v1.2.3 From 757b28531f944a01edf3d64bf9608cde8ffeffba Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Mon, 20 May 2013 16:18:10 +0200 Subject: added enable and disable APIs to high level GWIN code --- include/gwin/gwin.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'include/gwin/gwin.h') diff --git a/include/gwin/gwin.h b/include/gwin/gwin.h index c7b20008..d1192bc7 100644 --- a/include/gwin/gwin.h +++ b/include/gwin/gwin.h @@ -87,6 +87,15 @@ GHandle gwinCreateWindow(GWindowObject *gw, coord_t x, coord_t y, coord_t width, */ void gwinDestroyWindow(GHandle gh); +/** + * @brief Enable or disable a widget (of any type). + * + * @param[in] gh The window handle + * + * @api + */ +void gwinSetEnabled(GHandle gh, bool_t enabled); + /** * @brief Get the X coordinate of the window * @details Returns the X coordinate of the origin of the window. @@ -138,6 +147,20 @@ void gwinDestroyWindow(GHandle gh); */ #define gwinSetBgColor(gh, bgclr) (gh)->bgcolor = (bgclr) +/** + * @brief Enable a window of any type + * + * @param[in] gh The window handle + */ +#define gwinEnable(gh) gwinSetEnabled(gh, TRUE) + +/** + * @brief Disable a window of any type + * + * @param[in] gh The window handle + */ +#define gwinDisable(gh) gwinSetEnabled(gh, FALSE) + /* Set up for text */ #if GDISP_NEED_TEXT || defined(__DOXYGEN__) -- cgit v1.2.3 From fefdd42d7d2bd0231b391c30b8edb4caba5b9b85 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Mon, 20 May 2013 16:43:40 +0200 Subject: doxygen fix --- include/gwin/gwin.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/gwin/gwin.h') diff --git a/include/gwin/gwin.h b/include/gwin/gwin.h index d1192bc7..710c86ba 100644 --- a/include/gwin/gwin.h +++ b/include/gwin/gwin.h @@ -91,6 +91,7 @@ void gwinDestroyWindow(GHandle gh); * @brief Enable or disable a widget (of any type). * * @param[in] gh The window handle + * @param[in] enabled Enable or disable the widget * * @api */ -- cgit v1.2.3