Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

editbox.h

Go to the documentation of this file.
00001 /***************************************************************************
00002              editbox.h  -  Textbox with borders and input processing
00003                              -------------------
00004     begin                : Sun Mar 2 2003
00005     copyright            : (C) 2003 by Reality Rift Studios
00006     email                : mattias@realityrift.com
00007  ***************************************************************************
00008 
00009  The contents of this file are subject to the Mozilla Public License Version
00010  1.1 (the "License"); you may not use this file except in compliance with
00011  the License. You may obtain a copy of the License at 
00012  http://www.mozilla.org/MPL/
00013 
00014  Software distributed under the License is distributed on an "AS IS" basis,
00015  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00016  for the specific language governing rights and limitations under the
00017  License.
00018 
00019  The Original Code is the NeoEngine, NeoWTK, editbox.h
00020 
00021  The Initial Developer of the Original Code is Mattias Jansson.
00022  Portions created by Mattias Jansson are Copyright (C) 2003
00023  Reality Rift Studios. All Rights Reserved.
00024 
00025  ***************************************************************************/
00026 
00027 #ifndef __NEOWTKEDITBOX_H
00028 #define __NEOWTKEDITBOX_H
00029 
00030 
00031 #include "base.h"
00032 #include "borderarea.h"
00033 
00034 #ifdef HAVE_NEOCHUNKIO
00035 #  include <neochunkio/complex.h>
00036 #  include "chunktype.h"
00037 #endif
00038 
00039 
00046 namespace NeoWTK
00047 {
00048 
00049 
00050 // External classes
00051 class TextArea;
00052 
00053 
00054 // Forward declarations
00055 class EditBoxChunk;
00056 
00057 
00063 class NEOWTK_API EditBox : public BorderArea
00064 {
00065 #ifdef HAVE_NEOCHUNKIO
00066     friend class EditBoxChunk;
00067 #endif
00068 
00069     protected:
00070 
00072         TextArea                                     *m_pkTextArea;
00073 
00075         Object                                       *m_pkCursor;
00076 
00078         bool                                          m_bInputFocus;
00079 
00081         float                                         m_fCursorBlinkTime;
00082 
00083 
00084     public:
00085 
00091                                                       EditBox( Object *pkParent, EditBox *pkObject = 0, bool bCreateAreas = true );
00092 
00095         virtual                                      ~EditBox();
00096 
00103         virtual bool                                  Render( NeoEngine::Frustum *pkFrustum = 0, bool bForce = false );
00104 
00109         virtual void                                  Update( float fDeltaTime );
00110 
00116         virtual unsigned int                          ProcessMsg( Msg *pkMsg );
00117 
00124         virtual Object                               *Duplicate( Object *pkParent = 0, Object *pkObject = 0 );
00125 };
00126 
00127 
00128 #ifdef HAVE_NEOCHUNKIO
00129 
00130 
00136 class NEOWTK_API EditBoxChunk : public BorderAreaChunk
00137 {
00138     public:
00139 
00146                                                       EditBoxChunk( unsigned short usType, const NeoEngine::HashString &rstrType, const NeoEngine::HashString &rstrID = "" ) : BorderAreaChunk( usType, rstrType, rstrID ) {}
00147 
00151         virtual                                      ~EditBoxChunk() {}
00152 
00159         virtual int                                   ParseData( unsigned int uiFlags, NeoEngine::FileManager *pkFileManager );
00160 
00168         static NeoChunkIO::Chunk                     *Allocator( unsigned short usType, const NeoEngine::HashString &rstrType, const NeoEngine::HashString &rstrID ) { return new EditBoxChunk( usType, rstrType, rstrID ); }
00169 };
00170 
00171 
00172 #endif 
00175 }; 
00178 #endif

Generated on Wed Jan 21 14:21:20 2004 for NeoWTK by doxygen 1.3.5