mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
textbox onup, ondown callbacks
This commit is contained in:
parent
2bb6ad523e
commit
7be1c3f223
5 changed files with 107 additions and 49 deletions
|
|
@ -20,6 +20,8 @@ namespace gui {
|
|||
wstringconsumer consumer = nullptr;
|
||||
wstringchecker validator = nullptr;
|
||||
runnable onEditStart = nullptr;
|
||||
runnable onUpPressed;
|
||||
runnable onDownPressed;
|
||||
bool valid = true;
|
||||
/// @brief text input pointer, value may be greather than text length
|
||||
uint caret = 0;
|
||||
|
|
@ -39,10 +41,10 @@ namespace gui {
|
|||
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);
|
||||
void stepLeft(bool shiftPressed, bool breakSelection);
|
||||
void stepRight(bool shiftPressed, bool breakSelection);
|
||||
void stepDefaultDown(bool shiftPressed, bool breakSelection);
|
||||
void stepDefaultUp(bool shiftPressed, bool breakSelection);
|
||||
|
||||
size_t normalizeIndex(int index);
|
||||
|
||||
|
|
@ -163,6 +165,8 @@ namespace gui {
|
|||
virtual void typed(unsigned int codepoint) override;
|
||||
virtual void keyPressed(keycode key) override;
|
||||
virtual std::shared_ptr<UINode> getAt(glm::vec2 pos, std::shared_ptr<UINode> self) override;
|
||||
virtual void setOnUpPressed(runnable callback);
|
||||
virtual void setOnDownPressed(runnable callback);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue