MyGUI 3.4.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
31 {
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 // метод для установления стейта айтема
87 virtual void _setContainerItemInfo(size_t _index, bool _set, bool _accept);
88
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
130
131 size_t mDropSenderIndex{ITEM_NONE};
132
133 // список виджетов для дропа
134 Widget* mDropItem{nullptr};
136
138
139 // нужно и виджету поддержка драг энд дропа
140 bool mNeedDragDrop{false};
141
142 DDContainer* mReseiverContainer{nullptr};
143 };
144
145} // namespace MyGUI
146
147#endif // MYGUI_DDCONTAINER_H_
#define MYGUI_EXPORT
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition MyGUI_RTTI.h:69
widget description should be here.
delegates::MultiDelegate< DDContainer * > _eventInvalideContainer
EventHandle_DDContainerPtrCDDItemInfoRefBoolRef eventRequestDrop
EventHandle_DDContainerPtrCDDItemInfoRefBoolRef eventStartDrag
EventHandle_EventHandle_DDContainerPtrWidgetPtrRefIntCoordRef requestDragWidgetInfo
EventHandle_EventHandle_DDContainerPtrDDItemState eventChangeDDState
EventHandle_DDContainerPtrCDDItemInfoRefBool eventDropResult
delegates::MultiDelegate< DDContainer *, Widget *, const DDWidgetState & > eventUpdateDropState
widget description should be here.
constexpr size_t ITEM_NONE