00001 #ifndef __CTextLabel__ 00002 #define __CTextLabel__ 00003 00004 #include "CControl.hpp" 00005 #include "../Fonts/CFont.hpp" 00006 00007 // =========================================================================== 00008 00009 using Exponent::GUI::Controls::CControl; 00010 using Exponent::GUI::Fonts::CFont; 00011 00012 // =========================================================================== 00013 00014 namespace Exponent 00015 { 00016 namespace GUI 00017 { 00018 namespace Controls 00019 { 00037 class CTextLabel : public CControl 00038 { 00040 EXPONENT_CLASS_DECLARATION; 00043 // =========================================================================== 00044 00045 public: 00046 00047 // =========================================================================== 00048 00056 CTextLabel(IControlRoot *root, const long uniqueId, const CRect &area, const CString &text); 00057 00061 virtual ~CTextLabel(); 00062 00063 // =========================================================================== 00064 00071 virtual void setColours(const CAlphaColour &frameColour = CAlphaColour::CALPHACOLOUR_BLACK, const CAlphaColour &backgroundColour = CAlphaColour::CALPHACOLOUR_WHITE, const CAlphaColour &textColour = CAlphaColour::CALPHACOLOUR_BLACK); 00072 00077 virtual void setTextColour(const CAlphaColour &textColour); 00078 00083 virtual void drawFrameAndBackground(const bool draw = true) { m_drawFrameAndBackground = draw; } 00084 00089 virtual void setFont(CFont *font); 00090 00095 virtual void setText(const CString &text); 00096 00101 const CString &getText() const { return m_text; } 00102 00108 virtual void setTextFormat(const CGraphics::ETextAlignment format); 00109 00110 // =========================================================================== 00111 00116 virtual void drawControl(CGraphics &graphics); 00117 00122 virtual void handleFileDrop(const CDropEvent &event); 00123 00124 // =========================================================================== 00125 00126 protected: 00127 00128 // =========================================================================== 00129 00130 bool m_drawFrameAndBackground; 00131 CFont *m_font; 00132 CAlphaColour m_textColour; 00133 CString m_text; 00135 CGraphics::ETextAlignment m_textFormat; 00136 }; 00137 } 00138 } 00139 } 00140 #endif // End of CTextLabel.hpp