2007-04-17 Everaldo Canuto <everaldo@simios.org>
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / ToolStripOverflow.cs
index 5eaf6ad0dbdce0ffeb05b70ae14ecc859362e7cd..cffc469efdfa0a6bc163e852923a92f4df25a2b1 100644 (file)
@@ -31,6 +31,7 @@ using System;
 using System.Runtime.InteropServices;
 using System.ComponentModel;
 using System.Drawing;
+using System.Windows.Forms.Layout;
 
 namespace System.Windows.Forms
 {
@@ -38,6 +39,8 @@ namespace System.Windows.Forms
        [ClassInterface (ClassInterfaceType.AutoDispatch)]
        public class ToolStripOverflow : ToolStripDropDown, IComponent, IDisposable
        {
+               private LayoutEngine layout_engine;
+               
                #region Public Constructors
                public ToolStripOverflow (ToolStripItem parentItem)
                {
@@ -46,6 +49,14 @@ namespace System.Windows.Forms
                #endregion
                
                #region Public Properties
+               public override System.Windows.Forms.Layout.LayoutEngine LayoutEngine {
+                       get {
+                               if (this.layout_engine == null)
+                                       this.layout_engine = new FlowLayout ();
+                                       
+                               return base.LayoutEngine;
+                       }
+               }
                #endregion
 
                #region Protected Properties
@@ -115,6 +126,12 @@ namespace System.Windows.Forms
                        this.PerformLayout ();
                }
                #endregion
+
+               #region Internal Methods
+               internal ToolStrip ParentToolStrip {
+                       get { return (ToolStrip)this.OwnerItem.Parent; }
+               }
+               #endregion
        }
 }
 #endif
\ No newline at end of file