Page 1 of 1
Clickable Image
Posted: Sun Sep 17, 2006 22:34
by extrakun
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!
Posted: Mon Sep 18, 2006 17:48
by CrazyEddie
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.
Posted: Tue Sep 19, 2006 09:07
by extrakun
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...
Posted: Tue Sep 19, 2006 17:54
by CrazyEddie
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:
Code: Select all
myStaticImage->subscribeEvent( Window::EventMouseClick, &myHandler );
Would work regardless of the actual widget class of 'myStaticImage'.
HTH
CE