Commit d73565d1 authored by bitplane's avatar bitplane

Menu fix by CuteAlien.

Bug with double mouse events sent to user receiver, reported by Xplod
Documentation error in IVideoDriver.h

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1043 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 3de449dc
...@@ -595,7 +595,7 @@ namespace video ...@@ -595,7 +595,7 @@ namespace video
virtual u32 getDynamicLightCount() const = 0; virtual u32 getDynamicLightCount() const = 0;
//! Returns light data which was previously set by IVideoDriver::addDynamicLight(). //! Returns light data which was previously set by IVideoDriver::addDynamicLight().
/** \param idx: Zero based index of the light. Must be greater than 0 and smaller /** \param idx: Zero based index of the light. Must be 0 or greater and smaller
than IVideoDriver()::getDynamicLightCount. than IVideoDriver()::getDynamicLightCount.
\return Light data. */ \return Light data. */
virtual const SLight& getDynamicLight(u32 idx) const = 0; virtual const SLight& getDynamicLight(u32 idx) const = 0;
......
...@@ -362,8 +362,11 @@ void CGUIEnvironment::clear() ...@@ -362,8 +362,11 @@ void CGUIEnvironment::clear()
//! called by ui if an event happened. //! called by ui if an event happened.
bool CGUIEnvironment::OnEvent(const SEvent& event) bool CGUIEnvironment::OnEvent(const SEvent& event)
{ {
if (UserReceiver && (event.EventType != EET_GUI_EVENT || event.GUIEvent.Caller != this)) if (UserReceiver && (event.EventType != EET_MOUSE_INPUT_EVENT) &&
(event.EventType != EET_GUI_EVENT || event.GUIEvent.Caller != this))
{
return UserReceiver->OnEvent(event); return UserReceiver->OnEvent(event);
}
return false; return false;
} }
......
...@@ -119,10 +119,11 @@ bool CGUIMenu::OnEvent(const SEvent& event) ...@@ -119,10 +119,11 @@ bool CGUIMenu::OnEvent(const SEvent& event)
if (!Environment->hasFocus(this)) if (!Environment->hasFocus(this))
{ {
Environment->setFocus(this); Environment->setFocus(this);
if (Parent)
Parent->bringToFront(this);
} }
if (Parent)
Parent->bringToFront(this);
core::position2d<s32> p(event.MouseInput.X, event.MouseInput.Y); core::position2d<s32> p(event.MouseInput.X, event.MouseInput.Y);
bool shouldCloseSubMenu = hasOpenSubMenu(); bool shouldCloseSubMenu = hasOpenSubMenu();
if (!AbsoluteClippingRect.isPointInside(p)) if (!AbsoluteClippingRect.isPointInside(p))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment