Move drop file event to Window, handle mouse capture automatically
This commit is contained in:
@@ -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 ());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user