diff -r 2ba5af9de65e lib/irrlicht/include/IGUIWindow.h --- a/lib/irrlicht/include/IGUIWindow.h Wed Sep 23 15:23:45 2009 +0200 +++ b/lib/irrlicht/include/IGUIWindow.h Wed Sep 23 15:27:37 2009 +0200 @@ -50,6 +50,12 @@ namespace gui //! Get if the window titlebar will be drawn virtual bool getDrawTitlebar() const = 0; + + //! Set if the window should call bringToFront for itself on focus and lmouse_button_down + virtual void setAutoBringToFront(bool enableAutomatic) = 0; + + //! Get if the window will call bringToFront for itself on focus and lmouse_button_down + virtual bool getAutoBringToFront() const = 0; }; diff -r 2ba5af9de65e lib/irrlicht/source/Irrlicht/CGUIWindow.cpp --- a/lib/irrlicht/source/Irrlicht/CGUIWindow.cpp Wed Sep 23 15:23:45 2009 +0200 +++ b/lib/irrlicht/source/Irrlicht/CGUIWindow.cpp Wed Sep 23 15:27:37 2009 +0200 @@ -19,7 +19,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) +: IGUIWindow(environment, parent, id, rectangle), Dragging(false), IsDraggable(true), DrawBackground(true), DrawTitlebar(true), AutoBringToFront(true) { #ifdef _DEBUG setDebugName("CGUIWindow"); @@ -122,7 +122,7 @@ bool CGUIWindow::OnEvent(const SEvent& e else if (event.GUIEvent.EventType == EGET_ELEMENT_FOCUSED) { - if (Parent && ((event.GUIEvent.Caller == this) || isMyChild(event.GUIEvent.Caller))) + if ( AutoBringToFront && (Parent && ((event.GUIEvent.Caller == this) || isMyChild(event.GUIEvent.Caller))) ) Parent->bringToFront(this); } else @@ -161,7 +161,7 @@ bool CGUIWindow::OnEvent(const SEvent& e DragStart.X = event.MouseInput.X; DragStart.Y = event.MouseInput.Y; Dragging = IsDraggable; - if (Parent) + if (AutoBringToFront && Parent) Parent->bringToFront(this); return true; case EMIE_LMOUSE_LEFT_UP: @@ -300,6 +300,18 @@ bool CGUIWindow::getDrawTitlebar() const return DrawTitlebar; } +//! Set if the window should call bringToFront for itself on focus and lmouse_button_down +void CGUIWindow::setAutoBringToFront(bool enableAutomatic) +{ + AutoBringToFront = enableAutomatic; +} + +//! Get if the window will call bringToFront for itself on focus and lmouse_button_down +bool CGUIWindow::getAutoBringToFront() const +{ + return AutoBringToFront; +} + //! Writes attributes of the element. void CGUIWindow::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const { @@ -308,6 +320,7 @@ void CGUIWindow::serializeAttributes(io: out->addBool("IsDraggable", IsDraggable); out->addBool("DrawBackground", DrawBackground); out->addBool("DrawTitlebar", DrawTitlebar); + out->addBool("AutoBringToFront", AutoBringToFront); // Currently we can't just serialize attributes of sub-elements. // To do this we either @@ -330,6 +343,7 @@ void CGUIWindow::deserializeAttributes(i IsDraggable = in->getAttributeAsBool("IsDraggable"); DrawBackground = in->getAttributeAsBool("DrawBackground"); DrawTitlebar = in->getAttributeAsBool("DrawTitlebar"); + AutoBringToFront = in->getAttributeAsBool("AutoBringToFront"); CloseButton->setVisible( in->getAttributeAsBool("IsCloseVisible") ); MinButton->setVisible( in->getAttributeAsBool("IsMinVisible") ); diff -r 2ba5af9de65e lib/irrlicht/source/Irrlicht/CGUIWindow.h --- a/lib/irrlicht/source/Irrlicht/CGUIWindow.h Wed Sep 23 15:23:45 2009 +0200 +++ b/lib/irrlicht/source/Irrlicht/CGUIWindow.h Wed Sep 23 15:27:37 2009 +0200 @@ -63,6 +63,12 @@ namespace gui //! Get if the window titlebar will be drawn virtual bool getDrawTitlebar() const; + //! Set if the window should call bringToFront for itself on focus and lmouse_button_down + virtual void setAutoBringToFront(bool enableAutomatic); + + //! Get if the window will call bringToFront for itself on focus and lmouse_button_down + virtual bool getAutoBringToFront() const; + //! Writes attributes of the element. virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const; @@ -79,6 +85,7 @@ namespace gui bool Dragging, IsDraggable; bool DrawBackground; bool DrawTitlebar; + bool AutoBringToFront; }; } // end namespace gui