public RibbonBarPopup(IRibbonBarItem ribbonBarItem)
 {
     this.m_RibbonBarMirrorPopupPanel = new RibbonBarMirrorPopupPanelItem(ribbonBarItem);
     //
     this.m_ToolStripControlHost = new ToolStripControlHost(new BaseItemHost(this.m_RibbonBarMirrorPopupPanel)
     {
         Size = this.m_RibbonBarMirrorPopupPanel.Size, BackColor = System.Drawing.Color.Transparent
     });
     this.m_RibbonBarMirrorPopupPanel.Entity = this.m_ToolStripControlHost.Control;
     this.m_ToolStripControlHost.Dock        = DockStyle.Fill;
     //this.m_ToolStripControlHost.BackColor = base.BackColor;
     this.m_ToolStripControlHost.Margin  = new Padding(0);
     this.m_ToolStripControlHost.Padding = new Padding(0);
     base.Items.Add(this.m_ToolStripControlHost);
     //
     this.Margin            = new Padding(0);
     this.Padding           = new Padding(3);
     this.DropShadowEnabled = false;
     this.ShowItemToolTips  = false;
     //
     ((ISetOwnerHelper)(this.m_ToolStripControlHost.Control)).SetOwner(this);
 }
Esempio n. 2
0
        public override object Clone()
        {
            RibbonBarMirrorPopupPanelItem baseItem = new RibbonBarMirrorPopupPanelItem(this.m_pRibbonBarItem);

            baseItem.Checked           = this.Checked;
            baseItem.Enabled           = this.Enabled;
            baseItem.Font              = this.Font;
            baseItem.ForeColor         = this.ForeColor;
            baseItem.Name              = this.Name;
            baseItem.Site              = this.Site;
            baseItem.Size              = this.Size;
            baseItem.Tag               = this.Tag;
            baseItem.Text              = this.Text;
            baseItem.Image             = this.Image;
            baseItem.LeftBottomRadius  = this.LeftBottomRadius;
            baseItem.LeftTopRadius     = this.LeftTopRadius;
            baseItem.Padding           = this.Padding;
            baseItem.RightBottomRadius = this.RightBottomRadius;
            baseItem.RightTopRadius    = this.RightTopRadius;
            baseItem.ShowNomalState    = this.ShowNomalState;
            baseItem.Visible           = this.Visible;
            //
            baseItem.ColumnDistance  = this.ColumnDistance;
            baseItem.GlyphEnabled    = this.GlyphEnabled;
            baseItem.GlyphVisible    = this.GlyphVisible;
            baseItem.IsStretchItems  = this.IsStretchItems;
            baseItem.IsRestrictItems = this.IsRestrictItems;
            //foreach (BaseItem one in this.BaseItems)
            //{
            //    baseItem.BaseItems.Add(one.Clone() as BaseItem);
            //}
            if (this.GetEventState("VisibleChanged") == EventStateStyle.eUsed)
            {
                baseItem.VisibleChanged += new EventHandler(baseItem_VisibleChanged);
            }
            if (this.GetEventState("SizeChanged") == EventStateStyle.eUsed)
            {
                baseItem.SizeChanged += new EventHandler(baseItem_SizeChanged);
            }
            if (this.GetEventState("Paint") == EventStateStyle.eUsed)
            {
                baseItem.Paint += new PaintEventHandler(baseItem_Paint);
            }
            if (this.GetEventState("MouseUp") == EventStateStyle.eUsed)
            {
                baseItem.MouseUp += new MouseEventHandler(baseItem_MouseUp);
            }
            if (this.GetEventState("MouseMove") == EventStateStyle.eUsed)
            {
                baseItem.MouseMove += new MouseEventHandler(baseItem_MouseMove);
            }
            if (this.GetEventState("MouseLeave") == EventStateStyle.eUsed)
            {
                baseItem.MouseLeave += new EventHandler(baseItem_MouseLeave);
            }
            if (this.GetEventState("MouseEnter") == EventStateStyle.eUsed)
            {
                baseItem.MouseEnter += new EventHandler(baseItem_MouseEnter);
            }
            if (this.GetEventState("MouseDown") == EventStateStyle.eUsed)
            {
                baseItem.MouseDown += new MouseEventHandler(baseItem_MouseDown);
            }
            if (this.GetEventState("MouseDoubleClick") == EventStateStyle.eUsed)
            {
                baseItem.MouseDoubleClick += new MouseEventHandler(baseItem_MouseDoubleClick);
            }
            if (this.GetEventState("MouseClick") == EventStateStyle.eUsed)
            {
                baseItem.MouseClick += new MouseEventHandler(baseItem_MouseClick);
            }
            if (this.GetEventState("LocationChanged") == EventStateStyle.eUsed)
            {
                baseItem.LocationChanged += new EventHandler(baseItem_LocationChanged);
            }
            if (this.GetEventState("EnabledChanged") == EventStateStyle.eUsed)
            {
                baseItem.EnabledChanged += new EventHandler(baseItem_EnabledChanged);
            }
            if (this.GetEventState("CheckedChanged") == EventStateStyle.eUsed)
            {
                baseItem.CheckedChanged += new EventHandler(baseItem_CheckedChanged);
            }
            if (this.GetEventState("GlyphMouseDown") == EventStateStyle.eUsed)
            {
                baseItem.GlyphMouseDown += new MouseEventHandler(baseItem_GlyphMouseDown);
            }
            if (this.GetEventState("GlyphMouseMove") == EventStateStyle.eUsed)
            {
                baseItem.GlyphMouseMove += new MouseEventHandler(baseItem_GlyphMouseMove);
            }
            if (this.GetEventState("GlyphMouseUp") == EventStateStyle.eUsed)
            {
                baseItem.GlyphMouseUp += new MouseEventHandler(baseItem_GlyphMouseUp);
            }
            if (this.GetEventState("GlyphMouseClick") == EventStateStyle.eUsed)
            {
                baseItem.GlyphMouseClick += new MouseEventHandler(baseItem_GlyphMouseClick);
            }
            if (this.GetEventState("GlyphMouseDoubleClick") == EventStateStyle.eUsed)
            {
                baseItem.GlyphMouseDoubleClick += new MouseEventHandler(baseItem_GlyphMouseDoubleClick);
            }
            return(baseItem);
        }