mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
add 'sub-consumer' to textbox
This commit is contained in:
parent
868b69db90
commit
699d8ce2bb
6 changed files with 37 additions and 5 deletions
|
|
@ -17,6 +17,7 @@ namespace gui {
|
|||
std::wstring placeholder;
|
||||
wstringsupplier supplier = nullptr;
|
||||
wstringconsumer consumer = nullptr;
|
||||
wstringconsumer subconsumer = nullptr;
|
||||
wstringchecker validator = nullptr;
|
||||
runnable onEditStart = nullptr;
|
||||
runnable onUpPressed;
|
||||
|
|
@ -65,6 +66,8 @@ namespace gui {
|
|||
void performEditingKeyboardEvents(keycode key);
|
||||
|
||||
void refreshLabel();
|
||||
|
||||
void onInput();
|
||||
public:
|
||||
TextBox(
|
||||
std::wstring placeholder,
|
||||
|
|
@ -79,6 +82,10 @@ namespace gui {
|
|||
/// @param consumer std::wstring consumer function
|
||||
virtual void setTextConsumer(wstringconsumer consumer);
|
||||
|
||||
/// @brief Sub-consumer called while editing text
|
||||
/// @param consumer std::wstring consumer function
|
||||
virtual void setTextSubConsumer(wstringconsumer consumer);
|
||||
|
||||
/// @brief Text validator called while text editing and returns true if
|
||||
/// text is valid
|
||||
/// @param validator std::wstring consumer returning boolean
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue