Mouse over combobox

JezzaP

29-07-2009 17:18:46

How can I detect whether the mouse is over a combobox - specifically during a mouse click so that the normal behaviour of the mouse is not run.
Thanks.

Altren

29-07-2009 23:54:34

You can disable combobox. (setEnabled(false)) if you want to disable normal behaviour.
Or tell me what you want to have as result?

JezzaP

31-07-2009 16:34:03

Sorry for late reply - compute troubles :S.
I have a function that normally runs when the mouse is clicked. It selects and deselects objects. But when I click on one of the widgets (this now needs to be for combo box and edit) I don't want the selected object to be deselected - i.e. the function not to be run. How do I check if the mouse was clicked over these widgets. For buttons, I use eventMouseButtonPressed which seems to work, but combobox and edit dont seem to call this when they are clicked on.

Altren

31-07-2009 20:23:10

Oh, so you want to check if you clicked on GUI or not?
virtual bool mousePressed( const OIS::MouseEvent &arg, OIS::MouseButtonID id )
{
if ( mGUI->injectMousePress(arg, id) ) return true;
// your not related to GUI code here
// ...
}
All inject*** functions return true if event was handled MyGUI and else if it wasn't.

JezzaP

31-07-2009 20:45:30

Thank you
P.S. MyGUI is awesome, much prefer it to CEGUI. Keep up the good work.