mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
double click support
This commit is contained in:
parent
b6f2456a82
commit
a678eddb77
7 changed files with 102 additions and 10 deletions
|
|
@ -123,15 +123,25 @@ static void _readUINode(UiXmlReader& reader, xml::xmlelement element, UINode& no
|
|||
std::string text = element->attr("onclick").getText();
|
||||
if (!text.empty()) {
|
||||
auto callback = scripting::create_runnable(
|
||||
reader.getEnvironment(),
|
||||
text,
|
||||
reader.getFilename()
|
||||
reader.getEnvironment(), text, reader.getFilename()
|
||||
);
|
||||
node.listenAction([callback](GUI*) {
|
||||
callback();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (element->has("ondoubleclick")) {
|
||||
std::string text = element->attr("ondoubleclick").getText();
|
||||
if (!text.empty()) {
|
||||
auto callback = scripting::create_runnable(
|
||||
reader.getEnvironment(), text, reader.getFilename()
|
||||
);
|
||||
node.listenDoubleClick([callback](GUI*) {
|
||||
callback();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void _readContainer(UiXmlReader& reader, xml::xmlelement element, Container& container) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue