-
Notifications
You must be signed in to change notification settings - Fork 163
/
Copy pathDragDropInstrumentTarget.h
72 lines (54 loc) · 2.67 KB
/
DragDropInstrumentTarget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/************************************************************************
* Copyright(c) 2018, One Unified. All rights reserved. *
* email: [email protected] *
* *
* This file is provided as is WITHOUT ANY WARRANTY *
* without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
* This software may not be used nor distributed without proper license *
* agreement. *
* *
* See the file LICENSE.txt for redistribution information. *
************************************************************************/
/*
* File: DragDropInstrumentTarget.h
* Author: [email protected]
*
* Created on July 7, 2018, 8:52 PM
*/
#ifndef DRAGDROPINSTRUMENTTARGET_H
#define DRAGDROPINSTRUMENTTARGET_H
#include <functional>
#include <wx/dnd.h>
#include "DragDropInstrument.h"
namespace ou { // One Unified
namespace tf { // TradeFrame
/* wxDropTarget is defined in a class desiring to be the destination of an
* instrument, or OptionInstrument/UnderlyingInstrument pair
* WxDropTarget has the appropriate 'retrieve complete' function assigned
* in order to receive the desired objects in a callback
*/
class DragDropInstrumentTarget: public wxDropTarget {
public:
DragDropInstrumentTarget( DragDropInstrument *data = nullptr );
virtual ~DragDropInstrumentTarget( );
virtual bool GetData();
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult defResult);
virtual wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult defResult);
virtual bool OnDrop(wxCoord x, wxCoord y);
virtual wxDragResult OnEnter(wxCoord x, wxCoord y, wxDragResult defResult);
virtual void OnLeave();
typedef Instrument::pInstrument_t pInstrument_t;
typedef pInstrument_t pOptionInstrument_t;
typedef pInstrument_t pUnderlyingInstrument_t;
typedef DragDropInstrument::fOnInstrumentRetrieveComplete_t fOnInstrumentRetrieveComplete_t;
fOnInstrumentRetrieveComplete_t m_fOnInstrumentRetrieveComplete; // results of instrument drag, may or may not have contract
typedef DragDropInstrument::fOnOptionUnderlyingRetrieveComplete_t fOnOptionUnderlyingRetrieveComplete_t;
fOnOptionUnderlyingRetrieveComplete_t m_fOnOptionUnderlyingRetrieveComplete;
protected:
private:
};
} // namespace tf
} // namespace ou
#endif /* DRAGDROPINSTRUMENTTARGET_H */