MyGUI 3.0.1

MyGUI_ChildSkinInfo.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_CHILD_SKIN_INFO_H__
00024 #define __MYGUI_CHILD_SKIN_INFO_H__
00025 
00026 #include "MyGUI_Prerequest.h"
00027 #include "MyGUI_WidgetStyle.h"
00028 
00029 namespace MyGUI
00030 {
00031 
00032     struct MYGUI_EXPORT ChildSkinInfo
00033     {
00034         ChildSkinInfo() : style(WidgetStyle::Child), align(Align::Default) { }
00035 
00036         ChildSkinInfo(const std::string& _type, const WidgetStyle& _style, const std::string& _skin, const IntCoord& _coord, const Align& _align, const std::string& _layer, const std::string& _name) :
00037             type(_type),
00038             skin(_skin),
00039             name(_name),
00040             layer(_layer),
00041             style(_style),
00042             coord(_coord),
00043             align(_align)
00044         {
00045             // set Child style by default
00046             if (style == WidgetStyle::MAX) style = WidgetStyle::Child;
00047         }
00048 
00049         void addParam(const std::string& _key, const std::string& _value)
00050         {
00051             params[_key] = _value;
00052         }
00053 
00054         std::string findValue(const std::string& _key) const
00055         {
00056             MapString::const_iterator iter = params.find(_key);
00057             if (iter != params.end()) return iter->second;
00058             return "";
00059         }
00060 
00061         std::string type, skin, name, layer;
00062         WidgetStyle style;
00063         IntCoord coord;
00064         Align align;
00065         MapString params;
00066     };
00067 
00068     typedef std::vector<ChildSkinInfo> VectorChildSkinInfo;
00069 
00070 } // namespace MyGUI
00071 
00072 
00073 #endif // __MYGUI_CHILD_SKIN_INFO_H__
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines