cWidget::WithCaption Class Reference

Able to parse and store a Caption node. More...

#include <cWidgetBase.h>

Inheritance diagram for cWidget::WithCaption:

Inheritance graph
[legend]
Collaboration diagram for cWidget::WithCaption:

Collaboration graph
[legend]

List of all members.

Public Member Functions

bool Process (tXmlParser::node cur)
 Default constructor.

Protected Types

enum  location { top, bottom, off }

Protected Member Functions

 WithCaption ()

Protected Attributes

tString m_caption
 The caption text.
int m_captionloc
 The caption location.

Private Member Functions

void ProcessCaption (tXmlParser::node cur)
 Processes the inside of a Caption node.
void ProcessCaptionLocation (tXmlParser::node cur)
 Processes the location attribute of a Caption node.


Detailed Description

Able to parse and store a Caption node.

Definition at line 194 of file cWidgetBase.h.


Member Enumeration Documentation

enum cWidget::WithCaption::location [protected]

Enumerator:
top  the possible positions of a caption
bottom 
off 

Definition at line 198 of file cWidgetBase.h.

00198                   { 
00199         top,
00200         bottom,
00201         off
00202     };


Constructor & Destructor Documentation

cWidget::WithCaption::WithCaption (  )  [inline, protected]

Definition at line 205 of file cWidgetBase.h.

00205 : Base(), m_captionloc(off) {}; 


Member Function Documentation

void cWidget::WithCaption::ProcessCaption ( tXmlParser::node  cur  )  [private]

Processes the inside of a Caption node.

Definition at line 488 of file cWidgetBase.cpp.

References m_caption, and ProcessCaptionLocation().

Referenced by Process().

00489                                                    {
00490     ProcessCaptionLocation(cur);
00491     for (cur = cur.GetFirstChild(); cur; ++cur) {
00492         if(cur.IsOfType("Text")) {
00493             m_caption = cur.GetProp("value");
00494         }
00495     }

Here is the call graph for this function:

Here is the caller graph for this function:

void cWidget::WithCaption::ProcessCaptionLocation ( tXmlParser::node  cur  )  [private]

Processes the location attribute of a Caption node.

Definition at line 497 of file cWidgetBase.cpp.

References bottom, m_captionloc, off, tERR_WARN, and top.

Referenced by ProcessCaption().

00498                                                            {
00499     std::map<tString, int> locations;
00500     locations[tString("top")] = top;
00501     locations[tString("bottom")] = bottom;
00502     locations[tString("off")] = off;
00503 
00504     std::map<tString, int>::iterator iter;
00505     if((iter = locations.find(cur.GetProp("location"))) != locations.end()) {
00506         m_captionloc = iter->second;
00507     } else {
00508         tERR_WARN("Location '" + cur.GetProp("location") + "' unknown!");
00509         m_captionloc = bottom;
00510     }

Here is the caller graph for this function:

bool cWidget::WithCaption::Process ( tXmlParser::node  cur  )  [virtual]

Default constructor.

Processes a Caption node or passes on to Base::Process()

Reimplemented from cWidget::Base.

Reimplemented in cWidget::BarGauge, and cWidget::Label.

Definition at line 480 of file cWidgetBase.cpp.

References cWidget::Base::Process(), and ProcessCaption().

Referenced by cWidget::Label::Process(), and cWidget::BarGauge::Process().

00481                                             {
00482     if(cur.IsOfType("Caption")) {
00483         ProcessCaption(cur);
00484         return true;
00485     }
00486     return Base::Process(cur);

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

tString cWidget::WithCaption::m_caption [protected]

The caption text.

Definition at line 203 of file cWidgetBase.h.

Referenced by ProcessCaption(), cWidget::Label::Render(), cWidget::VerticalBarGauge::RenderCaption(), and cWidget::BarGauge::RenderCaption().

int cWidget::WithCaption::m_captionloc [protected]

The caption location.

Definition at line 204 of file cWidgetBase.h.

Referenced by ProcessCaptionLocation(), cWidget::Label::Render(), cWidget::VerticalBarGauge::RenderCaption(), and cWidget::BarGauge::RenderCaption().


The documentation for this class was generated from the following files:
Generated on Sun Mar 16 00:04:58 2008 for Armagetron Advanced by  doxygen 1.5.4