Marko Pintera 10 лет назад
Родитель
Сommit
28dde26bec

+ 1 - 1
BansheeEngine/Include/BsGUIElementBase.h

@@ -66,7 +66,7 @@ namespace BansheeEngine
 		void setFlexibleHeight(UINT32 minHeight = 0, UINT32 maxHeight = 0);
 
 		/**
-		 * @brief	Resets element dimensions to their initial values dictated by the elements style.
+		 * @brief	Resets element dimensions to their initial values dictated by the element's style.
 		 */
 		virtual void resetDimensions();
 

+ 8 - 6
BansheeEngine/Include/BsGUIElementStyle.h

@@ -18,12 +18,14 @@ namespace BansheeEngine
 	};
 
 	/**
-	 * @brief	GUI element style that determines GUI element look depending on its active state
+	 * @brief	GUI element style that determines the look of a GUI element, as well as
+	 *			the element's default layout options. Different looks can be provided
+	 *			for different element states.
 	 */
 	struct BS_EXPORT GUIElementStyle : public IReflectable
 	{
 		/**
-		 * @brief	Specific texture and text color used in a particular GUI element style
+		 * @brief	Specific texture and text color used in a particular GUI element style.
 		 */
 		struct BS_EXPORT GUIElementStateStyle
 		{
@@ -65,10 +67,10 @@ namespace BansheeEngine
 
 		UINT32 width; /** Wanted width of the GUI element in pixels. Only used if fixedWidth is enabled. */
 		UINT32 height; /** Wanted height of the GUI element in pixels. Only used if fixedHeight is enabled. */
-		UINT32 minWidth, maxWidth; /**< Minimum and maximum width allowed for this object. Used by the layout only when exact width is not specified. */
-		UINT32 minHeight, maxHeight; /**< Minimum and maximum height allowed for this object. Used by the layout only when exact height is not specified. */
-		bool fixedWidth; /**< If width is fixed, layout will not attempt to resize the element depending on available size. */
-		bool fixedHeight; /**< If height is fixed, layout will not attempt to resize the element depending on available size. */
+		UINT32 minWidth, maxWidth; /**< Minimum and maximum width allowed for the GUI element. Used by the layout only when exact width is not specified. */
+		UINT32 minHeight, maxHeight; /**< Minimum and maximum height allowed for the GUI element. Used by the layout only when exact height is not specified. */
+		bool fixedWidth; /**< Determines should the layout resize the element depending on available size. If true no resizing will be done. */
+		bool fixedHeight; /**< Determines should the layout resize the element depending on available size. If true no resizing will be done. */
 
 		Map<String, String> subStyles; /**< Sub-styles used by certain more complex elements. */
 

+ 67 - 0
MBansheeEngine/GUI/GUIButton.cs

@@ -3,6 +3,9 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
+    /// <summary>
+    /// GUI button that can be clicked. Has normal, hover and active states	with an optional label.
+    /// </summary>
     public sealed class GUIButton : GUIElement
     {
         public delegate void OnClickDelegate();
@@ -10,54 +13,118 @@ namespace BansheeEngine
         public delegate void OnHoverDelegate();
         public delegate void OnOutDelegate();
 
+        /// <summary>
+        /// Triggered when button is clicked.
+        /// </summary>
         public event OnClickDelegate OnClick;
+
+        /// <summary>
+        /// Triggered when button is clicked twice in rapid succession.
+        /// </summary>
         public event OnDoubleClickDelegate OnDoubleClick;
+
+        /// <summary>
+        /// Triggered when pointer hovers over the button.
+        /// </summary>
         public event OnHoverDelegate OnHover;
+
+        /// <summary>
+        /// Triggered when pointer that was previously hovering leaves the button.
+        /// </summary>
         public event OnOutDelegate OnOut;
 
+        /// <summary>
+        /// Creates a new button with the specified label.
+        /// </summary>
+        /// <param name="content">Content to display on the button.
+        /// </param>
+        /// <param name="style">Optional style to use for the element. Style controls the look
+        /// of the element, as well as default layout options. Style will be retrieved
+        /// from the active GUISkin. If not specified default button style is used.
+        /// </param>
+        /// <param name="options">Options that allow you to control how is the element 
+        /// positioned and sized. This will override any similar options set by style.
+        /// </param>
         public GUIButton(GUIContent content, string style, params GUIOption[] options)
         {
             Internal_CreateInstance(this, content, style, options);
         }
 
+        /// <summary>
+        /// Creates a new button with the specified label.
+        /// </summary>
+        /// <param name="content">Content to display on the button.
+        /// </param>
+        /// <param name="style">Optional style to use for the element. Style controls the look
+        /// of the element, as well as default layout options. Style will be retrieved
+        /// from the active GUISkin. If not specified default button style is used.
+        /// </param>
         public GUIButton(GUIContent content, string style)
         {
             Internal_CreateInstance(this, content, style, new GUIOption[0]);
         }
 
+        /// <summary>
+        /// Creates a new button with the specified label.
+        /// </summary>
+        /// <param name="content">Content to display on the button.
+        /// </param>
+        /// <param name="options">Options that allow you to control how is the element 
+        /// positioned and sized. This will override any similar options set by style.
+        /// </param>
         public GUIButton(GUIContent content, params GUIOption[] options)
         {
             Internal_CreateInstance(this, content, "", options);
         }
 
+        /// <summary>
+        /// Creates a new button with the specified label.
+        /// </summary>
+        /// <param name="content">Content to display on the button.</param>
         public void SetContent(GUIContent content)
         {
             Internal_SetContent(mCachedPtr, content);
         }
 
+        /// <summary>
+        /// Colors the element with a specific tint.
+        /// </summary>
+        /// <param name="color">Tint to apply to the element.</param>
         public void SetTint(Color color)
         {
             Internal_SetTint(mCachedPtr, color);
         }
 
+        /// <summary>
+        /// Triggered by the native interop object when a click occurs.
+        /// </summary>
         private void DoOnClick()
         {
             if (OnClick != null)
                 OnClick();
         }
 
+        /// <summary>
+        /// Triggered by the native interop object when a double click occurs.
+        /// </summary>
         private void DoOnDoubleClick()
         {
             if (OnDoubleClick != null)
                 OnDoubleClick();
         }
 
+        /// <summary>
+        /// Triggered by the native interop object when the pointer is hovered over the element.
+        /// </summary>
         private void DoOnHover()
         {
             if (OnHover != null)
                 OnHover();
         }
 
+        /// <summary>
+        /// Triggered by the native interop object when the pointer leaves the element.
+        /// </summary>
         private void DoOnOut()
         {
             if (OnOut != null)

+ 89 - 30
MBansheeEngine/GUI/GUIContent.cs

@@ -2,70 +2,129 @@
 
 namespace BansheeEngine
 {
+    /// <summary>
+    /// Holds data used for displaying content in a GUIElement. 
+    /// Content can consist of a string, image, a tooltip or none of those.
+    /// </summary>
     public sealed class GUIContent
     {
+        private LocString text;
+        private LocString tooltip;
+        private SpriteTexture image;
+
+        /// <summary>
+        /// Returns string content (if any).
+        /// </summary>
+        public LocString Text
+        {
+            get { return text; }
+        }
+
+        /// <summary>
+        /// Returns image content (if any).
+        /// </summary>
+        public SpriteTexture Image
+        {
+            get { return image; }
+        }
+
+        /// <summary>
+        /// Returns tooltip content (if any).
+        /// </summary>
+        public LocString Tooltip
+        {
+            get { return tooltip; }
+        }
+
+        /// <summary>
+        /// Constructs content with just a string.
+        /// </summary>
+        /// <param name="text">Textual portion of the content to be displayed as label in GUI elements.</param>
 		public GUIContent(LocString text)
 		{
-		    _text = text;
+		    this.text = text;
 		}
 
+        /// <summary>
+        /// Constructs content with a string and a tooltip.
+        /// </summary>
+        /// <param name="text">Textual portion of the content to be displayed as label in GUI elements.</param>
+        /// <param name="tooltip">Tooltip to be displayed when user hovers over a GUI element.</param>
         public GUIContent(LocString text, LocString tooltip)
         {
-            _text = text;
-            _tooltip = tooltip;
+            this.text = text;
+            this.tooltip = tooltip;
         }
 
+        /// <summary>
+        /// Constructs content with just an image.
+        /// </summary>
+        /// <param name="image">Image to be displayed on top of the GUI element.</param>
         public GUIContent(SpriteTexture image)
         {
-            _image = image;
+            this.image = image;
         }
 
+        /// <summary>
+        /// Constructs content with an image and a tooltip.
+        /// </summary>
+        /// <param name="image">Image to be displayed on top of the GUI element.</param>
+        /// <param name="tooltip">Tooltip to be displayed when user hovers over a GUI element.</param>
         public GUIContent(SpriteTexture image, LocString tooltip)
         {
-            _image = image;
-            _tooltip = tooltip;
+            this.image = image;
+            this.tooltip = tooltip;
         }
 
+        /// <summary>
+        /// Constructs content with a string and an image.
+        /// </summary>
+        /// <param name="text">Textual portion of the content to be displayed as label in GUI elements.
+        /// </param>
+        /// <param name="image">Image to be displayed on top of the GUI element. Image will be placed to the
+        /// right or to the left of the text depending on active GUI style.
+        /// </param>
         public GUIContent(LocString text, SpriteTexture image)
         {
-            _text = text;
-            _image = image;
+            this.text = text;
+            this.image = image;
         }
 
+        /// <summary>
+        /// Constructs content with a string, an image and a tooltip.
+        /// </summary>
+        /// <param name="text">Textual portion of the content to be displayed as label in GUI elements.
+        /// </param>
+        /// <param name="image">Image to be displayed on top of the GUI element. Image will be placed to the
+        /// right or to the left of the text depending on active GUI style.
+        /// </param>
+        /// <param name="tooltip">Tooltip to be displayed when user hovers over a GUI element.
+        /// </param>
         public GUIContent(LocString text, SpriteTexture image, LocString tooltip)
         {
-            _text = text;
-            _image = image;
-            _tooltip = tooltip;
+            this.text = text;
+            this.image = image;
+            this.tooltip = tooltip;
         }
 
+        /// <summary>
+        /// Implicitly converts a localized string into a GUI content containing only text.
+        /// </summary>
+        /// <param name="text">Localized string to initialize the GUI content with.</param>
+        /// <returns>GUI content containing only a string.</returns>
         public static implicit operator GUIContent(LocString text)
         {
             return new GUIContent(text);
         }
 
+        /// <summary>
+        /// Implicitly converts a string into a GUI content containing only text.
+        /// </summary>
+        /// <param name="text">String to initialize the GUI content with.</param>
+        /// <returns>GUI content containing only a string.</returns>
         public static implicit operator GUIContent(string text)
         {
             return new GUIContent(new LocString(text));
         }
-
-        public LocString text
-        {
-            get { return _text; }
-        }
-
-        public SpriteTexture image
-        {
-            get { return _image; }
-        }
-
-        public LocString getTooltip
-        {
-            get { return _tooltip; }
-        }
-
-        private LocString _text;
-        private LocString _tooltip;
-        private SpriteTexture _image;
     }
 }

+ 82 - 6
MBansheeEngine/GUI/GUIElement.cs

@@ -4,72 +4,138 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
+    /// <summary>
+    /// Base class for all GUI elements. Every GUI element can at least
+    /// be positioned in it's parent layout/panel and be hidden/visible,
+    /// focused/unfocused and assigned a context menu.
+    /// </summary>
     public abstract class GUIElement : ScriptObject
     {
+        /// <summary>
+        /// Triggered when a GUI element receives or loses keyboard focus.
+        /// </summary>
         public Action<bool> OnFocusChanged;
 
+        /// <summary>
+        /// Gets or sets non-clipped bounds of the GUI element. Relative to a parent GUI panel.
+        /// </summary>
         public Rect2I Bounds
         {
             get { return Internal_GetBounds(mCachedPtr); }
             set { Internal_SetBounds(mCachedPtr, value); }
         }
 
+        /// <summary>
+        /// Gets or sets non-clipped bounds of the GUI element including the margins. 
+        /// Relative to a parent GUI panel.
+        /// </summary>
         public Rect2I VisualBounds
         {
             get { return Internal_GetVisualBounds(mCachedPtr); }
         }
 
+        /// <summary>
+        /// Makes the element hidden or visible.
+        /// </summary>
         public bool Visible
         {
             set { Internal_SetVisible(mCachedPtr, value); }
         }
 
+        /// <summary>
+        /// Assigns or removes keyboard focus on this element.
+        /// </summary>
         public bool Focus
         {
             set { Internal_SetFocus(mCachedPtr, value); }
         }
 
-        private void InternalOnFocusChanged(bool focus)
-        {
-            if (OnFocusChanged != null)
-                OnFocusChanged(focus);
-        }
-
+        /// <summary>
+        /// Destroys this element and all its children. Removes the element
+        /// from parent layout/panel.
+        /// </summary>
+        /// <remarks>
+        /// Calling methods on a destroyed element is a no-operation.
+        /// Destroyed elements aren't allowed to be assigned as children
+        /// of other elements, or be parents of other elements.
+        /// </remarks>
         public virtual void Destroy()
         {
             Internal_Destroy(mCachedPtr);
         }
 
+        /// <summary>
+        /// Sets element position relative to parent GUI panel.
+        /// </summary>
+        /// <param name="x">X position of the element in pixels, relative to parent GUI panel.</param>
+        /// <param name="y">Y position of the element in pixels, relative to parent GUI panel.</param>
+        /// <remarks>
+        /// Be aware that this value will be ignored if GUI element is part of a layout because the 
+        /// layout controls placement of child elements.
+        /// </remarks>
         public void SetPosition(int x, int y)
         {
             Internal_SetPosition(mCachedPtr, x, y);
         }
 
+        /// <summary>
+        /// Sets a fixed element width.
+        /// </summary>
+        /// <param name="width">Width in pixels.</param>
         public void SetWidth(int width)
         {
             Internal_SetWidth(mCachedPtr, width);
         }
 
+        /// <summary>
+        /// Sets a flexible element width. Element will be resized according to its 
+        /// contents and parent layout but will always stay within the provided range.
+        /// </summary>
+        /// <param name="minWidth">Minimum width in pixels. Element will never be smaller than this width.
+        /// </param>
+        /// <param name="maxWidth">Maximum width in pixels. Element will never be larger than this width.
+        /// Specify zero for unlimited width.
+        /// </param>
         public void SetFlexibleWidth(int minWidth, int maxWidth)
         {
             Internal_SetFlexibleWidth(mCachedPtr, minWidth, maxWidth);
         }
 
+        /// <summary>
+        /// Sets a fixed element height.
+        /// </summary>
+        /// <param name="height">Height in pixels.</param>
         public void SetHeight(int height)
         {
             Internal_SetHeight(mCachedPtr, height);
         }
 
+        /// <summary>
+        /// Sets a flexible element height. Element will be resized according to its 
+        /// contents and parent layout but will always stay within the provided range.
+        /// </summary>
+        /// <param name="minHeight">Minimum height in pixels. Element will never be smaller than this height.
+        /// </param>
+        /// <param name="maxHeight">Maximum height in pixels. Element will never be larger than this height.
+        /// Specify zero for unlimited width.
+        /// </param>
         public void SetFlexibleHeight(int minHeight, int maxHeight)
         {
             Internal_SetFlexibleHeight(mCachedPtr, minHeight, maxHeight);
         }
 
+        /// <summary>
+        /// Resets element bounds to their initial values dictated by the element's style.
+        /// </summary>
         public void ResetDimensions()
         {
             Internal_ResetDimensions(mCachedPtr);
         }
 
+        /// <summary>
+        /// Assigns a new context menu that will be opened when the element is right clicked.
+        /// </summary>
+        /// <param name="menu">Object containing context menu contents. Can be null if no menu is wanted.</param>
         public void SetContextMenu(ContextMenu menu)
         {
             IntPtr menuPtr = IntPtr.Zero;
@@ -79,6 +145,16 @@ namespace BansheeEngine
             Internal_SetContextMenu(mCachedPtr, menuPtr);
         }
 
+        /// <summary>
+        /// Triggered by the native interop object when the keyboard
+        /// focus of this element changes.
+        /// </summary>
+        private void InternalOnFocusChanged(bool focus)
+        {
+            if (OnFocusChanged != null)
+                OnFocusChanged(focus);
+        }
+
         [MethodImpl(MethodImplOptions.InternalCall)]
         private static extern void Internal_SetVisible(IntPtr nativeInstance, bool visible);
 

+ 12 - 0
MBansheeEngine/GUI/GUIElementStateStyle.cs

@@ -3,19 +3,31 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
+    /// <summary>
+    /// Container for texture and text color used in a particular GUI element style.
+    /// </summary>
     public sealed class GUIElementStateStyle : ScriptObject
     {
+        /// <summary>
+        /// Constructs a new GUI element state style with default values.
+        /// </summary>
         public GUIElementStateStyle()
         {
             Internal_CreateInstance(this);
         }
 
+        /// <summary>
+        /// Texture used by the GUI element style state. Can be null.
+        /// </summary>
         public SpriteTexture texture
         {
             get { SpriteTexture value; Internal_GetTexture(mCachedPtr, out value); return value; }
             set { Internal_SetTexture(mCachedPtr, value); }
         }
 
+        /// <summary>
+        /// Color applied to the text when GUI element style state is active.
+        /// </summary>
         public Color textColor
         {
             get { Color value; Internal_GetTextColor(mCachedPtr, out value); return value; }

+ 137 - 33
MBansheeEngine/GUI/GUIElementStyle.cs

@@ -1,195 +1,299 @@
 using System;
 using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
 
 namespace BansheeEngine
 {
-    public struct RectOffset
+    /// <summary>
+    /// Rectangle represented in the form of offsets from some parent rectangle.
+    /// </summary>
+    [StructLayout(LayoutKind.Sequential)]
+    public struct RectOffset // Note: Must match the C++ struct RectOffset
 	{
-		int left, right, top, bottom;
+		public int left, right, top, bottom;
 	};
 
-	public enum GUIImagePosition
+    /// <summary>
+    /// Possible positions used for positioning content image within a GUI element.
+    /// </summary>
+    public enum GUIImagePosition // Note: Must match the C++ enum GUIImagePosition.
 	{
 		Left, Right
 	};
 
-    public enum TextHorzAlign
+    /// <summary>
+    /// Specifies how is text horizontally aligned within its bounds.
+    /// </summary>
+    public enum TextHorzAlign // Note: Must match the C++ enum TextHorzAlign.
 	{
 		Left, Center, Right
 	};
 
-	public enum TextVertAlign
+    /// <summary>
+    /// Specifies how is text vertically aligned within its bounds.
+    /// </summary>
+    public enum TextVertAlign // Note: Must match the C++ enum TextVertAlign
 	{
 		Top, Center, Bottom
 	};
 
+    /// <summary>
+    /// GUI element style that determines the look of a GUI element, as well as
+    /// the element's default layout options. Different looks can be provided
+    /// for different element states.
+    /// </summary>
     public sealed class GUIElementStyle : ScriptObject
     {
         // Constructor for runtime use only (dummy parameter to differentiate from the normal constructor)
         private GUIElementStyle(bool dummy)
         {  }
 
+        /// <summary>
+        /// Constructs a new GUI element style with default values.
+        /// </summary>
 		public GUIElementStyle()
         {
 		    Internal_CreateInstance(this);
         }
 
-        public Font font
+        /// <summary>
+        /// Font to use for all text within the GUI element. 
+        /// </summary>
+        public Font Font
         {
             get { Font value; Internal_GetFont(mCachedPtr, out value); return value; }
             set { Internal_SetFont(mCachedPtr, value); }
         }
 
-        public int fontSize
+        /// <summary>
+        /// Font size to use for all text within the GUI element.
+        /// </summary>
+        public int FontSize
         {
             get { int value; Internal_GetFontSize(mCachedPtr, out value); return value; }
             set { Internal_SetFontSize(mCachedPtr, value); }
         }
 
-
-        public TextHorzAlign textHorzAlign
+        /// <summary>
+        /// Horizontal alignment of text within the GUI element. 
+        /// </summary>
+        public TextHorzAlign TextHorzAlign
         {
             get { TextHorzAlign value; Internal_GetTextHorzAlign(mCachedPtr, out value); return value; }
             set { Internal_SetTextHorzAlign(mCachedPtr, value); }
         }
 
-        public TextVertAlign textVertAlign
+        /// <summary>
+        /// Vertical alignment of text within the GUI element. 
+        /// </summary>
+        public TextVertAlign TextVertAlign
         {
             get { TextVertAlign value; Internal_GetTextVertAlign(mCachedPtr, out value); return value; }
             set { Internal_SetTextVertAlign(mCachedPtr, value); }
         }
 
-        public GUIImagePosition imagePosition
+        /// <summary>
+        /// Position of content image relative to text.
+        /// </summary>
+        public GUIImagePosition ImagePosition
         {
             get { GUIImagePosition value; Internal_GetImagePosition(mCachedPtr, out value); return value; }
             set { Internal_SetImagePosition(mCachedPtr, value); }
         }
 
-        public bool wordWrap
+        /// <summary>
+        /// Determines should the text word wrap if it doesn't fit in its element's bounds.
+        /// </summary>
+        public bool WordWrap
         {
             get { bool value; Internal_GetWordWrap(mCachedPtr, out value); return value; }
             set { Internal_SetWordWrap(mCachedPtr, value); }
         }
 
 
-        public GUIElementStateStyle normal
+        /// <summary>
+        /// Style used when element is in normal state and off.
+        /// </summary>
+        public GUIElementStateStyle Normal
         {
             get { GUIElementStateStyle value; Internal_GetNormal(mCachedPtr, out value); return value; }
             set { Internal_SetNormal(mCachedPtr, value); }
         }
 
-        public GUIElementStateStyle hover
+        /// <summary>
+        /// Style used when element is in hover state and off.
+        /// </summary>
+        public GUIElementStateStyle Hover
         {
             get { GUIElementStateStyle value; Internal_GetHover(mCachedPtr, out value); return value; }
             set { Internal_SetHover(mCachedPtr, value); }
         }
 
-        public GUIElementStateStyle active
+        /// <summary>
+        /// Style used when element is in active state and off.
+        /// </summary>
+        public GUIElementStateStyle Active
         {
             get { GUIElementStateStyle value; Internal_GetActive(mCachedPtr, out value); return value; }
             set { Internal_SetActive(mCachedPtr, value); }
         }
 
-        public GUIElementStateStyle focused
+        /// <summary>
+        /// Style used when element is in focused state and off.
+        /// </summary>
+        public GUIElementStateStyle Focused
         {
             get { GUIElementStateStyle value; Internal_GetFocused(mCachedPtr, out value); return value; }
             set { Internal_SetFocused(mCachedPtr, value); }
         }
 
 
-		// For controls that can be turned on-off
-        public GUIElementStateStyle normalOn
+        /// <summary>
+        /// Style used when element is in normal state and on.
+        /// </summary>
+        public GUIElementStateStyle NormalOn
         {
             get { GUIElementStateStyle value; Internal_GetNormalOn(mCachedPtr, out value); return value; }
             set { Internal_SetNormalOn(mCachedPtr, value); }
         }
 
-        public GUIElementStateStyle hoverOn
+        /// <summary>
+        /// Style used when element is in hover state and on.
+        /// </summary>
+        public GUIElementStateStyle HoverOn
         {
             get { GUIElementStateStyle value; Internal_GetHoverOn(mCachedPtr, out value); return value; }
             set { Internal_SetHoverOn(mCachedPtr, value); }
         }
 
-        public GUIElementStateStyle activeOn
+        /// <summary>
+        /// Style used when element is in active state and on.
+        /// </summary>
+        public GUIElementStateStyle ActiveOn
         {
             get { GUIElementStateStyle value; Internal_GetActiveOn(mCachedPtr, out value); return value; }
             set { Internal_SetActiveOn(mCachedPtr, value); }
         }
 
-        public GUIElementStateStyle focusedOn
+        /// <summary>
+        /// Style used when element is in focused state and on. 
+        /// </summary>
+        public GUIElementStateStyle FocusedOn
         {
             get { GUIElementStateStyle value; Internal_GetFocusedOn(mCachedPtr, out value); return value; }
             set { Internal_SetFocusedOn(mCachedPtr, value); }
         }
 
 
-        public RectOffset border // Determines how the element is scaled (using the typical Scale9Grid approach)
+        /// <summary>
+        /// Determines how the element is scaled (using the typical Scale9Grid approach).
+        /// </summary>
+        public RectOffset Border
         {
             get { RectOffset value; Internal_GetBorder(mCachedPtr, out value); return value; }
             set { Internal_SetBorder(mCachedPtr, ref value); }
         }
 
-        public RectOffset margins // Determines offset from the background graphics to the content. Input uses bounds offset by this value.
+        /// <summary>
+        /// Determines offset from the background graphics to the content. Input uses bounds offset by this value.
+        /// </summary>
+        public RectOffset Margins
         {
             get { RectOffset value; Internal_GetMargins(mCachedPtr, out value); return value; }
             set { Internal_SetMargins(mCachedPtr, ref value); }
         }
 
-        public RectOffset contentOffset // Additional offset to the content, that doesn't effect the bounds. Applied on top of the margins offsets.
+        /// <summary>
+        /// Additional offset to the content, that doesn't effect the bounds. Applied on top of the margins offsets.
+        /// </summary>
+        public RectOffset ContentOffset
         {
             get { RectOffset value; Internal_GetContentOffset(mCachedPtr, out value); return value; }
             set { Internal_SetContentOffset(mCachedPtr, ref value); }
         }
 
 
-        public int width
+        /// <summary>
+        /// Wanted width of the GUI element in pixels. Only used if <see cref="FixedWidth"/> is enabled.
+        /// </summary>
+        public int Width
         {
             get { int value; Internal_GetWidth(mCachedPtr, out value); return value; }
             set { Internal_SetWidth(mCachedPtr, value); }
         }
 
-        public int height
+        /// <summary>
+        /// Wanted height of the GUI element in pixels. Only used if <see cref="FixedHeight"/> is enabled.
+        /// </summary>
+        public int Height
         {
             get { int value; Internal_GetHeight(mCachedPtr, out value); return value; }
             set { Internal_SetHeight(mCachedPtr, value); }
         }
 
-        public int minWidth
+        /// <summary>
+        /// Minimum width allowed for the GUI element. Used by the layout only when exact width is not specified.
+        /// </summary>
+        public int MinWidth
         {
             get { int value; Internal_GetMinWidth(mCachedPtr, out value); return value; }
             set { Internal_SetMinWidth(mCachedPtr, value); }
         }
-        
-        public int maxWidth
+
+        /// <summary>
+        /// Maximum width allowed for the GUI element. Used by the layout only when exact width is not specified.
+        /// </summary>
+        public int MaxWidth
         {
             get { int value; Internal_GetMaxWidth(mCachedPtr, out value); return value; }
             set { Internal_SetMaxWidth(mCachedPtr, value); }
         }
 
-        public int minHeight
+        /// <summary>
+        /// Minimum height allowed for the GUI element. Used by the layout only when exact height is not specified.
+        /// </summary>
+        public int MinHeight
         {
             get { int value; Internal_GetMinHeight(mCachedPtr, out value); return value; }
             set { Internal_SetMinHeight(mCachedPtr, value); }
         }
 
-        public int maxHeight
+        /// <summary>
+        /// Maximum height allowed for the GUI element. Used by the layout only when exact height is not specified.
+        /// </summary>
+        public int MaxHeight
         {
             get { int value; Internal_GetMaxHeight(mCachedPtr, out value); return value; }
             set { Internal_SetMaxHeight(mCachedPtr, value); }
         }
 
-        public bool fixedWidth
+        /// <summary>
+        /// Determines should the layout resize the element depending on available size. If true no resizing will be done.
+        /// </summary>
+        public bool FixedWidth
         {
             get { bool value; Internal_GetFixedWidth(mCachedPtr, out value); return value; }
             set { Internal_SetFixedWidth(mCachedPtr, value); }
         }
 
-        public bool fixedHeight
+        /// <summary>
+        /// Determines should the layout resize the element depending on available size. If true no resizing will be done.
+        /// </summary>
+        public bool FixedHeight
         {
             get { bool value; Internal_GetFixedHeight(mCachedPtr, out value); return value; }
             set { Internal_SetFixedHeight(mCachedPtr, value); }
         }
 
+        /// <summary>
+        /// Registers a new sub-style that is used by complex GUI elements that contain
+        /// one or multiple sub-elements.
+        /// </summary>
+        /// <param name="guiType">Name of the sub-element this style is to be used for. 
+        /// This depends on GUI element the style is applied to.
+        /// </param>
+        /// <param name="styleName">Name of the style in GUI skin to use for the sub-element.
+        /// </param>
         public void AddSubStyle(string guiType, string styleName)
         {
             if (guiType == null || styleName == null)