Home » U++ Library support » U++ Library : Other (not classified elsewhere) » draganddrop does not work
Re: draganddrop does not work [message #49791 is a reply to message #49790] |
Mon, 07 May 2018 15:00 |
Oblivion
Messages: 1093 Registered: August 2007
|
Senior Contributor |
|
|
Quote:Should not it work on the top of the hierarchy as well?
Well, DockWindow is based on TopWindow,and DockableCtrl is based on ParentCtrl. And both of these base classes are based on Ctrl.
CTrl::DragAndDrop() virtual method has an empty default implementation. And it is not overriden in Topwindow or ParentCtrl, which makes sense TBH.
Of course you can redirect the dnd message to the member ctrls in a number of ways.
For example:
class maintradetesterwindow : public DockWindow // public Withtablayout<TopWindow>
{
public:
maintradetesterwindow();
void DragAndDrop(Point p, PasteClip& d);
class ManualTradeDock : public WithmanualtradeLayout <DockableCtrl> {
public:
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)
{
manual_trade.DragAndDrop(p, d); // <---
}
But you shouldn't need this for other ctrls, as they already hava their specialized DND methods implemented (e.g. the ArrayCtrl you use).
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 15:21] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sun Apr 28 07:51:05 CEST 2024
Total time taken to generate the page: 0.05862 seconds
|