#ifndef __C_GUI_STATIC_TEXT_H_INCLUDED__
#define __C_GUI_STATIC_TEXT_H_INCLUDED__
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_GUI_
#include "IGUIStaticText.h"
#include "irrArray.h"
namespace irr
{
namespace gui
{
class CGUIStaticText : public IGUIStaticText
{
public:
CGUIStaticText(const wchar_t* text, bool border, IGUIEnvironment* environment,
IGUIElement* parent, s32 id, const core::rect<s32>& rectangle,
bool background = false);
virtual ~CGUIStaticText();
virtual void draw();
virtual void setOverrideFont(IGUIFont* font=0);
virtual IGUIFont * getOverrideFont() const;
virtual void setOverrideColor(video::SColor color);
virtual void setBackgroundColor(video::SColor color);
virtual void setDrawBackground(bool draw);
virtual void setDrawBorder(bool draw);
virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical);
virtual video::SColor const & getOverrideColor() const;
virtual void enableOverrideColor(bool enable);
virtual bool isOverrideColorEnabled() const;
virtual void setTextRestrainedInside(bool restrainedInside);
virtual bool isTextRestrainedInside() const;
virtual void setWordWrap(bool enable);
virtual bool isWordWrapEnabled() const;
virtual void setText(const wchar_t* text);
virtual s32 getTextHeight() const;
virtual s32 getTextWidth() const;
virtual void updateAbsolutePosition();
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
private:
void breakText();
EGUI_ALIGNMENT HAlign, VAlign;
bool Border;
bool OverrideColorEnabled;
bool OverrideBGColorEnabled;
bool WordWrap;
bool Background;
bool RestrainTextInside;
video::SColor OverrideColor, BGColor;
gui::IGUIFont* OverrideFont;
gui::IGUIFont* LastBreakFont;
core::array< core::stringw > BrokenText;
};
}
}
#endif
#endif