GDragDropSource Class Reference

A drag source class. More...

#include <GDragAndDrop.h>

List of all members.

Public Member Functions

int Drag (GView *SourceWnd, int Effect)
 Start a drag operation.
virtual void OnRegister (bool Suc)
 Called when window is registered.
virtual void OnStartData ()
 Called on start of drag op.
virtual void OnEndData ()
 Called on end of drag op.
virtual bool GetData (GVariant *Data, char *Format)
virtual bool GetFormats (List< char > &Formats)

Protected Member Functions

bool CreateFileDrop (GVariant *Var, GMouse &m, List< char > &Files)
 Creates a file drop.

Detailed Description

A drag source class.

Member Function Documentation

virtual bool GDragDropSource::GetData ( GVariant Data,
char *  Format 
) [inline, virtual]

This is called when you are being asked for your data. You must provide it in the format specified and return it via the GVariant.

Data  Provide your data in this class
Format  The format of the data to be provided

Referenced by Drag().

virtual bool GDragDropSource::GetFormats ( List< char > &  Formats  )  [inline, virtual]

This is called to see what formats your support Insert into the list dynamically allocated strings that describe the formats you can supply data in. One of these will be chosen by the target and passed to 'GetData'

You can define your own formats by making up a string or you can use OS defined ones to interact with other apps in the system. e.g. Win32 defines "CF_HDROP" for file d'n'd. You can use 'FormatToInt' and 'FormatToStr' to convert to and from the OS's integer id's. This works the same on Win32 as Linux. But the system formats will obviously be different.

The default file drop format for each OS is defined as LGI_FileDropFormat.

Formats  List of format you can provide. You should keep the format length to 4 bytes on the Mac.

Referenced by Drag().

The documentation for this class was generated from the following files:

Generated on Wed Dec 1 15:41:02 2010 for Lgi by  doxygen