Commit 46a01b0d authored by bitplane's avatar bitplane

Fixed bug with tab controls not absorbing a mouse-down but expecting to have...

Fixed bug with tab controls not absorbing a mouse-down but expecting to have the focus in a mouse-up,  reported by christianclavet.
Windows are now brought to the front when any of their children are focused.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1212 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 6a1cafc0
...@@ -347,9 +347,9 @@ bool CGUITabControl::OnEvent(const SEvent& event) ...@@ -347,9 +347,9 @@ bool CGUITabControl::OnEvent(const SEvent& event)
case EET_MOUSE_INPUT_EVENT: case EET_MOUSE_INPUT_EVENT:
switch(event.MouseInput.Event) switch(event.MouseInput.Event)
{ {
//case EMIE_LMOUSE_PRESSED_DOWN: case EMIE_LMOUSE_PRESSED_DOWN:
// Environment->setFocus(this); // todo: dragging tabs around
// return true; return true;
case EMIE_LMOUSE_LEFT_UP: case EMIE_LMOUSE_LEFT_UP:
if (selectTab(core::position2d<s32>(event.MouseInput.X, event.MouseInput.Y))) if (selectTab(core::position2d<s32>(event.MouseInput.X, event.MouseInput.Y)))
return true; return true;
......
...@@ -119,10 +119,8 @@ bool CGUIWindow::OnEvent(const SEvent& event) ...@@ -119,10 +119,8 @@ bool CGUIWindow::OnEvent(const SEvent& event)
else else
if (event.GUIEvent.EventType == EGET_ELEMENT_FOCUSED) if (event.GUIEvent.EventType == EGET_ELEMENT_FOCUSED)
{ {
if (event.GUIEvent.Caller == this && Parent) if (isMyChild(event.GUIEvent.Caller) && Parent)
{
Parent->bringToFront(this); Parent->bringToFront(this);
}
} }
else else
if (event.GUIEvent.EventType == EGET_BUTTON_CLICKED) if (event.GUIEvent.EventType == EGET_BUTTON_CLICKED)
...@@ -140,9 +138,8 @@ bool CGUIWindow::OnEvent(const SEvent& event) ...@@ -140,9 +138,8 @@ bool CGUIWindow::OnEvent(const SEvent& event)
// if the event was not absorbed // if the event was not absorbed
if (!Parent->OnEvent(e)) if (!Parent->OnEvent(e))
{
remove(); remove();
}
return true; return true;
} }
......
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