MyGUI 3.2.2

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
15 namespace 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 virtual void onMouseButtonPressed(int _left, int _top, MouseButton _id);
105 virtual void onMouseButtonReleased(int _left, int _top, MouseButton _id);
106 virtual void onMouseDrag(int _left, int _top, MouseButton _id);
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 virtual void setPropertyOverride(const std::string& _key, const std::string& _value);
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::types::TCoord< int >
MyGUI::Widget
Widget properties. Widget_skin_childs Skin childs. Widget widget description should be here...
Definition: MyGUI_Widget.h:29
MyGUI::types::TPoint< int >
MyGUI_Prerequest.h
MyGUI::DDContainer::mDropDimension
IntCoord mDropDimension
Definition: MyGUI_DDContainer.h:136
MyGUI::DDContainer::mDropInfo
DDItemInfo mDropInfo
Definition: MyGUI_DDContainer.h:130
MyGUI::DDContainer::mStartDrop
bool mStartDrop
Definition: MyGUI_DDContainer.h:125
MyGUI::DDWidgetState
Definition: MyGUI_DDItemInfo.h:98
MyGUI::DDContainer::mClickInWidget
IntPoint mClickInWidget
Definition: MyGUI_DDContainer.h:138
MyGUI_DDItemInfo.h
MyGUI::delegates::CDelegate3< DDContainer *, Widget *&, IntCoord & >
MyGUI::DDContainer::mReseiverContainer
DDContainer * mReseiverContainer
Definition: MyGUI_DDContainer.h:143
MyGUI::delegates::CMultiDelegate3< DDContainer *, const DDItemInfo &, bool & >
MyGUI::EventHandle_EventHandle_DDContainerPtrDDItemState
delegates::CMultiDelegate2< DDContainer *, DDItemState > EventHandle_EventHandle_DDContainerPtrDDItemState
Definition: MyGUI_DDContainer.h:20
MyGUI::MouseButton
Definition: MyGUI_MouseButton.h:15
MyGUI::EventHandle_DDContainerPtrCDDItemInfoRefBoolRef
delegates::CMultiDelegate3< DDContainer *, const DDItemInfo &, bool & > EventHandle_DDContainerPtrCDDItemInfoRefBoolRef
Definition: MyGUI_DDContainer.h:18
MyGUI::DDContainer::mNeedDragDrop
bool mNeedDragDrop
Definition: MyGUI_DDContainer.h:141
MyGUI::DDItemInfo
Definition: MyGUI_DDItemInfo.h:53
MyGUI::DDContainer::eventUpdateDropState
delegates::CMultiDelegate3< DDContainer *, Widget *, const DDWidgetState & > eventUpdateDropState
Definition: MyGUI_DDContainer.h:101
MyGUI
Definition: MyGUI_ActionController.h:14
MYGUI_RTTI_DERIVED
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition: MyGUI_RTTI.h:65
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition: MyGUI_Platform.h:103
MyGUI::DDContainer::mDropSenderIndex
size_t mDropSenderIndex
Definition: MyGUI_DDContainer.h:132
MyGUI::DDContainer::mOldDrop
Widget * mOldDrop
Definition: MyGUI_DDContainer.h:127
MyGUI::EventHandle_EventHandle_DDContainerPtrWidgetPtrRefIntCoordRef
delegates::CDelegate3< DDContainer *, Widget *&, IntCoord & > EventHandle_EventHandle_DDContainerPtrWidgetPtrRefIntCoordRef
Definition: MyGUI_DDContainer.h:21
MyGUI::DDContainer::eventChangeDDState
EventHandle_EventHandle_DDContainerPtrDDItemState eventChangeDDState
Definition: MyGUI_DDContainer.h:74
MyGUI::DDContainer::mDropItem
Widget * mDropItem
Definition: MyGUI_DDContainer.h:135
MyGUI::EventHandle_DDContainerPtrCDDItemInfoRefBool
delegates::CMultiDelegate3< DDContainer *, const DDItemInfo &, bool > EventHandle_DDContainerPtrCDDItemInfoRefBool
Definition: MyGUI_DDContainer.h:19
MyGUI::DDContainer::mNeedDrop
bool mNeedDrop
Definition: MyGUI_DDContainer.h:124
MyGUI::DDContainer
DDContainer properties. DDContainer_skin_childs Skin childs. DDContainer widget description should b...
Definition: MyGUI_DDContainer.h:27
MyGUI::delegates::CMultiDelegate2< DDContainer *, DDItemState >
MyGUI::DDContainer::eventDropResult
EventHandle_DDContainerPtrCDDItemInfoRefBool eventDropResult
Definition: MyGUI_DDContainer.h:67
MyGUI_Widget.h
MyGUI_EventPair.h
MyGUI::DDContainer::eventStartDrag
EventHandle_DDContainerPtrCDDItemInfoRefBoolRef eventStartDrag
Definition: MyGUI_DDContainer.h:51
MyGUI::DDContainer::mCurrentSender
Widget * mCurrentSender
Definition: MyGUI_DDContainer.h:128
MyGUI::DDContainer::mDropResult
bool mDropResult
Definition: MyGUI_DDContainer.h:123
MyGUI::delegates::CMultiDelegate1
Definition: MyGUI_Delegate.h:203
MyGUI::DDContainer::requestDragWidgetInfo
EventHandle_EventHandle_DDContainerPtrWidgetPtrRefIntCoordRef requestDragWidgetInfo
Definition: MyGUI_DDContainer.h:82
MyGUI::DDContainer::eventRequestDrop
EventHandle_DDContainerPtrCDDItemInfoRefBoolRef eventRequestDrop
Definition: MyGUI_DDContainer.h:59
MyGUI::DDContainer::_eventInvalideContainer
delegates::CMultiDelegate1< DDContainer * > _eventInvalideContainer
Definition: MyGUI_DDContainer.h:93