#ifndef __EditBox__
#define __EditBox__

#ifndef GUI_DLL 
    #ifdef GUI_BUILD
	    #define GUI_DLL __declspec(dllexport)
    #else
	    #define GUI_DLL __declspec(dllimport)
        #pragma comment(lib, "WindowManager.lib")
    #endif
#endif


#include "Window.h"


class GUI_DLL EditBox : public Window {
public:
    EditBox(Window* parent = 0);
    virtual ~EditBox();

    virtual const wchar_t* getValue();
    virtual void setValue(const wchar_t* value);

    virtual Text* getCaption();
    virtual void setCaption(const wchar_t* value);

protected:
    void onMouseEnter(Event& event);
    void onMouseLeave(Event& event);
    void onGainFocus(Event& event);
    void onLoseFocus(Event& event);
    void onKeyDown(Event& event);
    void onChar(Event& event);

    Texture* _normalTexture;
    Texture* _disabledTexture;

    class Caret;
    Caret* _caret;

    std::wstring _text;
    uint32 _caretPosition;
};

#endif