This commit is contained in:
Eduardo Bart
2011-04-17 17:09:37 -03:00
parent 9b22a6e0a6
commit f2c187c810
8 changed files with 1773 additions and 42 deletions

View File

@@ -26,8 +26,9 @@
#define UICHECKBOXSKIN_H
#include <prerequisites.h>
#include <ui/uielementskin.h>
class UICheckBoxSkin
class UICheckBoxSkin : public UIElementSkin
{
};

View File

@@ -39,8 +39,11 @@ public:
m_elementType(elementType) { }
virtual ~UIElementSkin() { }
/// Load the skin from a YAML node
virtual void load(const YAML::Node& node);
/// Apply the skin to an element
virtual void apply(UIElement *element);
/// Draw the skinned element
virtual void draw(UIElement *element);
const std::string& getName() const { return m_name; }

View File

@@ -29,25 +29,27 @@
#include <ui/uiconstants.h>
#include <ui/uicontainer.h>
namespace UILoader
class UILoader
{
/// Detect element type and create it
UIElementPtr createElementFromId(const std::string& id);
public:
/// Loads an UIElement and it's children from a YAML file
UIElementPtr loadFile(const std::string& file, const UIContainerPtr& parent = UIContainer::getRootContainer());
static UIElementPtr loadFile(const std::string& file, const UIContainerPtr& parent = UIContainer::getRootContainer());
private:
/// Detect element type and create it
static UIElementPtr createElementFromId(const std::string& id);
/// Populate container children from a YAML node
void populateContainer(const UIContainerPtr& parent, const YAML::Node& node);
static void populateContainer(const UIContainerPtr& parent, const YAML::Node& node);
/// Load element and its children from a YAML node
void loadElements(const UIElementPtr& parent, const YAML::Node& node);
static void loadElements(const UIElementPtr& parent, const YAML::Node& node);
/// Load element proprieties from a YAML node
void loadElement(const UIElementPtr& element, const YAML::Node& node);
static void loadElement(const UIElementPtr& element, const YAML::Node& node);
/// Load anchor from a YAML node
void loadElementAnchor(const UIElementPtr& element, EAnchorType type, const YAML::Node& node);
static void loadElementAnchor(const UIElementPtr& element, EAnchorType type, const YAML::Node& node);
};
#endif // UILOADER_H