GLWChannelText.h

Go to the documentation of this file.
00001 ////////////////////////////////////////////////////////////////////////////////
00002 //    Scorched3D (c) 2000-2009
00003 //
00004 //    This file is part of Scorched3D.
00005 //
00006 //    Scorched3D is free software; you can redistribute it and/or modify
00007 //    it under the terms of the GNU General Public License as published by
00008 //    the Free Software Foundation; either version 2 of the License, or
00009 //    (at your option) any later version.
00010 //
00011 //    Scorched3D is distributed in the hope that it will be useful,
00012 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 //    GNU General Public License for more details.
00015 //
00016 //    You should have received a copy of the GNU General Public License
00017 //    along with Scorched3D; if not, write to the Free Software
00018 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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         // GLWChannelViewI
00040         virtual void channelsChanged(unsigned int id);
00041 
00042         // GLWSelectorI
00043         virtual void itemSelected(GLWSelectorEntry *entry, int position);
00044 
00045         // GLWButtonI
00046         virtual void buttonDown(unsigned int id);
00047 
00048         // GLWidget
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__

Generated on Mon Feb 16 15:14:45 2009 for Scorched3D by  doxygen 1.5.3