FIFE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
gcn::ClickLabel Class Reference

#include <clicklabel.h>

Inherits Widget, MouseListener, KeyListener, and FocusListener.

+ Collaboration diagram for gcn::ClickLabel:

Public Member Functions

 ClickLabel ()
 
 ClickLabel (const std::string &caption)
 
virtual ~ClickLabel ()
 
virtual void setWidth (int32_t width)
 
virtual void setCaption (const std::string &caption)
 
virtual const std::string & getCaption () const
 
virtual void draw (Graphics *graphics)
 
virtual void adjustSize ()
 
void setTextWrapping (bool)
 
bool isTextWrapping () const
 
virtual void focusLost (const Event &event)
 
virtual void mousePressed (MouseEvent &mouseEvent)
 
virtual void mouseReleased (MouseEvent &mouseEvent)
 
virtual void mouseEntered (MouseEvent &mouseEvent)
 
virtual void mouseExited (MouseEvent &mouseEvent)
 
virtual void mouseDragged (MouseEvent &mouseEvent)
 
virtual void keyPressed (KeyEvent &keyEvent)
 
virtual void keyReleased (KeyEvent &keyEvent)
 

Protected Member Functions

void wrapText ()
 

Protected Attributes

FIFE::GuiFontmGuiFont
 
bool mTextWrapping
 
std::string mCaption
 
std::string mWrappedText
 
bool mHasMouse
 
bool mKeyPressed
 
bool mMousePressed
 

Detailed Description

Definition at line 42 of file clicklabel.h.

Constructor & Destructor Documentation

gcn::ClickLabel::ClickLabel ( )

Definition at line 38 of file clicklabel.cpp.

References mGuiFont, and setTextWrapping().

gcn::ClickLabel::ClickLabel ( const std::string &  caption)

Definition at line 49 of file clicklabel.cpp.

References mGuiFont, setCaption(), setTextWrapping(), and wrapText().

gcn::ClickLabel::~ClickLabel ( )
virtual

Definition at line 62 of file clicklabel.cpp.

Member Function Documentation

void gcn::ClickLabel::adjustSize ( )
virtual

Definition at line 114 of file clicklabel.cpp.

References FIFE::GuiFont::getAsImageMultiline(), FIFE::Image::getHeight(), FIFE::Image::getWidth(), isTextWrapping(), mCaption, mGuiFont, mWrappedText, and setWidth().

Referenced by draw().

+ Here is the caller graph for this function:

void gcn::ClickLabel::draw ( Graphics *  graphics)
virtual
void gcn::ClickLabel::focusLost ( const Event &  event)
virtual

Definition at line 190 of file clicklabel.cpp.

References mKeyPressed, and mMousePressed.

const std::string & gcn::ClickLabel::getCaption ( ) const
virtual

Definition at line 71 of file clicklabel.cpp.

References mCaption.

bool gcn::ClickLabel::isTextWrapping ( ) const

Definition at line 110 of file clicklabel.cpp.

References mTextWrapping.

Referenced by adjustSize(), draw(), and wrapText().

+ Here is the caller graph for this function:

void gcn::ClickLabel::keyPressed ( KeyEvent &  keyEvent)
virtual

Definition at line 169 of file clicklabel.cpp.

References mKeyPressed.

void gcn::ClickLabel::keyReleased ( KeyEvent &  keyEvent)
virtual

Definition at line 179 of file clicklabel.cpp.

References mKeyPressed.

void gcn::ClickLabel::mouseDragged ( MouseEvent &  mouseEvent)
virtual

Definition at line 164 of file clicklabel.cpp.

void gcn::ClickLabel::mouseEntered ( MouseEvent &  mouseEvent)
virtual

Definition at line 147 of file clicklabel.cpp.

References mHasMouse.

void gcn::ClickLabel::mouseExited ( MouseEvent &  mouseEvent)
virtual

Definition at line 142 of file clicklabel.cpp.

References mHasMouse.

void gcn::ClickLabel::mousePressed ( MouseEvent &  mouseEvent)
virtual

Definition at line 134 of file clicklabel.cpp.

References mMousePressed.

void gcn::ClickLabel::mouseReleased ( MouseEvent &  mouseEvent)
virtual

Definition at line 152 of file clicklabel.cpp.

References mHasMouse, and mMousePressed.

void gcn::ClickLabel::setCaption ( const std::string &  caption)
virtual

Definition at line 65 of file clicklabel.cpp.

References mCaption, mGuiFont, and wrapText().

Referenced by ClickLabel().

+ Here is the caller graph for this function:

void gcn::ClickLabel::setTextWrapping ( bool  textWrapping)

Definition at line 102 of file clicklabel.cpp.

References mTextWrapping, and wrapText().

Referenced by ClickLabel().

+ Here is the caller graph for this function:

void gcn::ClickLabel::setWidth ( int32_t  width)
virtual

Definition at line 75 of file clicklabel.cpp.

References wrapText().

Referenced by adjustSize().

+ Here is the caller graph for this function:

void gcn::ClickLabel::wrapText ( )
protected

Definition at line 127 of file clicklabel.cpp.

References isTextWrapping(), mCaption, mGuiFont, mWrappedText, and FIFE::GuiFont::splitTextToWidth().

Referenced by ClickLabel(), draw(), setCaption(), setTextWrapping(), and setWidth().

+ Here is the caller graph for this function:

Member Data Documentation

std::string gcn::ClickLabel::mCaption
protected

Definition at line 88 of file clicklabel.h.

Referenced by adjustSize(), draw(), getCaption(), setCaption(), and wrapText().

FIFE::GuiFont* gcn::ClickLabel::mGuiFont
protected

Definition at line 86 of file clicklabel.h.

Referenced by adjustSize(), ClickLabel(), draw(), setCaption(), and wrapText().

bool gcn::ClickLabel::mHasMouse
protected

Definition at line 91 of file clicklabel.h.

Referenced by mouseEntered(), mouseExited(), and mouseReleased().

bool gcn::ClickLabel::mKeyPressed
protected

Definition at line 92 of file clicklabel.h.

Referenced by focusLost(), keyPressed(), and keyReleased().

bool gcn::ClickLabel::mMousePressed
protected

Definition at line 93 of file clicklabel.h.

Referenced by focusLost(), mousePressed(), and mouseReleased().

bool gcn::ClickLabel::mTextWrapping
protected

Definition at line 87 of file clicklabel.h.

Referenced by isTextWrapping(), and setTextWrapping().

std::string gcn::ClickLabel::mWrappedText
protected

Definition at line 89 of file clicklabel.h.

Referenced by adjustSize(), draw(), and wrapText().


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