$#include "UIElement.h" enum HorizontalAlignment { HA_LEFT = 0, HA_CENTER, HA_RIGHT }; enum VerticalAlignment { VA_TOP = 0, VA_CENTER, VA_BOTTOM }; enum Corner { C_TOPLEFT = 0, C_TOPRIGHT, C_BOTTOMLEFT, C_BOTTOMRIGHT, MAX_UIELEMENT_CORNERS }; enum Orientation { O_HORIZONTAL = 0, O_VERTICAL }; enum FocusMode { FM_NOTFOCUSABLE = 0, FM_RESETFOCUS, FM_FOCUSABLE, FM_FOCUSABLE_DEFOCUSABLE }; enum LayoutMode { LM_FREE = 0, LM_HORIZONTAL, LM_VERTICAL }; enum TraversalMode { TM_BREADTH_FIRST = 0, TM_DEPTH_FIRST }; static const unsigned DD_DISABLED; static const unsigned DD_SOURCE; static const unsigned DD_TARGET; static const unsigned DD_SOURCE_AND_TARGET; class UIElement : public Serializable { UIElement(Context* context); virtual ~UIElement(); virtual const IntVector2& GetScreenPosition() const; bool LoadXML(Deserializer& source); bool SaveXML(Serializer& dest) const; bool FilterAttributes(XMLElement& dest) const; void SetName(const String& name); void SetName(const char* name); void SetPosition(const IntVector2& position); void SetPosition(int x, int y); void SetSize(const IntVector2& size); void SetSize(int width, int height); void SetWidth(int width); void SetHeight(int height); void SetMinSize(const IntVector2& minSize); void SetMinSize(int width, int height); void SetMinWidth(int width); void SetMinHeight(int height); void SetMaxSize(const IntVector2& maxSize); void SetMaxSize(int width, int height); void SetMaxWidth(int width); void SetMaxHeight(int height); void SetFixedSize(const IntVector2& size); void SetFixedSize(int width, int height); void SetFixedWidth(int width); void SetFixedHeight(int height); void SetAlignment(HorizontalAlignment hAlign, VerticalAlignment vAlign); void SetHorizontalAlignment(HorizontalAlignment align); void SetVerticalAlignment(VerticalAlignment align); void SetClipBorder(const IntRect& rect); void SetColor(const Color& color); void SetColor(Corner corner, const Color& color); void SetPriority(int priority); void SetOpacity(float opacity); void SetBringToFront(bool enable); void SetBringToBack(bool enable); void SetClipChildren(bool enable); void SetSortChildren(bool enable); void SetUseDerivedOpacity(bool enable); void SetEnabled(bool enable); void SetFocus(bool enable); void SetSelected(bool enable); void SetVisible(bool enable); void SetFocusMode(FocusMode mode); void SetDragDropMode(unsigned mode); bool SetStyle(const String& styleName, XMLFile* file = 0); bool SetStyle(const char* styleName, XMLFile* file = 0); bool SetStyle(const XMLElement& element); bool SetStyleAuto(XMLFile* file = 0); void SetDefaultStyle(XMLFile* style); void SetLayout(LayoutMode mode, int spacing = 0, const IntRect& border = IntRect::ZERO); void SetLayoutMode(LayoutMode mode); void SetLayoutSpacing(int spacing); void SetLayoutBorder(const IntRect& border); void SetIndent(int indent); void SetIndentSpacing(int indentSpacing); void UpdateLayout(); void DisableLayoutUpdate(); void EnableLayoutUpdate(); void BringToFront(); // UIElement* CreateChild(ShortStringHash type, const String& name = String::EMPTY, unsigned index = M_MAX_UNSIGNED); // UIElement* CreateChild(const char* type, const char* name = 0, unsigned index = M_MAX_UNSIGNED); void AddChild(UIElement* element); void InsertChild(unsigned index, UIElement* element); void RemoveChild(UIElement* element, unsigned index = 0); void RemoveChildAtIndex @ RemoveChild(unsigned index); void RemoveAllChildren(); void Remove(); unsigned FindChild(UIElement* element) const; void SetParent(UIElement* parent, unsigned index = M_MAX_UNSIGNED); void SetInternal(bool enable); void SetTraversalMode(TraversalMode traversalMode); void SetElementEventSender(bool flag); // template T* CreateChild(const String& name = String::EMPTY, unsigned index = M_MAX_UNSIGNED); BorderImage* CreateChild @ CreateBorderImage(const char* name = 0, unsigned index = M_MAX_UNSIGNED); Button* CreateChild