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

OgreGuiElements.cpp

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 #include "OgreString.h"
00027 #include "OgreGuiManager.h"
00028 #include "OgreGuiElementFactories.h"
00029 #include "OgreException.h"
00030 #include "OgreStringVector.h"
00031 #include "OgreRoot.h"
00032 #include "OgreCursorGuiElement.h"
00033 #include "OgreOverlayManager.h"
00034 
00035 namespace Ogre {
00036 
00037     //-----------------------------------------------------------------------
00038     GuiElementFactory* pCursorFactory = NULL;
00039     GuiElementFactory* pPanelFactory = NULL;
00040     GuiElementFactory* pBorderPanelFactory = NULL;
00041     GuiElementFactory* pTextAreaFactory = NULL;
00042     GuiElementFactory* pTextBoxFactory = NULL;
00043     GuiElementFactory* pButtonFactory = NULL;
00044     GuiElementFactory* pBorderButtonFactory = NULL;
00045     GuiElementFactory* pListFactory = NULL;
00046     GuiElementFactory* pScrollBarFactory = NULL;
00047     GuiElementFactory* pPopupMenuFactory = NULL;
00048     GuiElementFactory* pTTYFactory = NULL;
00049     CursorGuiElement*  pCursorGui = NULL;
00050     //-----------------------------------------------------------------------
00051 
00052     //-----------------------------------------------------------------------
00053     extern "C" void dllStartPlugin(void)
00054     {
00055         SET_TERM_HANDLER;
00056         
00057         pCursorFactory = new CursorGuiElementFactory();
00058         GuiManager::getSingleton().addGuiElementFactory(pCursorFactory);
00059 
00060         pPanelFactory = new PanelGuiElementFactory();
00061         GuiManager::getSingleton().addGuiElementFactory(pPanelFactory);
00062 
00063         pBorderPanelFactory = new BorderPanelGuiElementFactory();
00064         GuiManager::getSingleton().addGuiElementFactory(pBorderPanelFactory);
00065         
00066         pTextAreaFactory = new TextAreaGuiElementFactory();
00067         GuiManager::getSingleton().addGuiElementFactory(pTextAreaFactory);
00068 
00069         pTextBoxFactory = new TextBoxGuiElementFactory();
00070         GuiManager::getSingleton().addGuiElementFactory(pTextBoxFactory);
00071 
00072         pButtonFactory = new ButtonGuiElementFactory();
00073         GuiManager::getSingleton().addGuiElementFactory(pButtonFactory);
00074 
00075         pBorderButtonFactory = new BorderButtonGuiElementFactory();
00076         GuiManager::getSingleton().addGuiElementFactory(pBorderButtonFactory);
00077 
00078         pListFactory = new ListGuiElementFactory();
00079         GuiManager::getSingleton().addGuiElementFactory(pListFactory);
00080 
00081         pScrollBarFactory = new ScrollBarGuiElementFactory();
00082         GuiManager::getSingleton().addGuiElementFactory(pScrollBarFactory);
00083 
00084         pPopupMenuFactory = new PopupMenuGuiElementFactory();
00085         GuiManager::getSingleton().addGuiElementFactory(pPopupMenuFactory);
00086         
00087         pTTYFactory = new TTYGuiElementFactory();
00088         GuiManager::getSingleton().addGuiElementFactory(pTTYFactory);
00089 
00090             // create default cursor
00091         pCursorGui = new CursorGuiElement("Cursor default");
00092         OverlayManager::getSingleton().setDefaultCursorGui(pCursorGui, pCursorGui);
00093     } 
00094 
00095     //-----------------------------------------------------------------------
00096     extern "C" void dllStopPlugin(void)
00097     {
00098         delete pPanelFactory;
00099         delete pBorderPanelFactory;
00100         delete pTextAreaFactory;
00101         delete pTextBoxFactory;
00102         delete pButtonFactory;
00103         delete pScrollBarFactory;
00104         delete pPopupMenuFactory;
00105         delete pBorderButtonFactory;
00106         delete pListFactory;
00107         delete pCursorGui;
00108         delete pTTYFactory;
00109             delete pCursorFactory; 
00110 
00111     }
00112 
00113 }
00114 

Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:48:28 2004