MyGUI_BackwardCompatibility.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_BackwardCompatibility.h"
#include "MyGUI_Button.h"
#include "MyGUI_ComboBox.h"
#include "MyGUI_EditBox.h"
#include "MyGUI_ItemBox.h"
#include "MyGUI_ListBox.h"
#include "MyGUI_MenuControl.h"
#include "MyGUI_MenuItem.h"
#include "MyGUI_MultiListBox.h"
#include "MyGUI_ProgressBar.h"
#include "MyGUI_ScrollView.h"
#include "MyGUI_TabControl.h"
#include "MyGUI_Widget.h"
#include "MyGUI_Window.h"
#include "MyGUI_TabItem.h"
#include "MyGUI_Canvas.h"
#include "MyGUI_LayoutManager.h"
#include "MyGUI_FontManager.h"
#include "MyGUI_ResourceManager.h"
#include "MyGUI_Gui.h"
#include "MyGUI_PointerManager.h"
#include "MyGUI_InputManager.h"
#include "MyGUI_RenderManager.h"
#include "MyGUI_LanguageManager.h"
#include "MyGUI_PluginManager.h"
#include "MyGUI_SkinManager.h"
#include "MyGUI_WidgetManager.h"
#include "MyGUI_FactoryManager.h"
#include "MyGUI_DeprecatedWidgets.h"
namespace MyGUI
{
#ifndef MYGUI_DONT_USE_OBSOLETE
void MemberObsolete<Button>::setButtonPressed(bool _value)
{
static_cast<Button*>(this)->setStateSelected(_value);
}
bool MemberObsolete<Button>::getButtonPressed() const
{
return static_cast<const Button*>(this)->getStateSelected();
}
void MemberObsolete<Button>::setStateCheck(bool _value)
{
static_cast<Button*>(this)->setStateSelected(_value);
}
bool MemberObsolete<Button>::getStateCheck() const
{
return static_cast<const Button*>(this)->getStateSelected();
}
ImageBox* MemberObsolete<Button>::getStaticImage() const
{
return static_cast<const Button*>(this)->_getImageBox();
}
void MemberObsolete<Button>::setImageIndex(size_t _index)
{
if (static_cast<Button*>(this)->_getImageBox())
static_cast<Button*>(this)->_getImageBox()->setImageIndex(_index);
}
size_t MemberObsolete<Button>::getImageIndex() const
{
if (static_cast<const Button*>(this)->_getImageBox())
return static_cast<const Button*>(this)->_getImageBox()->getImageIndex();
return ITEM_NONE;
}
void MemberObsolete<ImageBox>::addItemFrameDublicate(size_t _index, size_t _indexSourceFrame)
{
static_cast<ImageBox*>(this)->addItemFrameDuplicate(_index, _indexSourceFrame);
}
void MemberObsolete<ImageBox>::insertItemFrameDublicate(size_t _index, size_t _indexFrame, size_t _indexSourceFrame)
{
static_cast<ImageBox*>(this)->insertItemFrameDuplicate(_index, _indexFrame, _indexSourceFrame);
}
size_t MemberObsolete<ComboBox>::getItemIndexSelected() const
{
return static_cast<const ComboBox*>(this)->getIndexSelected();
}
void MemberObsolete<ComboBox>::setItemSelectedAt(size_t _index)
{
static_cast<ComboBox*>(this)->setIndexSelected(_index);
}
void MemberObsolete<ComboBox>::clearItemSelected()
{
static_cast<ComboBox*>(this)->clearIndexSelected();
}
void MemberObsolete<ComboBox>::insertItem(size_t _index, const UString& _name)
{
static_cast<ComboBox*>(this)->insertItemAt(_index, _name);
}
void MemberObsolete<ComboBox>::setItem(size_t _index, const UString& _item)
{
static_cast<ComboBox*>(this)->setItemNameAt(_index, _item);
}
const UString& MemberObsolete<ComboBox>::getItem(size_t _index) const
{
return static_cast<const ComboBox*>(this)->getItemNameAt(_index);
}
void MemberObsolete<ComboBox>::deleteItem(size_t _index)
{
static_cast<ComboBox*>(this)->removeItemAt(_index);
}
void MemberObsolete<ComboBox>::deleteAllItems()
{
static_cast<ComboBox*>(this)->removeAllItems();
}
size_t MemberObsolete<ComboBox>::getItemSelect() const
{
return static_cast<const ComboBox*>(this)->getIndexSelected();
}
void MemberObsolete<ComboBox>::resetItemSelect()
{
static_cast<ComboBox*>(this)->clearIndexSelected();
}
void MemberObsolete<ComboBox>::setItemSelect(size_t _index)
{
static_cast<ComboBox*>(this)->setIndexSelected(_index);
}
void MemberObsolete<ComboBox>::setMaxListHeight(int _value)
{
static_cast<ComboBox*>(this)->setMaxListLength(_value);
}
int MemberObsolete<ComboBox>::getMaxListHeight() const
{
return static_cast<const ComboBox*>(this)->getMaxListLength();
}
void MemberObsolete<EditBox>::showVScroll(bool _visible)
{
static_cast<EditBox*>(this)->setVisibleVScroll(_visible);
}
bool MemberObsolete<EditBox>::isShowVScroll()
{
return static_cast<EditBox*>(this)->isVisibleVScroll();
}
void MemberObsolete<EditBox>::showHScroll(bool _visible)
{
static_cast<EditBox*>(this)->setVisibleHScroll(_visible);
}
bool MemberObsolete<EditBox>::isShowHScroll()
{
return static_cast<EditBox*>(this)->isVisibleHScroll();
}
void MemberObsolete<EditBox>::setTextColour(size_t _start, size_t _count, const Colour& _colour)
{
static_cast<EditBox*>(this)->setTextIntervalColour(_start, _count, _colour);
}
void MemberObsolete<EditBox>::getTextSelect(size_t& _start, size_t& _end) const
{
_start = static_cast<const EditBox*>(this)->getTextSelectionStart();
_end = static_cast<const EditBox*>(this)->getTextSelectionEnd();
}
UString MemberObsolete<EditBox>::getText(size_t _start, size_t _count) const
{
return static_cast<const EditBox*>(this)->getTextInterval(_start, _count);
}
void MemberObsolete<EditBox>::setTextSelect(size_t _start, size_t _end)
{
static_cast<EditBox*>(this)->setTextSelection(_start, _end);
}
void MemberObsolete<EditBox>::deleteTextSelect()
{
static_cast<EditBox*>(this)->deleteTextSelection();
}
UString MemberObsolete<EditBox>::getSelectedText() const
{
return static_cast<const EditBox*>(this)->getTextSelection();
}
bool MemberObsolete<EditBox>::isTextSelect()
{
return static_cast<EditBox*>(this)->isTextSelection();
}
void MemberObsolete<EditBox>::setTextSelectColour(const Colour& _colour)
{
static_cast<EditBox*>(this)->setTextSelectionColour(_colour);
}
size_t MemberObsolete<ItemBox>::getItemIndexSelected() const
{
return static_cast<const ItemBox*>(this)->getIndexSelected();
}
void MemberObsolete<ItemBox>::setItemSelectedAt(size_t _index)
{
static_cast<ItemBox*>(this)->setIndexSelected(_index);
}
void MemberObsolete<ItemBox>::clearItemSelected()
{
static_cast<ItemBox*>(this)->clearIndexSelected();
}
void MemberObsolete<ItemBox>::insertItem(size_t _index, Any _data)
{
static_cast<ItemBox*>(this)->insertItemAt(_index, _data);
}
void MemberObsolete<ItemBox>::setItemData(size_t _index, Any _data)
{
static_cast<ItemBox*>(this)->setItemDataAt(_index, _data);
}
void MemberObsolete<ItemBox>::deleteItem(size_t _index)
{
static_cast<ItemBox*>(this)->removeItemAt(_index);
}
void MemberObsolete<ItemBox>::deleteAllItems()
{
static_cast<ItemBox*>(this)->removeAllItems();
}
size_t MemberObsolete<ItemBox>::getItemSelect() const
{
return static_cast<const ItemBox*>(this)->getIndexSelected();
}
void MemberObsolete<ItemBox>::resetItemSelect()
{
static_cast<ItemBox*>(this)->clearIndexSelected();
}
void MemberObsolete<ItemBox>::setItemSelect(size_t _index)
{
static_cast<ItemBox*>(this)->setIndexSelected(_index);
}
Widget* MemberObsolete<ItemBox>::getWidgetDrop() const
{
return static_cast<const ItemBox*>(this)->getWidgetDrag();
}
void MemberObsolete<ItemBox>::resetDrop()
{
static_cast<ItemBox*>(this)->resetDrag();
}
void MemberObsolete<ItemBox>::setItemBoxAlignVert(bool _value)
{
static_cast<ItemBox*>(this)->setVerticalAlignment(_value);
}
bool MemberObsolete<ItemBox>::getItemBoxAlignVert() const
{
return static_cast<const ItemBox*>(this)->getVerticalAlignment();
}
size_t MemberObsolete<ListBox>::getItemIndexSelected() const
{
return static_cast<const ListBox*>(this)->getIndexSelected();
}
void MemberObsolete<ListBox>::setItemSelectedAt(size_t _index)
{
static_cast<ListBox*>(this)->setIndexSelected(_index);
}
void MemberObsolete<ListBox>::clearItemSelected()
{
static_cast<ListBox*>(this)->clearIndexSelected();
}
void MemberObsolete<ListBox>::insertItem(size_t _index, const UString& _item)
{
static_cast<ListBox*>(this)->insertItemAt(_index, _item);
}
void MemberObsolete<ListBox>::setItem(size_t _index, const UString& _item)
{
static_cast<ListBox*>(this)->setItemNameAt(_index, _item);
}
const UString& MemberObsolete<ListBox>::getItem(size_t _index) const
{
return static_cast<const ListBox*>(this)->getItemNameAt(_index);
}
void MemberObsolete<ListBox>::deleteItem(size_t _index)
{
static_cast<ListBox*>(this)->removeItemAt(_index);
}
void MemberObsolete<ListBox>::deleteAllItems()
{
static_cast<ListBox*>(this)->removeAllItems();
}
size_t MemberObsolete<ListBox>::findItem(const UString& _item)
{
return static_cast<ListBox*>(this)->findItemIndexWith(_item);
}
size_t MemberObsolete<ListBox>::getItemSelect() const
{
return static_cast<const ListBox*>(this)->getIndexSelected();
}
void MemberObsolete<ListBox>::resetItemSelect()
{
static_cast<ListBox*>(this)->clearIndexSelected();
}
void MemberObsolete<ListBox>::setItemSelect(size_t _index)
{
static_cast<ListBox*>(this)->setIndexSelected(_index);
}
void MemberObsolete<ListBox>::beginToIndex(size_t _index)
{
static_cast<ListBox*>(this)->beginToItemAt(_index);
}
void MemberObsolete<ListBox>::beginToStart()
{
static_cast<ListBox*>(this)->beginToItemFirst();
}
void MemberObsolete<ListBox>::beginToEnd()
{
static_cast<ListBox*>(this)->beginToItemLast();
}
void MemberObsolete<ListBox>::beginToSelect()
{
static_cast<ListBox*>(this)->beginToItemSelected();
}
bool MemberObsolete<ListBox>::isItemVisible(size_t _index, bool _fill)
{
return static_cast<ListBox*>(this)->isItemVisibleAt(_index, _fill);
}
bool MemberObsolete<ListBox>::isItemSelectVisible(bool _fill)
{
return static_cast<ListBox*>(this)->isItemSelectedVisible(_fill);
}
void MemberObsolete<MenuControl>::showMenu()
{
static_cast<MenuControl*>(this)->setVisible(true);
}
void MemberObsolete<MenuControl>::hideMenu()
{
static_cast<MenuControl*>(this)->setVisible(false);
}
bool MemberObsolete<MenuControl>::isShowMenu()
{
return static_cast<MenuControl*>(this)->getVisible();
}
void MemberObsolete<MenuControl>::showItemChildAt(size_t _index)
{
static_cast<MenuControl*>(this)->setItemChildVisibleAt(_index, true);
}
void MemberObsolete<MenuControl>::showItemChild(MenuItem* _item)
{
static_cast<MenuControl*>(this)->setItemChildVisible(_item, true);
}
void MemberObsolete<MenuControl>::hideItemChildAt(size_t _index)
{
static_cast<MenuControl*>(this)->setItemChildVisibleAt(_index, false);
}
void MemberObsolete<MenuControl>::hideItemChild(MenuItem* _item)
{
static_cast<MenuControl*>(this)->setItemChildVisible(_item, false);
}
void MemberObsolete<MenuControl>::setAlignVert(bool _value)
{
static_cast<MenuControl*>(this)->setVerticalAlignment(_value);
}
bool MemberObsolete<MenuControl>::getAlignVert() const
{
return static_cast<const MenuControl*>(this)->getVerticalAlignment();
}
void MemberObsolete<MenuItem>::showItemChild()
{
static_cast<MenuItem*>(this)->setItemChildVisible(true);
}
void MemberObsolete<MenuItem>::hideItemChild()
{
static_cast<MenuItem*>(this)->setItemChildVisible(false);
}
size_t MemberObsolete<MultiListBox>::getItemIndexSelected() const
{
return static_cast<const MultiListBox*>(this)->getIndexSelected();
}
void MemberObsolete<MultiListBox>::setItemSelectedAt(size_t _index)
{
static_cast<MultiListBox*>(this)->setIndexSelected(_index);
}
void MemberObsolete<MultiListBox>::clearItemSelected()
{
static_cast<MultiListBox*>(this)->clearIndexSelected();
}
size_t MemberObsolete<MultiListBox>::findItem(size_t _column, const UString& _name)
{
return static_cast<MultiListBox*>(this)->findSubItemWith(_column, _name);
}
const UString& MemberObsolete<MultiListBox>::getSubItem(size_t _column, size_t _index) const
{
return static_cast<const MultiListBox*>(this)->getSubItemNameAt(_column, _index);
}
void MemberObsolete<MultiListBox>::setSubItem(size_t _column, size_t _index, const UString& _name)
{
static_cast<MultiListBox*>(this)->setSubItemNameAt(_column, _index, _name);
}
void MemberObsolete<MultiListBox>::deleteColumn(size_t _column)
{
static_cast<MultiListBox*>(this)->removeColumnAt(_column);
}
void MemberObsolete<MultiListBox>::deleteAllColumns()
{
static_cast<MultiListBox*>(this)->removeAllColumns();
}
int MemberObsolete<MultiListBox>::getColumnWidth(size_t _column) const
{
return static_cast<const MultiListBox*>(this)->getColumnWidthAt(_column);
}
const UString& MemberObsolete<MultiListBox>::getColumnName(size_t _column) const
{
return static_cast<const MultiListBox*>(this)->getColumnNameAt(_column);
}
void MemberObsolete<MultiListBox>::setColumnWidth(size_t _column, int _width)
{
static_cast<MultiListBox*>(this)->setColumnWidthAt(_column, _width);
}
void MemberObsolete<MultiListBox>::addColumn(int _width, const UString& _name)
{
static_cast<MultiListBox*>(this)->addColumn(_name, _width);
}
void MemberObsolete<MultiListBox>::setColumnName(size_t _column, const UString& _name)
{
static_cast<MultiListBox*>(this)->setColumnNameAt(_column, _name);
}
void MemberObsolete<MultiListBox>::insertColumn(size_t _column, int _width, const UString& _name)
{
static_cast<MultiListBox*>(this)->insertColumnAt(_column, _name, _width);
}
size_t MemberObsolete<MultiListBox>::getItemSelect() const
{
return static_cast<const MultiListBox*>(this)->getIndexSelected();
}
void MemberObsolete<MultiListBox>::resetItemSelect()
{
static_cast<MultiListBox*>(this)->clearIndexSelected();
}
void MemberObsolete<MultiListBox>::setItemSelect(size_t _index)
{
static_cast<MultiListBox*>(this)->setIndexSelected(_index);
}
void MemberObsolete<MultiListBox>::insertItem(size_t _index, const UString& _name)
{
static_cast<MultiListBox*>(this)->insertItemAt(_index, _name);
}
void MemberObsolete<MultiListBox>::setItem(size_t _index, const UString& _name)
{
static_cast<MultiListBox*>(this)->setItemNameAt(_index, _name);
}
const UString& MemberObsolete<MultiListBox>::getItem(size_t _index) const
{
return static_cast<const MultiListBox*>(this)->getItemNameAt(_index);
}
void MemberObsolete<MultiListBox>::deleteItem(size_t _index)
{
static_cast<MultiListBox*>(this)->removeItemAt(_index);
}
void MemberObsolete<MultiListBox>::deleteAllItems()
{
static_cast<MultiListBox*>(this)->removeAllItems();
}
void MemberObsolete<ProgressBar>::setProgressStartPoint(Align _value)
{
if (_value == Align::Right)
static_cast<ProgressBar*>(this)->setFlowDirection(FlowDirection::RightToLeft);
else if (_value == Align::Top)
static_cast<ProgressBar*>(this)->setFlowDirection(FlowDirection::TopToBottom);
else if (_value == Align::Bottom)
static_cast<ProgressBar*>(this)->setFlowDirection(FlowDirection::BottomToTop);
else
static_cast<ProgressBar*>(this)->setFlowDirection(FlowDirection::LeftToRight);
}
Align MemberObsolete<ProgressBar>::getProgressStartPoint() const
{
if (static_cast<const ProgressBar*>(this)->getFlowDirection() == FlowDirection::RightToLeft)
return Align::Right;
if (static_cast<const ProgressBar*>(this)->getFlowDirection() == FlowDirection::TopToBottom)
return Align::Top;
if (static_cast<const ProgressBar*>(this)->getFlowDirection() == FlowDirection::BottomToTop)
return Align::Bottom;
return Align::Left;
}
void MemberObsolete<ScrollView>::showVScroll(bool _visible)
{
static_cast<ScrollView*>(this)->setVisibleVScroll(_visible);
}
bool MemberObsolete<ScrollView>::isShowVScroll()
{
return static_cast<ScrollView*>(this)->isVisibleVScroll();
}
void MemberObsolete<ScrollView>::showHScroll(bool _visible)
{
static_cast<ScrollView*>(this)->setVisibleHScroll(_visible);
}
bool MemberObsolete<ScrollView>::isShowHScroll()
{
return static_cast<ScrollView*>(this)->isVisibleHScroll();
}
int MemberObsolete<TabControl>::getSheetButtonWidthIndex(size_t _index) const
{
return static_cast<const TabControl*>(this)->getButtonWidthAt(_index);
}
int MemberObsolete<TabControl>::getSheetButtonWidth(TabItem* _sheet) const
{
return static_cast<const TabControl*>(this)->getButtonWidth(_sheet);
}
void MemberObsolete<TabControl>::setSheetButtonWidthIndex(size_t _index, int _width)
{
static_cast<TabControl*>(this)->setButtonWidthAt(_index, _width);
}
void MemberObsolete<TabControl>::setSheetButtonWidth(TabItem* _sheet, int _width)
{
static_cast<TabControl*>(this)->setButtonWidth(_sheet, _width);
}
void MemberObsolete<TabControl>::showBarButton(size_t _index)
{
static_cast<TabControl*>(this)->beginToItemAt(_index);
}
void MemberObsolete<TabControl>::showBarSelectButton()
{
static_cast<TabControl*>(this)->beginToItemSelected();
}
size_t MemberObsolete<TabControl>::getSheetCount() const
{
return static_cast<const TabControl*>(this)->getItemCount();
}
const UString& MemberObsolete<TabControl>::getSheetName(TabItem* _sheet) const
{
return static_cast<const TabControl*>(this)->getItemName(_sheet);
}
const UString& MemberObsolete<TabControl>::getSheetNameIndex(size_t _index) const
{
return static_cast<const TabControl*>(this)->getItemNameAt(_index);
}
TabItem* MemberObsolete<TabControl>::getSheet(size_t _index) const
{
return static_cast<const TabControl*>(this)->getItemAt(_index);
}
void MemberObsolete<TabControl>::setSheetNameIndex(size_t _index, const UString& _name, int _width)
{
static_cast<TabControl*>(this)->setItemNameAt(_index, _name);
}
void MemberObsolete<TabControl>::setSheetName(TabItem* _sheet, const UString& _name, int _width)
{
static_cast<TabControl*>(this)->setItemName(_sheet, _name);
}
TabItem* MemberObsolete<TabControl>::addSheet(const UString& _name, int _width)
{
return static_cast<TabControl*>(this)->addItem(_name, _width);
}
TabItem* MemberObsolete<TabControl>::insertSheet(size_t _index, const UString& _name, int _width)
{
return static_cast<TabControl*>(this)->insertItemAt(_index, _name);
}
void MemberObsolete<TabControl>::removeSheetIndex(size_t _index)
{
static_cast<TabControl*>(this)->removeItemAt(_index);
}
void MemberObsolete<TabControl>::removeSheet(TabItem* _sheet)
{
static_cast<TabControl*>(this)->removeItem(_sheet);
}
void MemberObsolete<TabControl>::selectSheetIndex(size_t _index, bool _smooth)
{
static_cast<TabControl*>(this)->setIndexSelected(_index);
}
void MemberObsolete<TabControl>::selectSheet(TabItem* _sheet, bool _smooth)
{
static_cast<TabControl*>(this)->setItemSelected(_sheet);
}
size_t MemberObsolete<TabControl>::getSelectSheetIndex() const
{
return static_cast<const TabControl*>(this)->getIndexSelected();
}
size_t MemberObsolete<TabControl>::getItemIndexSelected() const
{
return static_cast<const TabControl*>(this)->getIndexSelected();
}
void MemberObsolete<TabControl>::setItemSelectedAt(size_t _index)
{
static_cast<TabControl*>(this)->setIndexSelected(_index);
}
bool MemberObsolete<Widget>::isEnabled()
{
return static_cast<Widget*>(this)->getEnabled();
}
bool MemberObsolete<Widget>::isInheritsAlpha()
{
return static_cast<Widget*>(this)->getInheritsAlpha();
}
bool MemberObsolete<Widget>::isNeedKeyFocus()
{
return static_cast<Widget*>(this)->getNeedKeyFocus();
}
bool MemberObsolete<Widget>::isNeedMouseFocus()
{
return static_cast<Widget*>(this)->getNeedMouseFocus();
}
bool MemberObsolete<Widget>::isInheritsPick()
{
return static_cast<Widget*>(this)->getInheritsPick();
}
bool MemberObsolete<Widget>::isVisible()
{
return static_cast<Widget*>(this)->getVisible();
}
void MemberObsolete<Window>::showSmooth(bool _reset)
{
static_cast<Window*>(this)->setVisibleSmooth(true);
}
void MemberObsolete<Window>::hideSmooth()
{
static_cast<Window*>(this)->setVisibleSmooth(false);
}
void MemberObsolete<Window>::setMinMax(const IntRect& _minmax)
{
static_cast<Window*>(this)->setMinSize(_minmax.left, _minmax.top);
static_cast<Window*>(this)->setMaxSize(_minmax.right, _minmax.bottom);
}
void MemberObsolete<Window>::setMinMax(int _min_w, int _min_h, int _max_w, int _max_h)
{
static_cast<Window*>(this)->setMinSize(_min_w, _min_h);
static_cast<Window*>(this)->setMaxSize(_max_w, _max_h);
}
IntRect MemberObsolete<Window>::getMinMax() const
{
return {
static_cast<const Window*>(this)->getMinSize().width,
static_cast<const Window*>(this)->getMinSize().height,
static_cast<const Window*>(this)->getMaxSize().width,
static_cast<const Window*>(this)->getMaxSize().height};
}
bool MemberObsolete<FontManager>::load(const std::string& _file)
{
return ResourceManager::getInstance().load(_file);
}
void MemberObsolete<FontManager>::loadOldFontFormat(
xml::ElementPtr _node2,
std::string_view _file,
Version _version,
std::string_view _tag)
{
xml::ElementEnumerator _node = _node2->getElementEnumerator();
while (_node.next())
{
if (_node->getName() == _tag)
{
std::string name;
if (!_node->findAttribute("name", name))
return;
std::string_view type;
if (_node->findAttribute("resolution").empty())
type = "ResourceManualFont";
else
type = "ResourceTrueTypeFont";
xml::Document doc;
xml::ElementPtr root = doc.createRoot("MyGUI");
xml::ElementPtr node = root->createChild("Resource");
node->addAttribute("type", type);
node->addAttribute("name", name);
std::string tmp;
if (_node->findAttribute("source", tmp))
{
xml::ElementPtr prop = node->createChild("Property");
prop->addAttribute("key", "Source");
prop->addAttribute("value", tmp);
}
if (_node->findAttribute("size", tmp))
{
xml::ElementPtr prop = node->createChild("Property");
prop->addAttribute("key", "Size");
prop->addAttribute("value", tmp);
}
if (_node->findAttribute("resolution", tmp))
{
xml::ElementPtr prop = node->createChild("Property");
prop->addAttribute("key", "Resolution");
prop->addAttribute("value", tmp);
}
if (_node->findAttribute("antialias_colour", tmp))
{
xml::ElementPtr prop = node->createChild("Property");
prop->addAttribute("key", "Antialias");
prop->addAttribute("value", tmp);
}
if (_node->findAttribute("space_width", tmp))
{
xml::ElementPtr prop = node->createChild("Property");
prop->addAttribute("key", "SpaceWidth");
prop->addAttribute("value", tmp);
}
if (_node->findAttribute("tab_width", tmp))
{
xml::ElementPtr prop = node->createChild("Property");
prop->addAttribute("key", "TabWidth");
prop->addAttribute("value", tmp);
}
if (_node->findAttribute("cursor_width", tmp))
{
xml::ElementPtr prop = node->createChild("Property");
prop->addAttribute("key", "CursorWidth");
prop->addAttribute("value", tmp);
}
if (_node->findAttribute("distance", tmp))
{
xml::ElementPtr prop = node->createChild("Property");
prop->addAttribute("key", "Distance");
prop->addAttribute("value", tmp);
}
if (_node->findAttribute("offset_height", tmp))
{
xml::ElementPtr prop = node->createChild("Property");
prop->addAttribute("key", "OffsetHeight");
prop->addAttribute("value", tmp);
}
if (_node->findAttribute("default_height", tmp))
{
xml::ElementPtr prop = node->createChild("Property");
prop->addAttribute("key", "DefaultHeight");
prop->addAttribute("value", tmp);
}
xml::ElementPtr codes = node->createChild("Codes");
xml::ElementEnumerator codeold = _node->getElementEnumerator();
while (codeold.next("Code"))
{
xml::ElementPtr codenew = codes->createChild("Code");
if (codeold->findAttribute("range", tmp))
codenew->addAttribute("range", tmp);
if (codeold->findAttribute("hide", tmp))
codenew->addAttribute("hide", tmp);
if (codeold->findAttribute("index", tmp))
codenew->addAttribute("index", tmp);
if (codeold->findAttribute("coord", tmp))
codenew->addAttribute("coord", tmp);
}
ResourceManager::getInstance().loadFromXmlNode(root, _file, _version);
}
}
}
void MemberObsolete<Gui>::destroyWidgetsVector(VectorWidgetPtr& _widgets)
{
static_cast<Gui*>(this)->destroyWidgets(_widgets);
}
bool MemberObsolete<Gui>::injectMouseMove(int _absx, int _absy, int _absz)
{
return InputManager::getInstance().injectMouseMove(_absx, _absy, _absz);
}
bool MemberObsolete<Gui>::injectMousePress(int _absx, int _absy, MouseButton _id)
{
return InputManager::getInstance().injectMousePress(_absx, _absy, _id);
}
bool MemberObsolete<Gui>::injectMouseRelease(int _absx, int _absy, MouseButton _id)
{
return InputManager::getInstance().injectMouseRelease(_absx, _absy, _id);
}
bool MemberObsolete<Gui>::injectKeyPress(KeyCode _key, Char _text)
{
return InputManager::getInstance().injectKeyPress(_key, _text);
}
bool MemberObsolete<Gui>::injectKeyRelease(KeyCode _key)
{
return InputManager::getInstance().injectKeyRelease(_key);
}
void MemberObsolete<Gui>::hidePointer()
{
PointerManager::getInstance().setVisible(false);
}
void MemberObsolete<Gui>::showPointer()
{
PointerManager::getInstance().setVisible(true);
}
bool MemberObsolete<Gui>::isShowPointer()
{
return PointerManager::getInstance().isVisible();
}
bool MemberObsolete<Gui>::load(const std::string& _file)
{
return ResourceManager::getInstance().load(_file);
}
const IntSize& MemberObsolete<Gui>::getViewSize() const
{
return RenderManager::getInstance().getViewSize();
}
int MemberObsolete<Gui>::getViewWidth() const
{
return RenderManager::getInstance().getViewSize().width;
}
int MemberObsolete<Gui>::getViewHeight() const
{
return RenderManager::getInstance().getViewSize().height;
}
void MemberObsolete<Gui>::setVisiblePointer(bool _value)
{
PointerManager::getInstance().setVisible(_value);
}
bool MemberObsolete<Gui>::isVisiblePointer()
{
return PointerManager::getInstance().isVisible();
}
void MemberObsolete<Gui>::_injectFrameEntered(float _time)
{
Gui::getInstance().frameEvent(_time);
}
void MemberObsolete<Gui>::_resizeWindow(const IntSize& _size)
{
LayerManager::getInstance().resizeView(_size);
}
const IntPoint& MemberObsolete<InputManager>::getLastLeftPressed() const
{
return InputManager::getInstance().getLastPressedPosition(MouseButton::Left);
}
const IntPoint& MemberObsolete<InputManager>::getLastRightPressed() const
{
return InputManager::getInstance().getLastPressedPosition(MouseButton::Right);
}
bool MemberObsolete<LanguageManager>::load(const std::string& _file)
{
return ResourceManager::getInstance().load(_file);
}
bool MemberObsolete<LayerManager>::load(const std::string& _file)
{
return ResourceManager::getInstance().load(_file);
}
VectorWidgetPtr MemberObsolete<LayoutManager>::load(std::string_view _file)
{
return static_cast<LayoutManager*>(this)->loadLayout(_file);
}
bool MemberObsolete<PluginManager>::load(const std::string& _file)
{
return ResourceManager::getInstance().load(_file);
}
void MemberObsolete<PointerManager>::setDeafultPointer(std::string_view _value)
{
static_cast<PointerManager*>(this)->setDefaultPointer(_value);
}
void MemberObsolete<PointerManager>::show()
{
static_cast<PointerManager*>(this)->setVisible(true);
}
void MemberObsolete<PointerManager>::hide()
{
static_cast<PointerManager*>(this)->setVisible(false);
}
bool MemberObsolete<PointerManager>::isShow()
{
return static_cast<PointerManager*>(this)->isVisible();
}
bool MemberObsolete<PointerManager>::load(const std::string& _file)
{
return ResourceManager::getInstance().load(_file);
}
void MemberObsolete<PointerManager>::loadOldPointerFormat(
xml::ElementPtr _node,
std::string_view _file,
Version _version,
std::string_view _tag)
{
std::string_view pointer;
std::string_view layer;
xml::ElementEnumerator node = _node->getElementEnumerator();
while (node.next())
{
if (node->getName() == _tag)
{
layer = node->findAttribute("layer");
pointer = node->findAttribute("default");
// сохраняем
std::string_view shared_text = node->findAttribute("texture");
// берем детей и крутимся, основной цикл
xml::ElementEnumerator info = node->getElementEnumerator();
while (info.next("Info"))
{
std::string_view name = info->findAttribute("name");
if (name.empty())
continue;
std::string_view texture = info->findAttribute("texture");
std::string_view type =
(shared_text.empty() && texture.empty()) ? "ResourceImageSetPointer" : "ResourceManualPointer";
xml::Document doc;
xml::ElementPtr root = doc.createRoot("MyGUI");
xml::ElementPtr newnode = root->createChild("Resource");
newnode->addAttribute("type", type);
newnode->addAttribute("name", name);
std::string tmp;
if (info->findAttribute("point", tmp))
{
xml::ElementPtr prop = newnode->createChild("Property");
prop->addAttribute("key", "Point");
prop->addAttribute("value", tmp);
}
if (info->findAttribute("size", tmp))
{
xml::ElementPtr prop = newnode->createChild("Property");
prop->addAttribute("key", "Size");
prop->addAttribute("value", tmp);
}
if (info->findAttribute("resource", tmp))
{
xml::ElementPtr prop = newnode->createChild("Property");
prop->addAttribute("key", "Resource");
prop->addAttribute("value", tmp);
}
if (info->findAttribute("offset", tmp))
{
xml::ElementPtr prop = newnode->createChild("Property");
prop->addAttribute("key", "Coord");
prop->addAttribute("value", tmp);
}
if (!shared_text.empty() || !texture.empty())
{
xml::ElementPtr prop = newnode->createChild("Property");
prop->addAttribute("key", "Texture");
prop->addAttribute("value", shared_text.empty() ? texture : shared_text);
}
ResourceManager::getInstance().loadFromXmlNode(root, _file, _version);
}
}
}
if (!layer.empty())
static_cast<PointerManager*>(this)->setLayerName(layer);
if (!pointer.empty())
static_cast<PointerManager*>(this)->setDefaultPointer(pointer);
}
size_t MemberObsolete<ResourceManager>::getResourceCount() const
{
return static_cast<const ResourceManager*>(this)->getCount();
}
IResourcePtr MemberObsolete<ResourceManager>::getResource(std::string_view _name, bool _throw) const
{
return static_cast<const ResourceManager*>(this)->getByName(_name, _throw);
}
ResourceSkin* MemberObsolete<SkinManager>::getSkin(std::string_view _name) const
{
return static_cast<const SkinManager*>(this)->getByName(_name);
}
bool MemberObsolete<SkinManager>::load(const std::string& _file)
{
return ResourceManager::getInstance().load(_file);
}
void MemberObsolete<SkinManager>::loadOldSkinFormat(
xml::ElementPtr _node,
std::string_view /*_file*/,
Version _version,
std::string_view _tag)
{
const std::string& resourceCategory = ResourceManager::getInstance().getCategoryName();
// берем детей и крутимся, основной цикл со скинами
xml::ElementEnumerator skin = _node->getElementEnumerator();
while (skin.next(_tag))
{
std::string_view type = skin->findAttribute("type");
if (type.empty())
type = "ResourceSkin";
IObject* object = FactoryManager::getInstance().createObject(resourceCategory, type);
if (object != nullptr)
{
ResourceSkin* data = object->castType<ResourceSkin>();
data->deserialization(skin.current(), _version);
ResourceManager::getInstance().addResource(data);
}
}
}
void MemberObsolete<WidgetManager>::destroyWidgetsVector(VectorWidgetPtr& _widgets)
{
static_cast<WidgetManager*>(this)->destroyWidgets(_widgets);
}
Widget* MemberObsolete<WidgetManager>::findWidgetT(std::string_view _name, bool _throw)
{
return Gui::getInstance().findWidgetT(_name, _throw);
}
Widget* MemberObsolete<WidgetManager>::findWidgetT(std::string_view _name, std::string_view _prefix, bool _throw)
{
return Gui::getInstance().findWidgetT(_name, _prefix, _throw);
}
void MemberObsolete<WidgetManager>::parse(Widget* _widget, std::string_view _key, std::string_view _value)
{
_widget->setProperty(_key, _value);
}
#endif // MYGUI_DONT_USE_OBSOLETE
#ifndef MYGUI_DONT_USE_OBSOLETE
static std::string_view convertAlignToDirection(std::string_view _value)
{
Align align = utility::parseValue<Align>(_value);
if (align == Align::Right)
return FlowDirection(FlowDirection::RightToLeft).print();
if (align == Align::Top)
return FlowDirection(FlowDirection::TopToBottom).print();
if (align == Align::Bottom)
return FlowDirection(FlowDirection::BottomToTop).print();
return FlowDirection(FlowDirection::LeftToRight).print();
}
static std::string convertRectToCoord(std::string_view _value)
{
IntRect rect = IntRect::parse(_value);
IntCoord coord(rect.left, rect.top, rect.width(), rect.height());
return coord.print();
}
using SetString = std::set<std::string, std::less<>>;
static MapString mPropertyRename;
static SetString mPropertyIgnore;
static MapString mSkinRename;
#endif // MYGUI_DONT_USE_OBSOLETE
bool BackwardCompatibility::isIgnoreProperty(std::string_view _key)
{
#ifndef MYGUI_DONT_USE_OBSOLETE
return mPropertyIgnore.find(_key) != mPropertyIgnore.end();
#else
return false;
#endif // MYGUI_DONT_USE_OBSOLETE
}
bool BackwardCompatibility::checkProperty(Widget* _owner, std::string& _key, std::string& _value)
{
#ifndef MYGUI_DONT_USE_OBSOLETE
if (mPropertyIgnore.find(_key) != mPropertyIgnore.end())
return false;
MapString::iterator item = mPropertyRename.find(_key);
if (item != mPropertyRename.end())
{
MYGUI_LOG(
Warning,
(*item).first << " is deprecated, use " << (*item).second << " ["
<< LayoutManager::getInstance().getCurrentLayout() << "]");
_key = (*item).second;
}
else if (_key == "Progress_StartPoint")
{
MYGUI_LOG(
Warning,
"Progress_StartPoint is deprecated, use Progress_FlowDirection"
<< " [" << LayoutManager::getInstance().getCurrentLayout() << "]");
_key = "Progress_FlowDirection";
_value = convertAlignToDirection(_value);
}
else if (_key == "ComboBox_AddItem")
{
MYGUI_LOG(
Warning,
"ComboBox_AddItem is deprecated"
<< " [" << LayoutManager::getInstance().getCurrentLayout() << "]");
ComboBox* widget = _owner->castType<ComboBox>(false);
if (widget != nullptr)
widget->addItem(_value);
return false;
}
else if (_key == "List_AddItem")
{
MYGUI_LOG(
Warning,
"List_AddItem is deprecated"
<< " [" << LayoutManager::getInstance().getCurrentLayout() << "]");
ListBox* widget = _owner->castType<ListBox>(false);
if (widget != nullptr)
widget->addItem(_value);
return false;
}
else if (_key == "Tab_AddSheet")
{
MYGUI_LOG(
Warning,
"Tab_AddSheet is deprecated"
<< " [" << LayoutManager::getInstance().getCurrentLayout() << "]");
TabControl* widget = _owner->castType<TabControl>(false);
if (widget != nullptr)
widget->addItem(_value);
return false;
}
else if (_key == "Tab_AddItem")
{
MYGUI_LOG(
Warning,
"Tab_AddItem is deprecated"
<< " [" << LayoutManager::getInstance().getCurrentLayout() << "]");
TabControl* widget = _owner->castType<TabControl>(false);
if (widget != nullptr)
widget->addItem(_value);
return false;
}
else if (_key == "Window_MinMax")
{
MYGUI_LOG(
Warning,
"Window_MinMax is deprecated, use Window_MinSize or Window_MaxSize"
<< " [" << LayoutManager::getInstance().getCurrentLayout() << "]");
Window* widget = _owner->castType<Window>(false);
if (widget != nullptr)
{
IntRect rect = IntRect::parse(_value);
widget->setMinSize(rect.left, rect.top);
widget->setMaxSize(rect.right, rect.bottom);
}
return false;
}
else if (_key == "ImageRect")
{
MYGUI_LOG(
Warning,
"ImageRect is deprecated, use ImageCoord"
<< " [" << LayoutManager::getInstance().getCurrentLayout() << "]");
_key = "ImageCoord";
_value = convertRectToCoord(_value);
}
else if (_key == "StartPoint")
{
MYGUI_LOG(
Warning,
"StartPoint is deprecated, use FlowDirection"
<< " [" << LayoutManager::getInstance().getCurrentLayout() << "]");
_key = "FlowDirection";
_value = convertAlignToDirection(_value);
}
#endif // MYGUI_DONT_USE_OBSOLETE
return true;
}
void BackwardCompatibility::initialise()
{
#ifndef MYGUI_DONT_USE_OBSOLETE
mPropertyRename["Widget_Caption"] = "Caption";
mPropertyRename["Button_Pressed"] = "StateSelected";
mPropertyRename["ButtonPressed"] = "StateSelected";
mPropertyRename["StateCheck"] = "StateSelected";
mPropertyRename["Edit_ShowVScroll"] = "VisibleVScroll";
mPropertyRename["Edit_ShowHScroll"] = "VisibleHScroll";
mPropertyRename["ScrollView_VScroll"] = "VisibleVScroll";
mPropertyRename["ScrollView_HScroll"] = "VisibleHScroll";
mPropertyRename["Progress_Position"] = "RangePosition";
mPropertyRename["Scroll_Position"] = "RangePosition";
mPropertyRename["Tab_SelectSheet"] = "SelectItem";
mPropertyRename["Image_Texture"] = "ImageTexture";
mPropertyRename["Image_Coord"] = "ImageRegion";
mPropertyRename["Image_Tile"] = "ImageTile";
mPropertyRename["Image_Index"] = "ImageIndex";
mPropertyRename["Image_Resource"] = "ImageResource";
mPropertyRename["Image_Group"] = "ImageGroup";
mPropertyRename["Image_Name"] = "ImageName";
mPropertyRename["MenuItem_Id"] = "MenuItemId";
mPropertyRename["MenuItem_Type"] = "MenuItemType";
mPropertyRename["Combo_MaxLength"] = "MaxListLength";
mPropertyRename["AlignText"] = "TextAlign";
mPropertyRename["ToStick"] = "Snap";
mPropertyRename["ListSmoothShow"] = "SmoothShow";
mPropertyRename["HeightList"] = "MaxListLength";
mPropertyRename["AlignVert"] = "VerticalAlignment";
mPropertyIgnore.insert("DragLayer");
mPropertyIgnore.insert("SkinLine");
mPropertyIgnore.insert("HeightLine");
mPropertyIgnore.insert("SkinLine");
mPropertyIgnore.insert("HeightLine");
mPropertyIgnore.insert("SeparatorHeight");
mPropertyIgnore.insert("SeparatorSkin");
mPropertyIgnore.insert("SubmenuImageSize");
mPropertyIgnore.insert("SubMenuSkin");
mPropertyIgnore.insert("SubMenuLayer");
mPropertyIgnore.insert("DistanceButton");
mPropertyIgnore.insert("ButtonSkin");
mPropertyIgnore.insert("ButtonType");
mPropertyIgnore.insert("ButtonSize");
mPropertyIgnore.insert("ButtonOffset");
mPropertyIgnore.insert("DefaultLayer");
mPropertyIgnore.insert("FadeSkin");
mPropertyIgnore.insert("FadeLayer");
mPropertyIgnore.insert("SkinButton");
mPropertyIgnore.insert("HeightButton");
mPropertyIgnore.insert("SkinList");
mPropertyIgnore.insert("SkinButtonEmpty");
mPropertyIgnore.insert("WidthSeparator");
mPropertyIgnore.insert("SkinSeparator");
mPropertyIgnore.insert("TrackSkin");
mPropertyIgnore.insert("TrackWidth");
mPropertyIgnore.insert("TrackMin");
mPropertyIgnore.insert("TrackStep");
mPropertyIgnore.insert("TrackFill");
mPropertyIgnore.insert("OffsetBar");
mPropertyIgnore.insert("ButtonSkin");
mPropertyIgnore.insert("EmptyBarSkin");
mPropertyIgnore.insert("TrackRangeMargins");
mPropertyIgnore.insert("MinTrackSize");
mPropertyIgnore.insert("MainMove");
mPropertyIgnore.insert("LevelOffset");
mPropertyIgnore.insert("State");
mSkinRename["StaticImage"] = "ImageBox";
mSkinRename["StaticText"] = "TextBox";
mSkinRename["HScroll"] = "ScrollBarH";
mSkinRename["VScroll"] = "ScrollBarV";
mSkinRename["ItemBoxH"] = "ItemBox";
mSkinRename["ItemBoxV"] = "ItemBox";
mSkinRename["VSlider"] = "SliderV";
mSkinRename["HSlider"] = "SliderH";
mSkinRename["Progress"] = "ProgressBar";
mSkinRename["ProgressFill"] = "ProgressBarFill";
mSkinRename["List"] = "ListBox";
mSkinRename["MultiList"] = "MultiListBox";
mSkinRename["Edit"] = "EditBox";
mSkinRename["EditStretch"] = "EditBoxStretch";
mSkinRename["EditEmpty"] = "EditBoxEmpty";
mSkinRename["RadioBox"] = "RadioButton";
mSkinRename["Tab"] = "TabControl";
mSkinRename["WordWrap"] = "WordWrapEmpty";
mSkinRename["WordWrapSimple"] = "WordWrapEmpty";
mSkinRename["ButtonSmall"] = "Button";
mSkinRename["ButtonImageText"] = "ButtonImage";
mSkinRename["TileClient"] = "ClientTileSkin";
mSkinRename["DefaultClient"] = "ClientDefaultSkin";
mSkinRename["Panel"] = "PanelSkin";
mSkinRename["PanelSmall"] = "PanelSkin";
mSkinRename["Separator1"] = "SepUpVSkin";
mSkinRename["Separator2"] = "SepDownVSkin";
mSkinRename["Separator3"] = "SepUpHSkin";
mSkinRename["Separator4"] = "SepDownHSkin";
mSkinRename["MarkerWhite"] = "WhiteSkin";
mSkinRename["ButtonLeft"] = "ButtonLeftSkin";
mSkinRename["ButtonRight"] = "ButtonRightSkin";
mSkinRename["ButtonUp"] = "ButtonUpSkin";
mSkinRename["ButtonDown"] = "ButtonDownSkin";
mSkinRename["ButtonV"] = "ButtonAcceptSkin";
mSkinRename["ButtonX"] = "ButtonCloseSkin";
mSkinRename["ButtonMinusPlus"] = "ButtonExpandSkin";
#endif // MYGUI_DONT_USE_OBSOLETE
}
std::string_view BackwardCompatibility::getPropertyRename(std::string_view _propertyName)
{
#ifndef MYGUI_DONT_USE_OBSOLETE
MapString::const_iterator item = mPropertyRename.find(_propertyName);
if (item != mPropertyRename.end())
return (*item).second;
#endif // MYGUI_DONT_USE_OBSOLETE
return _propertyName;
}
std::string_view BackwardCompatibility::getFactoryRename(
std::string_view _categoryName,
std::string_view _factoryName)
{
#ifndef MYGUI_DONT_USE_OBSOLETE
if (_categoryName == "Widget")
{
if (_factoryName == "HScroll")
{
MYGUI_LOG(
Warning,
"HScroll factory is deprecated, use " << ScrollBar::getClassTypeName() << " ["
<< LayoutManager::getInstance().getCurrentLayout() << "]");
}
else if (_factoryName == "VScroll")
{
MYGUI_LOG(
Warning,
"VScroll factory is deprecated, use " << ScrollBar::getClassTypeName() << " ["
<< LayoutManager::getInstance().getCurrentLayout() << "]");
}
else if (_factoryName == "RenderBox")
{
MYGUI_LOG(
Warning,
"RenderBox factory is deprecated, use " << Canvas::getClassTypeName() << " ["
<< LayoutManager::getInstance().getCurrentLayout() << "]");
}
else if (_factoryName == "Sheet")
{
MYGUI_LOG(
Warning,
"Sheet factory is deprecated, use " << TabItem::getClassTypeName() << " ["
<< LayoutManager::getInstance().getCurrentLayout() << "]");
}
else if (_factoryName == "StaticImage")
{
MYGUI_LOG(
Warning,
"StaticImage factory is deprecated, use "
<< ImageBox::getClassTypeName() << " [" << LayoutManager::getInstance().getCurrentLayout()
<< "]");
}
else if (_factoryName == "StaticText")
{
MYGUI_LOG(
Warning,
"StaticText factory is deprecated, use " << TextBox::getClassTypeName() << " ["
<< LayoutManager::getInstance().getCurrentLayout() << "]");
}
else if (_factoryName == "Progress")
{
MYGUI_LOG(
Warning,
"Progress factory is deprecated, use " << ProgressBar::getClassTypeName() << " ["
<< LayoutManager::getInstance().getCurrentLayout() << "]");
}
else if (_factoryName == "List")
{
MYGUI_LOG(
Warning,
"List factory is deprecated, use " << ListBox::getClassTypeName() << " ["
<< LayoutManager::getInstance().getCurrentLayout() << "]");
}
else if (_factoryName == "Edit")
{
MYGUI_LOG(
Warning,
"Edit factory is deprecated, use " << EditBox::getClassTypeName() << " ["
<< LayoutManager::getInstance().getCurrentLayout() << "]");
}
else if (_factoryName == "Tab")
{
MYGUI_LOG(
Warning,
"Tab factory is deprecated, use " << TabControl::getClassTypeName() << " ["
<< LayoutManager::getInstance().getCurrentLayout() << "]");
}
else if (_factoryName == "MultiList")
{
MYGUI_LOG(
Warning,
"MultiList factory is deprecated, use " << MultiListBox::getClassTypeName() << " ["
<< LayoutManager::getInstance().getCurrentLayout() << "]");
}
else if (_factoryName == "MenuCtrl")
{
MYGUI_LOG(
Warning,
"MenuCtrl factory is deprecated, use " << MenuControl::getClassTypeName() << " ["
<< LayoutManager::getInstance().getCurrentLayout() << "]");
}
}
#endif // MYGUI_DONT_USE_OBSOLETE
return _factoryName;
}
std::string_view BackwardCompatibility::getSkinRename(std::string_view _skinName)
{
#ifndef MYGUI_DONT_USE_OBSOLETE
MapString::iterator item = mSkinRename.find(_skinName);
if (item != mSkinRename.end())
{
MYGUI_LOG(
Warning,
(*item).first << " skin is deprecated, use " << (*item).second << " ["
<< LayoutManager::getInstance().getCurrentLayout() << "]");
return (*item).second;
}
#endif // MYGUI_DONT_USE_OBSOLETE
return _skinName;
}
void BackwardCompatibility::shutdown()
{
#ifndef MYGUI_DONT_USE_OBSOLETE
mPropertyRename.clear();
#endif // MYGUI_DONT_USE_OBSOLETE
}
void BackwardCompatibility::registerWidgetTypes()
{
#ifndef MYGUI_DONT_USE_OBSOLETE
FactoryManager& factory = FactoryManager::getInstance();
const std::string& widgetCategory = MyGUI::WidgetManager::getInstance().getCategoryName();
factory.registerFactory<HScroll>(widgetCategory);
factory.registerFactory<VScroll>(widgetCategory);
factory.registerFactory<Canvas>(widgetCategory, "RenderBox");
factory.registerFactory<TabItem>(widgetCategory, "Sheet");
factory.registerFactory<ImageBox>(widgetCategory, "StaticImage");
factory.registerFactory<TextBox>(widgetCategory, "StaticText");
factory.registerFactory<ProgressBar>(widgetCategory, "Progress");
factory.registerFactory<ListBox>(widgetCategory, "List");
factory.registerFactory<EditBox>(widgetCategory, "Edit");
factory.registerFactory<TabControl>(widgetCategory, "Tab");
factory.registerFactory<MultiListBox>(widgetCategory, "MultiList");
factory.registerFactory<MenuControl>(widgetCategory, "MenuCtrl");
#endif // MYGUI_DONT_USE_OBSOLETE
}
} // namespace MyGUI
MyGUI_BackwardCompatibility.h
MyGUI_Button.h
MyGUI_Canvas.h
MyGUI_ComboBox.h
MyGUI_DeprecatedWidgets.h
MYGUI_LOG
#define MYGUI_LOG(level, text)
Definition MyGUI_Diagnostic.h:17
MyGUI_EditBox.h
MyGUI_FactoryManager.h
MyGUI_FontManager.h
MyGUI_Gui.h
MyGUI_InputManager.h
MyGUI_ItemBox.h
MyGUI_LanguageManager.h
MyGUI_LayoutManager.h
MyGUI_ListBox.h
MyGUI_MultiListBox.h
MyGUI_PluginManager.h
MyGUI_PointerManager.h
MyGUI_Precompiled.h
MyGUI_ProgressBar.h
MyGUI_RenderManager.h
MyGUI_ResourceManager.h
MyGUI_ScrollView.h
MyGUI_SkinManager.h
MyGUI_TabControl.h
MyGUI_TabItem.h
MyGUI_Widget.h
MyGUI_WidgetManager.h
MyGUI_Window.h
MyGUI::Any
Definition MyGUI_Any.h:56
MyGUI::BackwardCompatibility::initialise
static void initialise()
Definition MyGUI_BackwardCompatibility.cpp:1201
MyGUI::BackwardCompatibility::getSkinRename
static std::string_view getSkinRename(std::string_view _skinName)
Definition MyGUI_BackwardCompatibility.cpp:1417
MyGUI::BackwardCompatibility::registerWidgetTypes
static void registerWidgetTypes()
Definition MyGUI_BackwardCompatibility.cpp:1440
MyGUI::BackwardCompatibility::isIgnoreProperty
static bool isIgnoreProperty(std::string_view _key)
Definition MyGUI_BackwardCompatibility.cpp:1086
MyGUI::BackwardCompatibility::getPropertyRename
static std::string_view getPropertyRename(std::string_view _propertyName)
Definition MyGUI_BackwardCompatibility.cpp:1310
MyGUI::BackwardCompatibility::checkProperty
static bool checkProperty(Widget *_owner, std::string &_key, std::string &_value)
Definition MyGUI_BackwardCompatibility.cpp:1095
MyGUI::BackwardCompatibility::getFactoryRename
static std::string_view getFactoryRename(std::string_view _categoryName, std::string_view _factoryName)
Definition MyGUI_BackwardCompatibility.cpp:1320
MyGUI::BackwardCompatibility::shutdown
static void shutdown()
Definition MyGUI_BackwardCompatibility.cpp:1433
MyGUI::Button
widget description should be here.
Definition MyGUI_Button.h:20
MyGUI::Canvas
wrapper over Texture - shows the texture. Implemented: resizing of texture (see TextureResizeMode); r...
Definition MyGUI_Canvas.h:22
MyGUI::Canvas::getClassTypeName
static std::string_view getClassTypeName()
Definition MyGUI_Canvas.h:23
MyGUI::ComboBox
widget description should be here.
Definition MyGUI_ComboBox.h:29
MyGUI::ComboBox::addItem
void addItem(const UString &_name, Any _data=Any::Null)
Add an item to the end of a array.
Definition MyGUI_ComboBox.cpp:469
MyGUI::EditBox
widget description should be here.
Definition MyGUI_EditBox.h:26
MyGUI::EditBox::getClassTypeName
static std::string_view getClassTypeName()
Definition MyGUI_EditBox.h:27
MyGUI::FactoryManager
Definition MyGUI_FactoryManager.h:19
MyGUI::FactoryManager::registerFactory
void registerFactory(std::string_view _category, std::string_view _type, Delegate::IDelegate *_delegate)
Definition MyGUI_FactoryManager.cpp:39
MyGUI::FactoryManager::getInstance
static FactoryManager & getInstance()
MyGUI::FactoryManager::createObject
IObject * createObject(std::string_view _category, std::string_view _type)
Definition MyGUI_FactoryManager.cpp:80
MyGUI::Gui
Definition MyGUI_Gui.h:24
MyGUI::Gui::frameEvent
void frameEvent(float _time) const
Definition MyGUI_Gui.cpp:369
MyGUI::Gui::findWidgetT
Widget * findWidgetT(std::string_view _name, bool _throw=true) const
Definition MyGUI_Gui.cpp:178
MyGUI::Gui::getInstance
static Gui & getInstance()
Definition MyGUI_Gui.cpp:34
MyGUI::HScroll
Definition MyGUI_DeprecatedWidgets.h:31
MyGUI::IObject
Definition MyGUI_IObject.h:17
MyGUI::IObject::castType
Type * castType(bool _throw=true)
Definition MyGUI_IObject.h:18
MyGUI::ImageBox
widget description should be here.
Definition MyGUI_ImageBox.h:22
MyGUI::ImageBox::getClassTypeName
static std::string_view getClassTypeName()
Definition MyGUI_ImageBox.h:23
MyGUI::InputManager::getLastPressedPosition
const IntPoint & getLastPressedPosition(MouseButton _id) const
Definition MyGUI_InputManager.cpp:648
MyGUI::InputManager::injectMousePress
bool injectMousePress(int _absx, int _absy, MouseButton _id)
Definition MyGUI_InputManager.cpp:212
MyGUI::InputManager::injectMouseMove
bool injectMouseMove(int _absx, int _absy, int _absz)
Definition MyGUI_InputManager.cpp:73
MyGUI::InputManager::getInstance
static InputManager & getInstance()
MyGUI::InputManager::injectMouseRelease
bool injectMouseRelease(int _absx, int _absy, MouseButton _id)
Definition MyGUI_InputManager.cpp:285
MyGUI::InputManager::injectKeyPress
bool injectKeyPress(KeyCode _key, Char _text=0)
Definition MyGUI_InputManager.cpp:341
MyGUI::InputManager::injectKeyRelease
bool injectKeyRelease(KeyCode _key)
Definition MyGUI_InputManager.cpp:360
MyGUI::ItemBox
widget description should be here.
Definition MyGUI_ItemBox.h:31
MyGUI::LayerManager::getInstance
static LayerManager & getInstance()
MyGUI::LayerManager::resizeView
void resizeView(const IntSize &_viewSize)
Definition MyGUI_LayerManager.cpp:248
MyGUI::LayoutManager
Definition MyGUI_LayoutManager.h:27
MyGUI::LayoutManager::getInstance
static LayoutManager & getInstance()
MyGUI::ListBox
widget description should be here.
Definition MyGUI_ListBox.h:28
MyGUI::ListBox::addItem
void addItem(const UString &_name, Any _data=Any::Null)
Add an item to the end of a array.
Definition MyGUI_ListBox.cpp:873
MyGUI::ListBox::getClassTypeName
static std::string_view getClassTypeName()
Definition MyGUI_ListBox.h:29
MyGUI::MemberObsolete< Button >::getImageIndex
size_t getImageIndex() const
Definition MyGUI_BackwardCompatibility.cpp:68
MyGUI::MemberObsolete< Button >::setImageIndex
void setImageIndex(size_t _index)
Definition MyGUI_BackwardCompatibility.cpp:63
MyGUI::MemberObsolete< MultiListBox >::addColumn
void addColumn(int _width, const UString &_name)
Definition MyGUI_BackwardCompatibility.cpp:423
MyGUI::MemberObsolete
Definition MyGUI_DeprecatedTypes.h:14
MyGUI::MultiListBox
widget description should be here.
Definition MyGUI_MultiListBox.h:43
MyGUI::MultiListBox::getClassTypeName
static std::string_view getClassTypeName()
Definition MyGUI_MultiListBox.h:44
MyGUI::PointerManager
Definition MyGUI_PointerManager.h:22
MyGUI::PointerManager::isVisible
bool isVisible() const
Definition MyGUI_PointerManager.cpp:271
MyGUI::PointerManager::getInstance
static PointerManager & getInstance()
Definition MyGUI_PointerManager.cpp:25
MyGUI::PointerManager::setVisible
void setVisible(bool _visible)
Definition MyGUI_PointerManager.cpp:121
MyGUI::ProgressBar
widget description should be here.
Definition MyGUI_ProgressBar.h:22
MyGUI::ProgressBar::getClassTypeName
static std::string_view getClassTypeName()
Definition MyGUI_ProgressBar.h:23
MyGUI::RenderManager::getViewSize
virtual const IntSize & getViewSize() const =0
MyGUI::RenderManager::getInstance
static RenderManager & getInstance()
MyGUI::ResourceManager
Definition MyGUI_ResourceManager.h:23
MyGUI::ResourceManager::getCategoryName
const std::string & getCategoryName() const
Definition MyGUI_ResourceManager.cpp:283
MyGUI::ResourceManager::loadFromXmlNode
void loadFromXmlNode(xml::ElementPtr _node, std::string_view _file, Version _version)
Definition MyGUI_ResourceManager.cpp:65
MyGUI::ResourceManager::load
bool load(const std::string &_file)
Definition MyGUI_ResourceManager.cpp:60
MyGUI::ResourceManager::getInstance
static ResourceManager & getInstance()
MyGUI::ResourceManager::addResource
void addResource(IResourcePtr _item)
Definition MyGUI_ResourceManager.cpp:213
MyGUI::ResourceSkin
Definition MyGUI_ResourceSkin.h:22
MyGUI::ResourceSkin::deserialization
void deserialization(xml::ElementPtr _node, Version _version) override
Definition MyGUI_ResourceSkin.cpp:22
MyGUI::ScrollBar::getClassTypeName
static std::string_view getClassTypeName()
Definition MyGUI_ScrollBar.h:25
MyGUI::ScrollView
widget description should be here.
Definition MyGUI_ScrollView.h:21
MyGUI::SkinManager
Definition MyGUI_SkinManager.h:22
MyGUI::TabControl
widget description should be here.
Definition MyGUI_TabControl.h:27
MyGUI::TabControl::getClassTypeName
static std::string_view getClassTypeName()
Definition MyGUI_TabControl.h:32
MyGUI::TabControl::addItem
TabItem * addItem(const UString &_name, Any _data=Any::Null)
Add an item to the end of a array.
Definition MyGUI_TabControl.cpp:647
MyGUI::TabItem
widget description should be here.
Definition MyGUI_TabItem.h:21
MyGUI::TabItem::getClassTypeName
static std::string_view getClassTypeName()
Definition MyGUI_TabItem.h:22
MyGUI::TextBox
widget description should be here.
Definition MyGUI_TextBox.h:20
MyGUI::TextBox::getClassTypeName
static std::string_view getClassTypeName()
Definition MyGUI_TextBox.h:21
MyGUI::UString
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
Definition MyGUI_UString.h:144
MyGUI::VScroll
Definition MyGUI_DeprecatedWidgets.h:20
MyGUI::Version
Definition MyGUI_Version.h:18
MyGUI::Widget
widget description should be here.
Definition MyGUI_Widget.h:40
MyGUI::Widget::setProperty
void setProperty(std::string_view _key, std::string_view _value)
Definition MyGUI_Widget.cpp:1135
MyGUI::WidgetManager
Definition MyGUI_WidgetManager.h:21
MyGUI::WidgetManager::getCategoryName
const std::string & getCategoryName() const
Definition MyGUI_WidgetManager.cpp:194
MyGUI::WidgetManager::getInstance
static WidgetManager & getInstance()
MyGUI::Window
widget description should be here.
Definition MyGUI_Window.h:34
MyGUI::Window::setMinSize
void setMinSize(const IntSize &_value)
Definition MyGUI_Window.cpp:451
MyGUI::Window::setMaxSize
void setMaxSize(const IntSize &_value)
Definition MyGUI_Window.cpp:462
MyGUI::xml::Document
Definition MyGUI_XmlDocument.h:298
MyGUI::xml::Document::createRoot
ElementPtr createRoot(std::string_view _name)
Definition MyGUI_XmlDocument.cpp:827
MyGUI::xml::ElementEnumerator
Definition MyGUI_XmlDocument.h:121
MyGUI::xml::ElementEnumerator::next
bool next()
Definition MyGUI_XmlDocument.cpp:107
MyGUI::xml::ElementEnumerator::current
ElementPtr current()
Definition MyGUI_XmlDocument.cpp:136
MyGUI::xml::Element::findAttribute
bool findAttribute(std::string_view _name, std::string &_value)
Definition MyGUI_XmlDocument.cpp:242
MyGUI::xml::Element::getElementEnumerator
ElementEnumerator getElementEnumerator()
Definition MyGUI_XmlDocument.cpp:348
MyGUI::xml::Element::getName
const std::string & getName() const
Definition MyGUI_XmlDocument.cpp:328
MyGUI::xml::Element::addAttribute
void addAttribute(std::string_view _key, const T &_value)
Definition MyGUI_XmlDocument.h:187
MyGUI::xml::Element::createChild
ElementPtr createChild(std::string_view _name, std::string_view _content={}, ElementType _type=ElementType::Normal)
Definition MyGUI_XmlDocument.cpp:218
MyGUI::utility::parseValue
T parseValue(std::string_view _value)
Definition MyGUI_StringUtility.h:60
MyGUI::xml::ElementPtr
Element * ElementPtr
Definition MyGUI_XmlDocument.h:112
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::SetString
std::set< std::string, std::less<> > SetString
Definition MyGUI_BackwardCompatibility.cpp:1079
MyGUI::IntRect
types::TRect< int > IntRect
Definition MyGUI_Types.h:33
MyGUI::mPropertyRename
static MapString mPropertyRename
Definition MyGUI_BackwardCompatibility.cpp:1080
MyGUI::IntPoint
types::TPoint< int > IntPoint
Definition MyGUI_Types.h:27
MyGUI::IResourcePtr
IResource * IResourcePtr
Definition MyGUI_IResource.h:19
MyGUI::convertAlignToDirection
static std::string_view convertAlignToDirection(std::string_view _value)
Definition MyGUI_BackwardCompatibility.cpp:1060
MyGUI::MapString
std::map< std::string, std::string, std::less<> > MapString
Definition MyGUI_Types.h:40
MyGUI::convertRectToCoord
static std::string convertRectToCoord(std::string_view _value)
Definition MyGUI_BackwardCompatibility.cpp:1072
MyGUI::mPropertyIgnore
static SetString mPropertyIgnore
Definition MyGUI_BackwardCompatibility.cpp:1081
MyGUI::Char
unsigned int Char
Definition MyGUI_Types.h:50
MyGUI::ITEM_NONE
constexpr size_t ITEM_NONE
Definition MyGUI_Macros.h:19
MyGUI::IntCoord
types::TCoord< int > IntCoord
Definition MyGUI_Types.h:36
MyGUI::IntSize
types::TSize< int > IntSize
Definition MyGUI_Types.h:30
MyGUI::mSkinRename
static MapString mSkinRename
Definition MyGUI_BackwardCompatibility.cpp:1082
MyGUI::VectorWidgetPtr
std::vector< Widget * > VectorWidgetPtr
Definition MyGUI_WidgetDefines.h:20
MyGUI::Align
Definition MyGUI_Align.h:20
MyGUI::Align::Left
@ Left
Definition MyGUI_Align.h:27
MyGUI::Align::Bottom
@ Bottom
Definition MyGUI_Align.h:32
MyGUI::Align::Right
@ Right
Definition MyGUI_Align.h:28
MyGUI::Align::Top
@ Top
Definition MyGUI_Align.h:31
MyGUI::Colour
Definition MyGUI_Colour.h:17
MyGUI::FlowDirection
Definition MyGUI_FlowDirection.h:19
MyGUI::FlowDirection::TopToBottom
@ TopToBottom
Definition MyGUI_FlowDirection.h:24
MyGUI::FlowDirection::RightToLeft
@ RightToLeft
Definition MyGUI_FlowDirection.h:23
MyGUI::FlowDirection::BottomToTop
@ BottomToTop
Definition MyGUI_FlowDirection.h:25
MyGUI::FlowDirection::LeftToRight
@ LeftToRight
Definition MyGUI_FlowDirection.h:22
MyGUI::FlowDirection::print
std::string_view print() const
Definition MyGUI_FlowDirection.h:83
MyGUI::KeyCode
Definition MyGUI_KeyCode.h:16
MyGUI::MouseButton
Definition MyGUI_MouseButton.h:16
MyGUI::MouseButton::Right
@ Right
Definition MyGUI_MouseButton.h:22
MyGUI::MouseButton::Left
@ Left
Definition MyGUI_MouseButton.h:21
MyGUI::types::TCoord::print
std::string print() const
Definition MyGUI_TCoord.h:176
MyGUI::types::TRect::right
T right
Definition MyGUI_TRect.h:21
MyGUI::types::TRect::height
T height() const
Definition MyGUI_TRect.h:88
MyGUI::types::TRect::left
T left
Definition MyGUI_TRect.h:19
MyGUI::types::TRect::bottom
T bottom
Definition MyGUI_TRect.h:22
MyGUI::types::TRect::width
T width() const
Definition MyGUI_TRect.h:83
MyGUI::types::TRect::top
T top
Definition MyGUI_TRect.h:20
MyGUI::types::TRect< int >::parse
static TRect< int > parse(std::string_view _value)
Definition MyGUI_TRect.h:142
MyGUI::types::TSize::width
T width
Definition MyGUI_TSize.h:19
MyGUI::types::TSize::height
T height
Definition MyGUI_TSize.h:20