29 lines
516 B
C++
29 lines
516 B
C++
#pragma once
|
|
|
|
#include "Widget.h"
|
|
|
|
#include <string>
|
|
|
|
class TextBox : public Widget
|
|
{
|
|
public:
|
|
TextBox();
|
|
|
|
static std::unique_ptr<TextBox> Create();
|
|
|
|
void setContent(const std::string& text);
|
|
|
|
std::string getContent() const;
|
|
|
|
void appendContent(const std::string& text);
|
|
|
|
void onPaintEvent(const PaintEvent* event) override;
|
|
|
|
bool onMyKeyboardEvent(const KeyboardEvent* event) override;
|
|
|
|
private:
|
|
std::string mContent;
|
|
bool mCaps;
|
|
};
|
|
|
|
using TextBoxUPtr = std::unique_ptr<TextBox>;
|