gui::label Class Reference

#include <label.hpp>

Inheritance diagram for gui::label:

Inheritance graph
[legend]
Collaboration diagram for gui::label:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 label (CVideo &video, const std::string &text, int size=font::SIZE_NORMAL, const SDL_Color &colour=font::NORMAL_COLOUR, const bool auto_join=true)
const std::string & set_text (const std::string &text)
const std::string & get_text () const
int set_size (int size)
int get_size () const
const SDL_Color & set_colour (const SDL_Color &colour)
const SDL_Color & get_colour () const
virtual void draw_contents ()

Private Member Functions

void update_label_size ()

Private Attributes

std::string text_
int size_
SDL_Color colour_


Detailed Description

Definition at line 24 of file widgets/label.hpp.


Constructor & Destructor Documentation

gui::label::label ( CVideo video,
const std::string &  text,
int  size = font::SIZE_NORMAL,
const SDL_Color &  colour = font::NORMAL_COLOUR,
const bool  auto_join = true 
)

Definition at line 23 of file widgets/label.cpp.

References update_label_size().


Member Function Documentation

const std::string & gui::label::set_text ( const std::string &  text  ) 

const std::string & gui::label::get_text (  )  const

Definition at line 39 of file widgets/label.cpp.

References text_.

Referenced by mp::ui::append_to_title(), gui::dialog::layout(), and gui::dialog::show().

int gui::label::set_size ( int  size  ) 

Definition at line 44 of file widgets/label.cpp.

References gui::widget::set_dirty(), size_, and update_label_size().

int gui::label::get_size (  )  const

Definition at line 52 of file widgets/label.cpp.

References size_.

const SDL_Color & gui::label::set_colour ( const SDL_Color &  colour  ) 

Definition at line 57 of file widgets/label.cpp.

References colour_, get_colour(), and gui::widget::set_dirty().

const SDL_Color & gui::label::get_colour (  )  const

Definition at line 64 of file widgets/label.cpp.

References colour_, font::DISABLED_COLOUR, and gui::widget::enabled().

Referenced by draw_contents(), and set_colour().

void gui::label::draw_contents (  )  [virtual]

Reimplemented from gui::widget.

Definition at line 69 of file widgets/label.cpp.

References font::draw_text(), get_colour(), gui::widget::location(), size_, text_, and gui::widget::video().

void gui::label::update_label_size (  )  [private]

Definition at line 74 of file widgets/label.cpp.

References gui::widget::set_measurements(), size_, text_, and font::text_area().

Referenced by label(), set_size(), and set_text().


Member Data Documentation

std::string gui::label::text_ [private]

Definition at line 42 of file widgets/label.hpp.

Referenced by draw_contents(), get_text(), set_text(), and update_label_size().

int gui::label::size_ [private]

Definition at line 43 of file widgets/label.hpp.

Referenced by draw_contents(), get_size(), set_size(), and update_label_size().

SDL_Color gui::label::colour_ [private]

Definition at line 44 of file widgets/label.hpp.

Referenced by get_colour(), and set_colour().


The documentation for this class was generated from the following files:

Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs