Hi all,
I have looked through the tutorials and the API, but couldn't find a way to make an image clickable...(for instance, there's no MouseClicked event for StaticImage)
How do I go about making a clickable image? Can I derive a class from PushButton but hides its borders (is that possible in the first place)
Many thanks in advance!
Clickable Image
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Hi
The MouseClicked event is inherited by all controls from the Window base class; so it should actually work for you.
If not things to check are to make sure the SingleClickTimeout is set to something acceptable in the CEGUI::System class, and that you are injecting mouse button down and up events properly.
CE.
The MouseClicked event is inherited by all controls from the Window base class; so it should actually work for you.
If not things to check are to make sure the SingleClickTimeout is set to something acceptable in the CEGUI::System class, and that you are injecting mouse button down and up events properly.
CE.
CrazyEddie wrote:Hi
The MouseClicked event is inherited by all controls from the Window base class; so it should actually work for you.
If not things to check are to make sure the SingleClickTimeout is set to something acceptable in the CEGUI::System class, and that you are injecting mouse button down and up events properly.
CE.
Hi CE,
Thanks for the reply, I will check it out. But just a clarification...for a pushbutton, when you subscribe an event to it, you use PushButton::EventClicked...there's no such thing for StaticImage...
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Hi
The PushButton::EventClicked is a specialised event introduced by the PushButton class, however, Window::EventMouseClicked is available for all of the widget and window classes...
For example:
Would work regardless of the actual widget class of 'myStaticImage'.
HTH
CE
The PushButton::EventClicked is a specialised event introduced by the PushButton class, however, Window::EventMouseClicked is available for all of the widget and window classes...
For example:
Code: Select all
myStaticImage->subscribeEvent( Window::EventMouseClick, &myHandler );
Would work regardless of the actual widget class of 'myStaticImage'.
HTH
CE
Who is online
Users browsing this forum: No registered users and 35 guests