#pragma once

#include "label.qh"
CLASS(InputBox, Label)
	METHOD(InputBox, configureInputBox, void(entity, string, float, float, string));
	METHOD(InputBox, draw, void(entity));
	METHOD(InputBox, setText, void(entity, string));
	METHOD(InputBox, enterText, void(entity, string));
	METHOD(InputBox, keyDown, float(entity, float, float, float));
	METHOD(InputBox, mouseMove, float(entity, vector));
	METHOD(InputBox, mouseRelease, float(entity, vector));
	METHOD(InputBox, mousePress, bool(InputBox this, vector pos));
	METHOD(InputBox, mouseDrag, float(entity, vector));
	METHOD(InputBox, showNotify, void(entity));
	METHOD(InputBox, resizeNotify, void(entity, vector, vector, vector, vector));

	ATTRIB(InputBox, src, string);

	ATTRIB(InputBox, cursorPos, float, 0);  // characters
	ATTRIB(InputBox, scrollPos, float, 0);  // widths

	ATTRIB(InputBox, focusable, bool, true);
	ATTRIB(InputBox, allowFocusSound, bool, true);
	ATTRIB(InputBox, disabled, float, 0);
	ATTRIB(InputBox, lastChangeTime, float, 0);
	ATTRIB(InputBox, dragScrollTimer, float, 0);
	ATTRIB(InputBox, dragScrollPos, vector, '0 0 0');
	ATTRIB(InputBox, pressed, bool, false);
	ATTRIB(InputBox, editColorCodes, bool, true);
	ATTRIB(InputBox, forbiddenCharacters, string, "");
	ATTRIB(InputBox, allowedCharacters, string, "");
	ATTRIB(InputBox, color, vector, '1 1 1');
	ATTRIB(InputBox, colorF, vector, '1 1 1');
	ATTRIB(InputBox, maxLength, float, 255);  // if negative, it counts bytes, not chars
	ATTRIB(InputBox, applyButton, entity);

	ATTRIB(InputBox, enableClearButton, bool, true);
	ATTRIB(InputBox, clearButton, entity);
	ATTRIB(InputBox, cb_width, float, 0);
	ATTRIB(InputBox, cb_pressed, bool, false);
	ATTRIB(InputBox, cb_focused, bool, false);
	ATTRIB(InputBox, cb_color, vector, '1 1 1');
	ATTRIB(InputBox, cb_colorF, vector, '1 1 1');
	ATTRIB(InputBox, cb_colorC, vector, '1 1 1');
ENDCLASS(InputBox)
