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 » U++ Library support » U++ Library : Other (not classified elsewhere) » draganddrop does not work
Re: draganddrop does not work [message #49789 is a reply to message #49788] Mon, 07 May 2018 13:57 Go to previous messageGo to previous message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
Hello aftershock,

Your code doesn't work because you need to override the dnd virtual function of the DockableCtrl, not of the DockWindow.

Here is a solution:

main.cpp:

#include <Docking/Docking.h>

using namespace Upp;

#define LAYOUTFILE <tradetester_drag_bug/tradetester.lay>
#include <CtrlCore/lay.h>



class maintradetesterwindow : public DockWindow // public Withtablayout<TopWindow>oin 
{
	public:
	maintradetesterwindow();
	void DragAndDrop(Point p, PasteClip& d);
	class ManualTradeDock : public WithmanualtradeLayout <DockableCtrl> { // <--- 
		virtual void DragAndDrop(Point p, PasteClip& d)
		{
			if(IsDragAndDropSource())
				return;
			if(AcceptFiles(d)) {
			  Vector<String>	files2 = GetFiles(d);
				DUMP(files2);
			}
		}
	};
	ManualTradeDock manual_trade;
};




maintradetesterwindow::maintradetesterwindow()
{

	Sizeable();
	CtrlLayout ( manual_trade );
	DockableCtrl & manual_trade_dk =   Register ( manual_trade.Title ( t_ ( "Manual trade" ) ) );

	DockLeft ( manual_trade_dk );
}

void maintradetesterwindow::DragAndDrop(Point p, PasteClip& d)
{
//	if(IsDragAndDropSource())
//		return;
//	if(AcceptFiles(d)) {
//	  Vector<String>	files2 = GetFiles(d);
///		DUMP(files2);
//	}
}


GUI_APP_MAIN
{
	

	//  ::SColorFace_Write(Black());
	//  ::SColorText_Write(Yellow());



	maintradetesterwindow().Run();
}



It should work now. Smile

Best regards,
Oblivion


[Updated on: Mon, 07 May 2018 14:21]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: StaticText : Add missing GetData/SetData overloads
Next Topic: is there a TerminalCtrl?
Goto Forum:
  


Current Time: Sun Apr 28 08:48:27 CEST 2024

Total time taken to generate the page: 0.05422 seconds