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);
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
132
133 // список виджетов для дропа
134 Widget* mDropItem{nullptr};
136
138
139 // нужно и виджету поддержка драг энд дропа
140 bool mNeedDragDrop{false};
141
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.
void onMouseDrag(int _left, int _top, MouseButton _id) override
delegates::MultiDelegate< DDContainer * > _eventInvalideContainer
EventHandle_DDContainerPtrCDDItemInfoRefBoolRef eventRequestDrop
virtual void notifyInvalideDrop(DDContainer *_sender)
EventHandle_DDContainerPtrCDDItemInfoRefBoolRef eventStartDrag
virtual void _setContainerItemInfo(size_t _index, bool _set, bool _accept)
EventHandle_EventHandle_DDContainerPtrWidgetPtrRefIntCoordRef requestDragWidgetInfo
DDContainer * mReseiverContainer
void onMouseButtonPressed(int _left, int _top, MouseButton _id) override
void setPropertyOverride(std::string_view _key, std::string_view _value) override
void mouseButtonPressed(MouseButton _id)
virtual void updateDropItems()
EventHandle_EventHandle_DDContainerPtrDDItemState eventChangeDDState
void onMouseButtonReleased(int _left, int _top, MouseButton _id) override
void mouseButtonReleased(MouseButton _id)
virtual void removeDropItems()
void setNeedDragDrop(bool _value)
virtual void updateDropItemsState(const DDWidgetState &_state)
EventHandle_DDContainerPtrCDDItemInfoRefBool eventDropResult
void mouseDrag(MouseButton _id)
void endDrop(bool _reset)
delegates::MultiDelegate< DDContainer *, Widget *, const DDWidgetState & > eventUpdateDropState
widget description should be here.
types::TPoint< int > IntPoint
Definition MyGUI_Types.h:27
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:36
delegates::Delegate< DDContainer *, Widget *&, IntCoord & > EventHandle_EventHandle_DDContainerPtrWidgetPtrRefIntCoordRef
delegates::MultiDelegate< DDContainer *, const DDItemInfo &, bool > EventHandle_DDContainerPtrCDDItemInfoRefBool