Пример #1
0
	TabItem* TabControl::insertItemAt(size_t _index, const UString& _name, Any _data)
	{
		MYGUI_ASSERT_RANGE_INSERT(_index, mItemsInfo.size(), "TabControl::insertItem");

		Widget* widget = Base::baseCreateWidget(WidgetStyle::Child, TabItem::getClassTypeName(), "Default", _getWidgetTemplate()->getCoord(), _getWidgetTemplate()->getAlign(), "", "", false);

		size_t lastIndex = mItemsInfo.size() - 1;
		setItemNameAt(lastIndex, _name);
		setItemDataAt(lastIndex, _data);

		swapItems(_index == ITEM_NONE ? lastIndex : _index, lastIndex);

		return widget->castType<TabItem>();
	}
	void MenuControl::_setItemNameAt(size_t _index, const UString& _name)
	{
		setItemNameAt(_index, _name);
	}
	void MenuControl::setItemName(MenuItem* _item, const UString& _name)
	{
		setItemNameAt(getItemIndex(_item), _name);
	}
Пример #4
0
			//! Replace an item name
			void setItemName(ItemType _item, NameType _name) { setItemNameAt(getItemIndex(_item), _name); }
Пример #5
0
	void ComboBox::_setItemNameAt(size_t _index, const UString& _name)
	{
		setItemNameAt(_index, _name);
	}
Пример #6
0
	void TabControl::setItemName(TabItem* _item, const UString& _name)
	{
		setItemNameAt(getItemIndex(_item), _name);
	}