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 |
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.
Best regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Mon, 07 May 2018 14:21] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sun Apr 28 08:48:27 CEST 2024
Total time taken to generate the page: 0.05422 seconds
|