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
master
bitplane 2008-01-29 02:24:49 +00:00
parent 6a1cafc09e
commit 46a01b0d0a
2 changed files with 5 additions and 8 deletions

View File

@ -347,9 +347,9 @@ bool CGUITabControl::OnEvent(const SEvent& event)
case EET_MOUSE_INPUT_EVENT:
switch(event.MouseInput.Event)
{
//case EMIE_LMOUSE_PRESSED_DOWN:
// Environment->setFocus(this);
// return true;
case EMIE_LMOUSE_PRESSED_DOWN:
// todo: dragging tabs around
return true;
case EMIE_LMOUSE_LEFT_UP:
if (selectTab(core::position2d<s32>(event.MouseInput.X, event.MouseInput.Y)))
return true;

View File

@ -119,10 +119,8 @@ bool CGUIWindow::OnEvent(const SEvent& event)
else
if (event.GUIEvent.EventType == EGET_ELEMENT_FOCUSED)
{
if (event.GUIEvent.Caller == this && Parent)
{
if (isMyChild(event.GUIEvent.Caller) && Parent)
Parent->bringToFront(this);
}
}
else
if (event.GUIEvent.EventType == EGET_BUTTON_CLICKED)
@ -140,9 +138,8 @@ bool CGUIWindow::OnEvent(const SEvent& event)
// if the event was not absorbed
if (!Parent->OnEvent(e))
{
remove();
}
return true;
}