MyGUI
3.0.1
Main Page
Related Pages
Namespaces
Data Structures
Files
Examples
File List
Globals
MyGUIEngine
include
MyGUI_DDContainer.h
Go to the documentation of this file.
1
7
/*
8
This file is part of MyGUI.
9
10
MyGUI is free software: you can redistribute it and/or modify
11
it under the terms of the GNU Lesser General Public License as published by
12
the Free Software Foundation, either version 3 of the License, or
13
(at your option) any later version.
14
15
MyGUI is distributed in the hope that it will be useful,
16
but WITHOUT ANY WARRANTY; without even the implied warranty of
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
GNU Lesser General Public License for more details.
19
20
You should have received a copy of the GNU Lesser General Public License
21
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
22
*/
23
#ifndef __MYGUI_DDCONTAINER_H__
24
#define __MYGUI_DDCONTAINER_H__
25
26
#include "
MyGUI_Prerequest.h
"
27
#include "
MyGUI_Widget.h
"
28
#include "
MyGUI_DDItemInfo.h
"
29
#include "
MyGUI_EventPair.h
"
30
31
namespace
MyGUI
32
{
33
34
typedef
delegates::CDelegate3<DDContainer*, const DDItemInfo&, bool&>
EventHandle_DDContainerPtrCDDItemInfoRefBoolRef
;
35
typedef
delegates::CDelegate3<DDContainer*, const DDItemInfo&, bool>
EventHandle_DDContainerPtrCDDItemInfoRefBool
;
36
typedef
delegates::CDelegate2<DDContainer*, DDItemState>
EventHandle_EventHandle_DDContainerPtrDDItemState
;
37
typedef
delegates::CDelegate3<DDContainer*, WidgetPtr&, IntCoord&>
EventHandle_EventHandle_DDContainerPtrWidgetPtrRefIntCoordRef
;
38
39
40
class
MYGUI_EXPORT
DDContainer
:
41
public
Widget
42
{
43
MYGUI_RTTI_DERIVED
(
DDContainer
)
44
45
public:
46
DDContainer
();
47
51
void
setNeedDragDrop(
bool
_value) { mNeedDragDrop = _value; }
53
bool
getNeedDragDrop
() {
return
mNeedDragDrop; }
54
56
virtual
void
setProperty(
const
std::string& _key,
const
std::string& _value);
57
58
/*event:*/
65
EventHandle_DDContainerPtrCDDItemInfoRefBoolRef
eventStartDrag
;
66
73
EventHandle_DDContainerPtrCDDItemInfoRefBoolRef
eventRequestDrop
;
74
81
EventHandle_DDContainerPtrCDDItemInfoRefBool
eventDropResult
;
82
88
EventHandle_EventHandle_DDContainerPtrDDItemState
eventChangeDDState
;
89
96
EventHandle_EventHandle_DDContainerPtrWidgetPtrRefIntCoordRef
requestDragWidgetInfo
;
97
98
99
/*internal:*/
100
// метод для установления стейта айтема
101
virtual
void
_setContainerItemInfo
(
size_t
_index,
bool
_set,
bool
_accept) { }
102
103
virtual
void
_initialise(
WidgetStyle
_style,
const
IntCoord
& _coord,
Align
_align,
ResourceSkin
* _info,
Widget
* _parent,
ICroppedRectangle
* _croppedParent,
IWidgetCreator
* _creator,
const
std::string& _name);
104
109
EventPair<EventHandle_WidgetVoid, delegates::CDelegate1<DDContainer*>
>
110
_eventInvalideContainer
;
111
118
delegates::CDelegate3<DDContainer*, Widget*, const DDWidgetState&>
119
eventUpdateDropState
;
120
121
protected
:
122
virtual
~
DDContainer
();
123
124
void
baseChangeWidgetSkin(
ResourceSkin
* _info);
125
126
virtual
void
onMouseButtonPressed(
int
_left,
int
_top,
MouseButton
_id);
127
virtual
void
onMouseButtonReleased(
int
_left,
int
_top,
MouseButton
_id);
128
virtual
void
onMouseDrag(
int
_left,
int
_top);
129
130
virtual
void
notifyInvalideDrop(
DDContainer
* _sender);
131
132
virtual
void
_getContainer(
Widget
*& _container,
size_t
& _index);
133
134
virtual
void
removeDropItems();
135
virtual
void
updateDropItems();
136
virtual
void
updateDropItemsState(
const
DDWidgetState
& _state);
137
138
void
mouseDrag();
139
void
mouseButtonReleased(
MouseButton
_id);
140
void
mouseButtonPressed(
MouseButton
_id);
141
142
void
endDrop(
bool
_reset);
143
144
private
:
145
void
initialiseWidgetSkin(
ResourceSkin
* _info);
146
void
shutdownWidgetSkin();
147
148
149
protected
:
150
bool
mDropResult
;
151
bool
mNeedDrop
;
152
bool
mStartDrop
;
153
154
Widget
*
mOldDrop
;
155
Widget
*
mCurrentSender
;
156
157
DDItemInfo
mDropInfo
;
158
159
size_t
mDropSenderIndex
;
160
161
// список виджетов для дропа
162
Widget
*
mDropItem
;
163
IntCoord
mDropDimension
;
164
165
IntPoint
mClickInWidget
;
166
167
// нужно и виджету поддержка драг энд дропа
168
bool
mNeedDragDrop
;
169
170
DDContainer
*
mReseiverContainer
;
171
};
172
173
}
// namespace MyGUI
174
175
#endif // __MYGUI_DDCONTAINER_H__
Generated by
1.8.1.2