textbox autoresize

This commit is contained in:
MihailRis
2024-05-14 05:05:13 +03:00
parent ea2b77b323
commit 8bf65eef1a
6 changed files with 164 additions and 81 deletions
+12 -2
View File
@@ -37,11 +37,16 @@ namespace gui {
bool multiline = false;
bool editable = true;
bool autoresize = false;
void stepLeft(bool shiftPressed, bool breakSelection, uint previousCaret);
void stepRight(bool shiftPressed, bool breakSelection, uint previousCaret);
void stepDown(bool shiftPressed, bool breakSelection, uint previousCaret);
void stepUp(bool shiftPressed, bool breakSelection, uint previousCaret);
size_t normalizeIndex(int index);
int calcIndexAt(int x, int y) const;
void paste(const std::wstring& text);
void setTextOffset(uint x);
void erase(size_t start, size_t length);
bool eraseSelected();
@@ -61,7 +66,9 @@ namespace gui {
std::wstring placeholder,
glm::vec4 padding=glm::vec4(4.0f)
);
void paste(const std::wstring& text);
virtual void setTextSupplier(wstringsupplier supplier);
/// @brief Consumer called on stop editing text (textbox defocus)
@@ -139,6 +146,9 @@ namespace gui {
/// @brief Set runnable called on textbox focus
virtual void setOnEditStart(runnable oneditstart);
virtual void setAutoResize(bool flag);
virtual bool isAutoResize() const;
virtual void onFocus(GUI*) override;
virtual void refresh() override;
virtual void click(GUI*, int, int) override;