#include "UIElement.h" UIElement::UIElement() : Framework::ReferenceCounter(), marginLeft(0), marginRight(0), marginTop(0), marginBottom(0), width(0), height(0) {} void UIElement::setId(const Framework::Text& id) { this->id = id; } const Framework::Text& UIElement::getId() const { return id; } void UIElement::setMarginLeft(const Framework::Text& marginLeft) { this->marginLeft = marginLeft; } const Framework::Text& UIElement::getMarginLeft() const { return marginLeft; } void UIElement::setMarginRight(const Framework::Text& marginRight) { this->marginRight = marginRight; } const Framework::Text& UIElement::getMarginRight() const { return marginRight; } void UIElement::setMarginTop(const Framework::Text& marginTop) { this->marginTop = marginTop; } const Framework::Text& UIElement::getMarginTop() const { return marginTop; } void UIElement::setMarginBottom(const Framework::Text& marginBottom) { this->marginBottom = marginBottom; } const Framework::Text& UIElement::getMarginBottom() const { return marginBottom; } void UIElement::setWidth(const Framework::Text& width) { this->width = width; } const Framework::Text& UIElement::getWidth() const { return width; } void UIElement::setHeight(const Framework::Text& height) { this->height = height; } const Framework::Text& UIElement::getHeight() const { return height; } void UIElement::setAlignLeft(const Framework::Text& alignLeft) { this->alignLeft = alignLeft; } const Framework::Text& UIElement::getAlignLeft() const { return alignLeft; } void UIElement::setAlignRight(const Framework::Text& alignRight) { this->alignRight = alignRight; } const Framework::Text& UIElement::getAlignRight() const { return alignRight; } void UIElement::setAlignTop(const Framework::Text& alignTop) { this->alignTop = alignTop; } const Framework::Text& UIElement::getAlignTop() const { return alignTop; } void UIElement::setAlignBottom(const Framework::Text& alignBottom) { this->alignBottom = alignBottom; } const Framework::Text& UIElement::getAlignBottom() const { return alignBottom; } void UIElement::setStyle(const Framework::Text& style) { this->style = style; } const Framework::Text& UIElement::getStyle() const { return style; } Framework::XML::Element* UIElement::toUIML( Framework::Either zTarget, Entity* zActor) const { Framework::XML::Element* result = new Framework::XML::Element(); result->setAttribute("id", id); if (!marginLeft.istGleich("0")) { result->setAttribute("marginLeft", marginLeft); } if (!marginRight.istGleich("0")) { result->setAttribute("marginRight", marginRight); } if (!marginTop.istGleich("0")) { result->setAttribute("marginTop", marginTop); } if (!marginBottom.istGleich("0")) { result->setAttribute("marginBottom", marginBottom); } result->setAttribute("width", width); result->setAttribute("height", height); if (alignLeft.getLength() > 0) { result->setAttribute("alignLeft", alignLeft); } if (alignRight.getLength() > 0) { result->setAttribute("alignRight", alignRight); } if (alignTop.getLength() > 0) { result->setAttribute("alignTop", alignTop); } if (alignBottom.getLength() > 0) { result->setAttribute("alignBottom", alignBottom); } if (style.getLength() > 0) { result->setAttribute("style", style); } return result; } UIContainerElement::UIContainerElement() : UIElement() {} void UIContainerElement::addChild(UIElement* child) { children.add(child); } const Framework::RCArray& UIContainerElement::getChildren() const { return children; } Framework::XML::Element* UIContainerElement::toUIML( Framework::Either zTarget, Entity* zActor) const { Framework::XML::Element* result = UIElement::toUIML(zTarget, zActor); for (UIElement* child : children) { result->addChild(child->toUIML(zTarget, zActor)); } return result; }