CmPlatform.cpp 770 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #include "CmPlatform.h"
  2. namespace CamelotFramework
  3. {
  4. OSDropTarget::OSDropTarget(const RenderWindow* ownerWindow, INT32 x, INT32 y, UINT32 width, UINT32 height)
  5. :mOwnerWindow(ownerWindow), mX(x), mY(y), mWidth(width), mHeight(height), mDropType(OSDropType::None), mFileList(nullptr)
  6. {
  7. }
  8. OSDropTarget::~OSDropTarget()
  9. {
  10. clean();
  11. }
  12. void OSDropTarget::setArea(INT32 x, INT32 y, UINT32 width, UINT32 height)
  13. {
  14. mX = x;
  15. mY = y;
  16. mWidth = width;
  17. mHeight = height;
  18. }
  19. void OSDropTarget::clean()
  20. {
  21. if(mFileList != nullptr)
  22. cm_delete(mFileList);
  23. }
  24. void OSDropTarget::setFileList(const Vector<WString>::type& fileList)
  25. {
  26. clean();
  27. mFileList = cm_new<Vector<WString>::type>();
  28. *mFileList = fileList;
  29. }
  30. }