00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #if !defined(__INCLUDE_GLWChannelTexth_INCLUDE__)
00022 #define __INCLUDE_GLWChannelTexth_INCLUDE__
00023
00024 #include <GLW/GLWChannelView.h>
00025 #include <GLW/GLWIconButton.h>
00026 #include <GLW/GLWSelector.h>
00027 #include <string>
00028
00029 class GLWChannelText :
00030 public GLWidget,
00031 public GLWButtonI,
00032 public GLWSelectorI,
00033 public GLWChannelViewI
00034 {
00035 public:
00036 GLWChannelText();
00037 virtual ~GLWChannelText();
00038
00039
00040 virtual void channelsChanged(unsigned int id);
00041
00042
00043 virtual void itemSelected(GLWSelectorEntry *entry, int position);
00044
00045
00046 virtual void buttonDown(unsigned int id);
00047
00048
00049 virtual void draw();
00050 virtual void simulate(float frameTime);
00051 virtual bool initFromXML(XMLNode *node);
00052 virtual void mouseDown(int button, float x, float y, bool &skipRest);
00053 virtual void mouseUp(int button, float x, float y, bool &skipRest);
00054 virtual void mouseDrag(int button, float mx, float my, float x, float y, bool &skipRest);
00055 virtual void keyDown(char *buffer, unsigned int keyState,
00056 KeyboardHistory::HistoryElement *history, int hisCount,
00057 bool &skipRest);
00058 virtual void setParent(GLWPanel *parent);
00059 virtual void setX(float x);
00060 virtual void setY(float y);
00061 virtual void setW(float w);
00062 virtual void setH(float h);
00063
00064 REGISTER_CLASS_HEADER(GLWChannelText);
00065 protected:
00066 static std::list<ChannelText> lastMessages_;
00067 GLTexture buttonTexture_, colorTexture_;
00068 GLWChannelViewTextRenderer prompt_;
00069 GLWChannelView::CurrentChannelEntry channelEntry_;
00070 GLWIconButton button_;
00071 GLWChannelView view_;
00072 std::map<KeyboardKey *, std::string> keys_;
00073 LangString text_;
00074 float fontSize_, outlineFontSize_;
00075 float ctime_;
00076 bool cursor_, visible_;
00077 bool createdTexture_;
00078 int maxTextLen_;
00079 unsigned int whisperDest_;
00080 LangString whisperDestStr_;
00081
00082 void processNotVisibleKey(unsigned int unicode, unsigned int dik, bool &skipRest);
00083 void processVisibleKey(unsigned int unicode, unsigned int dik);
00084 void processSpecialText();
00085 void processNormalText();
00086 bool checkCurrentChannel();
00087 bool channelValid(const char *channelName);
00088 void setVisible(bool visible);
00089 void setChannelEntry(GLWChannelView::CurrentChannelEntry &entry);
00090 };
00091
00092 #endif // __INCLUDE_GLWChannelTexth_INCLUDE__