OpenMortal Apocalypse mirror
Sourceforge mirror
SourceForge.net Logo
      News | Info | Characters | Arenas | Screenshots | Forums | Download  
Developer: Making of | Character-HOWTO | AI Design | Submit a Character
Documentation: Main Page | Modules | Class Hierarchy | Class List | File List

TextArea.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           TextArea.h  -  description
00003                              -------------------
00004     begin                : Wed Jan 28 2004
00005     copyright            : (C) 2004 by upi
00006     email                : upi@feel
00007  ***************************************************************************/
00008 
00009 
00010 #ifndef TEXTAREA_H
00011 #define TEXTAREA_H
00012 
00013 #include "SDL_video.h"
00014 
00015 struct SDL_Surface;
00016 struct _sge_TTFont;
00017 
00018 #include <string>
00019 #include <list>
00020 
00021 
00022 typedef std::list<std::string> TStringList;
00023 typedef std::list<int> TIntList;
00024 
00030 class CTextArea
00031 {
00032 public:
00033     CTextArea( SDL_Surface* a_poScreen, _sge_TTFont* a_poFont, int a_x, int a_y, int a_w, int a_h );
00034     ~CTextArea();
00035 
00036     void TintBackground( int a_iColor, int a_iAlpha );
00037     void AddString( const char* a_poText, int a_iColor );
00038     void Redraw();
00039     void Clear();
00040     void ScrollUp();
00041     void ScrollDown();
00042     
00043 protected:
00044     SDL_Surface*        m_poScreen;
00045     SDL_Surface*        m_poBackground;
00046     _sge_TTFont*        m_poFont;
00047     SDL_Rect            m_oClipRect;
00048     int                 x, y, w, h;
00049     
00050     int                 m_iScrollOffset;
00051     TStringList         m_asRowTexts;
00052     TIntList            m_aiRowColors;
00053 };
00054 
00055 
00056 #endif // TEXTAREA_H