Move drop file event to Window, handle mouse capture automatically

This commit is contained in:
Joshua Granick
2016-03-01 10:45:33 -08:00
parent 85ec75fd59
commit 78bf85b766
22 changed files with 218 additions and 189 deletions

View File

@@ -14,28 +14,29 @@ namespace lime {
DropEvent::DropEvent () {
type = DROP_FILE;
file = 0;
type = DROP_FILE;
}
void DropEvent::Dispatch (DropEvent* event) {
if (DropEvent::callback)
{
if (DropEvent::callback) {
if (!init)
{
id_file = val_id("file");
id_type = val_id("type");
init = true;
}
value object = (DropEvent::eventObject ? DropEvent::eventObject->get() : alloc_empty_object());
alloc_field(object, id_file, alloc_string(event->file));
alloc_field(object, id_type, alloc_int (event->type));
if (!init) {
id_file = val_id ("file");
id_type = val_id ("type");
init = true;
}
value object = (DropEvent::eventObject ? DropEvent::eventObject->get () : alloc_empty_object ());
alloc_field (object, id_file, alloc_string (event->file));
alloc_field (object, id_type, alloc_int (event->type));
val_call0 (DropEvent::callback->get ());