CTextBox::CTextBox(std::string Text, const Rect &rect, int SliderStyle, EFonts Font /*= FONT_SMALL*/, EAlignment Align /*= TOPLEFT*/, const SDL_Color &Color /*= Colors::WHITE*/)
:CBoundedLabel(rect.x, rect.y, Font, Align, Color, Text), sliderStyle(SliderStyle), slider(NULL)
{
	type |= REDRAW_PARENT;
	autoRedraw = false;
	pos.h = rect.h;
	pos.w = rect.w;
	assert(Align == TOPLEFT || Align == CENTER); //TODO: support for other alignments
	assert(pos.w >= 40); //we need some space
	setTxt(Text);
}
Example #2
0
//! Attach iterator to given text. Also reset the iterator. A deep copy
//! of the given text is made if makeCopy is true.
inline void DelimitedTxt::setTxt(const String& txt, bool makeCopy)
{
    setTxt(txt.ascii(), txt.byteSize() - 1, makeCopy);
}
void CGStatusBar::clear()
{
    if(!textLock)
	    setTxt("");
}
void CGStatusBar::print(const std::string & Text)
{
    if(!textLock)
	    setTxt(Text);
}