|
@@ -21,6 +21,7 @@
|
|
|
#include "BsGUIInputCaret.h"
|
|
#include "BsGUIInputCaret.h"
|
|
|
#include "BsGUIInputSelection.h"
|
|
#include "BsGUIInputSelection.h"
|
|
|
#include "BsGUIListBox.h"
|
|
#include "BsGUIListBox.h"
|
|
|
|
|
+#include "BsGUIButton.h"
|
|
|
#include "BsGUIDropDownBox.h"
|
|
#include "BsGUIDropDownBox.h"
|
|
|
#include "BsGUIContextMenu.h"
|
|
#include "BsGUIContextMenu.h"
|
|
|
#include "BsDragAndDropManager.h"
|
|
#include "BsDragAndDropManager.h"
|
|
@@ -503,7 +504,7 @@ namespace BansheeEngine
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- void GUIManager::openDropDownListBox(GUIListBox* parentList, const CM::Vector<WString>::type& elements,
|
|
|
|
|
|
|
+ void GUIManager::openDropDownListBox(const GUIListBox* parentList, const CM::Vector<WString>::type& elements,
|
|
|
std::function<void(CM::UINT32)> selectedCallback, const GUISkin& skin)
|
|
std::function<void(CM::UINT32)> selectedCallback, const GUISkin& skin)
|
|
|
{
|
|
{
|
|
|
if(mDropDownBoxOpenScheduled || mDropDownBoxActive)
|
|
if(mDropDownBoxOpenScheduled || mDropDownBoxActive)
|
|
@@ -544,25 +545,37 @@ namespace BansheeEngine
|
|
|
mDropDownBoxActive = false;
|
|
mDropDownBoxActive = false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- void GUIManager::openContextMenu(const GUIContextMenu* menu, const Int2& position, GUIWidget& widget)
|
|
|
|
|
|
|
+ void GUIManager::openMenuBarMenu(GUIButton* parentButton, const GUIMenu* menu)
|
|
|
{
|
|
{
|
|
|
if(mDropDownBoxOpenScheduled || mDropDownBoxActive)
|
|
if(mDropDownBoxOpenScheduled || mDropDownBoxActive)
|
|
|
- closeContextMenu();
|
|
|
|
|
|
|
+ closeDropDownBox();
|
|
|
|
|
|
|
|
mDropDownSO = SceneObject::create("DropDownBox");
|
|
mDropDownSO = SceneObject::create("DropDownBox");
|
|
|
mDropDownBox = mDropDownSO->addComponent<GUIDropDownBox>();
|
|
mDropDownBox = mDropDownSO->addComponent<GUIDropDownBox>();
|
|
|
|
|
|
|
|
Vector<GUIDropDownData>::type dropDownData = menu->getDropDownData();
|
|
Vector<GUIDropDownData>::type dropDownData = menu->getDropDownData();
|
|
|
|
|
+ GUIWidget& widget = parentButton->_getParentWidget();
|
|
|
|
|
|
|
|
mDropDownBox->initialize(widget.getTarget(), widget.getOwnerWindow(),
|
|
mDropDownBox->initialize(widget.getTarget(), widget.getOwnerWindow(),
|
|
|
- GUIDropDownAreaPlacement::aroundPosition(position), dropDownData, widget.getSkin(), GUIDropDownType::ContextMenu);
|
|
|
|
|
|
|
+ GUIDropDownAreaPlacement::aroundBoundsVert(parentButton->getBounds()), dropDownData, widget.getSkin(), GUIDropDownType::MenuBar);
|
|
|
|
|
|
|
|
mDropDownBoxOpenScheduled = true;
|
|
mDropDownBoxOpenScheduled = true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- void GUIManager::closeContextMenu()
|
|
|
|
|
|
|
+ void GUIManager::openContextMenu(const GUIContextMenu* menu, const Int2& position, GUIWidget& widget)
|
|
|
{
|
|
{
|
|
|
- closeDropDownBox();
|
|
|
|
|
|
|
+ if(mDropDownBoxOpenScheduled || mDropDownBoxActive)
|
|
|
|
|
+ closeDropDownBox();
|
|
|
|
|
+
|
|
|
|
|
+ mDropDownSO = SceneObject::create("DropDownBox");
|
|
|
|
|
+ mDropDownBox = mDropDownSO->addComponent<GUIDropDownBox>();
|
|
|
|
|
+
|
|
|
|
|
+ Vector<GUIDropDownData>::type dropDownData = menu->getDropDownData();
|
|
|
|
|
+
|
|
|
|
|
+ mDropDownBox->initialize(widget.getTarget(), widget.getOwnerWindow(),
|
|
|
|
|
+ GUIDropDownAreaPlacement::aroundPosition(position), dropDownData, widget.getSkin(), GUIDropDownType::ContextMenu);
|
|
|
|
|
+
|
|
|
|
|
+ mDropDownBoxOpenScheduled = true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void GUIManager::updateCaretTexture()
|
|
void GUIManager::updateCaretTexture()
|