1 /*! 2 @file 3 @author Generate utility by Albert Semenov 4 @date 01/2009 5 @module 6 */ 7 #pragma once 8 9 #include "MyGUI_Managed_Widget.h" 10 11 namespace MyGUI 12 { 13 namespace Managed 14 { 15 16 public ref class DDContainer : public Widget 17 { 18 19 private: 20 typedef MyGUI::DDContainer ThisType; 21 22 public: DDContainer()23 DDContainer() : Widget() { } 24 25 internal: DDContainer(MyGUI::DDContainer * _native)26 DDContainer( MyGUI::DDContainer* _native ) : Widget(_native) { } 27 DDContainer( BaseWidget^ _parent, MyGUI::WidgetStyle _style, const std::string& _skin, const MyGUI::IntCoord& _coord, MyGUI::Align _align, const std::string& _layer, const std::string& _name ) 28 { 29 CreateWidget(_parent, _style, _skin, _coord, _align, _layer, _name); 30 } 31 getClassTypeName()32 virtual const std::string& getClassTypeName() override { return ThisType::getClassTypeName(); } 33 34 static BaseWidget^ WidgetCreator(BaseWidget^ _parent, MyGUI::WidgetStyle _style, const std::string& _skin, const MyGUI::IntCoord& _coord, MyGUI::Align _align, const std::string& _layer, const std::string& _name) 35 { 36 return gcnew DDContainer(_parent, _style, _skin, _coord, _align, _layer, _name); 37 } 38 39 40 //InsertPoint 41 42 public: 43 delegate void HandleUpdateDropState( 44 Convert<MyGUI::DDContainer *>::Type _sender , 45 Convert<MyGUI::Widget *>::Type _items , 46 Convert<const MyGUI::DDWidgetState &>::Type _state ); 47 event HandleUpdateDropState^ EventUpdateDropState 48 { 49 void add(HandleUpdateDropState^ _value) 50 { 51 bool empty = mDelegateUpdateDropState == nullptr; 52 53 mDelegateUpdateDropState += _value; 54 MMYGUI_CHECK_NATIVE(mNative); 55 56 if (empty) 57 static_cast<ThisType*>(mNative)->eventUpdateDropState += 58 static_cast< MyGUI::delegates::IDelegate3< 59 MyGUI::DDContainer * , 60 MyGUI::Widget * , 61 const MyGUI::DDWidgetState & > *>( 62 new Delegate3< HandleUpdateDropState^ , 63 MyGUI::DDContainer * , 64 MyGUI::Widget * , 65 const MyGUI::DDWidgetState & >(mDelegateUpdateDropState) ); 66 } 67 void remove(HandleUpdateDropState^ _value) 68 { 69 mDelegateUpdateDropState -= _value; 70 MMYGUI_CHECK_NATIVE(mNative); 71 72 bool empty = mDelegateUpdateDropState == nullptr; 73 74 if (empty) 75 static_cast<ThisType*>(mNative)->eventUpdateDropState -= 76 static_cast< MyGUI::delegates::IDelegate3< 77 MyGUI::DDContainer * , 78 MyGUI::Widget * , 79 const MyGUI::DDWidgetState & > *>( 80 new Delegate3< HandleUpdateDropState^ , 81 MyGUI::DDContainer * , 82 MyGUI::Widget * , 83 const MyGUI::DDWidgetState & >(mDelegateUpdateDropState) ); 84 } 85 } 86 private: 87 HandleUpdateDropState^ mDelegateUpdateDropState; 88 public: 89 delegate void HandleDragWidgetInfo( 90 Convert<MyGUI::DDContainer *>::Type _sender , 91 Convert<MyGUI::Widget * &>::Type _item , 92 Convert<MyGUI::types::TCoord < int > &>::Type _dimension ); 93 event HandleDragWidgetInfo^ RequestDragWidgetInfo 94 { 95 void add(HandleDragWidgetInfo^ _value) 96 { 97 mDelegateDragWidgetInfo += _value; 98 MMYGUI_CHECK_NATIVE(mNative); 99 static_cast<ThisType*>(mNative)->requestDragWidgetInfo = 100 static_cast< MyGUI::delegates::IDelegate3< 101 MyGUI::DDContainer * , 102 MyGUI::Widget * & , 103 MyGUI::types::TCoord < int > & > *>( 104 new Delegate3_Ref2< HandleDragWidgetInfo^ , 105 MyGUI::DDContainer * , 106 MyGUI::Widget * & , 107 MyGUI::types::TCoord < int > & >(mDelegateDragWidgetInfo) ); 108 } 109 void remove(HandleDragWidgetInfo^ _value) 110 { 111 mDelegateDragWidgetInfo -= _value; 112 MMYGUI_CHECK_NATIVE(mNative); 113 if (mDelegateDragWidgetInfo == nullptr) 114 static_cast<ThisType*>(mNative)->requestDragWidgetInfo = nullptr; 115 else 116 static_cast<ThisType*>(mNative)->requestDragWidgetInfo = 117 static_cast< MyGUI::delegates::IDelegate3< 118 MyGUI::DDContainer * , 119 MyGUI::Widget * & , 120 MyGUI::types::TCoord < int > & > *>( 121 new Delegate3_Ref2< HandleDragWidgetInfo^ , 122 MyGUI::DDContainer * , 123 MyGUI::Widget * & , 124 MyGUI::types::TCoord < int > & >(mDelegateDragWidgetInfo) ); 125 } 126 } 127 private: 128 HandleDragWidgetInfo^ mDelegateDragWidgetInfo; 129 public: 130 delegate void HandleChangeDDState( 131 Convert<MyGUI::DDContainer *>::Type _sender , 132 Convert<MyGUI::DDItemState>::Type _state ); 133 event HandleChangeDDState^ EventChangeDDState 134 { 135 void add(HandleChangeDDState^ _value) 136 { 137 bool empty = mDelegateChangeDDState == nullptr; 138 139 mDelegateChangeDDState += _value; 140 MMYGUI_CHECK_NATIVE(mNative); 141 142 if (empty) 143 static_cast<ThisType*>(mNative)->eventChangeDDState += 144 static_cast< MyGUI::delegates::IDelegate2< 145 MyGUI::DDContainer * , 146 MyGUI::DDItemState > *>( 147 new Delegate2< HandleChangeDDState^ , 148 MyGUI::DDContainer * , 149 MyGUI::DDItemState >(mDelegateChangeDDState) ); 150 } 151 void remove(HandleChangeDDState^ _value) 152 { 153 mDelegateChangeDDState -= _value; 154 MMYGUI_CHECK_NATIVE(mNative); 155 156 bool empty = mDelegateChangeDDState == nullptr; 157 158 if (empty) 159 static_cast<ThisType*>(mNative)->eventChangeDDState -= 160 static_cast< MyGUI::delegates::IDelegate2< 161 MyGUI::DDContainer * , 162 MyGUI::DDItemState > *>( 163 new Delegate2< HandleChangeDDState^ , 164 MyGUI::DDContainer * , 165 MyGUI::DDItemState >(mDelegateChangeDDState) ); 166 } 167 } 168 private: 169 HandleChangeDDState^ mDelegateChangeDDState; 170 public: 171 delegate void HandleDropResult( 172 Convert<MyGUI::DDContainer *>::Type _sender , 173 Convert<const MyGUI::DDItemInfo &>::Type _info , 174 Convert<bool>::Type _result ); 175 event HandleDropResult^ EventDropResult 176 { 177 void add(HandleDropResult^ _value) 178 { 179 bool empty = mDelegateDropResult == nullptr; 180 181 mDelegateDropResult += _value; 182 MMYGUI_CHECK_NATIVE(mNative); 183 184 if (empty) 185 static_cast<ThisType*>(mNative)->eventDropResult += 186 static_cast< MyGUI::delegates::IDelegate3< 187 MyGUI::DDContainer * , 188 const MyGUI::DDItemInfo & , 189 bool > *>( 190 new Delegate3< HandleDropResult^ , 191 MyGUI::DDContainer * , 192 const MyGUI::DDItemInfo & , 193 bool >(mDelegateDropResult) ); 194 } 195 void remove(HandleDropResult^ _value) 196 { 197 mDelegateDropResult -= _value; 198 MMYGUI_CHECK_NATIVE(mNative); 199 200 bool empty = mDelegateDropResult == nullptr; 201 202 if (empty) 203 static_cast<ThisType*>(mNative)->eventDropResult -= 204 static_cast< MyGUI::delegates::IDelegate3< 205 MyGUI::DDContainer * , 206 const MyGUI::DDItemInfo & , 207 bool > *>( 208 new Delegate3< HandleDropResult^ , 209 MyGUI::DDContainer * , 210 const MyGUI::DDItemInfo & , 211 bool >(mDelegateDropResult) ); 212 } 213 } 214 private: 215 HandleDropResult^ mDelegateDropResult; 216 public: 217 delegate void HandleRequestDrop( 218 Convert<MyGUI::DDContainer *>::Type _sender , 219 Convert<const MyGUI::DDItemInfo &>::Type _info , 220 Convert<bool &>::Type _result ); 221 event HandleRequestDrop^ EventRequestDrop 222 { 223 void add(HandleRequestDrop^ _value) 224 { 225 bool empty = mDelegateRequestDrop == nullptr; 226 227 mDelegateRequestDrop += _value; 228 MMYGUI_CHECK_NATIVE(mNative); 229 230 if (empty) 231 static_cast<ThisType*>(mNative)->eventRequestDrop += 232 static_cast< MyGUI::delegates::IDelegate3< 233 MyGUI::DDContainer * , 234 const MyGUI::DDItemInfo & , 235 bool & > *>( 236 new Delegate3< HandleRequestDrop^ , 237 MyGUI::DDContainer * , 238 const MyGUI::DDItemInfo & , 239 bool & >(mDelegateRequestDrop) ); 240 } 241 void remove(HandleRequestDrop^ _value) 242 { 243 mDelegateRequestDrop -= _value; 244 MMYGUI_CHECK_NATIVE(mNative); 245 246 bool empty = mDelegateRequestDrop == nullptr; 247 248 if (empty) 249 static_cast<ThisType*>(mNative)->eventRequestDrop -= 250 static_cast< MyGUI::delegates::IDelegate3< 251 MyGUI::DDContainer * , 252 const MyGUI::DDItemInfo & , 253 bool & > *>( 254 new Delegate3< HandleRequestDrop^ , 255 MyGUI::DDContainer * , 256 const MyGUI::DDItemInfo & , 257 bool & >(mDelegateRequestDrop) ); 258 } 259 } 260 private: 261 HandleRequestDrop^ mDelegateRequestDrop; 262 public: 263 delegate void HandleStartDrag( 264 Convert<MyGUI::DDContainer *>::Type _sender , 265 Convert<const MyGUI::DDItemInfo &>::Type _info , 266 Convert<bool &>::Type _result ); 267 event HandleStartDrag^ EventStartDrag 268 { 269 void add(HandleStartDrag^ _value) 270 { 271 bool empty = mDelegateStartDrag == nullptr; 272 273 mDelegateStartDrag += _value; 274 MMYGUI_CHECK_NATIVE(mNative); 275 276 if (empty) 277 static_cast<ThisType*>(mNative)->eventStartDrag += 278 static_cast< MyGUI::delegates::IDelegate3< 279 MyGUI::DDContainer * , 280 const MyGUI::DDItemInfo & , 281 bool & > *>( 282 new Delegate3< HandleStartDrag^ , 283 MyGUI::DDContainer * , 284 const MyGUI::DDItemInfo & , 285 bool & >(mDelegateStartDrag) ); 286 } 287 void remove(HandleStartDrag^ _value) 288 { 289 mDelegateStartDrag -= _value; 290 MMYGUI_CHECK_NATIVE(mNative); 291 292 bool empty = mDelegateStartDrag == nullptr; 293 294 if (empty) 295 static_cast<ThisType*>(mNative)->eventStartDrag -= 296 static_cast< MyGUI::delegates::IDelegate3< 297 MyGUI::DDContainer * , 298 const MyGUI::DDItemInfo & , 299 bool & > *>( 300 new Delegate3< HandleStartDrag^ , 301 MyGUI::DDContainer * , 302 const MyGUI::DDItemInfo & , 303 bool & >(mDelegateStartDrag) ); 304 } 305 } 306 private: 307 HandleStartDrag^ mDelegateStartDrag; 308 public: ResetDrag()309 void ResetDrag( ) 310 { 311 MMYGUI_CHECK_NATIVE(mNative); 312 static_cast<ThisType*>(mNative)->resetDrag( ); 313 } 314 public: 315 property Convert<bool>::Type NeedDragDrop 316 { get()317 Convert<bool>::Type get( ) 318 { 319 MMYGUI_CHECK_NATIVE(mNative); 320 return Convert<bool>::To( static_cast<ThisType*>(mNative)->getNeedDragDrop() ); 321 } set(Convert<bool>::Type _value)322 void set(Convert<bool>::Type _value) 323 { 324 MMYGUI_CHECK_NATIVE(mNative); 325 static_cast<ThisType*>(mNative)->setNeedDragDrop( Convert<bool>::From(_value) ); 326 } 327 } 328 329 }; 330 331 } // namespace Managed 332 } // namespace MyGUI 333