MyGUI_MultiListItem.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_MultiListItem.h"
#include "MyGUI_MultiListBox.h"
namespace MyGUI
{
void MultiListItem::initialiseOverride()
{
Base::initialiseOverride();
}
void MultiListItem::shutdownOverride()
{
Base::shutdownOverride();
}
void MultiListItem::setCaption(const UString& _value)
{
MultiListBox* owner = getOwner();
if (owner != nullptr)
owner->setColumnName(this, _value);
else
Base::setCaption(_value);
}
const UString& MultiListItem::getCaption() const
{
MultiListBox* owner = getOwner();
if (owner != nullptr)
return owner->getColumnName(this);
return Base::getCaption();
}
void MultiListItem::setItemResizingPolicy(ResizingPolicy _value)
{
MultiListBox* owner = getOwner();
if (owner != nullptr)
owner->setColumnResizingPolicy(this, _value);
}
void MultiListItem::setItemWidth(int _value)
{
MultiListBox* owner = getOwner();
if (owner != nullptr)
owner->setColumnWidth(this, _value);
}
void MultiListItem::setPropertyOverride(std::string_view _key, std::string_view _value)
{
if (_key == "ItemResizingPolicy")
setItemResizingPolicy(ResizingPolicy::parse(_value));
else if (_key == "ItemWidth")
setItemWidth(utility::parseValue<int>(_value));
else
{
Base::setPropertyOverride(_key, _value);
return;
}
eventChangeProperty(this, _key, _value);
}
MultiListBox* MultiListItem::getOwner() const
{
if (getParent() != nullptr)
{
if (getParent()->isType<MultiListBox>())
return getParent()->castType<MultiListBox>();
if ((getParent()->getParent() != nullptr) && (getParent()->getParent()->getClientWidget() == getParent()))
{
if (getParent()->getParent()->isType<MultiListBox>())
return getParent()->getParent()->castType<MultiListBox>();
}
}
return nullptr;
}
} // 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:43
MyGUI::MultiListBox::setColumnWidth
void setColumnWidth(MultiListItem *_item, int _width)
Definition MyGUI_MultiListBox.cpp:818
MyGUI::MultiListBox::setColumnName
void setColumnName(MultiListItem *_item, const UString &_name)
Definition MyGUI_MultiListBox.cpp:785
MyGUI::MultiListBox::setColumnResizingPolicy
void setColumnResizingPolicy(MultiListItem *_item, ResizingPolicy _value)
Definition MyGUI_MultiListBox.cpp:806
MyGUI::MultiListBox::getColumnName
const UString & getColumnName(const MultiListItem *_item) const
Definition MyGUI_MultiListBox.cpp:790
MyGUI::MultiListItem::setPropertyOverride
void setPropertyOverride(std::string_view _key, std::string_view _value) override
Definition MyGUI_MultiListItem.cpp:56
MyGUI::MultiListItem::isType
bool isType() const
Definition MyGUI_MultiListItem.h:23
MyGUI::MultiListItem::setItemWidth
void setItemWidth(int _value)
Definition MyGUI_MultiListItem.cpp:49
MyGUI::MultiListItem::initialiseOverride
void initialiseOverride() override
Definition MyGUI_MultiListItem.cpp:14
MyGUI::MultiListItem::setCaption
void setCaption(const UString &_value) override
Definition MyGUI_MultiListItem.cpp:24
MyGUI::MultiListItem::getCaption
const UString & getCaption() const override
Definition MyGUI_MultiListItem.cpp:33
MyGUI::MultiListItem::setItemResizingPolicy
void setItemResizingPolicy(ResizingPolicy _value)
Definition MyGUI_MultiListItem.cpp:42
MyGUI::MultiListItem::shutdownOverride
void shutdownOverride() override
Definition MyGUI_MultiListItem.cpp:19
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::Widget::getClientWidget
Widget * getClientWidget()
Definition MyGUI_Widget.cpp:1367
MyGUI::utility::parseValue
T parseValue(std::string_view _value)
Definition MyGUI_StringUtility.h:60
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::ResizingPolicy
Definition MyGUI_ResizingPolicy.h:16
MyGUI::ResizingPolicy::parse
static ResizingPolicy parse(std::string_view _value)
Definition MyGUI_ResizingPolicy.h:30