00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef __NEOWTKTEXTAREA_H
00028 #define __NEOWTKTEXTAREA_H
00029
00030
00031 #include "base.h"
00032 #include "area.h"
00033
00034 #include <neoengine/font.h>
00035
00036 #ifdef HAVE_NEOCHUNKIO
00037 # include <neochunkio/complex.h>
00038 # include "chunktype.h"
00039 #endif
00040
00041
00048 namespace NeoWTK
00049 {
00050
00051
00057 class NEOWTK_API TextArea : public Area
00058 {
00059 protected:
00060
00062 NeoEngine::FontPtr m_pkFont;
00063
00065 Coord m_kPadding;
00066
00068 NeoEngine::Color m_kFontColor;
00069
00070
00071 public:
00072
00074 std::string m_strText;
00075
00077 bool m_bPassword;
00078
00079
00084 TextArea( Object *pkParent, TextArea *pkObject = 0 );
00085
00088 virtual ~TextArea();
00089
00094 virtual void SetAttribute( const AttributeBase &rkAttribute );
00095
00100 virtual void SetText( const std::string &rstrText );
00101
00105 virtual const std::string &GetText();
00106
00111 virtual void SetFont( NeoEngine::FontPtr pkFont );
00112
00116 virtual NeoEngine::FontPtr GetFont();
00117
00121 virtual void SetFontColor( const NeoEngine::Color &rkColor );
00122
00126 const NeoEngine::Color &GetFontColor();
00127
00134 virtual bool Render( NeoEngine::Frustum *pkFrustum = 0, bool bForce = false );
00135
00140 virtual void SetTextPadding( const Coord &rkPadding );
00141
00146 virtual const Coord &GetTextPadding();
00147
00154 virtual Object *Duplicate( Object *pkParent = 0, Object *pkObject = 0 );
00155 };
00156
00157
00158 #ifdef HAVE_NEOCHUNKIO
00159
00160
00166 class NEOWTK_API TextAreaChunk : public AreaChunk
00167 {
00168 public:
00169
00176 TextAreaChunk( unsigned short usType, const NeoEngine::HashString &rstrType, const NeoEngine::HashString &rstrID = "" ) : AreaChunk( usType, rstrType, rstrID ) {}
00177
00181 virtual ~TextAreaChunk() {}
00182
00189 virtual int ParseData( unsigned int uiFlags, NeoEngine::FileManager *pkFileManager );
00190
00198 static NeoChunkIO::Chunk *Allocator( unsigned short usType, const NeoEngine::HashString &rstrType, const NeoEngine::HashString &rstrID ) { return new TextAreaChunk( usType, rstrType, rstrID ); }
00199 };
00200
00201
00202 #endif
00205 };
00208 #endif