How to send generic event from eventhandler.cpp to wiidgets

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
nalin18
Posts: 3
Joined: Wed Jan 14, 2015 6:37 pm

How to send generic event from eventhandler.cpp to wiidgets

Post by nalin18 »

Well I want to send a mouse click event from eventhandler.cpp and then to catch that event in a "widget".cpp file.
But I dont know how to send and catch events.
Can someone please help me with it.?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: How to send generic event from eventhandler.cpp to wiidg

Post by CuteAlien »

Eventhandler and widget are very common terms - meaning there are lot's of those. You have to be a little bit more specific what you are talking about. Are you trying to combine 2 libraries somehow? Which ones?

You have to give a lot of information if you ask for help. As we have no idea otherwise what you are doing. For example which eventhandler.cpp or widget.cpp you are talking about.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
nalin18
Posts: 3
Joined: Wed Jan 14, 2015 6:37 pm

Re: How to send generic event from eventhandler.cpp to wiidg

Post by nalin18 »

Okay, Well I have a class EventHandler which has the onEvent method which is being called every time an event occurs.The software I am using also uses Irrlicht.
It also has certain widgets like scroll bars, spinners etc.

What I want to do is send a generic event from the EventHandler class and catch that for a particular widget.
Like for a certain mouse click I want to get the mouse position but my widget class cannot access SEvent structure.
The eventhandler class is a friend class of the widget class and can access SEvent structure.

So do you now get the picture or want something more.

Sorry,for providing such less info earliar.
Thank You
Nalin
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: How to send generic event from eventhandler.cpp to wiidg

Post by CuteAlien »

So your EventHandler class is about an Irrlicht event handler, do I understand that correct? I do not understand at all yet what your widget class is or does. Is this one of your own classes? What is it supposed to do? Is it some alternative to the Irrlicht GUI system which you are writing yourself?

Maybe it would help if you could show us some actual code what this is about.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply