7#ifndef MYGUI_TAB_CONTROL_H_
8#define MYGUI_TAB_CONTROL_H_
104 void swapItems(
size_t _index1,
size_t _index2);
136 template<
typename ValueType>
140 return mItemsInfo[_index].data.castType<ValueType>(_throw);
143 template<
typename ValueType>
154 void setItemNameAt(
size_t _index,
const UString& _name);
160 const UString& getItemNameAt(
size_t _index)
const;
170 void beginToItemAt(
size_t _index);
173 void beginToItem(
const TabItem* _item);
175 void beginToItemFirst();
177 void beginToItemLast();
179 void beginToItemSelected();
186 void setButtonWidthAt(
size_t _index,
int _width = DEFAULT_WIDTH);
188 void setButtonWidth(
TabItem* _item,
int _width = DEFAULT_WIDTH);
191 int getButtonWidthAt(
size_t _index)
const;
193 int getButtonWidth(
TabItem* _item)
const;
198 void setButtonDefaultWidth(
int _width);
200 int getButtonDefaultWidth()
const;
203 void setButtonAutoWidth(
bool _auto);
205 bool getButtonAutoWidth()
const;
208 void setSmoothShow(
bool _value);
210 bool getSmoothShow()
const;
258 Widget* _getWidgetTemplate();
267 bool mButtonShow{
true};
269 std::vector<Button*> mItemButton;
270 std::string mButtonSkinName;
271 std::string mEmptySkinName;
273 Widget* mWidgetBar{
nullptr};
274 Button* mButtonLeft{
nullptr};
275 Button* mButtonRight{
nullptr};
276 Widget* mButtonDecor{
nullptr};
278 Widget* mEmptyBarWidget{
nullptr};
279 Widget* mItemTemplate{
nullptr};
282 VectorTabItemInfo mItemsInfo;
283 size_t mStartIndex{0};
286 int mButtonDefaultWidth{1};
287 bool mSmoothShow{
true};
288 bool mButtonAutoWidth{
true};
291 bool mShutdown{
false};
293 Widget* mHeaderPlace{
nullptr};
294 Widget* mControls{
nullptr};
295 Widget* mEmpty{
nullptr};
#define MYGUI_ASSERT_RANGE(index, size, owner)
#define MYGUI_RTTI_DERIVED(DerivedType)
widget description should be here.
EventPair< EventHandle_WidgetSizeT, EventHandle_TabPtrSizeT > eventTabChangeSelect
int _getTextWidth(const UString &_text)
void _notifyDeleteItem(TabItem *_sheet)
size_t getIndexSelected() const
Get index of selected item (ITEM_NONE if none selected)
void _setItemNameAt(size_t _index, const UString &_name) override
size_t findItemIndex(const TabItem *_item)
Search item, returns the position of the first occurrence in array or ITEM_NONE if item not found.
void swapItems(size_t _index1, size_t _index2)
void clearItemDataAt(size_t _index)
Clear an item data at a specified position.
void setItemDataAt(size_t _index, Any _data)
Replace an item data at a specified position.
void onWidgetCreated(Widget *_widget) override
void removeAllItems()
Remove all items.
static constexpr int DEFAULT_WIDTH
ValueType * getItemData(TabItem *_item, bool _throw=true)
Get item data.
void _insertItem(size_t _index, const UString &_name, TabItem *_sheet, Any _data)
ValueType * getItemDataAt(size_t _index, bool _throw=true)
Get item data from specified position.
void setSize(const IntSize &_size) override
size_t getItemCount() const
Get number of items.
size_t findItemIndexWith(const UString &_name)
Search item, returns the position of the first occurrence in array or ITEM_NONE if item not found.
void setItemSelected(TabItem *_item)
Select item.
TabItem * findItemWith(const UString &_name)
Search item, returns the item of the first occurrence in array or nullptr if item not found.
TabItem * getItemSelected() const
Get selected item (nullptr if none selected)
size_t _getItemCount() const override
TabItem * insertItem(TabItem *_to, const UString &_name, Any _data=Any::Null)
Insert an item into a array.
void shutdownOverride() override
void setCoord(const IntCoord &_coord) override
void _addItem(const MyGUI::UString &_name) override
void setIndexSelected(size_t _index)
Select specified _index.
void _removeItemAt(size_t _index) override
void _showItem(TabItem *_item, bool _show, bool _smooth)
size_t getItemIndex(const TabItem *_item) const
Get item index.
Widget * _getItemAt(size_t _index) const override
void removeItemAt(size_t _index)
Remove item at a specified position.
void clearItemData(TabItem *_item)
Clear an item data.
void notifyPressedBarButtonEvent(MyGUI::Widget *_sender)
void setPosition(const IntPoint &_point) override
void setItemData(TabItem *_item, Any _data)
Replace an item data.
void removeItem(TabItem *_item)
Remove item.
const UString & _getItemNameAt(size_t _index) const override
TabItem * addItem(const UString &_name, Any _data=Any::Null)
Add an item to the end of a array.
std::vector< TabItemInfo > VectorTabItemInfo
TabItem * getItemAt(size_t _index) const
Get item from specified position.
void initialiseOverride() override
TabItem * insertItemAt(size_t _index, const UString &_name, Any _data=Any::Null)
Insert an item into a array at a specified position.
void notifyPressedButtonEvent(MyGUI::Widget *_sender)
void setPropertyOverride(std::string_view _key, std::string_view _value) override
widget description should be here.
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
delegates::MultiDelegate< TabControl *, size_t > EventHandle_TabPtrSizeT
types::TPoint< int > IntPoint
constexpr size_t ITEM_NONE
types::TCoord< int > IntCoord
types::TSize< int > IntSize
std::vector< Widget * > VectorWidgetPtr
TabItemInfo(int _width, const UString &_name, TabItem *_item, Any _data)