Initial revision
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
116
include/wx/gtk1/dnd.h
Normal file
116
include/wx/gtk1/dnd.h
Normal file
@@ -0,0 +1,116 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dnd.h
|
||||
// Purpose: declaration of the wxDropTarget class
|
||||
// Author: Robert Roebling
|
||||
// RCS-ID:
|
||||
// Copyright: (c) 1998 Vadim Zeitlin, Robert Roebling
|
||||
// Licence: wxWindows license
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#ifndef __GTKDNDH__
|
||||
#define __GTKDNDH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/object.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/cursor.h"
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// classes
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
class wxWindow;
|
||||
|
||||
class wxDropTarget;
|
||||
class wxTextDropTarget;
|
||||
class wxDragSource;
|
||||
class wxTextDragSource;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// wxDropTarget
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
class wxDropTarget: wxObject
|
||||
{
|
||||
public:
|
||||
|
||||
wxDropTarget();
|
||||
~wxDropTarget();
|
||||
virtual void OnEnter() { }
|
||||
virtual void OnLeave() { }
|
||||
virtual bool OnDrop( long x, long y, const void *pData ) = 0;
|
||||
|
||||
public:
|
||||
|
||||
void Drop( GdkEvent *event, int x, int y );
|
||||
virtual void RegisterWidget( GtkWidget *widget ) = 0;
|
||||
void UnregisterWidget( GtkWidget *widget );
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// wxTextDropTarget
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
class wxTextDropTarget: public wxDropTarget
|
||||
{
|
||||
public:
|
||||
|
||||
wxTextDropTarget() {};
|
||||
virtual bool OnDrop( long x, long y, const void *pData );
|
||||
virtual bool OnDropText( long x, long y, const char *psz );
|
||||
virtual void RegisterWidget( GtkWidget *widget );
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// wxDragSource
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
class wxDragSource: public wxObject
|
||||
{
|
||||
public:
|
||||
|
||||
wxDragSource( wxWindow *win );
|
||||
~wxDragSource(void);
|
||||
void SetData( char *data, const long size );
|
||||
void Start( int x, int y );
|
||||
|
||||
public:
|
||||
|
||||
void ConnectWindow(void);
|
||||
void UnconnectWindow(void);
|
||||
virtual void RegisterWindow(void) = 0;
|
||||
void UnregisterWindow(void);
|
||||
|
||||
GtkWidget *m_widget;
|
||||
wxWindow *m_window;
|
||||
char *m_data;
|
||||
long m_size;
|
||||
wxCursor m_defaultCursor;
|
||||
wxCursor m_goaheadCursor;
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// wxTextDragSource
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
class wxTextDragSource: public wxDragSource
|
||||
{
|
||||
public:
|
||||
|
||||
wxTextDragSource( wxWindow *win ) : wxDragSource(win) {};
|
||||
void SetTextData( const wxString &text );
|
||||
void RegisterWindow(void);
|
||||
|
||||
private:
|
||||
|
||||
wxString m_tmp;
|
||||
};
|
||||
|
||||
#endif
|
||||
//__GTKDNDH__
|
||||
|
Reference in New Issue
Block a user