Updates to slider demo

This commit is contained in:
inmarket 2014-12-13 18:34:07 +10:00
parent d7896289d1
commit 21a26eb762
2 changed files with 11 additions and 1 deletions

View File

@ -42,12 +42,14 @@
#define GFX_USE_GINPUT TRUE #define GFX_USE_GINPUT TRUE
#define GFX_USE_GEVENT TRUE #define GFX_USE_GEVENT TRUE
#define GFX_USE_GTIMER TRUE #define GFX_USE_GTIMER TRUE
#define GFX_USE_GQUEUE TRUE
/* Features for the GDISP sub-system. */ /* Features for the GDISP sub-system. */
#define GDISP_NEED_VALIDATION TRUE #define GDISP_NEED_VALIDATION TRUE
#define GDISP_NEED_CLIP TRUE #define GDISP_NEED_CLIP TRUE
#define GDISP_NEED_CIRCLE TRUE #define GDISP_NEED_CIRCLE TRUE
#define GDISP_NEED_TEXT TRUE #define GDISP_NEED_TEXT TRUE
#define GDISP_NEED_MULTITHREAD TRUE
/* GDISP fonts to include */ /* GDISP fonts to include */
#define GDISP_INCLUDE_FONT_UI2 TRUE #define GDISP_INCLUDE_FONT_UI2 TRUE
@ -61,5 +63,8 @@
/* Features for the GINPUT subsystem. */ /* Features for the GINPUT subsystem. */
#define GINPUT_NEED_MOUSE TRUE #define GINPUT_NEED_MOUSE TRUE
/* Features for the GQUEUE subsystem. */
#define GQUEUE_NEED_ASYNC TRUE
#endif /* _GFXCONF_H */ #endif /* _GFXCONF_H */

View File

@ -50,6 +50,11 @@ static void createWidgets(void) {
// Set slider 2 to return extended events // Set slider 2 to return extended events
gwinSliderSendExtendedEvents(ghSlider2, TRUE); gwinSliderSendExtendedEvents(ghSlider2, TRUE);
// Some options to try
//gwinSliderSetRange(ghSlider1, 0, 70000);
//gwinSliderSetRange(ghSlider2, -4, 4);
//gwinSliderSetRange(ghSlider1, 4, -4);
// Console to display slider events // Console to display slider events
wi.g.y = 40; wi.g.x = 40; wi.g.width = gdispGetWidth()-50; wi.g.height = gdispGetHeight()-50; wi.g.y = 40; wi.g.x = 40; wi.g.width = gdispGetWidth()-50; wi.g.height = gdispGetHeight()-50;
ghConsole = gwinConsoleCreate(0, &wi.g); ghConsole = gwinConsoleCreate(0, &wi.g);
@ -90,7 +95,7 @@ int main(void) {
case GSLIDER_EVENT_START: sAction = "START"; break; case GSLIDER_EVENT_START: sAction = "START"; break;
default: sAction = "????"; break; default: sAction = "????"; break;
} }
gwinPrintf(ghConsole, "Slider %s = %d%% %s\n", gwinGetText(pe->gwin), pe->position, sAction); gwinPrintf(ghConsole, "Slider %s = %d %s\n", gwinGetText(pe->gwin), pe->position, sAction);
break; break;
default: default: