Quantcast
Channel: Forum - Recent Threads
Viewing all articles
Browse latest Browse all 5781

Implementing guix + SSP widget handler

$
0
0

Hello,

(SSP1.1.3 and GuiX Studio 5.3 on the DK-S7G2)

My application requires awareness of the touch down and up events for a pixelmap button.  To implement this, I have done the following:

In GuiX Studio, the widget properties define an event handler named LegUpButtonHandler;

Note that the parent window ALSO has its own event handler.

 

I created this event handler for the pixel map button:

UINT LegUpButtonHandler(GX_PIXELMAP_BUTTON *widget, GX_EVENT *event_ptr)
{
UINT result;

result = gx_widget_event_process(widget, event_ptr);

switch(event_ptr->gx_event_type)
{
case (GX_SIGNAL(ID_BUTTON_LEGUP, GX_EVENT_PEN_DOWN)):


[cut]

default:
result = gx_widget_event_process( widget, event_ptr );
break;
}

return result;
}

 

I registered this routine in MainThread_entry.c.  (The program structure is based on your HelloWorld application.)

UINT (*functionPtr)(GX_PIXELMAP_BUTTON *, GX_EVENT *);

functionPtr = &LegUpButtonHandler;
gx_widget_event_process_set(&(settingsWindow.settingsWindow_legupButton), functionPtr );

 

The touch message processing loop in MainThread_entry.c calls ssp_touch_to_guix() and it has:

static bool ssp_touch_to_guix(sf_touch_panel_payload_t * p_touch_payload, GX_EVENT * gx_event)
{
bool send_event = true;

switch (p_touch_payload->event_type)
{
case SF_TOUCH_PANEL_EVENT_DOWN:
gx_event->gx_event_type = GX_EVENT_PEN_DOWN;
break;
case SF_TOUCH_PANEL_EVENT_UP:
gx_event->gx_event_type = GX_EVENT_PEN_UP;
break;
case SF_TOUCH_PANEL_EVENT_HOLD:
case SF_TOUCH_PANEL_EVENT_MOVE:
gx_event->gx_event_type = GX_EVENT_PEN_DRAG;
break;
case SF_TOUCH_PANEL_EVENT_INVALID:
send_event = false;
break;
default:
send_event = false;
break;
}

if (send_event)
{

[cut]
}

return send_event;
}

 

I'm wondering if I should call the button handler from within the window handler.  I didn't see in the guix manual discussion of having both a window handler AND a widget handler.

Any ideas?

Steve


Viewing all articles
Browse latest Browse all 5781

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>