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://ogre.sourceforge.net/
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 #include "OgreEventDispatcher.h"
00033 
00034 
00035 namespace Ogre {
00036 
00037 
00048     class _OgreExport GuiContainer : public GuiElement
00049     {
00050     public:
00051         typedef std::map<String, GuiElement*> ChildMap;
00052         typedef MapIterator<ChildMap> ChildIterator;
00053         typedef std::map<String, GuiContainer*> ChildContainerMap;
00054         typedef MapIterator<ChildContainerMap> ChildContainerIterator;
00055     protected:
00056         // Map of all children
00057         ChildMap mChildren;
00058         // Map of container children (subset of mChildren)
00059         ChildContainerMap mChildContainers;
00060  
00061     public:
00063         GuiContainer(const String& name);
00064         virtual ~GuiContainer();
00065 
00067         virtual void addChild(GuiElement* elem);
00069         virtual void addChild(GuiContainer* cont);
00071         virtual void removeChild(const String& name);
00073         virtual GuiElement* getChild(const String& name);
00074 
00076         virtual ChildIterator getChildIterator(void);
00077 
00082         virtual ChildContainerIterator getChildContainerIterator(void);
00083 
00085         virtual void _update(void);
00086 
00088         virtual void _notifyZOrder(ushort newZOrder);
00089 
00091         virtual void _updateRenderQueue(RenderQueue* queue);
00092 
00094         inline bool isContainer()
00095         { return true; }
00096 
00098         virtual GuiElement* findElementAt(Real x, Real y);      // relative to parent
00099 
00100         void copyFromTemplate(GuiElement* templateGui);
00101 
00102     };
00103 
00104 
00105 
00106 }
00107 
00108 
00109 #endif
00110 

Copyright © 2002 by The OGRE Team