MyGUI 3.2.0

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

- File List
- Globals

MyGUI_DDContainer.h
Go to the documentation of this file.
1
6 /*
7 This file is part of MyGUI.
8
9 MyGUI is free software: you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 MyGUI is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public License
20 along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
21 */
22 #ifndef __MYGUI_DDCONTAINER_H__
23 #define __MYGUI_DDCONTAINER_H__
24
25 #include "MyGUI_Prerequest.h"
26 #include "MyGUI_Widget.h"
27 #include "MyGUI_DDItemInfo.h"
28 #include "MyGUI_EventPair.h"
29
30 namespace MyGUI
31 {
32
33 typedef delegates::CMultiDelegate3<DDContainer*, const DDItemInfo&, bool&> EventHandle_DDContainerPtrCDDItemInfoRefBoolRef;
34 typedef delegates::CMultiDelegate3<DDContainer*, const DDItemInfo&, bool> EventHandle_DDContainerPtrCDDItemInfoRefBool;
35 typedef delegates::CMultiDelegate2<DDContainer*, DDItemState> EventHandle_EventHandle_DDContainerPtrDDItemState;
36 typedef delegates::CDelegate3<DDContainer*, Widget*&, IntCoord&> EventHandle_EventHandle_DDContainerPtrWidgetPtrRefIntCoordRef;
37
38
39 class MYGUI_EXPORT DDContainer :
40 public Widget
41 {
42 MYGUI_RTTI_DERIVED( DDContainer )
43
44 public:
45 DDContainer();
46
50 void setNeedDragDrop(bool _value);
52 bool getNeedDragDrop() const;
53
54 void resetDrag();
55
56 /*events:*/
63 EventHandle_DDContainerPtrCDDItemInfoRefBoolRef
64 eventStartDrag;
65
72 EventHandle_DDContainerPtrCDDItemInfoRefBoolRef
73 eventRequestDrop;
74
81 EventHandle_DDContainerPtrCDDItemInfoRefBool
82 eventDropResult;
83
89 EventHandle_EventHandle_DDContainerPtrDDItemState
90 eventChangeDDState;
91
98 EventHandle_EventHandle_DDContainerPtrWidgetPtrRefIntCoordRef
99 requestDragWidgetInfo;
100
101
102 /*internal:*/
103 // метод для установления стейта айтема
104 virtual void _setContainerItemInfo(size_t _index, bool _set, bool _accept);
105
110 delegates::CMultiDelegate1<DDContainer*>
111 _eventInvalideContainer;
112
119 delegates::CMultiDelegate3<DDContainer*, Widget*, const DDWidgetState&>
120 eventUpdateDropState;
121
122 protected:
123 virtual void onMouseButtonPressed(int _left, int _top, MouseButton _id);
124 virtual void onMouseButtonReleased(int _left, int _top, MouseButton _id);
125 virtual void onMouseDrag(int _left, int _top, MouseButton _id);
126
127 virtual void notifyInvalideDrop(DDContainer* _sender);
128
129 virtual void removeDropItems();
130 virtual void updateDropItems();
131 virtual void updateDropItemsState(const DDWidgetState& _state);
132
133 void mouseDrag(MouseButton _id);
134 void mouseButtonReleased(MouseButton _id);
135 void mouseButtonPressed(MouseButton _id);
136
137 void endDrop(bool _reset);
138
139 virtual void setPropertyOverride(const std::string& _key, const std::string& _value);
140
141 protected:
142 bool mDropResult;
143 bool mNeedDrop;
144 bool mStartDrop;
145
146 Widget* mOldDrop;
147 Widget* mCurrentSender;
148
149 DDItemInfo mDropInfo;
150
151 size_t mDropSenderIndex;
152
153 // список виджетов для дропа
154 Widget* mDropItem;
155 IntCoord mDropDimension;
156
157 IntPoint mClickInWidget;
158
159 // нужно и виджету поддержка драг энд дропа
160 bool mNeedDragDrop;
161
162 DDContainer* mReseiverContainer;
163 };
164
165 } // namespace MyGUI
166
167 #endif // __MYGUI_DDCONTAINER_H__
MyGUI::types::TCoord< int >
MyGUI::Widget
Definition: MyGUI_Widget.h:41
MyGUI::types::TPoint< int >
MyGUI_Prerequest.h
MyGUI::DDWidgetState
Definition: MyGUI_DDItemInfo.h:108
MyGUI_DDItemInfo.h
MyGUI::delegates::CDelegate3< DDContainer *, Widget *&, IntCoord & >
MyGUI::delegates::CMultiDelegate3< DDContainer *, const DDItemInfo &, bool & >
MyGUI::EventHandle_EventHandle_DDContainerPtrDDItemState
delegates::CMultiDelegate2< DDContainer *, DDItemState > EventHandle_EventHandle_DDContainerPtrDDItemState
Definition: MyGUI_DDContainer.h:35
MyGUI::MouseButton
Definition: MyGUI_MouseButton.h:30
MyGUI::EventHandle_DDContainerPtrCDDItemInfoRefBoolRef
delegates::CMultiDelegate3< DDContainer *, const DDItemInfo &, bool & > EventHandle_DDContainerPtrCDDItemInfoRefBoolRef
Definition: MyGUI_DDContainer.h:33
MyGUI::DDItemInfo
Definition: MyGUI_DDItemInfo.h:63
MYGUI_RTTI_DERIVED
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition: MyGUI_RTTI.h:88
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition: MyGUI_Platform.h:120
MyGUI::EventHandle_EventHandle_DDContainerPtrWidgetPtrRefIntCoordRef
delegates::CDelegate3< DDContainer *, Widget *&, IntCoord & > EventHandle_EventHandle_DDContainerPtrWidgetPtrRefIntCoordRef
Definition: MyGUI_DDContainer.h:36
MyGUI::EventHandle_DDContainerPtrCDDItemInfoRefBool
delegates::CMultiDelegate3< DDContainer *, const DDItemInfo &, bool > EventHandle_DDContainerPtrCDDItemInfoRefBool
Definition: MyGUI_DDContainer.h:34
MyGUI::DDContainer
Definition: MyGUI_DDContainer.h:39
MyGUI::delegates::CMultiDelegate2< DDContainer *, DDItemState >
MyGUI_Widget.h
MyGUI_EventPair.h