From 9ee7c284e63fc419f70ffc3c53eb23590767ee08 Mon Sep 17 00:00:00 2001 From: Andrew Hannam Date: Sun, 7 Apr 2013 16:02:10 +1000 Subject: Add GINPUT Dial, simplify GWIN input assignment Added GINPUT Dial support and a driver that uses GADC to read the dial. Added support for Dial inputs to the GWIN slider. Updated the slider demo for Dial Inputs. Simplified the assigning of inputs to GWIN "widgets" button and slider. Updated the demo's to match the new input to button assignment. --- demos/modules/ginput/touch_driver_test/main.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'demos/modules/ginput/touch_driver_test') diff --git a/demos/modules/ginput/touch_driver_test/main.c b/demos/modules/ginput/touch_driver_test/main.c index 95d29d28..c7866ec3 100644 --- a/demos/modules/ginput/touch_driver_test/main.c +++ b/demos/modules/ginput/touch_driver_test/main.c @@ -201,28 +201,24 @@ StepCalibrate: gwinSetButtonText(ghNext, "Next", FALSE); gsNext = gwinGetButtonSource(ghNext); geventAttachSource(&gl, gsNext, 0); - gwinAttachButtonMouseSource(ghNext, gs); + gwinAttachButtonMouse(ghNext, 0); ghPrev = gwinCreateButton(&gPrev, swidth-100, 0, 50, 20, font, GBTN_NORMAL); gwinSetButtonText(ghPrev, "Back", FALSE); gsPrev = gwinGetButtonSource(ghPrev); geventAttachSource(&gl, gsPrev, 0); - gwinAttachButtonMouseSource(ghPrev, gs); + gwinAttachButtonMouse(ghPrev, 0); #if 0 { - GSourceHandle gsButton1, gsButton2; - // Attach a couple of hardware toggle buttons to our Next and Back buttons as well. // We can always use the mouse to trigger the buttons if you don't want to use hardware toggles. // This code depends on your hardware. Turn it on only if you have // defined a board definition for your toggle driver. Then change // the next two lines to be correct for your hardware. The values // below are correct for the Win32 toggle driver. - gsButton1 = ginputGetToggle(GINPUT_TOGGLE_MOMENTARY1); - gsButton2 = ginputGetToggle(GINPUT_TOGGLE_MOMENTARY2); - gwinAttachButtonToggleSource(ghNext, gsButton2); - gwinAttachButtonToggleSource(ghPrev, gsButton1); + gwinAttachButtonToggle(ghNext, GINPUT_TOGGLE_MOMENTARY1); + gwinAttachButtonToggle(ghPrev, GINPUT_TOGGLE_MOMENTARY2); } #endif } -- cgit v1.2.3