Mouse not over call and Right click select
by Ronald J Nelson · in Torque Game Engine · 08/16/2007 (11:27 pm) · 6 replies
I am trying to find a function that will detect when my mouse is no longer on a GUI so I can make a function call from it. I thought onMouseLeave was it, but no, even added a script call for it and tested it with an echo statement to no avail.
Can someone give me an idea how to do this? Basically I am using the function to close a popup.
I would also like to know where it is that tels the mouse to select items in text lists with the left mouse button. I want to be able to make the right have the ability too, but with a popup function. I got the popups working with just these two minor problems.
Thanks in advance.
Can someone give me an idea how to do this? Basically I am using the function to close a popup.
I would also like to know where it is that tels the mouse to select items in text lists with the left mouse button. I want to be able to make the right have the ability too, but with a popup function. I got the popups working with just these two minor problems.
Thanks in advance.
#2
It doesn't work. Any ideas?
08/17/2007 (12:24 am)
Well I tried this to make it generally availalbe to all GUI elements.void GuiControl::onMouseLeave(const GuiEvent &event)
{
Con::executef(this, 1, "onMouseLeave");
}It doesn't work. Any ideas?
#3
08/17/2007 (5:04 am)
If you are using this for any kind of a button control, you may need to add the Con::executef into guiButtonBase::onMouseLeave, as derivatives of that class don't automatically execute guiControl::methods I believe.
#4
08/17/2007 (7:20 am)
OnMouseLeave is not implemented in the GuiControl class. You should try using a GuiMouseEventCtrl. void GuiMouseEventCtrl::onMouseLeave(const GuiEvent &event)
{
Con::executef(this, 1, "onMouseLeave");
}
#5
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=9421
Now I only need to make the right mouse button select rows in the GuiTextListCtrl as well. This way I can properly use the getselected functions.
08/17/2007 (10:10 am)
Well I tried each of your suggestions with no success. However, I found a wonderful piece of code made by Orion Elenzil that works perfectly for the mouse leave portion of my problem.www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=9421
Now I only need to make the right mouse button select rows in the GuiTextListCtrl as well. This way I can properly use the getselected functions.
#6
08/17/2007 (5:18 pm)
Can someone give me an idea where the gui tells that the left mouse button has selected something in the GuiTextListCtrl? I see a lot of things that look keyboard related but nothing mouse.
Torque 3D Owner Peter Simard
Default Studio Name