diff -r 63e735dbc67e lib/irrlicht/source/Irrlicht/CGUIWindow.cpp --- a/lib/irrlicht/source/Irrlicht/CGUIWindow.cpp Wed Sep 23 15:29:09 2009 +0200 +++ b/lib/irrlicht/source/Irrlicht/CGUIWindow.cpp Wed Sep 23 15:31:39 2009 +0200 @@ -20,6 +20,7 @@ namespace gui //! constructor CGUIWindow::CGUIWindow(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect rectangle) : IGUIWindow(environment, parent, id, rectangle), Dragging(false), IsDraggable(true), DrawBackground(true), DrawTitlebar(true), AutoBringToFront(true) +, IsActive(false) { #ifdef _DEBUG setDebugName("CGUIWindow"); @@ -118,12 +119,23 @@ bool CGUIWindow::OnEvent(const SEvent& e if (event.GUIEvent.EventType == EGET_ELEMENT_FOCUS_LOST) { Dragging = false; + IsActive = false; } else if (event.GUIEvent.EventType == EGET_ELEMENT_FOCUSED) { - if ( AutoBringToFront && (Parent && ((event.GUIEvent.Caller == this) || isMyChild(event.GUIEvent.Caller))) ) - Parent->bringToFront(this); + if ( Parent && ((event.GUIEvent.Caller == this) || isMyChild(event.GUIEvent.Caller)) ) + { + IsActive = true; + if ( AutoBringToFront ) + { + Parent->bringToFront(this); + } + } + else + { + IsActive = false; + } } else if (event.GUIEvent.EventType == EGET_BUTTON_CLICKED) @@ -218,7 +230,7 @@ void CGUIWindow::draw() // draw body fast if ( DrawBackground ) { - rect = skin->draw3DWindowBackground(this, DrawTitlebar, skin->getColor(EGDC_ACTIVE_BORDER), + rect = skin->draw3DWindowBackground(this, DrawTitlebar, skin->getColor(IsActive ? EGDC_ACTIVE_BORDER : EGDC_INACTIVE_BORDER), AbsoluteRect, &AbsoluteClippingRect); if (DrawTitlebar && Text.size()) diff -r 63e735dbc67e lib/irrlicht/source/Irrlicht/CGUIWindow.h --- a/lib/irrlicht/source/Irrlicht/CGUIWindow.h Wed Sep 23 15:29:09 2009 +0200 +++ b/lib/irrlicht/source/Irrlicht/CGUIWindow.h Wed Sep 23 15:31:39 2009 +0200 @@ -86,6 +86,7 @@ namespace gui bool DrawBackground; bool DrawTitlebar; bool AutoBringToFront; + bool IsActive; }; } // end namespace gui