MyGUI: MyGUI_DDContainer.h Source File

MyGUI 3.4.2

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files
- Examples

- File List
- Globals

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
18 typedef delegates::CMultiDelegate3<DDContainer*, const DDItemInfo&, bool&> EventHandle_DDContainerPtrCDDItemInfoRefBoolRef;
19 typedef delegates::CMultiDelegate3<DDContainer*, const DDItemInfo&, bool> EventHandle_DDContainerPtrCDDItemInfoRefBool;
20 typedef delegates::CMultiDelegate2<DDContainer*, DDItemState> EventHandle_EventHandle_DDContainerPtrDDItemState;
21 typedef delegates::CDelegate3<DDContainer*, Widget*&, IntCoord&> EventHandle_EventHandle_DDContainerPtrWidgetPtrRefIntCoordRef;
22
23
27 class MYGUI_EXPORT DDContainer :
28 public Widget
29 {
30 MYGUI_RTTI_DERIVED( DDContainer )
31
32 public:
33 DDContainer();
34
38 void setNeedDragDrop(bool _value);
40 bool getNeedDragDrop() const;
41
42 void resetDrag();
43
44 /*events:*/
51 EventHandle_DDContainerPtrCDDItemInfoRefBoolRef eventStartDrag;
52
59 EventHandle_DDContainerPtrCDDItemInfoRefBoolRef eventRequestDrop;
60
67 EventHandle_DDContainerPtrCDDItemInfoRefBool eventDropResult;
68
74 EventHandle_EventHandle_DDContainerPtrDDItemState eventChangeDDState;
75
82 EventHandle_EventHandle_DDContainerPtrWidgetPtrRefIntCoordRef requestDragWidgetInfo;
83
84
85 /*internal:*/
86 // метод для установления стейта айтема
87 virtual void _setContainerItemInfo(size_t _index, bool _set, bool _accept);
88
93 delegates::CMultiDelegate1<DDContainer*> _eventInvalideContainer;
94
101 delegates::CMultiDelegate3<DDContainer*, Widget*, const DDWidgetState&> eventUpdateDropState;
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(const std::string& _key, const std::string& _value) override;
121
122 protected:
123 bool mDropResult;
124 bool mNeedDrop;
125 bool mStartDrop;
126
127 Widget* mOldDrop;
128 Widget* mCurrentSender;
129
130 DDItemInfo mDropInfo;
131
132 size_t mDropSenderIndex;
133
134 // список виджетов для дропа
135 Widget* mDropItem;
136 IntCoord mDropDimension;
137
138 IntPoint mClickInWidget;
139
140 // нужно и виджету поддержка драг энд дропа
141 bool mNeedDragDrop;
142
143 DDContainer* mReseiverContainer;
144 };
145
146} // namespace MyGUI
147
148#endif // MYGUI_DDCONTAINER_H_
MyGUI_DDItemInfo.h
MyGUI_EventPair.h
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition MyGUI_Platform.h:77
MyGUI_Prerequest.h
MYGUI_RTTI_DERIVED
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition MyGUI_RTTI.h:48
MyGUI_Widget.h
MyGUI::DDContainer
widget description should be here.
Definition MyGUI_DDContainer.h:29
MyGUI::DDContainer::mDropInfo
DDItemInfo mDropInfo
Definition MyGUI_DDContainer.h:130
MyGUI::DDContainer::eventRequestDrop
EventHandle_DDContainerPtrCDDItemInfoRefBoolRef eventRequestDrop
Definition MyGUI_DDContainer.h:59
MyGUI::DDContainer::eventStartDrag
EventHandle_DDContainerPtrCDDItemInfoRefBoolRef eventStartDrag
Definition MyGUI_DDContainer.h:51
MyGUI::DDContainer::eventUpdateDropState
delegates::CMultiDelegate3< DDContainer *, Widget *, const DDWidgetState & > eventUpdateDropState
Definition MyGUI_DDContainer.h:101
MyGUI::DDContainer::mCurrentSender
Widget * mCurrentSender
Definition MyGUI_DDContainer.h:128
MyGUI::DDContainer::mNeedDragDrop
bool mNeedDragDrop
Definition MyGUI_DDContainer.h:141
MyGUI::DDContainer::mOldDrop
Widget * mOldDrop
Definition MyGUI_DDContainer.h:127
MyGUI::DDContainer::requestDragWidgetInfo
EventHandle_EventHandle_DDContainerPtrWidgetPtrRefIntCoordRef requestDragWidgetInfo
Definition MyGUI_DDContainer.h:82
MyGUI::DDContainer::mReseiverContainer
DDContainer * mReseiverContainer
Definition MyGUI_DDContainer.h:143
MyGUI::DDContainer::mDropSenderIndex
size_t mDropSenderIndex
Definition MyGUI_DDContainer.h:132
MyGUI::DDContainer::mStartDrop
bool mStartDrop
Definition MyGUI_DDContainer.h:125
MyGUI::DDContainer::eventChangeDDState
EventHandle_EventHandle_DDContainerPtrDDItemState eventChangeDDState
Definition MyGUI_DDContainer.h:74
MyGUI::DDContainer::mClickInWidget
IntPoint mClickInWidget
Definition MyGUI_DDContainer.h:138
MyGUI::DDContainer::mDropResult
bool mDropResult
Definition MyGUI_DDContainer.h:123
MyGUI::DDContainer::mDropItem
Widget * mDropItem
Definition MyGUI_DDContainer.h:135
MyGUI::DDContainer::mNeedDrop
bool mNeedDrop
Definition MyGUI_DDContainer.h:124
MyGUI::DDContainer::eventDropResult
EventHandle_DDContainerPtrCDDItemInfoRefBool eventDropResult
Definition MyGUI_DDContainer.h:67
MyGUI::DDContainer::mDropDimension
IntCoord mDropDimension
Definition MyGUI_DDContainer.h:136
MyGUI::DDContainer::_eventInvalideContainer
delegates::CMultiDelegate1< DDContainer * > _eventInvalideContainer
Definition MyGUI_DDContainer.h:93
MyGUI::Widget
widget description should be here.
Definition MyGUI_Widget.h:37
MyGUI::delegates::Delegate
Definition MyGUI_Delegate.h:136
MyGUI::delegates::MultiDelegate
Definition MyGUI_Delegate.h:200
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::EventHandle_EventHandle_DDContainerPtrDDItemState
delegates::CMultiDelegate2< DDContainer *, DDItemState > EventHandle_EventHandle_DDContainerPtrDDItemState
Definition MyGUI_DDContainer.h:20
MyGUI::EventHandle_DDContainerPtrCDDItemInfoRefBool
delegates::CMultiDelegate3< DDContainer *, const DDItemInfo &, bool > EventHandle_DDContainerPtrCDDItemInfoRefBool
Definition MyGUI_DDContainer.h:19
MyGUI::EventHandle_DDContainerPtrCDDItemInfoRefBoolRef
delegates::CMultiDelegate3< DDContainer *, const DDItemInfo &, bool & > EventHandle_DDContainerPtrCDDItemInfoRefBoolRef
Definition MyGUI_DDContainer.h:18
MyGUI::EventHandle_EventHandle_DDContainerPtrWidgetPtrRefIntCoordRef
delegates::CDelegate3< DDContainer *, Widget *&, IntCoord & > EventHandle_EventHandle_DDContainerPtrWidgetPtrRefIntCoordRef
Definition MyGUI_DDContainer.h:21
MyGUI::DDItemInfo
Definition MyGUI_DDItemInfo.h:55
MyGUI::DDWidgetState
Definition MyGUI_DDItemInfo.h:100
MyGUI::MouseButton
Definition MyGUI_MouseButton.h:16
MyGUI::types::TCoord< int >
MyGUI::types::TPoint< int >