MyGUI_MenuControl.cpp
Go to the documentation of this file.
/*
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
* Distributed under the MIT License
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
*/
#include "MyGUI_Precompiled.h"
#include "MyGUI_MenuControl.h"
#include "MyGUI_ResourceSkin.h"
#include "MyGUI_MenuItem.h"
#include "MyGUI_ImageBox.h"
#include "MyGUI_MenuBar.h"
#include "MyGUI_WidgetManager.h"
#include "MyGUI_LayerManager.h"
#include "MyGUI_ControllerManager.h"
#include "MyGUI_InputManager.h"
#include "MyGUI_Gui.h"
#include "MyGUI_RenderManager.h"
namespace MyGUI
{
const float POPUP_MENU_SPEED_COEF = 3.0f;
void MenuControl::initialiseOverride()
{
Base::initialiseOverride();
// инициализируем овнера
Widget* parent = getParent();
if (parent)
{
mOwner = parent->castType<MenuItem>(false);
if (!mOwner)
{
Widget* client = parent;
parent = client->getParent();
if (parent && parent->getClientWidget())
{
mOwner = parent->castType<MenuItem>(false);
}
}
}
// FIXME нам нужен фокус клавы
setNeedKeyFocus(true);
//OBSOLETE
if (isUserString("SkinLine"))
{
mItemNormalSkin = getUserString("SkinLine");
mItemPopupSkin = mItemNormalSkin;
}
if (isUserString("SeparatorSkin"))
mItemSeparatorSkin = getUserString("SeparatorSkin");
if (isUserString("NormalSkin"))
mItemNormalSkin = getUserString("NormalSkin");
if (isUserString("PopupSkin"))
mItemPopupSkin = getUserString("PopupSkin");
if (isUserString("DistanceButton"))
mDistanceButton = utility::parseValue<int>(getUserString("DistanceButton"));
if (isUserString("SubMenuSkin"))
mSubMenuSkin = getUserString("SubMenuSkin");
if (isUserString("SubMenuLayer"))
mSubMenuLayer = getUserString("SubMenuLayer");
// FIXME добавленно, так как шетдаун вызывается и при смене скина
mShutdown = false;
}
void MenuControl::shutdownOverride()
{
mShutdown = true;
if (mOwner != nullptr)
mOwner->getMenuCtrlParent()->_notifyDeletePopup(mOwner);
Base::shutdownOverride();
}
void MenuControl::onWidgetCreated(Widget* _widget)
{
Base::onWidgetCreated(_widget);
MenuItem* child = _widget->castType<MenuItem>(false);
if (child != nullptr && !mInternalCreateChild)
{
_wrapItem(child, mItemsInfo.size(), UString(), MenuItemType::Normal, std::string_view{}, Any::Null);
}
}
MenuItem* MenuControl::insertItemAt(
size_t _index,
const UString& _name,
MenuItemType _type,
std::string_view _id,
Any _data)
{
MYGUI_ASSERT_RANGE_INSERT(_index, mItemsInfo.size(), "MenuControl::insertItemAt");
if (_index == ITEM_NONE)
_index = mItemsInfo.size();
mInternalCreateChild = true;
MenuItem* item = _getClientWidget()->createWidget<MenuItem>(getSkinByType(_type), IntCoord(), Align::Default);
mInternalCreateChild = false;
_wrapItem(item, _index, _name, _type, _id, _data);
return item;
}
void MenuControl::removeItemAt(size_t _index)
{
MYGUI_ASSERT_RANGE(_index, mItemsInfo.size(), "MenuControl::removeItemAt");
if (mItemsInfo[_index].submenu)
{
WidgetManager::getInstance().destroyWidget(mItemsInfo[_index].submenu);
mItemsInfo[_index].submenu = nullptr;
}
WidgetManager::getInstance().destroyWidget(mItemsInfo[_index].item);
}
void MenuControl::removeAllItems()
{
while (!mItemsInfo.empty())
{
if (mItemsInfo.back().submenu)
{
WidgetManager::getInstance().destroyWidget(mItemsInfo.back().submenu);
mItemsInfo.back().submenu = nullptr;
}
WidgetManager::getInstance().destroyWidget(mItemsInfo.back().item);
}
}
const UString& MenuControl::getItemNameAt(size_t _index) const
{
MYGUI_ASSERT_RANGE(_index, mItemsInfo.size(), "MenuControl::getItemNameAt");
return mItemsInfo[_index].name;
}
void MenuControl::update()
{
IntSize size;
if (mVerticalAlignment)
{
for (auto& iter : mItemsInfo)
{
IntSize contentSize = iter.item->_getContentSize();
iter.item->setCoord(0, size.height, _getClientWidget()->getWidth(), contentSize.height);
size.height += contentSize.height + mDistanceButton;
if (contentSize.width > size.width)
size.width = contentSize.width;
}
if (!mItemsInfo.empty())
size.height -= mDistanceButton;
}
else
{
int maxHeight = 0;
for (const auto& iter : mItemsInfo)
{
IntSize contentSize = iter.item->_getContentSize();
if (maxHeight < contentSize.height)
maxHeight = contentSize.height;
}
for (auto& iter : mItemsInfo)
{
IntSize contentSize = iter.item->_getContentSize();
iter.item->setCoord(size.width, 0, contentSize.width, maxHeight);
size.width += contentSize.width + mDistanceButton;
}
if (!mItemsInfo.empty())
size.width -= mDistanceButton;
}
if (mResizeToContent)
setSize(size + mCoord.size() - _getClientWidget()->getSize());
}
void MenuControl::setItemDataAt(size_t _index, Any _data)
{
MYGUI_ASSERT_RANGE(_index, mItemsInfo.size(), "MenuControl::setItemDataAt");
mItemsInfo[_index].data = std::move(_data);
}
MenuControl* MenuControl::getItemChildAt(size_t _index) const
{
MYGUI_ASSERT_RANGE(_index, mItemsInfo.size(), "MenuControl::getItemChildAt");
return mItemsInfo[_index].submenu;
}
void MenuControl::removeItemChildAt(size_t _index)
{
MYGUI_ASSERT_RANGE(_index, mItemsInfo.size(), "MenuControl::removeItemChildAt");
if (mItemsInfo[_index].submenu != nullptr)
{
WidgetManager::getInstance().destroyWidget(mItemsInfo[_index].submenu);
mItemsInfo[_index].submenu = nullptr;
}
update();
}
void MenuControl::setItemNameAt(size_t _index, const UString& _name)
{
MYGUI_ASSERT_RANGE(_index, mItemsInfo.size(), "MenuControl::setItemNameAt");
mItemsInfo[_index].name = _name;
MenuItem* item = mItemsInfo[_index].item;
item->setCaption(_name);
update();
}
void MenuControl::setItemIdAt(size_t _index, std::string_view _id)
{
MYGUI_ASSERT_RANGE(_index, mItemsInfo.size(), "MenuControl::setItemIdAt");
mItemsInfo[_index].id = _id;
}
const std::string& MenuControl::getItemIdAt(size_t _index) const
{
MYGUI_ASSERT_RANGE(_index, mItemsInfo.size(), "MenuControl::getItemIdAt");
return mItemsInfo[_index].id;
}
void MenuControl::_notifyDeleteItem(MenuItem* _item)
{
// дитю меняем скин
if (mChangeChildSkin)
return;
// общий шутдаун виджета
if (mShutdown)
return;
size_t index = getItemIndex(_item);
mItemsInfo.erase(mItemsInfo.begin() + index);
update();
}
void MenuControl::_notifyDeletePopup(MenuItem* _item)
{
size_t index = getItemIndex(_item);
mItemsInfo[index].submenu = nullptr;
}
void MenuControl::_notifyUpdateName(MenuItem* _item)
{
size_t index = getItemIndex(_item);
mItemsInfo[index].name = _item->getCaption();
ISubWidgetText* text = _item->getSubWidgetText();
mItemsInfo[index].width = text ? (text->getTextSize().width + _item->getSize().width - text->getWidth()) : 0;
update();
}
MenuItemType MenuControl::getItemTypeAt(size_t _index) const
{
MYGUI_ASSERT_RANGE(_index, mItemsInfo.size(), "MenuControl::getItemTypeAt");
return mItemsInfo[_index].type;
}
void MenuControl::setItemTypeAt(size_t _index, MenuItemType _type)
{
MYGUI_ASSERT_RANGE(_index, mItemsInfo.size(), "MenuControl::setItemTypeAt");
ItemInfo& info = mItemsInfo[_index];
if (info.type == _type)
return;
// сохраняем данные
info.type = _type;
// при смене скина дите отпишется
mChangeChildSkin = true;
info.item->changeWidgetSkin(getSkinByType(_type));
mChangeChildSkin = false;
info.item->setImageName(getIconIndexByType(_type));
info.item->setCaption(info.name);
update();
}
void MenuControl::notifyMenuCtrlAccept(MenuItem* _item)
{
if (mHideByAccept)
{
setVisibleSmooth(false);
}
else
{
InputManager::getInstance().setKeyFocusWidget(nullptr);
}
MenuItem* parent_item = getMenuItemParent();
if (parent_item)
{
MenuControl* parent_ctrl = parent_item->getMenuCtrlParent();
if (parent_ctrl)
{
parent_ctrl->notifyMenuCtrlAccept(_item);
}
}
eventMenuCtrlAccept(this, _item);
}
void MenuControl::setItemChildVisibleAt(size_t _index, bool _visible)
{
_setItemChildVisibleAt(_index, _visible, true);
}
void MenuControl::_setItemChildVisibleAt(size_t _index, bool _visible, bool _smooth)
{
MYGUI_ASSERT_RANGE(_index, mItemsInfo.size(), "MenuControl::setItemChildVisibleAt");
if (_visible)
{
if (mItemsInfo[_index].submenu && mItemsInfo[_index].submenu->getItemCount())
{
int offset = mItemsInfo[0].item->getAbsoluteTop() - getAbsoluteTop();
const IntCoord& coord = mItemsInfo[_index].item->getAbsoluteCoord();
IntPoint point(getAbsoluteRect().right, coord.top - offset);
MenuControl* menu = mItemsInfo[_index].submenu;
if (mVerticalAlignment)
{
// too wide
if (point.left + menu->getWidth() > menu->getParentSize().width)
{
// move to the left side if possible
if (point.left - menu->getWidth() - getWidth() > 0)
point.left -= menu->getWidth() + getWidth();
// or put near right parent border (window) if too wide for left side too
else
point.left = menu->getParentSize().width - menu->getWidth();
}
// too high (same logic as for too wide)
if (point.top + menu->getHeight() > menu->getParentSize().height)
{
// move to the top side if possible
if (point.top - menu->getHeight() - getHeight() > 0)
point.top -= menu->getHeight() + getHeight();
// or put near bottom parent border (window) if too high for top side too
else
point.top = menu->getParentSize().height - menu->getHeight();
}
}
else
{
point.set(coord.left, getAbsoluteRect().bottom);
}
menu->setPosition(point);
if (_smooth)
menu->setVisibleSmooth(true);
else
menu->setVisible(true);
MyGUI::LayerManager::getInstance().upLayerItem(menu);
}
}
else
{
if (mItemsInfo[_index].submenu)
{
if (_smooth)
mItemsInfo[_index].submenu->setVisibleSmooth(false);
else
mItemsInfo[_index].submenu->setVisible(false);
}
}
}
void MenuControl::notifyRootKeyChangeFocus(Widget* _sender, bool _focus) const
{
MenuItem* item = _sender->castType<MenuItem>();
if (item->getItemType() == MenuItemType::Popup)
{
if (_focus)
{
if (!mMenuDropMode || mIsMenuDrop)
{
item->setItemChildVisible(true);
item->setStateSelected(true);
}
}
else
{
item->setItemChildVisible(false);
item->setStateSelected(false);
}
}
}
Widget* MenuControl::createItemChildByType(size_t _index, std::string_view _type)
{
MYGUI_ASSERT_RANGE(_index, mItemsInfo.size(), "MenuControl::createItemChildByType");
removeItemChildAt(_index);
Widget* child = mItemsInfo[_index].item->createWidgetT(
WidgetStyle::Popup,
_type,
mSubMenuSkin,
IntCoord(),
Align::Default,
mSubMenuLayer);
MYGUI_ASSERT(child->isType<MenuControl>(), "child must have MenuControl base type");
return child;
}
void MenuControl::notifyMouseButtonClick(Widget* _sender)
{
MenuItem* item = _sender->castType<MenuItem>();
if (mMenuDropMode)
{
if (mIsMenuDrop)
{
if (item->getItemType() == MenuItemType::Popup)
{
item->setStateSelected(false);
item->setItemChildVisible(false);
mIsMenuDrop = false;
}
}
else
{
if (item->getItemType() == MenuItemType::Popup)
{
mIsMenuDrop = true;
item->setStateSelected(true);
item->setItemChildVisible(true);
InputManager::getInstance().setKeyFocusWidget(item);
}
}
}
else
{
if ((item->getItemType() == MenuItemType::Popup && mPopupAccept) ||
item->getItemType() == MenuItemType::Normal)
{
notifyMenuCtrlAccept(item);
}
}
}
void MenuControl::onKeyChangeRootFocus(bool _focus)
{
if (mMenuDropMode)
{
mIsMenuDrop = false;
}
if (!_focus && mHideByLostKey)
{
setVisibleSmooth(false);
eventMenuCtrlClose(this);
}
Base::onKeyChangeRootFocus(_focus);
}
void MenuControl::notifyMouseSetFocus(Widget* _sender, Widget* _new)
{
InputManager::getInstance().setKeyFocusWidget(_sender);
}
void MenuControl::_wrapItemChild(MenuItem* _item, MenuControl* _widget)
{
// заменяем
size_t index = getItemIndex(_item);
if (mItemsInfo[index].submenu != nullptr)
{
WidgetManager::getInstance().destroyWidget(mItemsInfo[index].submenu);
mItemsInfo[index].submenu = nullptr;
}
mItemsInfo[index].submenu = _widget;
// скрываем менюшку
mItemsInfo[index].submenu->setVisible(false);
update();
}
void MenuControl::_wrapItem(
MenuItem* _item,
size_t _index,
const UString& _name,
MenuItemType _type,
std::string_view _id,
Any _data)
{
_item->setAlign(mVerticalAlignment ? Align::Top | Align::HStretch : Align::Default);
_item->eventRootKeyChangeFocus += newDelegate(this, &MenuControl::notifyRootKeyChangeFocus);
_item->eventMouseButtonClick += newDelegate(this, &MenuControl::notifyMouseButtonClick);
_item->eventMouseSetFocus += newDelegate(this, &MenuControl::notifyMouseSetFocus);
_item->setImageName(getIconIndexByType(_type));
MenuControl* submenu = nullptr;
ItemInfo info = ItemInfo(_item, _name, _type, submenu, _id, _data);
mItemsInfo.insert(mItemsInfo.begin() + _index, std::move(info));
mChangeChildSkin = true;
_item->changeWidgetSkin(getSkinByType(_type));
mChangeChildSkin = false;
// его сет капшен, обновит размер
_item->setCaption(_name);
update();
}
void MenuControl::setVisible(bool _visible)
{
if (mAnimateSmooth)
{
ControllerManager::getInstance().removeItem(this);
setAlpha(ALPHA_MAX);
setEnabledSilent(true);
mAnimateSmooth = false;
}
if (_visible)
{
if (mOwner == nullptr && mHideByLostKey)
{
MyGUI::InputManager::getInstance().setKeyFocusWidget(this);
}
}
Base::setVisible(_visible);
}
void MenuControl::setVisibleSmooth(bool _visible)
{
mAnimateSmooth = true;
ControllerManager::getInstance().removeItem(this);
if (_visible)
{
setEnabledSilent(true);
if (!getVisible())
{
setAlpha(ALPHA_MIN);
Base::setVisible(true);
}
ControllerFadeAlpha* controller = createControllerFadeAlpha(ALPHA_MAX, POPUP_MENU_SPEED_COEF, true);
controller->eventPostAction += newDelegate(action::actionWidgetShow);
ControllerManager::getInstance().addItem(this, controller);
}
else
{
setEnabledSilent(false);
ControllerFadeAlpha* controller = createControllerFadeAlpha(ALPHA_MIN, POPUP_MENU_SPEED_COEF, false);
controller->eventPostAction += newDelegate(action::actionWidgetHide);
ControllerManager::getInstance().addItem(this, controller);
}
}
ControllerFadeAlpha* MenuControl::createControllerFadeAlpha(float _alpha, float _coef, bool _enable)
{
ControllerItem* item = ControllerManager::getInstance().createItem(ControllerFadeAlpha::getClassTypeName());
ControllerFadeAlpha* controller = item->castType<ControllerFadeAlpha>();
controller->setAlpha(_alpha);
controller->setCoef(_coef);
controller->setEnabled(_enable);
return controller;
}
MenuItem* MenuControl::insertItem(
MenuItem* _to,
const UString& _name,
MenuItemType _type,
std::string_view _id,
Any _data)
{
return insertItemAt(getItemIndex(_to), _name, _type, _id, _data);
}
MenuItem* MenuControl::addItem(const UString& _name, MenuItemType _type, std::string_view _id, Any _data)
{
return insertItemAt(ITEM_NONE, _name, _type, _id, _data);
}
void MenuControl::removeItem(MenuItem* _item)
{
removeItemAt(getItemIndex(_item));
}
MenuItem* MenuControl::getItemAt(size_t _index) const
{
MYGUI_ASSERT_RANGE(_index, mItemsInfo.size(), "MenuControl::getItemAt");
return mItemsInfo[_index].item;
}
size_t MenuControl::getItemIndex(const MenuItem* _item) const
{
for (size_t pos = 0; pos < mItemsInfo.size(); pos++)
{
if (mItemsInfo[pos].item == _item)
return pos;
}
MYGUI_EXCEPT("item (" << _item << ") not found, source 'MenuControl::getItemIndex'");
}
MenuItem* MenuControl::findItemWith(const UString& _name)
{
for (const auto& info : mItemsInfo)
{
if (info.name == _name)
return info.item;
}
return nullptr;
}
MenuItem* MenuControl::getItemById(std::string_view _id) const
{
for (const auto& info : mItemsInfo)
{
if (info.id == _id)
return info.item;
}
MYGUI_EXCEPT("item id (" << _id << ") not found, source 'MenuControl::getItemById'");
}
size_t MenuControl::getItemIndexById(std::string_view _id) const
{
for (size_t index = 0; index < mItemsInfo.size(); index++)
{
if (mItemsInfo[index].id == _id)
return index;
}
MYGUI_EXCEPT("item id (" << _id << ") not found, source 'MenuControl::getItemById'");
}
MenuItem* MenuControl::findItemById(std::string_view _id, bool _recursive)
{
for (const auto& info : mItemsInfo)
{
if (info.id == _id)
return info.item;
if (_recursive && info.submenu != nullptr)
{
MenuItem* find = info.submenu->findItemById(_id, _recursive);
if (find != nullptr)
return find;
}
}
return nullptr;
}
size_t MenuControl::findItemIndexWith(const UString& _name)
{
for (size_t index = 0; index < mItemsInfo.size(); index++)
{
if (mItemsInfo[index].name == _name)
return index;
}
return ITEM_NONE;
}
size_t MenuControl::findItemIndex(MenuItem* _item)
{
for (size_t index = 0; index < mItemsInfo.size(); index++)
{
if (mItemsInfo[index].item == _item)
return index;
}
return ITEM_NONE;
}
size_t MenuControl::getItemCount() const
{
return mItemsInfo.size();
}
void MenuControl::setItemData(MenuItem* _item, Any _data)
{
setItemDataAt(getItemIndex(_item), _data);
}
void MenuControl::clearItemDataAt(size_t _index)
{
setItemDataAt(_index, Any::Null);
}
void MenuControl::clearItemData(MenuItem* _item)
{
clearItemDataAt(getItemIndex(_item));
}
void MenuControl::setItemId(MenuItem* _item, std::string_view _id)
{
setItemIdAt(getItemIndex(_item), _id);
}
const std::string& MenuControl::getItemId(const MenuItem* _item) const
{
return getItemIdAt(getItemIndex(_item));
}
void MenuControl::setItemName(MenuItem* _item, const UString& _name)
{
setItemNameAt(getItemIndex(_item), _name);
}
const UString& MenuControl::getItemName(const MenuItem* _item) const
{
return getItemNameAt(getItemIndex(_item));
}
void MenuControl::setItemChildVisible(MenuItem* _item, bool _visible)
{
setItemChildVisibleAt(getItemIndex(_item), _visible);
}
MenuControl* MenuControl::getItemChild(const MenuItem* _item) const
{
return getItemChildAt(getItemIndex(_item));
}
MenuControl* MenuControl::createItemChildAt(size_t _index)
{
return createItemChildTAt<MenuControl>(_index);
}
MenuControl* MenuControl::createItemChild(MenuItem* _item)
{
return createItemChildAt(getItemIndex(_item));
}
void MenuControl::removeItemChild(MenuItem* _item)
{
removeItemChildAt(getItemIndex(_item));
}
MenuItemType MenuControl::getItemType(const MenuItem* _item) const
{
return getItemTypeAt(getItemIndex(_item));
}
void MenuControl::setItemType(MenuItem* _item, MenuItemType _type)
{
setItemTypeAt(getItemIndex(_item), _type);
}
void MenuControl::setPopupAccept(bool _value)
{
mPopupAccept = _value;
}
bool MenuControl::getPopupAccept() const
{
return mPopupAccept;
}
MenuItem* MenuControl::getMenuItemParent() const
{
return mOwner;
}
const std::string& MenuControl::getSkinByType(MenuItemType _type) const
{
if (_type == MenuItemType::Popup)
return mItemPopupSkin;
if (_type == MenuItemType::Separator)
return mItemSeparatorSkin;
return mItemNormalSkin;
}
std::string_view MenuControl::getIconIndexByType(MenuItemType _type) const
{
if (_type == MenuItemType::Popup)
return "Popup";
return "None";
}
MenuItemType MenuControl::getItemType(bool _submenu, bool _separator) const
{
if (_submenu)
return MenuItemType::Popup;
if (_separator)
return MenuItemType::Separator;
return MenuItemType::Normal;
}
size_t MenuControl::_getItemCount() const
{
return getItemCount();
}
void MenuControl::_addItem(const MyGUI::UString& _name)
{
addItem(_name, MenuItemType::Normal);
}
void MenuControl::_removeItemAt(size_t _index)
{
removeItemAt(_index);
_updateSizeForEmpty();
}
Widget* MenuControl::_getItemAt(size_t _index) const
{
return getItemAt(_index);
}
void MenuControl::_setItemNameAt(size_t _index, const UString& _name)
{
setItemNameAt(_index, _name);
}
const UString& MenuControl::_getItemNameAt(size_t _index) const
{
return getItemNameAt(_index);
}
void MenuControl::_setItemSelected(IItem* _item)
{
MenuItem* item = static_cast<MenuItem*>(_item);
for (auto& iter : mItemsInfo)
{
if (iter.type == MenuItemType::Popup)
{
iter.item->setStateSelected(false);
if (iter.submenu != nullptr)
iter.submenu->setVisible(false);
}
}
if (item->getItemType() == MenuItemType::Popup)
{
item->setStateSelected(true);
size_t index = getItemIndex(item);
_setItemChildVisibleAt(index, true, false);
_updateItems(index);
}
}
void MenuControl::_updateItems(size_t _index)
{
if (mItemsInfo[_index].submenu != nullptr)
mItemsInfo[_index].submenu->_updateSizeForEmpty();
}
void MenuControl::_updateSizeForEmpty()
{
if (mItemsInfo.empty())
setSize(100, 100);
}
void MenuControl::setVerticalAlignment(bool _value)
{
mVerticalAlignment = _value;
update();
}
bool MenuControl::getVerticalAlignment() const
{
return mVerticalAlignment;
}
void MenuControl::setPropertyOverride(std::string_view _key, std::string_view _value)
{
if (_key == "VerticalAlignment")
setVerticalAlignment(utility::parseValue<bool>(_value));
else
{
Base::setPropertyOverride(_key, _value);
return;
}
eventChangeProperty(this, _key, _value);
}
} // namespace MyGUI
MyGUI_ControllerManager.h
MYGUI_ASSERT
#define MYGUI_ASSERT(exp, dest)
Definition MyGUI_Diagnostic.h:31
MYGUI_EXCEPT
#define MYGUI_EXCEPT(dest)
Definition MyGUI_Diagnostic.h:21
MYGUI_ASSERT_RANGE_INSERT
#define MYGUI_ASSERT_RANGE_INSERT(index, size, owner)
Definition MyGUI_Diagnostic.h:50
MYGUI_ASSERT_RANGE
#define MYGUI_ASSERT_RANGE(index, size, owner)
Definition MyGUI_Diagnostic.h:44
MyGUI_Gui.h
MyGUI_ImageBox.h
MyGUI_InputManager.h
MyGUI_LayerManager.h
MyGUI_Precompiled.h
MyGUI_RenderManager.h
MyGUI_ResourceSkin.h
MyGUI_WidgetManager.h
MyGUI::Any
Definition MyGUI_Any.h:56
MyGUI::Any::Null
static const Any Null
Definition MyGUI_Any.h:58
MyGUI::Button::setImageName
void setImageName(std::string_view _name)
Definition MyGUI_Button.cpp:184
MyGUI::Button::setStateSelected
void setStateSelected(bool _check)
Set button selected state.
Definition MyGUI_Button.cpp:119
MyGUI::ControllerFadeAlpha
Definition MyGUI_ControllerFadeAlpha.h:19
MyGUI::ControllerFadeAlpha::getClassTypeName
static std::string_view getClassTypeName()
Definition MyGUI_ControllerFadeAlpha.h:20
MyGUI::ControllerFadeAlpha::setAlpha
void setAlpha(float _value)
Definition MyGUI_ControllerFadeAlpha.cpp:83
MyGUI::ControllerFadeAlpha::setCoef
void setCoef(float _value)
Definition MyGUI_ControllerFadeAlpha.cpp:88
MyGUI::ControllerFadeAlpha::setEnabled
void setEnabled(bool _value)
Definition MyGUI_ControllerFadeAlpha.cpp:93
MyGUI::ControllerItem
Definition MyGUI_ControllerItem.h:26
MyGUI::ControllerItem::eventPostAction
EventPairAddParameter< EventHandle_WidgetPtr, EventHandle_WidgetPtrControllerItemPtr > eventPostAction
Definition MyGUI_ControllerItem.h:53
MyGUI::ControllerManager::createItem
ControllerItem * createItem(std::string_view _type)
Definition MyGUI_ControllerManager.cpp:71
MyGUI::ControllerManager::getInstance
static ControllerManager & getInstance()
MyGUI::ControllerManager::removeItem
void removeItem(Widget *_widget)
Definition MyGUI_ControllerManager.cpp:102
MyGUI::ControllerManager::addItem
void addItem(Widget *_widget, ControllerItem *_item)
Definition MyGUI_ControllerManager.cpp:77
MyGUI::ICroppedRectangle::mCoord
IntCoord mCoord
Definition MyGUI_ICroppedRectangle.h:245
MyGUI::ICroppedRectangle::getWidth
int getWidth() const
Definition MyGUI_ICroppedRectangle.h:113
MyGUI::ICroppedRectangle::getHeight
int getHeight() const
Definition MyGUI_ICroppedRectangle.h:118
MyGUI::ICroppedRectangle::getAbsoluteRect
IntRect getAbsoluteRect() const
Definition MyGUI_ICroppedRectangle.h:67
MyGUI::ICroppedRectangle::getSize
IntSize getSize() const
Definition MyGUI_ICroppedRectangle.h:51
MyGUI::ICroppedRectangle::getAbsoluteTop
int getAbsoluteTop() const
Definition MyGUI_ICroppedRectangle.h:87
MyGUI::IItem
Definition MyGUI_IItem.h:18
MyGUI::IObject::castType
Type * castType(bool _throw=true)
Definition MyGUI_IObject.h:18
MyGUI::ISubWidgetText
Definition MyGUI_ISubWidgetText.h:19
MyGUI::ISubWidgetText::getTextSize
virtual IntSize getTextSize() const
Definition MyGUI_ISubWidgetText.h:122
MyGUI::InputManager::setKeyFocusWidget
void setKeyFocusWidget(Widget *_widget)
Definition MyGUI_InputManager.cpp:388
MyGUI::InputManager::getInstance
static InputManager & getInstance()
MyGUI::LayerManager::upLayerItem
void upLayerItem(Widget *_item)
Definition MyGUI_LayerManager.cpp:151
MyGUI::LayerManager::getInstance
static LayerManager & getInstance()
MyGUI::SkinItem::getSubWidgetText
ISubWidgetText * getSubWidgetText() const
Definition MyGUI_SkinItem.cpp:148
MyGUI::TextBox::getCaption
virtual const UString & getCaption() const
Definition MyGUI_TextBox.cpp:79
MyGUI::UString
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
Definition MyGUI_UString.h:144
MyGUI::UserData::isUserString
bool isUserString(std::string_view _key) const
Definition MyGUI_WidgetUserData.cpp:44
MyGUI::UserData::getUserString
std::string_view getUserString(std::string_view _key) const
Definition MyGUI_WidgetUserData.cpp:20
MyGUI::Widget
widget description should be here.
Definition MyGUI_Widget.h:40
MyGUI::Widget::getParent
Widget * getParent() const
Definition MyGUI_Widget.cpp:1352
MyGUI::Widget::setAlpha
void setAlpha(float _alpha)
Definition MyGUI_Widget.cpp:466
MyGUI::Widget::setSize
void setSize(const IntSize &_size) override
Definition MyGUI_Widget.cpp:693
MyGUI::Widget::eventChangeProperty
EventHandle_WidgetStringString eventChangeProperty
Definition MyGUI_Widget.h:324
MyGUI::Widget::setPosition
void setPosition(const IntPoint &_point) override
Definition MyGUI_Widget.cpp:676
MyGUI::Widget::getParentSize
IntSize getParentSize() const
Definition MyGUI_Widget.cpp:1082
MyGUI::Widget::changeWidgetSkin
void changeWidgetSkin(std::string_view _skinName)
Definition MyGUI_Widget.cpp:143
MyGUI::Widget::getVisible
bool getVisible() const
Definition MyGUI_Widget.cpp:1327
MyGUI::Widget::getClientWidget
Widget * getClientWidget()
Definition MyGUI_Widget.cpp:1367
MyGUI::Widget::setAlign
virtual void setAlign(Align _value)
Definition MyGUI_Widget.cpp:775
MyGUI::Widget::createWidget
T * createWidget(std::string_view _skin, const IntCoord &_coord, Align _align, std::string_view _name={})
Definition MyGUI_Widget.h:94
MyGUI::Widget::setEnabledSilent
void setEnabledSilent(bool _value)
Definition MyGUI_Widget.cpp:1357
MyGUI::Widget::_getClientWidget
Widget * _getClientWidget()
If there is client widget return it, otherwise return this.
Definition MyGUI_Widget.cpp:1196
MyGUI::WidgetInput::eventMouseButtonClick
EventHandle_WidgetVoid eventMouseButtonClick
Definition MyGUI_WidgetInput.h:168
MyGUI::WidgetInput::setNeedKeyFocus
void setNeedKeyFocus(bool _value)
Definition MyGUI_WidgetInput.cpp:142
MyGUI::WidgetInput::eventMouseSetFocus
EventHandle_WidgetWidget eventMouseSetFocus
Definition MyGUI_WidgetInput.h:121
MyGUI::WidgetInput::eventRootKeyChangeFocus
EventHandle_WidgetBool eventRootKeyChangeFocus
Definition MyGUI_WidgetInput.h:219
MyGUI::WidgetManager::getInstance
static WidgetManager & getInstance()
MyGUI::WidgetManager::destroyWidget
void destroyWidget(Widget *_widget)
Definition MyGUI_WidgetManager.cpp:123
MyGUI::action::actionWidgetHide
void actionWidgetHide(Widget *_widget, ControllerItem *_controller)
Definition MyGUI_ActionController.cpp:15
MyGUI::action::actionWidgetShow
void actionWidgetShow(Widget *_widget, ControllerItem *_controller)
Definition MyGUI_ActionController.cpp:20
MyGUI::utility::parseValue
T parseValue(std::string_view _value)
Definition MyGUI_StringUtility.h:60
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::ALPHA_MAX
constexpr float ALPHA_MAX
Definition MyGUI_Macros.h:20
MyGUI::IntPoint
types::TPoint< int > IntPoint
Definition MyGUI_Types.h:27
MyGUI::ALPHA_MIN
constexpr float ALPHA_MIN
Definition MyGUI_Macros.h:21
MyGUI::ITEM_NONE
constexpr size_t ITEM_NONE
Definition MyGUI_Macros.h:19
MyGUI::POPUP_MENU_SPEED_COEF
const float POPUP_MENU_SPEED_COEF
Definition MyGUI_MenuControl.cpp:23
MyGUI::IntCoord
types::TCoord< int > IntCoord
Definition MyGUI_Types.h:36
MyGUI::IntSize
types::TSize< int > IntSize
Definition MyGUI_Types.h:30
MyGUI::newDelegate
delegates::DelegateFunction< Args... > * newDelegate(void(*_func)(Args... args))
Definition MyGUI_Delegate.h:100
MyGUI::Align::HStretch
@ HStretch
Definition MyGUI_Align.h:29
MyGUI::Align::Default
@ Default
Definition MyGUI_Align.h:36
MyGUI::Align::Top
@ Top
Definition MyGUI_Align.h:31
MyGUI::WidgetStyle::Popup
@ Popup
Definition MyGUI_WidgetStyle.h:23
MyGUI::types::TCoord::top
T top
Definition MyGUI_TCoord.h:21
MyGUI::types::TCoord::left
T left
Definition MyGUI_TCoord.h:20
MyGUI::types::TSize::width
T width
Definition MyGUI_TSize.h:19
MyGUI::types::TSize::height
T height
Definition MyGUI_TSize.h:20