MyGUI: MyGUI_MultiListItem.cpp Source File

MyGUI 3.4.2

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

- File List
- Globals

MyGUI_MultiListItem.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_MultiListItem.h"
9#include "MyGUI_MultiListBox.h"
10
11namespace MyGUI
12{
13
14 MultiListItem::MultiListItem()
15 {
16 }
17
18 void MultiListItem::initialiseOverride()
19 {
20 Base::initialiseOverride();
21 }
22
23 void MultiListItem::shutdownOverride()
24 {
25 Base::shutdownOverride();
26 }
27
28 void MultiListItem::setCaption(const UString& _value)
29 {
30 MultiListBox* owner = getOwner();
31 if (owner != nullptr)
32 owner->setColumnName(this, _value);
33 else
34 Base::setCaption(_value);
35 }
36
37 const UString& MultiListItem::getCaption() const
38 {
39 MultiListBox* owner = getOwner();
40 if (owner != nullptr)
41 return owner->getColumnName(this);
42
43 return Base::getCaption();
44 }
45
46 void MultiListItem::setItemResizingPolicy(ResizingPolicy _value)
47 {
48 MultiListBox* owner = getOwner();
49 if (owner != nullptr)
50 owner->setColumnResizingPolicy(this, _value);
51 }
52
53 void MultiListItem::setItemWidth(int _value)
54 {
55 MultiListBox* owner = getOwner();
56 if (owner != nullptr)
57 owner->setColumnWidth(this, _value);
58 }
59
60 void MultiListItem::setPropertyOverride(const std::string& _key, const std::string& _value)
61 {
63 if (_key == "ItemResizingPolicy")
64 setItemResizingPolicy(ResizingPolicy::parse(_value));
65
67 else if (_key == "ItemWidth")
68 setItemWidth(utility::parseValue<int>(_value));
69
70 else
71 {
72 Base::setPropertyOverride(_key, _value);
73 return;
74 }
75
76 eventChangeProperty(this, _key, _value);
77 }
78
79 MultiListBox* MultiListItem::getOwner() const
80 {
81 if (getParent() != nullptr)
82 {
83 if (getParent()->isType<MultiListBox>())
84 return getParent()->castType<MultiListBox>();
85 else if ((getParent()->getParent() != nullptr) && (getParent()->getParent()->getClientWidget() == getParent()))
86 {
87 if (getParent()->getParent()->isType<MultiListBox>())
88 return getParent()->getParent()->castType<MultiListBox>();
89 }
90 }
91
92 return nullptr;
93 }
94
95} // namespace MyGUI
MyGUI_MultiListBox.h
MyGUI_MultiListItem.h
MyGUI_Precompiled.h
MyGUI::IObject::castType
Type * castType(bool _throw=true)
Definition MyGUI_IObject.h:18
MyGUI::MultiListBox
widget description should be here.
Definition MyGUI_MultiListBox.h:39
MyGUI::MultiListBox::setColumnWidth
void setColumnWidth(MultiListItem *_item, int _width)
Definition MyGUI_MultiListBox.cpp:805
MyGUI::MultiListBox::setColumnName
void setColumnName(MultiListItem *_item, const UString &_name)
Definition MyGUI_MultiListBox.cpp:772
MyGUI::MultiListBox::setColumnResizingPolicy
void setColumnResizingPolicy(MultiListItem *_item, ResizingPolicy _value)
Definition MyGUI_MultiListBox.cpp:793
MyGUI::MultiListBox::getColumnName
const UString & getColumnName(const MultiListItem *_item) const
Definition MyGUI_MultiListBox.cpp:777
MyGUI::MultiListItem::setPropertyOverride
void setPropertyOverride(const std::string &_key, const std::string &_value) override
Definition MyGUI_MultiListItem.cpp:60
MyGUI::MultiListItem::isType
bool isType() const
Definition MyGUI_MultiListItem.h:24
MyGUI::MultiListItem::setItemWidth
void setItemWidth(int _value)
Definition MyGUI_MultiListItem.cpp:53
MyGUI::MultiListItem::MultiListItem
MultiListItem()
Definition MyGUI_MultiListItem.cpp:14
MyGUI::MultiListItem::initialiseOverride
void initialiseOverride() override
Definition MyGUI_MultiListItem.cpp:18
MyGUI::MultiListItem::setCaption
void setCaption(const UString &_value) override
Definition MyGUI_MultiListItem.cpp:28
MyGUI::MultiListItem::getCaption
const UString & getCaption() const override
Definition MyGUI_MultiListItem.cpp:37
MyGUI::MultiListItem::setItemResizingPolicy
void setItemResizingPolicy(ResizingPolicy _value)
Definition MyGUI_MultiListItem.cpp:46
MyGUI::MultiListItem::shutdownOverride
void shutdownOverride() override
Definition MyGUI_MultiListItem.cpp:23
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::Widget::getClientWidget
Widget * getClientWidget()
Definition MyGUI_Widget.cpp:1290
MyGUI::utility::parseValue
T parseValue(const std::string &_value)
Definition MyGUI_StringUtility.h:112
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::ResizingPolicy
Definition MyGUI_ResizingPolicy.h:16
MyGUI::ResizingPolicy::parse
static ResizingPolicy parse(const std::string &_value)
Definition MyGUI_ResizingPolicy.h:30