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 __NEOWTKBUTTON_H
00028 #define __NEOWTKBUTTON_H
00029
00030
00031 #include "base.h"
00032 #include "object.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
00051 class BorderArea;
00052
00053
00054
00055 class ButtonChunk;
00056
00057
00063 class NEOWTK_API Button : public Object
00064 {
00065 #ifdef HAVE_NEOCHUNKIO
00066 friend class ButtonChunk;
00067 #endif
00068
00069 public:
00070
00075 enum STATE
00076 {
00078 UP = 0,
00079
00081 DOWN = 1
00082 };
00083
00084
00085 protected:
00086
00088 BorderArea *m_pkState[2];
00089
00091 STATE m_eState;
00092
00093
00094 public:
00095
00101 Button( Object *pkParent, Button *pkObject = 0, bool bCreateAreas = true );
00102
00105 virtual ~Button();
00106
00112 virtual const Coord &SetSize( const Coord &rkSize );
00113
00120 virtual bool Render( NeoEngine::Frustum *pkFrustum = 0, bool bForce = false );
00121
00125 virtual BorderArea *GetStateObject( STATE eState );
00126
00132 virtual unsigned int ProcessMsg( Msg *pkMsg );
00133
00140 virtual Object *Duplicate( Object *pkParent = 0, Object *pkObject = 0 );
00141 };
00142
00143
00144 #ifdef HAVE_NEOCHUNKIO
00145
00146
00152 class NEOWTK_API ButtonChunk : public ObjectChunk
00153 {
00154 public:
00155
00162 ButtonChunk( unsigned short usType, const NeoEngine::HashString &rstrType, const NeoEngine::HashString &rstrID = "" ) : ObjectChunk( usType, rstrType, rstrID ) {}
00163
00167 virtual ~ButtonChunk() {}
00168
00175 virtual int ParseData( unsigned int uiFlags, NeoEngine::FileManager *pkFileManager );
00176
00184 static NeoChunkIO::Chunk *Allocator( unsigned short usType, const NeoEngine::HashString &rstrType, const NeoEngine::HashString &rstrID ) { return new ButtonChunk( usType, rstrType, rstrID ); }
00185 };
00186
00187
00188 #endif
00191 };
00194 #endif