The-Powder-Toy/src/interface/Label.h

35 lines
817 B
C
Raw Normal View History

2012-01-14 12:51:24 -06:00
#ifndef LABEL_H
#define LABEL_H
#include <string>
#include "Component.h"
2012-01-20 16:07:49 -06:00
#include "Misc.h"
2012-01-14 12:51:24 -06:00
namespace ui
{
class Label : public Component
{
2012-01-20 16:07:49 -06:00
std::string text;
ui::Point textPosition;
HorizontalAlignment textHAlign;
VerticalAlignment textVAlign;
2012-01-14 12:51:24 -06:00
public:
2012-01-17 14:46:06 -06:00
Label(Window* parent_state, std::string labelText);
2012-01-14 12:51:24 -06:00
Label(Point position, Point size, std::string labelText);
Label(std::string labelText);
virtual ~Label();
2012-01-20 16:07:49 -06:00
void TextPosition();
void SetText(std::string text);
HorizontalAlignment GetHAlignment() { return textHAlign; }
VerticalAlignment GetVAlignment() { return textVAlign; }
void SetAlignment(HorizontalAlignment hAlign, VerticalAlignment vAlign) { textHAlign = hAlign; textVAlign = vAlign; TextPosition(); }
2012-01-14 12:51:24 -06:00
virtual void Draw(const Point& screenPos);
};
}
#endif // LABEL_H