diff options
Diffstat (limited to 'include/gwin/gwin.h')
-rw-r--r-- | include/gwin/gwin.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/gwin/gwin.h b/include/gwin/gwin.h index 43095643..710c86ba 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 @@ -87,6 +88,16 @@ 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 + * @param[in] enabled Enable or disable the widget + * + * @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. * The coordinate is relative to the physical screen zero point. @@ -137,6 +148,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__) |