Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ TheIDE and Library: Releases and ChangeLogs » Drag and Drop in Ctrl
Drag and Drop in Ctrl [message #9203] Fri, 20 April 2007 22:52
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
..working on it... now implemented in Win32, only the basic interfaces in Ctrl so far (may change in future, still in experimenting phase):

virtual bool Ctrl::DragAndDrop(Point p, const ClipData& d, bool drop);


- target recieves when drag happens over it. Returns true if accepted. drop-> perform drop of ClipData.

virtual String GetClip(const char *fmt, int kind);


- source (for D&D or clipboard) can provide data this way. kind can be CLIP_BOARD, CLIP_DROP or CLIP_SELECTION (getting ready for X11 middle mouse button pastes).

To start the show:

enum {
	DND_CANCELED = 0,
	DND_COPY = 1,
	DND_MOVE = 2,
};

int DoDragAndDrop(const char *fmts, Ctrl *src, dword actions = DND_MOVE);
int DoDragAndDrop(const char *fmt, const String& data, dword actions = DND_MOVE);

template <class T>
void DoDragAndDrop(const T& data)
{
	DoDragAndDrop(typeid(T).name(), StoreAsString(data));
}

template <class T>
bool Has(const ClipData& data)
{
	return data.Has(typeid(T).name());
}

template <class T>
bool Get(const ClipData& data)
{
	return data.Get(typeid(T).name());
}


fmts contains supported formats separated by ';'. As Win32 does not have text names for some basic formats, "text", "unicodetext" and "image" are supported by default.

Mirek
Previous Topic: Ctrl::*....
Next Topic: New mouse events....
Goto Forum:
  


Current Time: Sat May 04 02:34:22 CEST 2024

Total time taken to generate the page: 0.02344 seconds