Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OgreGuiContainer.h

Go to the documentation of this file.
00001 /*
00002 -----------------------------------------------------------------------------
00003 This source file is part of OGRE
00004     (Object-oriented Graphics Rendering Engine)
00005 For the latest info, see http://www.ogre3d.org/
00006 
00007 Copyright © 2000-2002 The OGRE Team
00008 Also see acknowledgements in Readme.html
00009 
00010 This program is free software; you can redistribute it and/or modify it under
00011 the terms of the GNU Lesser General Public License as published by the Free Software
00012 Foundation; either version 2 of the License, or (at your option) any later
00013 version.
00014 
00015 This program is distributed in the hope that it will be useful, but WITHOUT
00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
00018 
00019 You should have received a copy of the GNU Lesser General Public License along with
00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
00022 http://www.gnu.org/copyleft/lesser.txt.
00023 -----------------------------------------------------------------------------
00024 */
00025 
00026 #ifndef __GuiContainer_H__
00027 #define __GuiContainer_H__
00028 
00029 #include "OgrePrerequisites.h"
00030 #include "OgreGuiElement.h"
00031 #include "OgreIteratorWrappers.h"
00032 
00033 
00034 namespace Ogre {
00035 
00036 
00047     class _OgreExport GuiContainer : public GuiElement
00048     {
00049     public:
00050         typedef std::map<String, GuiElement*> ChildMap;
00051         typedef MapIterator<ChildMap> ChildIterator;
00052         typedef std::map<String, GuiContainer*> ChildContainerMap;
00053         typedef MapIterator<ChildContainerMap> ChildContainerIterator;
00054     protected:
00055         // Map of all children
00056         ChildMap mChildren;
00057         // Map of container children (subset of mChildren)
00058         ChildContainerMap mChildContainers;
00059 
00060         bool mChildrenProcessEvents;
00061  
00062     public:
00064         GuiContainer(const String& name);
00065         virtual ~GuiContainer();
00066 
00068         virtual void addChild(GuiElement* elem);
00070         virtual void addChildImpl(GuiElement* elem);
00072         virtual void addChildImpl(GuiContainer* cont);
00074         virtual void removeChild(const String& name);
00076         virtual GuiElement* getChild(const String& name);
00077 
00079         virtual ChildIterator getChildIterator(void);
00080 
00085         virtual ChildContainerIterator getChildContainerIterator(void);
00086 
00088         virtual void _positionsOutOfDate(void);
00089 
00091         virtual void _update(void);
00092 
00094         virtual void _notifyZOrder(ushort newZOrder);
00095 
00097         virtual void _notifyParent(GuiContainer* parent, Overlay* overlay);
00098 
00100         virtual void _updateRenderQueue(RenderQueue* queue);
00101 
00103         inline bool isContainer() const
00104         { return true; }
00105 
00107         virtual inline bool isChildrenProcessEvents() const
00108         { return true; }
00109 
00111         virtual inline void setChildrenProcessEvents(bool val)
00112         { mChildrenProcessEvents = val; }
00113 
00115         virtual GuiElement* findElementAt(Real x, Real y);      // relative to parent
00116 
00117         void copyFromTemplate(GuiElement* templateGui);
00118 
00119     };
00120 
00121 
00122 
00123 }
00124 
00125 
00126 #endif
00127 

Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:10:13 2004