From 1641e03aacbe459d4af8ebbf55aa9c0f1300cc8b Mon Sep 17 00:00:00 2001 From: cutealien Date: Sat, 17 Jul 2010 18:29:11 +0000 Subject: [PATCH] Add IGUIElement::bringToBack (patch written by DtD, although I'm to blame for the function-name) git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3356 dfc29bdd-3216-0410-991c-e03cc46cb475 --- changes.txt | 4 +++- include/IGUIElement.h | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/changes.txt b/changes.txt index 2c9555c1..2446c7c5 100644 --- a/changes.txt +++ b/changes.txt @@ -1,5 +1,7 @@ + - Add IGUIElement::bringToBack (patch written by DtD, although I'm to blame for the function-name) + ----------------------------- -Changes in 1.7.1 (05.07.2010) TA +Changes in 1.7.1 (05.07.2010) TA (eh... why 1.7.1? Trunk is for 1.8) - BurningVideo - add Normalmap Rendering ( one light only), pushed Burningvideo to 0.46 - add Stencil Shadow Rendering (one color only and 32 bit only), pushed Burningvideo to 0.47 diff --git a/include/IGUIElement.h b/include/IGUIElement.h index cfdcf185..123e52bc 100644 --- a/include/IGUIElement.h +++ b/include/IGUIElement.h @@ -538,6 +538,27 @@ public: } + //! Moves a child to the back, so it's siblings are drawn on top of it + /** \return True if successful, false if not. */ + virtual bool bringToBack(IGUIElement* child) + { + core::list::Iterator it = Children.begin(); + if (child == (*it)) // already there + return true; + for (; it != Children.end(); ++it) + { + if (child == (*it)) + { + Children.erase(it); + Children.push_front(child); + return true; + } + } + + _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; + return false; + } + //! Returns list with children of this element virtual const core::list& getChildren() const {