Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

CSTextIcon Class Reference

#include <CSIcon.h>

Inheritance diagram for CSTextIcon:

CSIcon CSGrafikElement CSMessageDispatchable CSMessageListener

Public Member Functions

virtual std::string getType ()
virtual ~CSTextIcon ()
bool initIcon (const std::string &text)
void setText (const std::string &text)
virtual void paint (SDL_Surface *destination, SDL_Rect *parentViewport)
virtual void layoutSetup ()

Static Public Member Functions

CSTextIconbuildIcon (const std::string &text)

Static Public Attributes

const char * CLASS = "CSTextIcon"
 static element, name of this class (introsepection)


Protected Member Functions

 CSTextIcon ()
void layoutSetupTextIcon ()

Constructor & Destructor Documentation

CSTextIcon::CSTextIcon  )  [inline, protected]
 

Definition at line 137 of file CSIcon.h.

References ICON_KIND_TEXT.

Referenced by buildIcon().

00137 : CSIcon(ICON_KIND_TEXT) {}

CSTextIcon::~CSTextIcon  )  [virtual]
 

Definition at line 96 of file CSIcon.cpp.

References LOG_ENTER, and LOG_EXIT.

00097 {
00098     static char *functionName="~CSTextIcon";
00099     LOG_ENTER 
00100     LOG_EXIT
00101 }


Member Function Documentation

void CSTextIcon::layoutSetupTextIcon  )  [protected]
 

Definition at line 129 of file CSIcon.cpp.

References CSGrafikElement::getFont(), CSFont::getHeight(), CSFont::getWidth(), LOG_ENTER, and LOG_EXIT.

Referenced by layoutSetup().

00130 {
00131     static char *functionName="layoutSetupTextIcon";
00132     LOG_ENTER 
00133     mMinHeight = mHeight = getFont()->getHeight();
00134     mMinWidth = mWidth = getFont()->getWidth(mText.c_str());
00135     LOG_EXIT
00136 }

Here is the call graph for this function:

virtual std::string CSTextIcon::getType  )  [inline, virtual]
 

Reimplemented from CSIcon.

Definition at line 142 of file CSIcon.h.

References CLASS.

00142 {return (std::string) CLASS;}

CSTextIcon* CSTextIcon::buildIcon const std::string &  text  )  [inline, static]
 

Definition at line 144 of file CSIcon.h.

References CSTextIcon(), initIcon(), and CSGrafikElement::layoutChanged().

Referenced by HTMLElement::buildDisplay(), CSButton::CSButton(), and CSWindow::rebuildElementWindow().

00145         {
00146             CSTextIcon* icon = 0;
00147             try
00148             {
00149                 icon = new CSTextIcon();
00150                 if (!icon->initIcon(text))
00151                 {
00152                     delete(icon);
00153                     icon = 0;
00154                 }
00155             }
00156             catch (...) {}
00157             icon->layoutChanged();
00158             return icon;
00159         }

Here is the call graph for this function:

bool CSTextIcon::initIcon const std::string &  text  ) 
 

Definition at line 103 of file CSIcon.cpp.

References CSGrafikElement::getFont(), CSGrafikElement::getHeight(), CSGrafikElement::getWidth(), CSGrafikElement::init(), LOG_ENTER, and LOG_EXIT.

Referenced by buildIcon().

00104 {
00105     static char *functionName="initIcon";
00106     LOG_ENTER 
00107     mText = text;
00108     init(getFont()->getHeight(), getFont()->getWidth(mText.c_str()));
00109     LOG_EXIT
00110     return true;
00111 }

Here is the call graph for this function:

void CSTextIcon::setText const std::string &  text  )  [inline]
 

Definition at line 162 of file CSIcon.h.

References CSGrafikElement::layoutChanged().

Referenced by CSWindow::setTitle().

00163         {
00164             if (text.compare(mText) != 0)
00165             {
00166                 mText = text;layoutChanged();
00167             }
00168         }

Here is the call graph for this function:

void CSTextIcon::paint SDL_Surface *  destination,
SDL_Rect *  parentViewport
[virtual]
 

Implements CSIcon.

Definition at line 113 of file CSIcon.cpp.

References CSIcon::getState(), CSGrafikElement::getTextColor(), CSGrafikElement::getX(), CSGrafikElement::getY(), ICON_STATE_DISABLED, ICON_STATE_ENABLED, CSGrafikElement::putString(), and CSGrafikElement::setEnabled().

00114 {
00115     static char *functionName="paint";
00116     int state = getState();
00117 
00118     if (state == ICON_STATE_ENABLED)
00119     {
00120         setEnabled(true);
00121     }
00122     if (state == ICON_STATE_DISABLED)
00123     {
00124         setEnabled(false);
00125     }
00126     putString(destination, parentViewport, getX(), getY(), getTextColor(), mText.c_str());
00127 }

Here is the call graph for this function:

virtual void CSTextIcon::layoutSetup  )  [inline, virtual]
 

Reimplemented from CSGrafikElement.

Definition at line 170 of file CSIcon.h.

References layoutSetupTextIcon().

Here is the call graph for this function:


Field Documentation

const char * CSTextIcon::CLASS = "CSTextIcon" [static]
 

static element, name of this class (introsepection)

Reimplemented from CSIcon.

Definition at line 12 of file CSIcon.cpp.

Referenced by getType().


Generated on Wed Jul 14 00:45:13 2004 for CSLib by doxygen 1.3.6