zetaPRIME e22c8995a6 TextBox widget, justification and inheritance in TextConfig,
fix closing osk from InputHandler, make font text input const,
font-related miscellany
2017-03-16 13:25:16 -04:00

45 lines
1.1 KiB
C++

#pragma once
#include "starlight/_global.h"
#include <string>
#include "starlight/gfx/DrawContextCanvas.h"
#include "starlight/ui/UIElement.h"
namespace starlight {
namespace ui {
class TextBox : public UIElement {
private:
//
public:
std::string text = "";
bool multiLine = false;
std::unique_ptr<gfx::DrawContextCanvas> textView;
TextBox(VRect rect) { this->rect = rect; }
TextBox(Vector2 pos) { this->rect = VRect(pos, Vector2(128, 24)); }
~TextBox() { }
void SetText(const std::string& text);
void PreDraw() override;
void PreDrawOffscreen() override;
void Draw() override;
// events
void OnResize() override;
void OnTouchOn() override;
void OnTouchOff() override;
void OnDragStart() override;
void OnDragRelease() override;
void OnDragHold() override;
};
}
}