Custom Widget handler? | developer.brewmp.com Custom Widget handler? | developer.brewmp.com

Developer

Custom Widget handler?

Forums:

Hi, I have created a list widget wrapped around a static widget and is using Menu Model. I have created a custom handler for the list widget. I have registered it using IWidget_SetHandler function.
Now the problem is, I want to handle only one event in my custom handler and rest all event I want to send it to default handler. So, How do I escalate this event to default handler?

I have tried following things and it did not work
1) Returning FALSE for all the other events.
2) Calling IWidget_HandleEvent function: But this in turn again calls my custom handler( probably because I have registered my custom handler!!)

Anything else, I could try. Please help.

I forgot to mention one more point. I am not using Root Container or Root Form. Instead I am creating a window for this list widget. Something like a pop-up.

I forgot to mention one more point. I am not using Root Container or Root Form. Instead I am creating a window for this list widget. Something like a pop-up.

Call HANDLERDESC_Call() to pass the event on to the default event handler. Don't forget to return the value returned by HANDLERDESC_Call().

Call HANDLERDESC_Call() to pass the event on to the default event handler. Don't forget to return the value returned by HANDLERDESC_Call().

Hi Eric, I tried using this function but it did not work.
I checked out in one of the window example application how they used HANDLERDESC_Call function. It was like :
HANDLERDESC_CALL(&pWindow->hdHandler, eCode, wParam, dwParam);
Here, the first parameter is HandlerDesc and rest are same for event handling function. I used exactly the same but it did not happen.
Let me explain my application.
I have created a window application. When my application starts, a list widget wrapped around a static widget is created. I have created a Menu Model and added this widget as a listener. I have created a handler ,MyEventHandler() ,for the list widget. In MyEventHandler() I am handling only one key event i.e. AVK_SELECT.
Then a root container is created and this widget is pushed into that. Now, a Window is created for this root container.
So, when the application starts I am able to see all the items in the list. The first item is in focus by default. When I press Select, I get an event in MyEventHandler() and I am able to handle is properly.
But when I press Down arrow key, I get an even of AV_DOWN in MyEventHandler(). Here if I call HANDLERDESC_Call() to acheive scroll down event for the list widget, it does not work.
Can you see any problem with this.
Also, I have tried IWidget_HandleEvent as well. If for AVK_DOWN event in MyEventHandler I call IWidgetHandleEvent, it again calls MyEventHandler recursively and eventually the program crashes cause of stack overflow.

Hi Eric, I tried using this function but it did not work.
I checked out in one of the window example application how they used HANDLERDESC_Call function. It was like :
HANDLERDESC_CALL(&pWindow->hdHandler, eCode, wParam, dwParam);
Here, the first parameter is HandlerDesc and rest are same for event handling function. I used exactly the same but it did not happen.
Let me explain my application.
I have created a window application. When my application starts, a list widget wrapped around a static widget is created. I have created a Menu Model and added this widget as a listener. I have created a handler ,MyEventHandler() ,for the list widget. In MyEventHandler() I am handling only one key event i.e. AVK_SELECT.
Then a root container is created and this widget is pushed into that. Now, a Window is created for this root container.
So, when the application starts I am able to see all the items in the list. The first item is in focus by default. When I press Select, I get an event in MyEventHandler() and I am able to handle is properly.
But when I press Down arrow key, I get an even of AV_DOWN in MyEventHandler(). Here if I call HANDLERDESC_Call() to acheive scroll down event for the list widget, it does not work.
Can you see any problem with this.
Also, I have tried IWidget_HandleEvent as well. If for AVK_DOWN event in MyEventHandler I call IWidgetHandleEvent, it again calls MyEventHandler recursively and eventually the program crashes cause of stack overflow.

It sounds like you're doing the right thing, so there must be a bug in your implementation. Perhaps you could post some code.

It sounds like you're doing the right thing, so there must be a bug in your implementation. Perhaps you could post some code.