#include <cWidgetBase.h>
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. |
Definition at line 194 of file cWidgetBase.h.
enum cWidget::WithCaption::location [protected] |
cWidget::WithCaption::WithCaption | ( | ) | [inline, protected] |
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 }
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 }
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);
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().