You really need to search the forums and main docs before asking these types of questions. They can be answered using simple logic and reasoning, skills you should have developed by the age of 12. I don't mean to offend, but when the answer to your question is already available and you ask it anyway, it insinuates that you feel your time is more valuable than those of us who actually offer help to others via the forum. In most cases, these threads will go completely unanswered. But since I am feeling generous today...
Here is what you know 1) you are subscribing to a mouse-based event (
EventMouseClick), 2) this signature of the function handling the event (OtherDialog::aHandle) must take a reference to an
EventArgs object, and 3) you want to know how to determine if the
right button was pressed.
So, from these pieces of information you can use the
Main Docs to deduce the answer. First, take a look at the
Class Heirarchy. From here you can see an object called
MouseEventArgs being subclassed from
EventArgs. Looking at the MouseEventArgs object, you can see that it has a member called
button that is typed as a
MouseButton enum. Looking as this enum, you can see an item called
RightButton.
So, now that you know where the information is, you just need to access that information from within OtherDialog::aHandle. Since you already know that MouseEventArgs derives from EventArgs, you can presume via reasoning that you should cast the EventArgs object you receive to an MouseEventArgs object, and then access the button member to determine which button was clicked. Ex:
Code: Select all
bool OtherDialog::aHandle(const CEGUI::EventArgs& e)
{
const CEGUI::MouseEventArgs& args = reinterpret_cast<const CEGUI::MouseEventArgs&>(e);
if (args.button != CEGUI::RightButton)
{
return false;
}
...
}
Now that wasn't so difficult, was it....