DbgEditorWidget1.cpp 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #include "DbgEditorWidget1.h"
  2. #include "BsEditorWindow.h"
  3. #include "BsGUILabel.h"
  4. #include "BsGUIButton.h"
  5. #include "BsGUIInputBox.h"
  6. #include "BsGUIScrollArea.h"
  7. #include "BsGUIArea.h"
  8. #include "BsGUILayout.h"
  9. #include "BsEditorWidgetManager.h"
  10. namespace BansheeEngine
  11. {
  12. DbgEditorWidget1* DbgEditorWidget1::Instance = nullptr;
  13. DbgEditorWidget1::DbgEditorWidget1(const ConstructPrivately& dummy, EditorWidgetContainer& parentContainer)
  14. :EditorWidget<DbgEditorWidget1>(HString(L"DbgEditorWidget1"), parentContainer)
  15. {
  16. GUILayout& layout = mContent->getLayout();
  17. //
  18. //mDbgLabel = GUILabel::create(*mGUI, "Testing test");
  19. //layout.addElement(mDbgLabel);
  20. //layout.addElement(GUIInputBox::create(*mGUI));
  21. //layout.addElement(GUIInputBox::create(*mGUI, GUILayoutOptions::fixed(100, 100), true));
  22. GUIScrollArea* scrollArea = GUIScrollArea::create();
  23. layout.addElement(scrollArea);
  24. GUILayout& scrollLayout = scrollArea->getLayout().addLayoutX();
  25. //scrollLayout.addElement(GUIButton::create(*mGUI, L"Test A"));
  26. //scrollLayout.addElement(GUIButton::create(*mGUI, L"Test B"));
  27. //scrollLayout.addElement(GUIButton::create(*mGUI, L"Test C"));
  28. //scrollLayout.addElement(GUIButton::create(*mGUI, L"Test D"));
  29. //scrollLayout.addElement(GUIButton::create(*mGUI, L"Test E"));
  30. //scrollLayout.addElement(GUIButton::create(*mGUI, L"Test F"));
  31. //scrollLayout.addElement(GUIButton::create(*mGUI, L"Test G"));
  32. //scrollLayout.addElement(GUIButton::create(*mGUI, L"Test H"));
  33. //scrollLayout.addElement(GUIButton::create(*mGUI, L"Test I"));
  34. //scrollLayout.addElement(GUIButton::create(*mGUI, L"Test J"));
  35. //scrollLayout.addElement(GUIButton::create(*mGUI, L"Test K"));
  36. //scrollLayout.addElement(GUIButton::create(*mGUI, L"Test L"));
  37. scrollLayout.addElement(GUIInputBox::create(true, GUIOptions(GUIOption::fixedWidth(100), GUIOption::fixedHeight(100))));
  38. scrollLayout.addElement(GUIInputBox::create(true, GUIOptions(GUIOption::fixedWidth(100), GUIOption::fixedHeight(100))));
  39. scrollLayout.addElement(GUIInputBox::create(true, GUIOptions(GUIOption::fixedWidth(100), GUIOption::fixedHeight(100))));
  40. //GUIFlexibleSpace& space4 = otherLayout.addFlexibleSpace();
  41. //otherLayout.addElement(mDbgLabel);
  42. //GUIFixedSpace& space = otherLayout.addSpace(10); // Due to bug in MSVC compiler I need to store return value
  43. //GUIFlexibleSpace& space3 = otherLayout.addFlexibleSpace();
  44. //otherLayout.addElement(GUIWindowFrame::create(*mGUI, GUILayoutOptions::fixed(100, 100)));
  45. //GUIFixedSpace& space2 = otherLayout.addSpace(10);
  46. //otherLayout.addElement(GUIButton::create(*mGUI, "Test"));
  47. //otherLayout.addElement(GUIWindowFrame::create(*mGUI));
  48. //GUIArea* backgroundArea = GUIArea::create(*mGUI, 0, 0, 0, 0, 2000);
  49. //backgroundArea->getLayout().addElement(GUITexture::create(*mGUI, GUILayoutOptions::expandableXY(), GUIImageScaleMode::RepeatToFit, mGUI->getSkin()->getStyle("WindowBackground")));
  50. //GUIArea* windowFrameArea = GUIArea::create(*mGUI, 0, 0, 0, 0, 1999);
  51. //windowFrameArea->getLayout().addElement(GUIWindowFrame::create(*mGUI));
  52. //GUIArea* titleBarBackgroundArea = GUIArea::create(*mGUI, 0, 1, 0, 11, 1999);
  53. //titleBarBackgroundArea->getLayout().addSpace(1);
  54. //titleBarBackgroundArea->getLayout().addElement(GUITexture::create(*mGUI, GUIImageScaleMode::RepeatToFit, GUILayoutOptions::expandableXY(), mGUI->getGUISkin()->getStyle("TitleBarBg")));
  55. //titleBarBackgroundArea->getLayout().addSpace(1);
  56. //mRenderWindow->resize(300, 250);
  57. //mRenderWindow->setVisible(false);
  58. }
  59. DbgEditorWidget1::~DbgEditorWidget1()
  60. {
  61. }
  62. DbgEditorWidget1* DbgEditorWidget1::instance()
  63. {
  64. return Instance;
  65. }
  66. DbgEditorWidget1* DbgEditorWidget1::open()
  67. {
  68. return static_cast<DbgEditorWidget1*>(EditorWidgetManager::instance().open(getTypeName()));
  69. }
  70. void DbgEditorWidget1::close()
  71. {
  72. if(Instance != nullptr)
  73. EditorWidgetManager::instance().close(Instance);
  74. Instance = nullptr;
  75. }
  76. const String& DbgEditorWidget1::getTypeName()
  77. {
  78. static String name = "DbgEditorWidget1";
  79. return name;
  80. }
  81. }