Let tracks recieve DND events.
This commit is contained in:
parent
41ac62e2cd
commit
477e1f5b40
44
Track.H
44
Track.H
|
@ -20,10 +20,9 @@
|
|||
#pragma once
|
||||
|
||||
#include <FL/Fl_Group.H>
|
||||
|
||||
#include <FL/Fl.H>
|
||||
#include "Region.H"
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <list>
|
||||
|
@ -41,13 +40,13 @@ class Track : public Fl_Group
|
|||
public:
|
||||
|
||||
Track ( int X, int Y, int W, int H ) : Fl_Group( X, Y, W, H )
|
||||
{
|
||||
_next = _prev = NULL;
|
||||
_name = NULL;
|
||||
{
|
||||
_next = _prev = NULL;
|
||||
_name = NULL;
|
||||
|
||||
box( FL_DOWN_BOX );
|
||||
color( fl_darker( FL_GRAY ) );
|
||||
}
|
||||
box( FL_DOWN_BOX );
|
||||
color( fl_darker( FL_GRAY ) );
|
||||
}
|
||||
|
||||
Track *next ( void ) { return _next; }
|
||||
Track *prev ( void ) { return _prev; }
|
||||
|
@ -80,4 +79,33 @@ public:
|
|||
r->position( r->x(), y() );
|
||||
r->redraw();
|
||||
}
|
||||
|
||||
int handle ( int m )
|
||||
{
|
||||
switch ( m )
|
||||
{
|
||||
case FL_DND_DRAG:
|
||||
case FL_DND_RELEASE:
|
||||
case FL_DND_ENTER:
|
||||
case FL_DND_LEAVE:
|
||||
case FL_ENTER:
|
||||
return 1;
|
||||
case FL_PASTE:
|
||||
{
|
||||
const char *file, *text = Fl::event_text();
|
||||
|
||||
if ( ! strncmp( text, "file://", 7 ) )
|
||||
file = text + 7;
|
||||
else
|
||||
// error?
|
||||
file = text;
|
||||
|
||||
printf( "pasted file \"%s\"\n", file );
|
||||
|
||||
return 1;
|
||||
}
|
||||
default:
|
||||
return Fl_Group::handle( m );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue