tibia-client/src/framework/ui/uitextedit.h

37 lines
816 B
C
Raw Normal View History

2011-04-10 02:51:35 +02:00
#ifndef UITEXTEDIT_H
#define UITEXTEDIT_H
2011-07-13 23:12:36 +02:00
#include <global.h>
2011-04-17 21:14:24 +02:00
#include <graphics/textarea.h>
#include <ui/uielement.h>
2011-04-10 02:51:35 +02:00
class Font;
class UITextEdit;
typedef std::shared_ptr<UITextEdit> UITextEditPtr;
2011-04-10 02:51:35 +02:00
class UITextEdit : public UIElement
{
public:
2011-04-11 23:11:22 +02:00
UITextEdit();
2011-04-10 02:51:35 +02:00
static UITextEditPtr create() { return UITextEditPtr(new UITextEdit); }
2011-04-11 06:08:56 +02:00
void onInputEvent(const InputEvent& event);
void onRectUpdate();
2011-04-16 21:46:31 +02:00
void onFocusChange();
2011-04-11 06:08:56 +02:00
2011-05-31 03:55:34 +02:00
void setText(const std::string& text) { m_textArea.setText(text); }
2011-05-03 00:48:41 +02:00
std::string getText() const { return m_textArea.getText(); }
2011-04-15 04:13:53 +02:00
TextArea& getTextArea() { return m_textArea; }
2011-04-11 06:08:56 +02:00
2011-04-16 21:46:31 +02:00
bool isFocusable() const { return true; }
2011-04-11 22:06:03 +02:00
virtual const char *getLuaTypeName() const { return "UITextEdit"; }
2011-04-22 00:44:30 +02:00
2011-04-10 02:51:35 +02:00
private:
2011-04-15 04:13:53 +02:00
TextArea m_textArea;
2011-04-10 02:51:35 +02:00
};
#endif // UITEXTEDIT_H