MyGUI 3.4.3
MyGUI_TabItem.cpp
Go to the documentation of this file.
1/*
2 * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3 * Distributed under the MIT License
4 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5 */
6
7#include "MyGUI_Precompiled.h"
8#include "MyGUI_TabItem.h"
9
10namespace MyGUI
11{
12
14 {
16
17 // FIXME проверить смену скина ибо должно один раз вызываться
18 //mOwner = getParent()->castType<TabControl>();
19 }
20
22 {
23 TabControl* owner = getParent() != nullptr ? getParent()->castType<TabControl>(false) : nullptr;
24 if (owner != nullptr)
25 owner->_notifyDeleteItem(this);
26
28 }
29
30 void TabItem::setCaption(const UString& _value)
31 {
32 TabControl* owner = getParent() != nullptr ? getParent()->castType<TabControl>(false) : nullptr;
33 if (owner != nullptr)
34 owner->setItemName(this, _value);
35 else
36 Base::setCaption(_value);
37 }
38
40 {
41 TabControl* owner = getParent() != nullptr ? getParent()->castType<TabControl>(false) : nullptr;
42 if (owner != nullptr)
43 return owner->getItemName(this);
44 return Base::getCaption();
45 }
46
47 void TabItem::setButtonWidth(int _width)
48 {
49 TabControl* owner = getParent() != nullptr ? getParent()->castType<TabControl>(false) : nullptr;
50 if (owner != nullptr)
51 owner->setButtonWidth(this, _width);
52 }
53
54 void TabItem::setPropertyOverride(std::string_view _key, std::string_view _value)
55 {
57 if (_key == "ButtonWidth")
59
60 else
61 {
62 Base::setPropertyOverride(_key, _value);
63 return;
64 }
65
66 eventChangeProperty(this, _key, _value);
67 }
68
69} // namespace MyGUI
Type * castType(bool _throw=true)
widget description should be here.
void _notifyDeleteItem(TabItem *_sheet)
void setButtonWidth(TabItem *_item, int _width=DEFAULT_WIDTH)
Set button width.
void setItemName(TabItem *_item, const UString &_name)
Replace an item name.
const UString & getItemName(const TabItem *_item) const
Get item name.
void setCaption(const UString &_value) override
void setPropertyOverride(std::string_view _key, std::string_view _value) override
void setButtonWidth(int _width=TabControl::DEFAULT_WIDTH)
Set button width.
void shutdownOverride() override
void initialiseOverride() override
const UString & getCaption() const override
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
Widget * getParent() const
EventHandle_WidgetStringString eventChangeProperty
T parseValue(std::string_view _value)