Add option GWIN_BUTTON_LAZY_RELEASE
Add option GWIN_BUTTON_LAZY_RELEASE. When set to true in gfxconf.h it changes gwin button behaviour to not require the mouse/touch be over the button when it is released.
This commit is contained in:
parent
57435fb4c2
commit
dddbb25930
3 changed files with 354 additions and 346 deletions
|
@ -87,6 +87,7 @@
|
||||||
#define GEVENT_MAX_SOURCE_LISTENERS 32
|
#define GEVENT_MAX_SOURCE_LISTENERS 32
|
||||||
#define GTIMER_THREAD_WORKAREA_SIZE 512
|
#define GTIMER_THREAD_WORKAREA_SIZE 512
|
||||||
#define GADC_MAX_LOWSPEED_DEVICES 4
|
#define GADC_MAX_LOWSPEED_DEVICES 4
|
||||||
|
#define GWIN_BUTTON_LAZY_RELEASE FALSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Optional Low Level Driver Definitions */
|
/* Optional Low Level Driver Definitions */
|
||||||
|
|
|
@ -62,9 +62,12 @@
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*
|
*
|
||||||
* @name GWIN Optional Sizing Parameters
|
* @name GWIN Optional Parameters
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
#ifndef GWIN_BUTTON_LAZY_RELEASE
|
||||||
|
#define GWIN_BUTTON_LAZY_RELEASE FALSE
|
||||||
|
#endif
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
#endif /* _GWIN_OPTIONS_H */
|
#endif /* _GWIN_OPTIONS_H */
|
||||||
|
|
|
@ -87,6 +87,9 @@ static void gwinButtonCallback(void *param, GEvent *pe) {
|
||||||
gbw->state = GBTN_UP;
|
gbw->state = GBTN_UP;
|
||||||
gwinButtonDraw((GHandle)param);
|
gwinButtonDraw((GHandle)param);
|
||||||
|
|
||||||
|
#if GWIN_BUTTON_LAZY_RELEASE
|
||||||
|
break;
|
||||||
|
#else
|
||||||
// If the mouse up was over the button then create the event
|
// If the mouse up was over the button then create the event
|
||||||
if (pme->x >= gbw->gwin.x && pme->x < gbw->gwin.x + gbw->gwin.width
|
if (pme->x >= gbw->gwin.x && pme->x < gbw->gwin.x + gbw->gwin.width
|
||||||
&& pme->y >= gbw->gwin.y && pme->y < gbw->gwin.y + gbw->gwin.height)
|
&& pme->y >= gbw->gwin.y && pme->y < gbw->gwin.y + gbw->gwin.height)
|
||||||
|
@ -94,6 +97,7 @@ static void gwinButtonCallback(void *param, GEvent *pe) {
|
||||||
|
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(GINPUT_NEED_TOGGLE) && GINPUT_NEED_TOGGLE
|
#if defined(GINPUT_NEED_TOGGLE) && GINPUT_NEED_TOGGLE
|
||||||
case GEVENT_TOGGLE:
|
case GEVENT_TOGGLE:
|
||||||
|
|
Loading…
Add table
Reference in a new issue