Hi folks,
A question for you custom widget experts…
I am automating button activation of my UI for test automation, but am
having an issue with my custom widget not responding. Normal buttons
respond to the PtSendEventToWidget() calls just fine. The custom button
widget operates normally/fine on the touch screen. The issue is with
using PtSendEventToWidget() to activate it for automation.
My custom widget behaves as a button. It has additional labels that are
overlaid to reflect various information/status.
I am wondering if there is a resource or something I should set? I
tried setting some raw callbacks in the resources structure when you
create your widget class. This worked, but the touch screen
interraction stopped behaving nicely (dragging finger would activate
while pressed, or various other weird combinations). The raw callbacks
were set to Ph_EV_BUT_PRESS and _RELEASE. Again, this did not work
well, as it messed up the normal behavior. I just need to know how to
get an event through to the button component of my widget.
My custom widget’s structure looks like this:
typedef struct
{
PtCompoundWidget_t compound;
PtWidget_t *button; // heart of widget
PtWidget_t *components[ IB_NUM_WIDGET_TYPES ]; // various overlay labels
PtCallbackList_t *activate; // callback
} InteractiveButtonWidget_t;
typedef union
{
PtWidget_t core;
PtBasicWidget_t basic;
PtContainerWidget_t container;
PtCompoundWidget_t compound;
InteractiveButtonWidget_t ibutton;
} InteractiveButtonUnion_t;
The ‘button’ element is set to make a call to the function identified by
‘activate’. The callback function specified in the app builder is
stored in ‘activate’.
I am sending the following sequence to any button:
struct{
PhEvent_t event;
PhRect_t rect;
PhPointerEvent_t pevent;
} new_event;
memset( &new_event.rect, -1 , sizeof( new_event.rect ) );
new_event.event.processing_flags = 0;
new_event.event.type = Ph_EV_BUT_PRESS;
new_event.pevent.click_count = 1;
new_event.pevent.buttons = Ph_BUTTON_SELECT;
new_event.event.num_rects = 1;
PtSendEventToWidget( button, (PhEvent_t *) &new_event);
PtSendEventToWidget( button, (PhEvent_t *) &new_event );
memset( &new_event.rect, -1 , sizeof( new_event.rect ) );
new_event.event.type = Ph_EV_BUT_RELEASE;
new_event.event.subtype = Ph_EV_RELEASE_REAL;
new_event.pevent.click_count = 1;
new_event.pevent.buttons = Ph_BUTTON_SELECT;
new_event.event.num_rects = 1;
PtSendEventToWidget( button, (PhEvent_t *) &new_event );
This is QNX4, and I’ve looked through all the documentation and the
/qnx4/phtk example widgets, but did not see anything that seemed
applicable there.
Thank you (please modify my email address to reply – or reply to the
group),
Barry