aboutsummaryrefslogtreecommitdiffstats
path: root/src/gwin/gwin_slider.h
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2014-12-06 15:48:47 +1000
committerinmarket <andrewh@inmarket.com.au>2014-12-06 15:48:47 +1000
commit5bf2b8678a5a58059baffe780d00cd570781cea7 (patch)
tree001a4d387ecfb39b79c1863a643e36966fd39638 /src/gwin/gwin_slider.h
parent4931f39a0d26f53a03834cfdc65d5e365a928652 (diff)
downloaduGFX-5bf2b8678a5a58059baffe780d00cd570781cea7.tar.gz
uGFX-5bf2b8678a5a58059baffe780d00cd570781cea7.tar.bz2
uGFX-5bf2b8678a5a58059baffe780d00cd570781cea7.zip
Extended slider events. Updated the demo to match.
Actually reduced code size :)
Diffstat (limited to 'src/gwin/gwin_slider.h')
-rw-r--r--src/gwin/gwin_slider.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/gwin/gwin_slider.h b/src/gwin/gwin_slider.h
index b88d6dfd..91a381a5 100644
--- a/src/gwin/gwin_slider.h
+++ b/src/gwin/gwin_slider.h
@@ -27,12 +27,18 @@
#define GEVENT_GWIN_SLIDER (GEVENT_GWIN_CTRL_FIRST+1)
typedef struct GEventGWinSlider {
- GEventType type; // The type of this event (GEVENT_GWIN_BUTTON)
+ GEventType type; // The type of this event (GEVENT_GWIN_SLIDER)
GHandle gwin; // The slider that is returning results
#if GWIN_WIDGET_TAGS
WidgetTag tag; // The slider tag
#endif
int position;
+
+ uint8_t action;
+ #define GSLIDER_EVENT_SET 4 /* Slider position is set. This is the only event returned by default */
+ #define GSLIDER_EVENT_CANCEL 3 /* Slider position changing has been cancelled */
+ #define GSLIDER_EVENT_START 2 /* Slider position has started changing */
+ #define GSLIDER_EVENT_MOVE 1 /* Slider position has been moved */
} GEventGWinSlider;
// There are currently no GEventGWinSlider listening flags - use 0
@@ -124,6 +130,19 @@ void gwinSliderSetPosition(GHandle gh, int pos);
#define gwinSliderGetPosition(gh) (((GSliderObject *)(gh))->pos)
/**
+ * @brief Should the slider send extended events.
+ *
+ * @param[in] gh The window handle (must be a slider window)
+ * @param[in] enabled TRUE to enable extended events, FALSE to disable them
+ *
+ * @note The slider by default will only send slider events with an action of GSLIDER_EVENT_SET.
+ * This call can be used to enable other slider action's to be sent as events
+ *
+ * @api
+ */
+void gwinSliderSendExtendedEvents(GHandle gh, bool_t enabled);
+
+/**
* @brief Some custom slider drawing routines
* @details These function may be passed to @p gwinSetCustomDraw() to get different slider drawing styles
*