Hi,
I put a child window onto my ItemEntry. With MousePassThroughEnabled be True, the ItemEntry looks fine. But I want the child window to handle some mouse events, such as clicked. So I am in a dilemma now, if the child window's MousePassThroughEnabled is True, the chiled window cannot receive the clicked event, otherwise, if the chiled window's MousePassThroughEnabled is False, the child is ok, but the ItemEntry cannot switch to hover state when mouse moves into the child, and cannot switch to selected state if clicked in the child, even when the child does not actually handle that click.
I cannot rewrite my ItemEntry using no child windows, because my child window is something complex custom window.
problem about ItemEntry
Moderators: CEGUI MVP, CEGUI Team
- scriptkid
- Home away from home
- Posts: 1178
- Joined: Wed Jan 12, 2005 12:06
- Location: The Hague, The Netherlands
- Contact:
Re: problem about ItemEntry
Interesting. I'm not sure whether the mouse can be in more then one window at the same time. You could easily check this by adding MouseEnter and MouseLeave listeners to both your parent and child to catch those.
If it weren't for the hover state (visually), you could trap all events in your main item entry, and, in case of a click loop all children to check if the mouse is inside one of them, and them perform a click action programatically on it.
I will try to fiddle a bit inside on of the sample files myself, since i'm curious too![Smile :)](./images/smilies/icon_smile.gif)
If it weren't for the hover state (visually), you could trap all events in your main item entry, and, in case of a click loop all children to check if the mouse is inside one of them, and them perform a click action programatically on it.
I will try to fiddle a bit inside on of the sample files myself, since i'm curious too
![Smile :)](./images/smilies/icon_smile.gif)
Check out my released snake game using Cegui!
Re: problem about ItemEntry
It seems that we have to manually dispatch the clicked events for such ItemEntries. It looks not so beautiful, but it should work. I'll try it! Thank you!
- scriptkid
- Home away from home
- Posts: 1178
- Joined: Wed Jan 12, 2005 12:06
- Location: The Hague, The Netherlands
- Contact:
Re: problem about ItemEntry
Hi, yes. I have setup a little sample. And as soon as a child gets mouse focus, the parent looses it. However, when dispatching the mouse events to children, only the parent item will appear to have focus, be clicked or what ever. But if it's enough when only your ItemEntries look hovered, then this should be a fairly common solution imo.
Good luck!
Good luck!
Check out my released snake game using Cegui!
Re: problem about ItemEntry
![Very Happy :D](./images/smilies/icon_biggrin.gif)
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 5 guests