Clickable Image

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

extrakun
Just popping in
Just popping in
Posts: 8
Joined: Sun Sep 17, 2006 11:47

Clickable Image

Postby extrakun » Sun Sep 17, 2006 22:34

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!

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Mon Sep 18, 2006 17:48

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.

extrakun
Just popping in
Just popping in
Posts: 8
Joined: Sun Sep 17, 2006 11:47

Postby extrakun » Tue Sep 19, 2006 09:07

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...

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Tue Sep 19, 2006 17:54

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


Return to “Help”

Who is online

Users browsing this forum: No registered users and 30 guests