MyGUI  3.0.1
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 
38 
39 
41  public Widget
42  {
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:*/
66 
74 
82 
89 
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 
111 
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:
151  bool mNeedDrop;
153 
156 
158 
160 
161  // список виджетов для дропа
164 
166 
167  // нужно и виджету поддержка драг энд дропа
169 
171  };
172 
173 } // namespace MyGUI
174 
175 #endif // __MYGUI_DDCONTAINER_H__