MyGUI_TabItem.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_TabItem.h"
namespace MyGUI
{
void TabItem::initialiseOverride()
{
Base::initialiseOverride();
// FIXME проверить смену скина ибо должно один раз вызываться
//mOwner = getParent()->castType<TabControl>();
}
void TabItem::shutdownOverride()
{
TabControl* owner = getParent() != nullptr ? getParent()->castType<TabControl>(false) : nullptr;
if (owner != nullptr)
owner->_notifyDeleteItem(this);
Base::shutdownOverride();
}
void TabItem::setCaption(const UString& _value)
{
TabControl* owner = getParent() != nullptr ? getParent()->castType<TabControl>(false) : nullptr;
if (owner != nullptr)
owner->setItemName(this, _value);
else
Base::setCaption(_value);
}
const UString& TabItem::getCaption() const
{
TabControl* owner = getParent() != nullptr ? getParent()->castType<TabControl>(false) : nullptr;
if (owner != nullptr)
return owner->getItemName(this);
return Base::getCaption();
}
void TabItem::setButtonWidth(int _width)
{
TabControl* owner = getParent() != nullptr ? getParent()->castType<TabControl>(false) : nullptr;
if (owner != nullptr)
owner->setButtonWidth(this, _width);
}
void TabItem::setPropertyOverride(std::string_view _key, std::string_view _value)
{
if (_key == "ButtonWidth")
setButtonWidth(utility::parseValue<int>(_value));
else
{
Base::setPropertyOverride(_key, _value);
return;
}
eventChangeProperty(this, _key, _value);
}
} // namespace MyGUI
MyGUI_Precompiled.h
MyGUI_TabItem.h
MyGUI::IObject::castType
Type * castType(bool _throw=true)
Definition MyGUI_IObject.h:18
MyGUI::TabControl
widget description should be here.
Definition MyGUI_TabControl.h:27
MyGUI::TabControl::_notifyDeleteItem
void _notifyDeleteItem(TabItem *_sheet)
Definition MyGUI_TabControl.cpp:452
MyGUI::TabControl::setButtonWidth
void setButtonWidth(TabItem *_item, int _width=DEFAULT_WIDTH)
Set button width.
Definition MyGUI_TabControl.cpp:715
MyGUI::TabControl::setItemName
void setItemName(TabItem *_item, const UString &_name)
Replace an item name.
Definition MyGUI_TabControl.cpp:682
MyGUI::TabControl::getItemName
const UString & getItemName(const TabItem *_item) const
Get item name.
Definition MyGUI_TabControl.cpp:687
MyGUI::TabItem::setCaption
void setCaption(const UString &_value) override
Definition MyGUI_TabItem.cpp:30
MyGUI::TabItem::setPropertyOverride
void setPropertyOverride(std::string_view _key, std::string_view _value) override
Definition MyGUI_TabItem.cpp:54
MyGUI::TabItem::setButtonWidth
void setButtonWidth(int _width=TabControl::DEFAULT_WIDTH)
Set button width.
Definition MyGUI_TabItem.cpp:47
MyGUI::TabItem::shutdownOverride
void shutdownOverride() override
Definition MyGUI_TabItem.cpp:21
MyGUI::TabItem::initialiseOverride
void initialiseOverride() override
Definition MyGUI_TabItem.cpp:13
MyGUI::TabItem::getCaption
const UString & getCaption() const override
Definition MyGUI_TabItem.cpp:39
MyGUI::UString
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
Definition MyGUI_UString.h:144
MyGUI::Widget::getParent
Widget * getParent() const
Definition MyGUI_Widget.cpp:1352
MyGUI::Widget::eventChangeProperty
EventHandle_WidgetStringString eventChangeProperty
Definition MyGUI_Widget.h:324
MyGUI::utility::parseValue
T parseValue(std::string_view _value)
Definition MyGUI_StringUtility.h:60
MyGUI
Definition MyGUI_ActionController.h:15