MyGUI 3.5.3
MyGUI_DDContainer.h
Go to the documentation of this file.
1/*
2 * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3 * Distributed under the MIT License
4 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5 */
6
7#ifndef MYGUI_DDCONTAINER_H_
8#define MYGUI_DDCONTAINER_H_
9
10#include "MyGUI_Prerequest.h"
11#include "MyGUI_Widget.h"
12#include "MyGUI_DDItemInfo.h"
13#include "MyGUI_EventPair.h"
14
15namespace MyGUI
16{
17
25
26
30 class MYGUI_EXPORT DDContainer : public Widget
31 {
32 MYGUI_RTTI_DERIVED(DDContainer)
33
34 public:
38 void setNeedDragDrop(bool _value);
40 bool getNeedDragDrop() const;
41
42 void resetDrag();
43
44 /*events:*/
52
60
68
75
83
84
85 /*internal:*/
86 // Method for setting item state in container
87 virtual void _setContainerItemInfo(size_t _index, bool _set, bool _accept);
88
93 delegates::MultiDelegate<DDContainer*> _eventInvalideContainer;
94
102
103 protected:
104 void onMouseButtonPressed(int _left, int _top, MouseButton _id) override;
105 void onMouseButtonReleased(int _left, int _top, MouseButton _id) override;
106 void onMouseDrag(int _left, int _top, MouseButton _id) override;
107
108 virtual void notifyInvalideDrop(DDContainer* _sender);
109
110 virtual void removeDropItems();
111 virtual void updateDropItems();
112 virtual void updateDropItemsState(const DDWidgetState& _state);
113
114 void mouseDrag(MouseButton _id);
115 void mouseButtonReleased(MouseButton _id);
116 void mouseButtonPressed(MouseButton _id);
117
118 void endDrop(bool _reset);
119
120 void setPropertyOverride(std::string_view _key, std::string_view _value) override;
121
122 protected:
123 bool mDropResult{false};
124 bool mNeedDrop{false};
125 bool mStartDrop{false};
126
127 Widget* mOldDrop{nullptr};
128
129 DDItemInfo mDropInfo;
130
131 size_t mDropSenderIndex{ITEM_NONE};
132
133 Widget* mDropItem{nullptr};
134 IntCoord mDropDimension;
135
136 IntPoint mClickInWidget;
137
138 bool mNeedDragDrop{false};
139
140 DDContainer* mReseiverContainer{nullptr};
141 };
142
143} // namespace MyGUI
144
145#endif // MYGUI_DDCONTAINER_H_
#define MYGUI_EXPORT
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition MyGUI_RTTI.h:67
types::TPoint< int > IntPoint
Definition MyGUI_Types.h:26
delegates::MultiDelegate< DDContainer *, const DDItemInfo &, bool > EventHandle_DDContainerPtrCDDItemInfoRefBool
delegates::MultiDelegate< DDContainer *, const DDItemInfo &, bool & > EventHandle_DDContainerPtrCDDItemInfoRefBoolRef
constexpr size_t ITEM_NONE
delegates::MultiDelegate< DDContainer *, DDItemState > EventHandle_EventHandle_DDContainerPtrDDItemState
types::TCoord< int > IntCoord
Definition MyGUI_Types.h:35
delegates::Delegate< DDContainer *, Widget *&, IntCoord & > EventHandle_EventHandle_DDContainerPtrWidgetPtrRefIntCoordRef