7 #ifndef __MYGUI_TAB_CONTROL_H__
8 #define __MYGUI_TAB_CONTROL_H__
59 virtual void setPosition(
const IntPoint& _value);
61 virtual void setSize(
const IntSize& _value);
63 virtual void setCoord(
const IntCoord& _value);
66 void setPosition(
int _left,
int _top);
68 void setSize(
int _width,
int _height);
70 void setCoord(
int _left,
int _top,
int _width,
int _height);
76 size_t getItemCount()
const;
87 void removeItemAt(
size_t _index);
89 void removeItem(
TabItem* _item);
92 void removeAllItems();
96 TabItem* getItemAt(
size_t _index);
99 size_t getItemIndex(
TabItem* _item);
102 size_t findItemIndex(
TabItem* _item);
105 size_t findItemIndexWith(
const UString& _name);
110 void swapItems(
size_t _index1,
size_t _index2);
116 size_t getIndexSelected()
const;
122 void setIndexSelected(
size_t _index);
125 void setItemSelected(
TabItem* _item);
132 void setItemDataAt(
size_t _index,
Any _data);
137 void clearItemDataAt(
size_t _index);
139 void clearItemData(
TabItem* _item);
142 template <
typename ValueType>
143 ValueType* getItemDataAt(
size_t _index,
bool _throw =
true)
146 return mItemsInfo[_index].data.castType<ValueType>(_throw);
149 template <
typename ValueType>
150 ValueType* getItemData(
TabItem* _item,
bool _throw =
true)
152 return getItemDataAt<ValueType>(getItemIndex(_item), _throw);
160 void setItemNameAt(
size_t _index,
const UString& _name);
166 const UString& getItemNameAt(
size_t _index);
176 void beginToItemAt(
size_t _index);
179 void beginToItem(
TabItem* _item);
181 void beginToItemFirst();
183 void beginToItemLast();
185 void beginToItemSelected();
192 void setButtonWidthAt(
size_t _index,
int _width =
DEFAULT);
197 int getButtonWidthAt(
size_t _index);
199 int getButtonWidth(
TabItem* _item);
204 void setButtonDefaultWidth(
int _value);
206 int getButtonDefaultWidth()
const;
209 void setButtonAutoWidth(
bool _value);
211 bool getButtonAutoWidth()
const;
214 void setSmoothShow(
bool _value);
216 bool getSmoothShow()
const;
228 virtual size_t _getItemCount();
230 virtual void _removeItemAt(
size_t _index);
231 virtual Widget* _getItemAt(
size_t _index);
232 virtual void _setItemNameAt(
size_t _index,
const UString& _name);
233 virtual const UString& _getItemNameAt(
size_t _index);
236 virtual void initialiseOverride();
237 virtual void shutdownOverride();
244 int _getTextWidth(
const UString& _text);
246 void _showItem(
TabItem* _sheet,
bool _show,
bool _smooth);
248 void _createItemButton();
250 void _insertItem(
size_t _index,
const UString& _name,
TabItem* _sheet,
Any _data);
253 void _notifyDeleteItem(
TabItem* _item);
255 virtual void onWidgetCreated(
Widget* _widget);
257 virtual void setPropertyOverride(
const std::string& _key,
const std::string& _value);
264 Widget* _getWidgetTemplate();
275 std::vector<Button*> mItemButton;
276 std::string mButtonSkinName;
277 std::string mEmptySkinName;
292 int mButtonDefaultWidth;
294 bool mButtonAutoWidth;
306 #endif // __MYGUI_TAB_CONTROL_H__