|
|
@@ -36,7 +36,7 @@ using namespace BansheeEngine;
|
|
|
namespace BansheeEditor
|
|
|
{
|
|
|
TestTextSprite::TestTextSprite(const HSceneObject& parent, CM::Viewport* target)
|
|
|
- :GUIWidget(parent, target), mListBox(nullptr)
|
|
|
+ :GUIWidget(parent, target)
|
|
|
{
|
|
|
}
|
|
|
|
|
|
@@ -49,15 +49,6 @@ namespace BansheeEditor
|
|
|
setSkin(BansheeEditor::EditorGUI::instance().getSkin());
|
|
|
setDepth(128);
|
|
|
|
|
|
- GUIArea* area = GUIArea::createStretchedXY(*this, 0, 0, 0, 0);
|
|
|
-
|
|
|
- mSceneTreeView = GUISceneTreeView::create(*this, GUIOptions(GUIOption::flexibleWidth(), GUIOption::flexibleHeight()));
|
|
|
- mResourceTreeView = GUIResourceTreeView::create(*this, GUIOptions(GUIOption::flexibleWidth(), GUIOption::flexibleHeight()));
|
|
|
- GUILayout& sceneTreeViewLayout = area->getLayout().addLayoutY();
|
|
|
-
|
|
|
- //sceneTreeViewLayout.addElement(mSceneTreeView);
|
|
|
-
|
|
|
-
|
|
|
SceneObject::create("FILLER_A");
|
|
|
SceneObject::create("FILLER_B");
|
|
|
SceneObject::create("FILLER_C");
|
|
|
@@ -71,116 +62,34 @@ namespace BansheeEditor
|
|
|
SceneObject::create("FILLER_K");
|
|
|
SceneObject::create("FILLER_L");
|
|
|
|
|
|
- area->getLayout().addElement(GUIRenderTexture::create(*this, sceneView, GUIOptions(GUIOption::fixedWidth(800), GUIOption::fixedHeight(600))));
|
|
|
- //mLabel = GUILabel::create(*this, HString(L""));
|
|
|
- //area->getLayout().addElement(mLabel);
|
|
|
-
|
|
|
- //Vector<HString>::type dropDownElements;
|
|
|
- //dropDownElements.push_back(HString(L"Ejlement #1"));
|
|
|
- //dropDownElements.push_back(HString(L"Element #2"));
|
|
|
- //dropDownElements.push_back(HString(L"Element #3"));
|
|
|
- //mListBox = GUIListBox::create(*this, dropDownElements, GUIOptions(GUIOption::fixedWidth(50), GUIOption::fixedHeight(13)));
|
|
|
- //area->getLayout().addElement(mListBox);
|
|
|
-
|
|
|
- GUIScrollArea* scrollArea = GUIScrollArea::create(*this, GUIOptions(GUIOption::fixedWidth(100), GUIOption::fixedHeight(100)));
|
|
|
- sceneTreeViewLayout.addFlexibleSpace();
|
|
|
- area->getLayout().addElement(scrollArea);
|
|
|
- sceneTreeViewLayout.addFlexibleSpace();
|
|
|
+ //GUIArea* area = GUIArea::createStretchedXY(*this, 0, 0, 0, 0);
|
|
|
+ //area->getLayout().addElement(GUIRenderTexture::create(*this, sceneView, GUIOptions(GUIOption::fixedWidth(800), GUIOption::fixedHeight(600))));
|
|
|
|
|
|
- scrollArea->getLayout().addElement(mSceneTreeView);
|
|
|
- area->getLayout().addElement(mResourceTreeView);
|
|
|
+ //GUIArea* area = GUIArea::createStretchedXY(*this, 0, 0, 0, 0);
|
|
|
|
|
|
- GUIIntField* intField = GUIIntField::create(*this, HString(L"Int Field"), GUIOptions(GUIOption::fixedWidth(200)));
|
|
|
- GUIFloatField* floatField = GUIFloatField::create(*this, HString(L"Float Field"), GUIOptions(GUIOption::fixedWidth(200)));
|
|
|
- area->getLayout().addElement(intField);
|
|
|
- area->getLayout().addElement(floatField);
|
|
|
- //GUIButton* button = GUIButton::create(*this, HString(L"dbgBtn"));
|
|
|
- //button->onClick.connect(boost::bind(&TestTextSprite::dbgBtn, this));
|
|
|
- //area->getLayout().addElement(button);
|
|
|
+ //mSceneTreeView = GUISceneTreeView::create(*this, GUIOptions(GUIOption::flexibleWidth(), GUIOption::flexibleHeight()));
|
|
|
+ //mResourceTreeView = GUIResourceTreeView::create(*this, GUIOptions(GUIOption::flexibleWidth(), GUIOption::flexibleHeight()));
|
|
|
+ //GUILayout& sceneTreeViewLayout = area->getLayout().addLayoutY();
|
|
|
|
|
|
- //button = GUIButton::create(*this, HString(L"Add GameObjects"));
|
|
|
- //button->onClick.connect(boost::bind(&TestTextSprite::dbgAdd, this));
|
|
|
- //area->getLayout().addElement(button);
|
|
|
+ //GUIScrollArea* scrollArea = GUIScrollArea::create(*this, GUIOptions(GUIOption::fixedWidth(100), GUIOption::fixedHeight(100)));
|
|
|
+ //sceneTreeViewLayout.addFlexibleSpace();
|
|
|
+ //area->getLayout().addElement(scrollArea);
|
|
|
+ //sceneTreeViewLayout.addFlexibleSpace();
|
|
|
|
|
|
- //button = GUIButton::create(*this, HString(L"Rename GameObject"));
|
|
|
- //button->onClick.connect(boost::bind(&TestTextSprite::dbgRename, this));
|
|
|
- //area->getLayout().addElement(button);
|
|
|
+ //scrollArea->getLayout().addElement(mSceneTreeView);
|
|
|
+ //area->getLayout().addElement(mResourceTreeView);
|
|
|
|
|
|
- //button = GUIButton::create(*this, HString(L"Remove child GameObjects"));
|
|
|
- //button->onClick.connect(boost::bind(&TestTextSprite::dbgRemoveChildren, this));
|
|
|
- //area->getLayout().addElement(button);
|
|
|
+ //GUIIntField* intField = GUIIntField::create(*this, HString(L"Int Field"), GUIOptions(GUIOption::fixedWidth(200)));
|
|
|
+ //GUIFloatField* floatField = GUIFloatField::create(*this, HString(L"Float Field"), GUIOptions(GUIOption::fixedWidth(200)));
|
|
|
+ //area->getLayout().addElement(intField);
|
|
|
+ //area->getLayout().addElement(floatField);
|
|
|
|
|
|
- //button = GUIButton::create(*this, HString(L"Remove parent GameObjects"));
|
|
|
- //button->onClick.connect(boost::bind(&TestTextSprite::dbgRemoveParents, this));
|
|
|
- //area->getLayout().addElement(button);
|
|
|
-
|
|
|
- area->getLayout().addFlexibleSpace();
|
|
|
-
|
|
|
- labelString = HString(L"\\{0}, {1}");
|
|
|
- //mLabel->setContent(GUIContent(labelString));
|
|
|
+ //area->getLayout().addFlexibleSpace();
|
|
|
}
|
|
|
|
|
|
void TestTextSprite::update()
|
|
|
{
|
|
|
- labelString.setParameter(0, toWString(Input::instance().getCursorPosition().x));
|
|
|
- mSceneTreeView->update();
|
|
|
- mResourceTreeView->update();
|
|
|
- //labelString.setParameter(1, toWString(Input::instance().getCursorPosition().y));
|
|
|
- }
|
|
|
-
|
|
|
- void TestTextSprite::dbgBtn()
|
|
|
- {
|
|
|
- static int dbg = 0;
|
|
|
-
|
|
|
- if(dbg == 0)
|
|
|
- {
|
|
|
- //Vector<HString>::type dropDownElements;
|
|
|
- //dropDownElements.push_back(HString(L"Element #4"));
|
|
|
- //dropDownElements.push_back(HString(L"Element #5"));
|
|
|
- //dropDownElements.push_back(HString(L"Element #6"));
|
|
|
-
|
|
|
- //mListBox->setElements(dropDownElements);
|
|
|
-
|
|
|
- //StringTable::instance().setString(L"dbgBtn", Language::Abkhazian, L"ALOALO");
|
|
|
- //StringTable::instance().setActiveLanguage(Language::Abkhazian);
|
|
|
- }
|
|
|
- else if(dbg == 1)
|
|
|
- {
|
|
|
- //StringTable::instance().removeString(L"dbgBtn");
|
|
|
- }
|
|
|
-
|
|
|
- dbg++;
|
|
|
- }
|
|
|
-
|
|
|
- void TestTextSprite::dbgAdd()
|
|
|
- {
|
|
|
- mDbgMainA = SceneObject::create("DEBUG_A");
|
|
|
- mDbgChildA = SceneObject::create("DEBUG_CHILD_0");
|
|
|
- mDbgChildA->setParent(mDbgMainA);
|
|
|
-
|
|
|
- mDbgChildB = SceneObject::create("DEBUG_CHILD_1");
|
|
|
- mDbgChildB->setParent(mDbgMainA);
|
|
|
-
|
|
|
- mDbgChildC = SceneObject::create("DEBUG_CHILD_2");
|
|
|
- mDbgChildC->setParent(mDbgMainA);
|
|
|
-
|
|
|
- mDbgMainB = SceneObject::create("DEBUG_B");
|
|
|
- }
|
|
|
-
|
|
|
- void TestTextSprite::dbgRename()
|
|
|
- {
|
|
|
- mDbgMainA->setName("Z_DEBUG_RENAMED_A");
|
|
|
- }
|
|
|
-
|
|
|
- void TestTextSprite::dbgRemoveChildren()
|
|
|
- {
|
|
|
- mDbgChildA->destroy();
|
|
|
- mDbgChildB->destroy();
|
|
|
- }
|
|
|
-
|
|
|
- void TestTextSprite::dbgRemoveParents()
|
|
|
- {
|
|
|
- mDbgMainA->destroy();
|
|
|
- mDbgMainB->destroy();
|
|
|
+ //mSceneTreeView->update();
|
|
|
+ //mResourceTreeView->update();
|
|
|
}
|
|
|
}
|