aboutsummaryrefslogtreecommitdiffstats
path: root/include/gwin/gwin.h
diff options
context:
space:
mode:
authorAndrew Hannam <andrewh@inmarket.com.au>2013-05-23 20:35:42 -0700
committerAndrew Hannam <andrewh@inmarket.com.au>2013-05-23 20:35:42 -0700
commit42006a67b5ccfd86f30d8a91cc474681c437eaf6 (patch)
tree39b6fa0bd051f274cdacc1925f262bc1a81b4c5e /include/gwin/gwin.h
parentb5ce2405501aa693fc4c134e3425e74ba0ff7589 (diff)
parent5f2a32714cda6bcfc8829e61895def2f627e1b8f (diff)
downloaduGFX-42006a67b5ccfd86f30d8a91cc474681c437eaf6.tar.gz
uGFX-42006a67b5ccfd86f30d8a91cc474681c437eaf6.tar.bz2
uGFX-42006a67b5ccfd86f30d8a91cc474681c437eaf6.zip
Merge pull request #30 from Tectu/master
Merge Tectu Changes
Diffstat (limited to 'include/gwin/gwin.h')
-rw-r--r--include/gwin/gwin.h25
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__)