MyGUI: MyGUI_TabItem.cpp Source File

MyGUI 3.4.2

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files
- Examples

- File List
- Globals

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
13 TabItem::TabItem()
14 {
15 }
16
17 void TabItem::initialiseOverride()
18 {
19 Base::initialiseOverride();
20
21 // FIXME проверить смену скина ибо должно один раз вызываться
22 //mOwner = getParent()->castType<TabControl>();
23 }
24
25 void TabItem::shutdownOverride()
26 {
27 TabControl* owner = getParent() != nullptr ? getParent()->castType<TabControl>(false) : nullptr;
28 if (owner != nullptr)
29 owner->_notifyDeleteItem(this);
30
31 Base::shutdownOverride();
32 }
33
34 void TabItem::setCaption(const UString& _value)
35 {
36 TabControl* owner = getParent() != nullptr ? getParent()->castType<TabControl>(false) : nullptr;
37 if (owner != nullptr)
38 owner->setItemName(this, _value);
39 else
40 Base::setCaption(_value);
41 }
42
43 const UString& TabItem::getCaption() const
44 {
45 TabControl* owner = getParent() != nullptr ? getParent()->castType<TabControl>(false) : nullptr;
46 if (owner != nullptr)
47 return owner->getItemName(this);
48 return Base::getCaption();
49 }
50
51 void TabItem::setButtonWidth(int _width)
52 {
53 TabControl* owner = getParent() != nullptr ? getParent()->castType<TabControl>(false) : nullptr;
54 if (owner != nullptr)
55 owner->setButtonWidth(this, _width);
56 }
57
58 void TabItem::setPropertyOverride(const std::string& _key, const std::string& _value)
59 {
61 if (_key == "ButtonWidth")
62 setButtonWidth(utility::parseValue<int>(_value));
63
64 else
65 {
66 Base::setPropertyOverride(_key, _value);
67 return;
68 }
69
70 eventChangeProperty(this, _key, _value);
71 }
72
73} // 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:30
MyGUI::TabControl::_notifyDeleteItem
void _notifyDeleteItem(TabItem *_item)
Definition MyGUI_TabControl.cpp:459
MyGUI::TabControl::setButtonWidth
void setButtonWidth(TabItem *_item, int _width=DEFAULT)
Set button width.
Definition MyGUI_TabControl.cpp:722
MyGUI::TabControl::setItemName
void setItemName(TabItem *_item, const UString &_name)
Replace an item name.
Definition MyGUI_TabControl.cpp:689
MyGUI::TabControl::getItemName
const UString & getItemName(const TabItem *_item) const
Get item name.
Definition MyGUI_TabControl.cpp:694
MyGUI::TabItem::setCaption
void setCaption(const UString &_value) override
Definition MyGUI_TabItem.cpp:34
MyGUI::TabItem::setPropertyOverride
void setPropertyOverride(const std::string &_key, const std::string &_value) override
Definition MyGUI_TabItem.cpp:58
MyGUI::TabItem::TabItem
TabItem()
Definition MyGUI_TabItem.cpp:13
MyGUI::TabItem::shutdownOverride
void shutdownOverride() override
Definition MyGUI_TabItem.cpp:25
MyGUI::TabItem::setButtonWidth
void setButtonWidth(int _value=DEFAULT)
Set button width.
Definition MyGUI_TabItem.cpp:51
MyGUI::TabItem::initialiseOverride
void initialiseOverride() override
Definition MyGUI_TabItem.cpp:17
MyGUI::TabItem::getCaption
const UString & getCaption() const override
Definition MyGUI_TabItem.cpp:43
MyGUI::UString
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
Definition MyGUI_UString.h:145
MyGUI::Widget::getParent
Widget * getParent() const
Definition MyGUI_Widget.cpp:1275
MyGUI::Widget::eventChangeProperty
EventHandle_WidgetStringString eventChangeProperty
Definition MyGUI_Widget.h:268
MyGUI::utility::parseValue
T parseValue(const std::string &_value)
Definition MyGUI_StringUtility.h:112
MyGUI
Definition MyGUI_ActionController.h:15