BsEditorWidget.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #include "BsEditorWidget.h"
  2. #include "BsGUIManager.h"
  3. #include "BsGUIWidget.h"
  4. #include "BsGUITexture.h"
  5. #include "BsGUISkin.h"
  6. #include "BsGUILayout.h"
  7. #include "BsEngineGUI.h"
  8. #include "BsGUIArea.h"
  9. using namespace CamelotFramework;
  10. using namespace BansheeEngine;
  11. namespace BansheeEditor
  12. {
  13. EditorWidget::EditorWidget(const WString& name)
  14. :mName(name), mParentWidget(nullptr), mContent(nullptr)
  15. {
  16. }
  17. EditorWidget::~EditorWidget()
  18. {
  19. }
  20. void EditorWidget::_setPosition(INT32 x, INT32 y)
  21. {
  22. if(mContent == nullptr)
  23. return;
  24. mContent->setPosition(x, y);
  25. }
  26. void EditorWidget::_setSize(UINT32 width, UINT32 height)
  27. {
  28. if(mContent == nullptr)
  29. return;
  30. mContent->setSize(width, height);
  31. }
  32. void EditorWidget::_changeParent(BS::GUIWidget& widget)
  33. {
  34. if(mParentWidget != &widget)
  35. {
  36. if(mParentWidget == nullptr)
  37. mContent = GUIArea::create(widget, 0, 0, 0, 0, 10000);
  38. else
  39. mContent->changeParentWidget(widget);
  40. mParentWidget = &widget;
  41. }
  42. }
  43. void EditorWidget::_disable()
  44. {
  45. mContent->disable();
  46. }
  47. void EditorWidget::_enable()
  48. {
  49. mContent->enable();
  50. }
  51. }