borderobject.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2004-2005 by Reality Rift Studios                       *
00003  *   http://www.realityrift.com  -  mattias@realityrift.com                *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 #ifndef neo_gui_borderobject_h
00022 #define neo_gui_borderobject_h
00023 
00027 #include "../core/platform.h"
00028 
00029 #if NEO_ENABLE_GUI
00030 
00031 #include "object.h"
00032 
00033 namespace neo {
00034 namespace gui {
00035 
00048 class BorderObject : public Object
00049 {
00050     public:
00051 
00053     enum ObjectID
00054     {
00056         TOPLEFT                                             = 0x00,
00057 
00059         TOP                                                 = 0x01,
00060 
00062         TOPRIGHT                                            = 0x02,
00063 
00065         LEFT                                                = 0x03,
00066 
00068         CENTER                                              = 0x04,
00069 
00071         RIGHT                                               = 0x05,
00072 
00074         BOTTOMLEFT                                          = 0x06,
00075 
00077         BOTTOM                                              = 0x07,
00078 
00080         BOTTOMRIGHT                                         = 0x08
00081     };
00082     
00084 
00089                                                             BorderObject( unsigned int id = 0, const std::string& name = "", Object* p_parent = 0, bool nocreate = false );
00090 
00092     virtual                                                ~BorderObject();
00093     
00095     void                                                    createObjects();
00096     
00098 
00101     static const std::string&                               getSubobjectName( ObjectID id );
00102 
00103     protected:
00104 
00105     virtual void                                            onResize();
00106     virtual void                                            onEvent( const Event& event );
00107     virtual void                                            onAttached( Object* p_object );
00108     virtual void                                            onDetached( Object* p_object );
00109     
00111 
00113     virtual Object*                                         createObject( ObjectID obj ) const = 0;
00114 
00115     private:
00116 
00118     void                                                    layoutBorders();
00119 
00121     bool                                                    _inLayout;
00122 
00124     static const std::string                                _borderNames[ BOTTOMRIGHT + 1 ];
00125 };
00126 
00127 }
00128 }
00129 
00130 #endif
00131 
00132 #endif

Generated on Sat Feb 17 20:50:47 2007 for NeoEngine 2 - Evolution by  doxygen 1.5.1