aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/EditBox.h
blob: 9e24553f984995ee7e713522de6a395dd0d361e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#pragma once
#include "GuiComponent.h"
using namespace std;
class Font;
class Screen;

class EditBox : public GuiComponent
{
private:
	Font *font;
    int x;
    int y;
    int width;
    int height;
    wstring value;
    unsigned int maxLength;
    int frame;

public:
	bool inFocus;
    bool active;
private:
	Screen *screen;

public:
	EditBox(Screen *screen, Font *font, int x, int y, int width, int height, const wstring& value);
    void setValue(const wstring& value);
    wstring getValue();
    void tick();
    void keyPressed(wchar_t ch, int eventKey);
    void mouseClicked(int mouseX, int mouseY, int buttonNum);
    void focus(bool newFocus);
    void render();
    void setMaxLength(int maxLength);
    int getMaxLength();
};