MyGUI  3.0.3
MyGUI_TabItem.h
Go to the documentation of this file.
00001 
00007 /*
00008     This file is part of MyGUI.
00009 
00010     MyGUI is free software: you can redistribute it and/or modify
00011     it under the terms of the GNU Lesser General Public License as published by
00012     the Free Software Foundation, either version 3 of the License, or
00013     (at your option) any later version.
00014 
00015     MyGUI is distributed in the hope that it will be useful,
00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018     GNU Lesser General Public License for more details.
00019 
00020     You should have received a copy of the GNU Lesser General Public License
00021     along with MyGUI.  If not, see <http://www.gnu.org/licenses/>.
00022 */
00023 #ifndef __MYGUI_TAB_ITEM_H__
00024 #define __MYGUI_TAB_ITEM_H__
00025 
00026 #include "MyGUI_Prerequest.h"
00027 #include "MyGUI_Widget.h"
00028 #include "MyGUI_Tab.h"
00029 
00030 namespace MyGUI
00031 {
00032 
00033     class MYGUI_EXPORT TabItem :
00034         public Widget
00035     {
00036         MYGUI_RTTI_DERIVED( TabItem )
00037 
00038     public:
00039         TabItem();
00040 
00042         virtual void setCaption(const UString& _value);
00044         virtual const UString& getCaption();
00045 
00047         void setButtonWidth(int _value = DEFAULT);
00049         int getButtonWidth();
00050 
00052         void setItemName(const UString& _value);
00054         const UString& getItemName();
00055 
00057         void setItemData(Any _value);
00058 
00060         template <typename ValueType>
00061         ValueType * getItemData(bool _throw = true)
00062         {
00063             return mOwner->getItemData<ValueType>(this, _throw);
00064         }
00065 
00067         void setItemSelected();
00068 
00070         void removeItem();
00071 
00073         virtual void setProperty(const std::string& _key, const std::string& _value);
00074 
00075     /*internal*/
00076         virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
00077 
00078     protected:
00079         virtual ~TabItem();
00080 
00081         void setSelected(bool _value);
00082 
00083     private:
00084         Tab* mOwner;
00085 
00086     };
00087 
00088 } // namespace MyGUI
00089 
00090 #endif // __MYGUI_TAB_ITEM_H__