Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

WiStatusBar Class Reference

Inheritance diagram for WiStatusBar:

Inheritance graph
[legend]
Collaboration diagram for WiStatusBar:

Collaboration graph
[legend]

Detailed Description

Statusbar with fixed width.

Definition at line 14 of file WiStatusBar.h.

Public Member Functions

 WiStatusBar (Font *new_font, const SDL_Color &color, int width=0)
virtual ~WiStatusBar ()
virtual int getW () const
virtual int getH () const
void setLabel (const std::string &label)
virtual void drawOn (SDL_Surface *screen)


Constructor & Destructor Documentation

WiStatusBar::WiStatusBar Font new_font,
const SDL_Color &  color,
int  width = 0
 

Definition at line 14 of file WiStatusBar.cpp.

00015 : m_color(color)
00016 {
00017     m_font = new_font;
00018     m_w = width;
00019 }

WiStatusBar::~WiStatusBar  )  [virtual]
 

Definition at line 21 of file WiStatusBar.cpp.

00022 {
00023     delete m_font;
00024 }


Member Function Documentation

void WiStatusBar::drawOn SDL_Surface *  screen  )  [virtual]
 

Implements Drawable.

Definition at line 33 of file WiStatusBar.cpp.

00034 {
00035     if (!m_label.empty()) {
00036         SDL_Rect rect;
00037         rect.x = m_shift.getX();
00038         rect.y = m_shift.getY();
00039 
00040         SDL_Surface *rendered = m_font->renderTextOutlined(m_label, m_color);
00041         SDL_BlitSurface(rendered, NULL, screen, &rect);
00042         SDL_FreeSurface(rendered);
00043     }
00044 }

int WiStatusBar::getH  )  const [virtual]
 

Implements IWidget.

Definition at line 27 of file WiStatusBar.cpp.

00028 {
00029     return m_font->getHeight();
00030 }

virtual int WiStatusBar::getW  )  const [inline, virtual]
 

Implements IWidget.

Definition at line 23 of file WiStatusBar.h.

00023 { return m_w; }

void WiStatusBar::setLabel const std::string &  label  )  [inline]
 

Definition at line 25 of file WiStatusBar.h.

00025 { m_label = label; }


The documentation for this class was generated from the following files:
Generated on Wed Jun 1 09:57:23 2005 for Fish Fillets - Next Generation by  doxygen 1.4.2