mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 14:01:49 +00:00
textbox ctrl+a
This commit is contained in:
parent
19b3c34eb2
commit
636ea2666f
2 changed files with 13 additions and 2 deletions
|
|
@ -511,6 +511,17 @@ void TextBox::keyPressed(int key) {
|
||||||
paste(util::str2wstr_utf8(text));
|
paste(util::str2wstr_utf8(text));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Select/deselect all
|
||||||
|
if (key == keycode::A) {
|
||||||
|
if (selectionStart == selectionEnd) {
|
||||||
|
selectionStart = 0;
|
||||||
|
selectionEnd = input.length();
|
||||||
|
selectionOrigin = 0;
|
||||||
|
setCaret(selectionEnd);
|
||||||
|
} else {
|
||||||
|
resetSelection();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -148,9 +148,9 @@ namespace gui {
|
||||||
virtual glm::vec4 getFocusedColor() const;
|
virtual glm::vec4 getFocusedColor() const;
|
||||||
virtual void setErrorColor(glm::vec4 color);
|
virtual void setErrorColor(glm::vec4 color);
|
||||||
virtual glm::vec4 getErrorColor() const;
|
virtual glm::vec4 getErrorColor() const;
|
||||||
/* Get TextBox content text or placeholder if empty */
|
/// @brief Get TextBox content text or placeholder if empty
|
||||||
virtual std::wstring getText() const;
|
virtual std::wstring getText() const;
|
||||||
/* Set TextBox content text */
|
/// @brief Set TextBox content text
|
||||||
virtual void setText(std::wstring value);
|
virtual void setText(std::wstring value);
|
||||||
virtual std::wstring getPlaceholder() const;
|
virtual std::wstring getPlaceholder() const;
|
||||||
virtual void setPlaceholder(const std::wstring&);
|
virtual void setPlaceholder(const std::wstring&);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue