7#ifndef MYGUI_TAB_CONTROL_H_
8#define MYGUI_TAB_CONTROL_H_
59 void setPosition(
const IntPoint& _value)
override;
61 void setSize(
const IntSize& _value)
override;
63 void setCoord(
const IntCoord& _value)
override;
73 size_t getItemCount()
const;
84 void removeItemAt(
size_t _index);
86 void removeItem(
TabItem* _item);
89 void removeAllItems();
93 TabItem* getItemAt(
size_t _index)
const;
96 size_t getItemIndex(
const TabItem* _item)
const;
99 size_t findItemIndex(
const TabItem* _item);
102 size_t findItemIndexWith(
const UString& _name);
107 void swapItems(
size_t _index1,
size_t _index2);
113 size_t getIndexSelected()
const;
116 TabItem* getItemSelected()
const;
119 void setIndexSelected(
size_t _index);
122 void setItemSelected(
TabItem* _item);
129 void setItemDataAt(
size_t _index,
Any _data);
134 void clearItemDataAt(
size_t _index);
136 void clearItemData(
TabItem* _item);
139 template <
typename ValueType>
143 return mItemsInfo[_index].data.castType<ValueType>(_throw);
146 template <
typename ValueType>
149 return getItemDataAt<ValueType>(getItemIndex(_item), _throw);
157 void setItemNameAt(
size_t _index,
const UString& _name);
163 const UString& getItemNameAt(
size_t _index)
const;
173 void beginToItemAt(
size_t _index);
176 void beginToItem(
const TabItem* _item);
178 void beginToItemFirst();
180 void beginToItemLast();
182 void beginToItemSelected();
189 void setButtonWidthAt(
size_t _index,
int _width =
DEFAULT);
194 int getButtonWidthAt(
size_t _index)
const;
196 int getButtonWidth(
TabItem* _item)
const;
201 void setButtonDefaultWidth(
int _value);
203 int getButtonDefaultWidth()
const;
206 void setButtonAutoWidth(
bool _value);
208 bool getButtonAutoWidth()
const;
211 void setSmoothShow(
bool _value);
213 bool getSmoothShow()
const;
225 size_t _getItemCount()
const override;
227 void _removeItemAt(
size_t _index)
override;
228 Widget* _getItemAt(
size_t _index)
const override;
229 void _setItemNameAt(
size_t _index,
const UString& _name)
override;
230 const UString& _getItemNameAt(
size_t _index)
const override;
233 void initialiseOverride()
override;
234 void shutdownOverride()
override;
241 int _getTextWidth(
const UString& _text);
243 void _showItem(
TabItem* _sheet,
bool _show,
bool _smooth);
245 void _createItemButton();
247 void _insertItem(
size_t _index,
const UString& _name,
TabItem* _sheet,
Any _data);
250 void _notifyDeleteItem(
TabItem* _item);
252 void onWidgetCreated(
Widget* _widget)
override;
254 void setPropertyOverride(
const std::string& _key,
const std::string& _value)
override;
261 Widget* _getWidgetTemplate();
272 std::vector<Button*> mItemButton;
273 std::string mButtonSkinName;
274 std::string mEmptySkinName;
289 int mButtonDefaultWidth;
291 bool mButtonAutoWidth;
#define MYGUI_ASSERT_RANGE(index, size, owner)
#define MYGUI_RTTI_DERIVED(DerivedType)
widget description should be here.
EventPair< EventHandle_WidgetSizeT, EventHandle_TabPtrSizeT > eventTabChangeSelect
ValueType * getItemData(TabItem *_item, bool _throw=true)
Get item data.
ValueType * getItemDataAt(size_t _index, bool _throw=true)
Get item data from specified position.
std::vector< TabItemInfo > VectorTabItemInfo
widget description should be here.
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
void actionWidgetHide(Widget *_widget, ControllerItem *_controller)
delegates::CMultiDelegate2< TabControl *, size_t > EventHandle_TabPtrSizeT
std::vector< Widget * > VectorWidgetPtr
TabItemInfo(int _width, const UString &_name, TabItem *_item, Any _data)