problem with handleDragEvent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-04-04 3:45 AM
Hello, when I use handleDragEvent and handleClickEvent, widgets such as buttons and sliders that need to be clicked and dragged no longer work. How can I solve this problem?
Solved! Go to Solution.
- Labels:
-
TouchGFX
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-04-04 7:06 PM
Hello mbagh.1,
I suppose you are not too familiar with object-oriented programming but I'll try to explain simply.
When you implement handleClickEvent() in your ScreenView, you are actually overwriting the one from ScreenViewBase. handleClickEvent() is a virtual function which means that the last implementation will be the one that will prevail over all the others.
So to make sure your widgets receive the event correctly you need to recall the function implemented in the ViewBase.
Here is sample code :
//In ScreenView
void ScreenView::handleClickEvent(const ClickEvent& evt)
{
// Do your thing
ScreenViewBase::handleClickEvent(evt);
}
When your question is answered, please close this topic by choosing Select as Best.
/Alexandre
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-04-04 7:06 PM
Hello mbagh.1,
I suppose you are not too familiar with object-oriented programming but I'll try to explain simply.
When you implement handleClickEvent() in your ScreenView, you are actually overwriting the one from ScreenViewBase. handleClickEvent() is a virtual function which means that the last implementation will be the one that will prevail over all the others.
So to make sure your widgets receive the event correctly you need to recall the function implemented in the ViewBase.
Here is sample code :
//In ScreenView
void ScreenView::handleClickEvent(const ClickEvent& evt)
{
// Do your thing
ScreenViewBase::handleClickEvent(evt);
}
When your question is answered, please close this topic by choosing Select as Best.
/Alexandre
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-04-05 3:54 AM
Thank you very much for your excellent guidance
