TextList Class Reference

#include <text_list.h>

List of all members.

Public Types

typedef std::list< Text
* >::iterator 
iterator

Public Member Functions

 TextList ()
 ~TextList ()
void AddText (const std::string &txt, uint maxlines)
void DeleteLine ()
void Clear ()
int Size ()
void Draw (int x, int y, int height)
void DrawLine (Text *newline, int x, int y, int height)

Public Attributes

std::list< Text * > list


Detailed Description

Definition at line 30 of file text_list.h.


Member Typedef Documentation

typedef std::list<Text*>::iterator TextList::iterator

Definition at line 33 of file text_list.h.


Constructor & Destructor Documentation

TextList::TextList (  ) 

Definition at line 27 of file text_list.cpp.

00028 {}

TextList::~TextList (  ) 

Definition at line 30 of file text_list.cpp.

00031 {
00032   list.clear();
00033 }


Member Function Documentation

void TextList::AddText ( const std::string &  txt,
uint  maxlines 
)

Definition at line 35 of file text_list.cpp.

00035                                                          {
00036   Text* new_txt = new Text(txt);
00037   list.push_back(new_txt);
00038   
00039   if(list.size() >= maxlines)
00040     list.pop_front();
00041 }

Here is the caller graph for this function:

void TextList::Clear (  ) 

Definition at line 52 of file text_list.cpp.

00052                     {
00053   list.clear();
00054 }

void TextList::DeleteLine (  ) 

Definition at line 47 of file text_list.cpp.

00047                          {
00048   if(list.size())
00049     list.pop_front();
00050 }

Here is the caller graph for this function:

void TextList::Draw ( int  x,
int  y,
int  height 
)

Definition at line 56 of file text_list.cpp.

00056                                            {
00057   iterator it = list.begin(), end = list.end();
00058 
00059   for(; it!=end; it++){
00060     //Draw each item in the list
00061     (*it)->DrawTopLeft(x, y);
00062     y+=height;
00063   }
00064 }

Here is the caller graph for this function:

void TextList::DrawLine ( Text newline,
int  x,
int  y,
int  height 
)

Definition at line 66 of file text_list.cpp.

00066                                                               {
00067   int size = list.size();
00068 
00069   y += (size * height);
00070   newline->DrawTopLeft(x, y);
00071 }

Here is the call graph for this function:

int TextList::Size (  ) 

Definition at line 43 of file text_list.cpp.

00043                   {
00044   return list.size();
00045 }

Here is the caller graph for this function:


Member Data Documentation

std::list<Text*> TextList::list

Definition at line 32 of file text_list.h.


The documentation for this class was generated from the following files:
Generated on Mon Jan 1 14:25:55 2007 for Wormux by  doxygen 1.4.7