mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
textbox onup, ondown callbacks
This commit is contained in:
parent
2bb6ad523e
commit
7be1c3f223
5 changed files with 107 additions and 49 deletions
|
|
@ -60,12 +60,12 @@ UINode* UINode::getParent() const {
|
|||
}
|
||||
|
||||
UINode* UINode::listenAction(onaction action) {
|
||||
actions.push_back(action);
|
||||
actions.listen(action);
|
||||
return this;
|
||||
}
|
||||
|
||||
UINode* UINode::listenDoubleClick(onaction action) {
|
||||
doubleClickCallbacks.push_back(action);
|
||||
doubleClickCallbacks.listen(action);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
@ -76,18 +76,14 @@ void UINode::click(GUI*, int, int) {
|
|||
void UINode::doubleClick(GUI* gui, int x, int y) {
|
||||
pressed = true;
|
||||
if (isInside(glm::vec2(x, y))) {
|
||||
for (auto callback : doubleClickCallbacks) {
|
||||
callback(gui);
|
||||
}
|
||||
doubleClickCallbacks.notify(gui);
|
||||
}
|
||||
}
|
||||
|
||||
void UINode::mouseRelease(GUI* gui, int x, int y) {
|
||||
pressed = false;
|
||||
if (isInside(glm::vec2(x, y))) {
|
||||
for (auto callback : actions) {
|
||||
callback(gui);
|
||||
}
|
||||
actions.notify(gui);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue