X-Git-Url: http://code.vuplus.com/gitweb/?a=blobdiff_plain;f=lib%2Fgui%2Felabel.h;h=84995eccd056c8e2b5995a27bc661f35efa28d1c;hb=f8842271c7653ae88ecf23ba269fd98354a24335;hp=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391;hpb=d63d2c3c6cbbd574dda4f8b00ebe6c661735edd5;p=vuplus_dvbapp diff --git a/lib/gui/elabel.h b/lib/gui/elabel.h index e69de29..84995ec 100644 --- a/lib/gui/elabel.h +++ b/lib/gui/elabel.h @@ -0,0 +1,56 @@ +#ifndef __lib_gui_elabel_h +#define __lib_gui_elabel_h + +#include + +class eLabel: public eWidget +{ +public: + eLabel(eWidget *parent, int markedPos = -1); + void setText(const std::string &string); + void setMarkedPos(int markedPos); + void setFont(gFont *font); + gFont* getFont(); + + enum + { + alignLeft, + alignTop=alignLeft, + alignCenter, + alignRight, + alignBottom=alignRight, + alignBlock + }; + + void setVAlign(int align); + void setHAlign(int align); + + void setForegroundColor(const gRGB &col); + void setShadowColor(const gRGB &col); + void setShadowOffset(const ePoint &offset); + void setNoWrap(int nowrap); + void clearForegroundColor(); + + eSize calculateSize(); +protected: + ePtr m_font; + int m_valign, m_halign; + std::string m_text; + int event(int event, void *data=0, void *data2=0); + int m_pos; +private: + int m_have_foreground_color, m_have_shadow_color; + gRGB m_foreground_color, m_shadow_color; + ePoint m_shadow_offset; + int m_nowrap; + + enum eLabelEvent + { + evtChangedText = evtUserWidget, + evtChangedFont, + evtChangedAlignment, + evtChangedMarkedPos + }; +}; + +#endif