OK. We've looked into this issue and it has turned out that you have found a bug
The method 'getWindowContainingMouse' will only return the right window
after the MouseLeave handler has been called.
The fix should be in anonymous cvs by wednesday.
If you cannot wait you can work around it by doing the handling in a MouseEnter handler that you subscribe to each button.
MouseEnter handlers get correct results for 'getWindowContainingMouse'.
Another approach to determine if the window is a child of your main menu window is to simply test the return value of 'getParent'. This is a little bit faster as well.
So... while the fix is being committed you can use a MouseEnter handler like this for your buttons:
Code: Select all
// Simple hide the menu routine
bool clsGUIStation::eventMenuButtonMouseEnters(const CEGUI::EventArgs& e)
{
CEGUI::Window* mWnd = static_cast<const CEGUI::WindowEventArgs&>(e).window;
if ( mWnd->getParent() == mGUIMenu ) return true;
mGUIMenu->setPosition( CEGUI::Point( 0.98f, mMenuOpenPos.d_y ) );
return true;
} // eventMenuButtonMouseEnters
HTH and thank you for finding this bug