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

+ 19 - 19
BansheeEngine/Include/BsGUIInputBox.h

@@ -9,7 +9,7 @@
 namespace BansheeEngine
 {
 	/**
-	 * @brief	Input box is a GUI element at accepts Unicode textual input. It can be
+	 * @brief	Input box is a GUI element that accepts Unicode textual input. It can be
 	 *			single or multi-line and handles various types of text manipulation.
 	 */
 	class BS_EXPORT GUIInputBox : public GUIElement
@@ -84,17 +84,17 @@ namespace BansheeEngine
 		/**
 		 * @copydoc	GUIElement::setTint
 		 */
-		virtual void setTint(const Color& color);
+		virtual void setTint(const Color& color) override;
 
 		/**
 		 * @copydoc	GUIElement::getElementType
 		 */
-		virtual ElementType _getElementType() const { return ElementType::InputBox; }
+		virtual ElementType _getElementType() const override { return ElementType::InputBox; }
 
 		/**
 		 * @copydoc	GUIElement::_getOptimalSize
 		 */
-		virtual Vector2I _getOptimalSize() const;
+		virtual Vector2I _getOptimalSize() const override;
 
 		/**
 		 * @brief	Triggered whenever input text has changed.
@@ -117,53 +117,53 @@ namespace BansheeEngine
 		/**
 		 * @copydoc GUIElement::getNumRenderElements()
 		 */
-		virtual UINT32 _getNumRenderElements() const;
+		virtual UINT32 _getNumRenderElements() const override;
 
 		/**
 		 * @copydoc GUIElement::getMaterial()
 		 */
-		virtual const GUIMaterialInfo& _getMaterial(UINT32 renderElementIdx) const;
+		virtual const GUIMaterialInfo& _getMaterial(UINT32 renderElementIdx) const override;
 
 		/**
 		 * @copydoc GUIElement::getNumQuads()
 		 */
-		virtual UINT32 _getNumQuads(UINT32 renderElementIdx) const;
+		virtual UINT32 _getNumQuads(UINT32 renderElementIdx) const override;
 
 		/**
 		 * @copydoc GUIElement::fillBuffer()
 		 */
 		virtual void _fillBuffer(UINT8* vertices, UINT8* uv, UINT32* indices, UINT32 startingQuad, 
-			UINT32 maxNumQuads, UINT32 vertexStride, UINT32 indexStride, UINT32 renderElementIdx) const;
+			UINT32 maxNumQuads, UINT32 vertexStride, UINT32 indexStride, UINT32 renderElementIdx) const override;
 
 		/**
 		 * @copydoc GUIElement::updateRenderElementsInternal()
 		 */
-		virtual void updateRenderElementsInternal();
+		virtual void updateRenderElementsInternal() override;
 
 		/**
 		 * @copydoc GUIElement::updateBounds()
 		 */
-		virtual void updateClippedBounds();
+		virtual void updateClippedBounds() override;
 
 		/**
 		 * @copydoc	GUIElement::mouseEvent
 		 */
-		virtual bool _mouseEvent(const GUIMouseEvent& ev);
+		virtual bool _mouseEvent(const GUIMouseEvent& ev) override;
 
 		/**
 		 * @copydoc	GUIElement::textInputEvent
 		 */
-		virtual bool _textInputEvent(const GUITextInputEvent& ev);
+		virtual bool _textInputEvent(const GUITextInputEvent& ev) override;
 
 		/**
 		 * @copydoc	GUIElement::commandEvent
 		 */
-		virtual bool _commandEvent(const GUICommandEvent& ev);
+		virtual bool _commandEvent(const GUICommandEvent& ev) override;
 
 		/**
 		 * @copydoc	GUIElement::virtualButtonEvent
 		 */
-		virtual bool _virtualButtonEvent(const GUIVirtualButtonEvent& ev);
+		virtual bool _virtualButtonEvent(const GUIVirtualButtonEvent& ev) override;
 
 		/**
 		 * @brief	Returns how much to offset text due to scrolling.
@@ -172,28 +172,28 @@ namespace BansheeEngine
 		 *			caret moves the text will scroll so that the caret remains visible, and
 		 *			how much scroll is applied is determined by this value.
 		 */
-		virtual Vector2I _getTextInputOffset() const;
+		virtual Vector2I _getTextInputOffset() const override;
 
 		/**
 		 * @brief	Returns rectangle in which the text can be displayed, in local
 		 *			coordinates (i.e. text will start at 0, 0).
 		 */
-		virtual Rect2I _getTextInputRect() const;
+		virtual Rect2I _getTextInputRect() const override;
 
 		/**
 		 * @copydoc	GUIElement::_getRenderElementDepth
 		 */
-		virtual UINT32 _getRenderElementDepth(UINT32 renderElementIdx) const;
+		virtual UINT32 _getRenderElementDepth(UINT32 renderElementIdx) const override;
 
 		/**
 		 * @copydoc	GUIElement::_getRenderElementDepthRange
 		 */
-		virtual UINT32 _getRenderElementDepthRange() const;
+		virtual UINT32 _getRenderElementDepthRange() const override;
 
 		/**
 		 * @copydoc	GUIElement::_hasCustomCursor
 		 */
-		virtual bool _hasCustomCursor(const Vector2I position, CursorType& type) const;
+		virtual bool _hasCustomCursor(const Vector2I position, CursorType& type) const override;
 
 		/**
 		 * @copydoc	GUIElement::getContextMenu

+ 1 - 1
BansheeEngine/Include/BsGUISkin.h

@@ -7,7 +7,7 @@
 namespace BansheeEngine
 {
 	/**
-	 * @brief	Holds information about how are GUI element types positioned and
+	 * @brief	Holds a set of styles that control how are GUI element types positioned and
 	 *			displayed in the GUI. Each element type can be assigned a specific style.
 	 */
 	class BS_EXPORT GUISkin : public Resource

+ 1 - 1
BansheeEngine/Include/BsGUISpace.h

@@ -31,7 +31,7 @@ namespace BansheeEngine
 		/**
 		 * @copydoc	GUIElementBase::_getType
 		 */
-		Type _getType() const { return GUIElementBase::Type::FixedSpace; }
+		Type _getType() const override { return GUIElementBase::Type::FixedSpace; }
 
 		/**
 		 * @copydoc	GUIElementBase::_getOptimalSize

+ 16 - 9
BansheeEngine/Include/BsGUITexture.h

@@ -7,7 +7,7 @@
 namespace BansheeEngine
 {
 	/**
-	 * @brief	Type of scaling modes for GUI images
+	 * @brief	Type of scaling modes for GUI images.
 	 */
 	enum class GUIImageScaleMode
 	{
@@ -18,7 +18,7 @@ namespace BansheeEngine
 	};
 
 	/**
-	 * @brief	A GUI element that allows you to display a texture.
+	 * @brief	A GUI element that displays a texture.
 	 */
 	class BS_EXPORT GUITexture : public GUIElement
 	{
@@ -31,7 +31,8 @@ namespace BansheeEngine
 		/**
 		 * @brief	Creates a new GUI texture element.
 		 *
-		 * @param	texture			Texture element to display.
+		 * @param	texture			Texture element to display. If this is null then the texture specified
+		 *							by the style will be used.
 		 * @param	scale			Scale mode to use when sizing the texture.
 		 * @param	transparent		Determines should the texture be rendered with transparency active.
 		 * @param	options			Options that allow you to control how is the element positioned and sized.
@@ -46,7 +47,8 @@ namespace BansheeEngine
 		/**
 		 * @brief	Creates a new GUI texture element.
 		 *
-		 * @param	texture			Texture element to display.
+		 * @param	texture			Texture element to display. If this is null then the texture specified
+		 *							by the style will be used.
 		 * @param	scale			Scale mode to use when sizing the texture.
 		 * @param	transparent		Determines should the texture be rendered with transparency active.
 		 * @param	styleName		Optional style to use for the element. Style will be retrieved
@@ -59,7 +61,8 @@ namespace BansheeEngine
 		/**
 		 * @brief	Creates a new GUI texture element.
 		 *
-		 * @param	texture			Texture element to display.
+		 * @param	texture			Texture element to display. If this is null then the texture specified
+		 *							by the style will be used.
 		 * @param	scale			Scale mode to use when sizing the texture.
 		 * @param	options			Options that allow you to control how is the element positioned and sized.
 		 *							This will override any similar options set by style.
@@ -73,7 +76,8 @@ namespace BansheeEngine
 		/**
 		 * @brief	Creates a new GUI texture element.
 		 *
-		 * @param	texture			Texture element to display.
+		 * @param	texture			Texture element to display. If this is null then the texture specified
+		 *							by the style will be used.
 		 * @param	scale			Scale mode to use when sizing the texture.
 		 * @param	styleName		Optional style to use for the element. Style will be retrieved
 		 *							from GUISkin of the GUIWidget the element is used on. If not specified
@@ -85,7 +89,8 @@ namespace BansheeEngine
 		/**
 		 * @brief	Creates a new GUI texture element. Uses the default StretchToFit scale mode.
 		 *
-		 * @param	texture			Texture element to display.
+		 * @param	texture			Texture element to display. If this is null then the texture specified
+		 *							by the style will be used.
 		 * @param	options			Options that allow you to control how is the element positioned and sized.
 		 *							This will override any similar options set by style.
 		 * @param	styleName		Optional style to use for the element. Style will be retrieved
@@ -98,7 +103,8 @@ namespace BansheeEngine
 		/**
 		 * @brief	Creates a new GUI texture element. Uses the default StretchToFit scale mode.
 		 *
-		 * @param	texture			Texture element to display.
+		 * @param	texture			Texture element to display. If this is null then the texture specified
+		 *							by the style will be used.
 		 * @param	styleName		Optional style to use for the element. Style will be retrieved
 		 *							from GUISkin of the GUIWidget the element is used on. If not specified
 		 *							default style is used.
@@ -151,7 +157,8 @@ namespace BansheeEngine
 		static GUITexture* create(const String& styleName = StringUtil::BLANK);
 
 		/**
-		 * @brief	Changes the active texture.
+		 * @brief	Changes the active texture. If the provided texture is null 
+		 *			then the texture specified by the style will be used.
 		 */
 		void setTexture(const HSpriteTexture& texture);
 

+ 95 - 3
MBansheeEngine/GUI/GUIScrollArea.cs

@@ -3,81 +3,173 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    public enum ScrollBarType
+    /// <summary>
+    /// Scroll bar options for a GUI scroll area.
+    /// </summary>
+    public enum ScrollBarType // Note: Must match the C++ enum ScrollBarType
 	{
 		ShowIfDoesntFit,
 		AlwaysShow,
 		NeverShow
 	};
 
+    /// <summary>
+    /// A GUI element container with support for vertical & horizontal scrolling.
+    /// </summary>
     public sealed class GUIScrollArea : GUIElement
     {
         private GUILayout _mainLayout;
 
+        /// <summary>
+        /// Default vertical layout into which you should place elements that need to be scrollable.
+        /// </summary>
         public GUILayout Layout
         {
             get { return _mainLayout; }
         }
 
+        /// <summary>
+        /// Position of the horizontal scroll bar, ranging [0, 1]. When bar is fully to the left (no scroll) the value is 
+        /// zero, and when the bar is fully to the right (full scroll) the value is one.
+        /// </summary>
         public float HorizontalScroll
         {
             get { return Internal_GetHorzScroll(mCachedPtr); }
             set { Internal_SetHorzScroll(mCachedPtr, value); }
         }
 
+        /// <summary>
+        /// Position of the vertical scroll bar, ranging [0, 1]. When bar is fully to the top (no scroll) the value is 
+        /// zero, and when the bar is fully to the bottom (full scroll) the value is one.
+        /// </summary>
         public float VerticalScroll
         {
             get { return Internal_GetVertScroll(mCachedPtr); }
             set { Internal_SetVertScroll(mCachedPtr, value); }
         }
 
+        /// <summary>
+        /// Returns the bounds of the scroll area not including the scroll bars. (i.e. only the portion that contains the 
+        /// contents).
+        /// </summary>
         public Rect2I ContentBounds
         {
             get { return Internal_GetContentBounds(mCachedPtr); }
         }
 
+        /// <summary>
+        /// Number of pixels the scroll bar will occupy when active. This is width for vertical scrollbar, and height for 
+        /// horizontal scrollbar.
+        /// </summary>
         public int ScrollBarWidth
         {
             get { return Internal_GetScrollBarWidth(mCachedPtr); }
         }
 
+        /// <summary>
+        /// Creates a new scroll area.
+        /// </summary>
+        /// <param name="vertBarType">Type of the vertical scroll bar.
+        /// </param>
+        /// <param name="horzBarType">Type of the horizontal scroll bar.
+        /// </param>
+        /// <param name="scrollBarStyle">Optional style that controls the look of the scroll bars. Style will be retrieved from the 
+        /// active GUISkin. If not specified default element style is used.
+        /// </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 element 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 GUIScrollArea(ScrollBarType vertBarType, ScrollBarType horzBarType, string scrollBarStyle,
-            string scrollAreaStyle, params GUIOption[] options)
+            string style, params GUIOption[] options)
         {
-            Internal_CreateInstance(this, vertBarType, horzBarType, scrollBarStyle, scrollAreaStyle, options);
+            Internal_CreateInstance(this, vertBarType, horzBarType, scrollBarStyle, style, options);
             _mainLayout = new GUILayoutY(this);
         }
 
+        /// <summary>
+        /// Creates a new scroll area.
+        /// </summary>
+        /// <param name="vertBarType">Type of the vertical scroll bar.
+        /// </param>
+        /// <param name="horzBarType">Type of the horizontal scroll bar.
+        /// </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 element 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 GUIScrollArea(ScrollBarType vertBarType, ScrollBarType horzBarType, string style, params GUIOption[] options)
         {
             Internal_CreateInstance(this, vertBarType, horzBarType, "", style, options);
             _mainLayout = new GUILayoutY(this);
         }
 
+        /// <summary>
+        /// Creates a new scroll area.
+        /// </summary>
+        /// <param name="vertBarType">Type of the vertical scroll bar.
+        /// </param>
+        /// <param name="horzBarType">Type of the horizontal scroll bar.
+        /// </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 GUIScrollArea(ScrollBarType vertBarType, ScrollBarType horzBarType, params GUIOption[] options)
         {
             Internal_CreateInstance(this, vertBarType, horzBarType, "", "", options);
             _mainLayout = new GUILayoutY(this);
         }
 
+        /// <summary>
+        /// Creates a new scroll area.
+        /// </summary>
+        /// <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 element 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 GUIScrollArea(string style, params GUIOption[] options)
         {
             Internal_CreateInstance(this, ScrollBarType.ShowIfDoesntFit, ScrollBarType.ShowIfDoesntFit, "", style, options);
             _mainLayout = new GUILayoutY(this);
         }
 
+        /// <summary>
+        /// Creates a new scroll area.
+        /// </summary>
+        /// <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 GUIScrollArea(params GUIOption[] options)
         {
             Internal_CreateInstance(this, ScrollBarType.ShowIfDoesntFit, ScrollBarType.ShowIfDoesntFit, "", "", options);
             _mainLayout = new GUILayoutY(this);
         }
 
+        /// <summary>
+        /// Creates a new scroll area.
+        /// </summary>
+        /// <param name="scrollBarStyle">Optional style that controls the look of the scroll bars. Style will be retrieved from the 
+        /// active GUISkin. If not specified default element 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 GUIScrollArea(string scrollBarStyle, string scrollAreaStyle, params GUIOption[] options)
         {
             Internal_CreateInstance(this, ScrollBarType.ShowIfDoesntFit, ScrollBarType.ShowIfDoesntFit, scrollBarStyle, scrollAreaStyle, options);
             _mainLayout = new GUILayoutY(this);
         }
 
+        /// <inheritdoc/>
         public override void Destroy()
         {
             _mainLayout.Destroy();

+ 24 - 0
MBansheeEngine/GUI/GUISkin.cs

@@ -3,27 +3,47 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
+    /// <summary>
+    /// Holds a set of styles that control how are GUI element types positioned and displayed in the GUI. Each element type 
+    /// can be assigned a specific style.
+    /// </summary>
     public sealed class GUISkin : Resource
     {
         // Constructor for runtime use only (dummy parameter to differentiate from the normal constructor)
         private GUISkin(bool dummy)
         {  }
 
+        /// <summary>
+        /// Creates a new empty GUI skin.
+        /// </summary>
         public GUISkin()
         {
             Internal_CreateInstance(this);
         }
 
+        /// <summary>
+        /// Returns names of all GUI element styles registered on this skin.
+        /// </summary>
         public string[] StyleNames
         {
             get { return Internal_GetStyleNames(mCachedPtr); }
         }
 
+        /// <summary>
+        /// Returns a style for the specified GUI element type.
+        /// </summary>
+        /// <param name="name">Name of the style to look for.</param>
+        /// <returns>Found element style, or null if a style with the specified name was not found.</returns>
         public GUIElementStyle GetStyle(string name)
         {
             return Internal_GetStyle(mCachedPtr, name);
         }
 
+        /// <summary>
+        /// Sets a style for the specified GUI element type.
+        /// </summary>
+        /// <param name="name">Name of the style to add/modify.</param>
+        /// <param name="style">Style object containing style options.</param>
         public void SetStyle(string name, GUIElementStyle style)
         {
             IntPtr stylePtr = IntPtr.Zero;
@@ -33,6 +53,10 @@ namespace BansheeEngine
             Internal_SetStyle(mCachedPtr, name, stylePtr);
         }
 
+        /// <summary>
+        /// Removes a style from the skin.
+        /// </summary>
+        /// <param name="name">Name of the style to remove.</param>
         public void RemoveStyle(string name)
         {
             Internal_RemoveStyle(mCachedPtr, name);

+ 70 - 0
MBansheeEngine/GUI/GUISlider.cs

@@ -3,33 +3,68 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
+    /// <summary>
+    /// A GUI element that represents a horizontal slider with a draggable handle.
+    /// </summary>
     public sealed class GUISliderH : GUIElement
     {
         public delegate void OnChangedDelegate(float percent);
 
+        /// <summary>
+        /// Triggered when the slider handle moves. Provided parameter represents
+        /// the position of the handle, in percent ranging [0, 1].
+        /// </summary>
         public event OnChangedDelegate OnChanged;
 
+        /// <summary>
+        /// Returns the position of the slider handle, in percent ranging [0, 1].
+        /// </summary>
         public float Percent
         {
             get { return Internal_GetPercent(mCachedPtr); }
             set { Internal_SetPercent(mCachedPtr, value); }
         }
 
+        /// <summary>
+        /// Creates a new horizontal slider.
+        /// </summary>
+        /// <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 element 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 GUISliderH(string style, params GUIOption[] options)
         {
             Internal_CreateInstance(this, style, options);
         }
 
+        /// <summary>
+        /// Creates a new vertical slider.
+        /// </summary>
+        /// <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 element style 
+        /// is used.
+        /// </param>
         public GUISliderH(string style = "")
         {
             Internal_CreateInstance(this, style, new GUIOption[0]);
         }
 
+        /// <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 the slider handle is moved.
+        /// </summary>
+        /// <param name="percent">New position of the slider handle, in percent ranging [0, 1].</param>
         private void DoOnChanged(float percent)
         {
             if (OnChanged != null)
@@ -49,33 +84,68 @@ namespace BansheeEngine
         private static extern void Internal_SetTint(IntPtr nativeInstance, Color color);
     }
 
+    /// <summary>
+    /// A GUI element that represents a vertical slider with a draggable handle.
+    /// </summary>
     public sealed class GUISliderV : GUIElement
     {
         public delegate void OnChangedDelegate(float percent);
 
+        /// <summary>
+        /// Triggered when the slider handle moves. Provided parameter represents
+        /// the position of the handle, in percent ranging [0, 1].
+        /// </summary>
         public event OnChangedDelegate OnChanged;
 
+        /// <summary>
+        /// Returns the position of the slider handle, in percent ranging [0, 1].
+        /// </summary>
         public float Percent
         {
             get { return Internal_GetPercent(mCachedPtr); }
             set { Internal_SetPercent(mCachedPtr, value); }
         }
 
+        /// <summary>
+        /// Creates a new vertical slider.
+        /// </summary>
+        /// <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 element 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 GUISliderV(string style, params GUIOption[] options)
         {
             Internal_CreateInstance(this, style, options);
         }
 
+        /// <summary>
+        /// Creates a new vertical slider.
+        /// </summary>
+        /// <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 element style 
+        /// is used.
+        /// </param>
         public GUISliderV(string style = "")
         {
             Internal_CreateInstance(this, style, new GUIOption[0]);
         }
 
+        /// <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 the slider handle is moved.
+        /// </summary>
+        /// <param name="percent">New position of the slider handle, in percent ranging [0, 1].</param>
         private void DoOnChanged(float percent)
         {
             if (OnChanged != null)

+ 21 - 0
MBansheeEngine/GUI/GUISpace.cs

@@ -3,13 +3,27 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
+    /// <summary>
+    /// GUI element that may be inserted into layouts in order to make a space of a fixed size.
+    /// </summary>
     public sealed class GUIFixedSpace : GUIElement
     {
+        /// <summary>
+        /// Creates a new fixed space. 
+        /// </summary>
+        /// <param name="size">Size of the space in pixels. This will represent either width or height depending whether the 
+        /// layout is vertical or horizontal.
+        /// </param>
         public GUIFixedSpace(int size)
         {
             Internal_CreateInstance(this, size);
         }
 
+        /// <summary>
+        /// Changes the size of the space.
+        /// </summary>
+        /// <param name="size">Size of the space in pixels. This will represent either width or height depending whether the 
+        /// layout is vertical or horizontal.</param>
         public void SetSize(int size)
         {
             Internal_SetSize(mCachedPtr, size);
@@ -22,8 +36,15 @@ namespace BansheeEngine
         private static extern void Internal_SetSize(IntPtr nativeInstance, int size);
     }
 
+    /// <summary>
+    /// GUI element that may be inserted into layouts to make a space of a flexible size. The space will expand only if there 
+    /// is room. If multiple flexible spaces are in a layout, their sizes will be shared equally.
+    /// </summary>
     public sealed class GUIFlexibleSpace : GUIElement
     {
+        /// <summary>
+        /// Creates a new flexible space.
+        /// </summary>
         public GUIFlexibleSpace()
         {
             Internal_CreateInstance(this);

+ 54 - 0
MBansheeEngine/GUI/GUITextBox.cs

@@ -3,43 +3,97 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
+    /// <summary>
+    /// GUI element that accepts Unicode textual input. It can be single or multi-line and handles various types of text 
+    /// manipulation.
+    /// </summary>
     public sealed class GUITextBox : GUIElement
     {
         public delegate void OnChangedDelegate(string newValue);
 
+        /// <summary>
+        /// Triggered whenever input text has changed.
+        /// </summary>
         public event OnChangedDelegate OnChanged;
 
+        /// <summary>
+        /// Creates a new text box element.
+        /// </summary>
+        /// <param name="multiline">Determines should the input box allow text that spans multiple lines.
+        /// </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 element 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 GUITextBox(bool multiline, string style, params GUIOption[] options)
         {
             Internal_CreateInstance(this, multiline, style, options);
         }
 
+        /// <summary>
+        /// Creates a new text box element.
+        /// </summary>
+        /// <param name="multiline">Determines should the input box allow text that spans multiple lines.
+        /// </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 GUITextBox(bool multiline, params GUIOption[] options)
         {
             Internal_CreateInstance(this, multiline, "", options);
         }
 
+        /// <summary>
+        /// Creates a new single-line text box element.
+        /// </summary>
+        /// <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 element 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 GUITextBox(string style, params GUIOption[] options)
         {
             Internal_CreateInstance(this, false, style, options);
         }
 
+        /// <summary>
+        /// Creates a new single-line text box element.
+        /// </summary>
+        /// <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 GUITextBox(params GUIOption[] options)
         {
             Internal_CreateInstance(this, false, "", options);
         }
 
+        /// <summary>
+        /// Text currently entered in the text box.
+        /// </summary>
         public string Text
         {
             get { string value; Internal_GetText(mCachedPtr, out value); return value; }
             set { Internal_SetText(mCachedPtr, value); }
         }
 
+        /// <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 the text box value is changed.
+        /// </summary>
+        /// <param name="newValue">New value in the text box.</param>
         private void DoOnChanged(string newValue)
         {
             if (OnChanged != null)

+ 124 - 1
MBansheeEngine/GUI/GUITexture.cs

@@ -3,61 +3,184 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
-    public enum GUIImageScaleMode
+    /// <summary>
+    /// Type of scaling modes for GUI images.
+    /// </summary>
+    public enum GUIImageScaleMode // Note: Must match C++ enum GUIImageScaleMode
 	{
+        /// <summary>
+        /// Image will stretch non-uniformly in all dimensions in order to cover the assigned area fully.
+        /// </summary>
 		StretchToFit,
+        /// <summary>
+        /// Image will scale uniformly until one dimension is aligned with the assigned area. Remaining dimension might have empty space.
+        /// </summary>
 		ScaleToFit,
+        /// <summary>
+        /// Image will scale uniformly until both dimensions are larger or aligned with the assigned area. Remaining dimension might be cropped.
+        /// </summary>
 		CropToFit,
+        /// <summary>
+        /// Image will keep its original size, but will repeat in order to fill the assigned area.
+        /// </summary>
 		RepeatToFit
 	};
 
+    /// <summary>
+    /// A GUI element that displays a texture.
+    /// </summary>
     public sealed class GUITexture : GUIElement
     {
+        /// <summary>
+        /// Creates a new texture element.
+        /// </summary>
+        /// <param name="texture">Texture to display. If this is null then the texture specified by the style will be used.
+        /// </param>
+        /// <param name="scale">Scale mode to use when sizing the texture.
+        /// </param>
+        /// <param name="transparent">Determines should the texture be rendered with transparency active.
+        /// </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 element 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 GUITexture(SpriteTexture texture, GUIImageScaleMode scale, bool transparent, string style, params GUIOption[] options)
         {
             Internal_CreateInstance(this, texture, scale, transparent, style, options);
         }
 
+        /// <summary>
+        /// Creates a new texture element.
+        /// </summary>
+        /// <param name="texture">Texture to display. If this is null then the texture specified by the style will be used.
+        /// </param>
+        /// <param name="scale">Scale mode to use when sizing the texture.
+        /// </param>
+        /// <param name="transparent">Determines should the texture be rendered with transparency active.
+        /// </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 GUITexture(SpriteTexture texture, GUIImageScaleMode scale, bool transparent, params GUIOption[] options)
         {
             Internal_CreateInstance(this, texture, scale, transparent, "", options);
         }
 
+        /// <summary>
+        /// Creates a new texture element. Texture will use the default StretchToFit scaling.
+        /// </summary>
+        /// <param name="texture">Texture to display. If this is null then the texture specified by the style will be used.
+        /// </param>
+        /// <param name="transparent">Determines should the texture be rendered with transparency active.
+        /// </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 element 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 GUITexture(SpriteTexture texture, bool transparent, string style, params GUIOption[] options)
         {
             Internal_CreateInstance(this, texture, GUIImageScaleMode.StretchToFit, transparent, style, options);
         }
 
+        /// <summary>
+        /// Creates a new texture element. Texture will use the default StretchToFit scaling.
+        /// </summary>
+        /// <param name="texture">Texture to display. If this is null then the texture specified by the style will be used.
+        /// </param>
+        /// <param name="transparent">Determines should the texture be rendered with transparency active.
+        /// </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 GUITexture(SpriteTexture texture, bool transparent, params GUIOption[] options)
         {
             Internal_CreateInstance(this, texture, GUIImageScaleMode.StretchToFit, transparent, "", options);
         }
 
+        /// <summary>
+        /// Creates a new texture element with transparency active.
+        /// </summary>
+        /// <param name="texture">Texture to display. If this is null then the texture specified by the style will be used.
+        /// </param>
+        /// <param name="scale">Scale mode to use when sizing the texture.
+        /// </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 element 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 GUITexture(SpriteTexture texture, GUIImageScaleMode scale, string style, params GUIOption[] options)
         {
             Internal_CreateInstance(this, texture, scale, true, style, options);
         }
 
+        /// <summary>
+        /// Creates a new texture element with transparency active.
+        /// </summary>
+        /// <param name="texture">Texture to display. If this is null then the texture specified by the style will be used.
+        /// </param>
+        /// <param name="scale">Scale mode to use when sizing the texture.
+        /// </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 GUITexture(SpriteTexture texture, GUIImageScaleMode scale, params GUIOption[] options)
         {
             Internal_CreateInstance(this, texture, scale, true, "", options);
         }
 
+        /// <summary>
+        /// Creates a new texture element with transparency active. Texture will use the default StretchToFit scaling.
+        /// </summary>
+        /// <param name="texture">Texture to display. If this is null then the texture specified by the style will be used.
+        /// </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 element 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 GUITexture(SpriteTexture texture, string style, params GUIOption[] options)
         {
             Internal_CreateInstance(this, texture, GUIImageScaleMode.StretchToFit, true, style, options);
         }
 
+        /// <summary>
+        /// Creates a new texture element with transparency active. Texture will use the default StretchToFit scaling.
+        /// </summary>
+        /// <param name="texture">Texture to display. If this is null then the texture specified by the style will be 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 GUITexture(SpriteTexture texture, params GUIOption[] options)
         {
             Internal_CreateInstance(this, texture, GUIImageScaleMode.StretchToFit, true, "", options);
         }
 
+        /// <summary>
+        /// Sets the texture to display.
+        /// </summary>
+        /// <param name="texture">Texture to display. If this is null then the texture specified by the style will be used.
+        /// </param>
         public void SetTexture(SpriteTexture texture)
         {
             Internal_SetTexture(mCachedPtr, texture);
         }
 
+        /// <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);

+ 94 - 0
MBansheeEngine/GUI/GUIToggle.cs

@@ -3,6 +3,9 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
+    /// <summary>
+    /// GUI element representing a toggle (on/off) button.
+    /// </summary>
     public sealed class GUIToggle : GUIElement
     {
         public delegate void OnClickDelegate();
@@ -17,76 +20,167 @@ namespace BansheeEngine
         public event OnToggleDelegate OnToggled;
         public event OnDoubleClickDelegate OnDoubleClick;
 
+        /// <summary>
+        /// On/off state of the button.
+        /// </summary>
         public bool Value
         {
             get { return Internal_GetValue(mCachedPtr); }
             set { Internal_SetValue(mCachedPtr, value); }
         }
 
+        /// <summary>
+        /// Creates a new toggle button with the specified label.
+        /// </summary>
+        /// <param name="content">Content to display on the button.
+        /// </param>
+        /// <param name="toggleGroup">Optional toggle group that is used for grouping multiple toggle buttons together. 
+        /// </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 element 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 GUIToggle(GUIContent content, GUIToggleGroup toggleGroup, string style, params GUIOption[] options)
         {
             Internal_CreateInstance(this, content, toggleGroup, style, options);
         }
 
+        /// <summary>
+        /// Creates a new toggle 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 element 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 GUIToggle(GUIContent content, string style, params GUIOption[] options)
         {
             Internal_CreateInstance(this, content, null, style, options);
         }
 
+        /// <summary>
+        /// Creates a new toggle 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 element style 
+        /// is used.
+        /// </param>
         public GUIToggle(GUIContent content, string style)
         {
             Internal_CreateInstance(this, content, null, style, new GUIOption[0]);
         }
 
+        /// <summary>
+        /// Creates a new toggle 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 GUIToggle(GUIContent content, params GUIOption[] options)
         {
             Internal_CreateInstance(this, content, null, "", options);
         }
 
+        /// <summary>
+        /// Creates a new toggle button with the specified label.
+        /// </summary>
+        /// <param name="content">Content to display on the button.
+        /// </param>
+        /// <param name="toggleGroup">Optional toggle group that is used for grouping multiple toggle buttons together. 
+        /// </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 element style 
+        /// is used.
+        /// </param>
         public GUIToggle(GUIContent content, GUIToggleGroup toggleGroup, string style)
         {
             Internal_CreateInstance(this, content, toggleGroup, style, new GUIOption[0]);
         }
 
+        /// <summary>
+        /// Creates a new toggle button with the specified label.
+        /// </summary>
+        /// <param name="content">Content to display on the button.
+        /// </param>
+        /// <param name="toggleGroup">Optional toggle group that is used for grouping multiple toggle buttons together. 
+        /// </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 GUIToggle(GUIContent content, GUIToggleGroup toggleGroup, params GUIOption[] options)
         {
             Internal_CreateInstance(this, content, toggleGroup, "", options);
         }
 
+        /// <summary>
+        /// Updates the contents displayed on the button.
+        /// </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 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)
                 OnOut();
         }
 
+        /// <summary>
+        /// Triggered by the native interop object when the button is toggle on or off.
+        /// </summary>
+        /// <param name="toggled">New state of the element.</param>
         private void DoOnToggled(bool toggled)
         {
             if (OnToggled != null)
                 OnToggled(toggled);
         }
 
+        /// <summary>
+        /// Triggered by the native interop object when a double click occurs.
+        /// </summary>
         private void DoOnDoubleClick()
         {
             if (OnDoubleClick != null)

+ 6 - 0
MBansheeEngine/GUI/GUIToggleGroup.cs

@@ -3,8 +3,14 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
+    /// <summary>
+    /// Object that allows you to group multiple GUI toggle buttons. Only one button among the grouped ones can be active.
+    /// </summary>
     public sealed class GUIToggleGroup : ScriptObject
     {
+        /// <summary>
+        /// Creates a new toggle group.
+        /// </summary>
         public GUIToggleGroup()
         {
             Internal_CreateInstance(this);