示例#1
0
 public ContextPopup()
 {
     this.m_ContextPopupPanel                        = new ContextPopupPanelItem();
     this.m_ContextPopupPanel.Padding                = new Padding(2);
     this.m_ContextPopupPanel.LeftTopRadius          = 6;
     this.m_ContextPopupPanel.LeftBottomRadius       = 6;
     this.m_ContextPopupPanel.RightTopRadius         = 6;
     this.m_ContextPopupPanel.RightBottomRadius      = 6;
     this.m_ContextPopupPanel.LockWith               = true;
     this.m_ContextPopupPanel.LockHeight             = true;
     this.m_ContextPopupPanel.IsStretchItems         = true;
     this.m_ContextPopupPanel.IsRestrictItems        = true;
     this.m_ContextPopupPanel.PreButtonIncreaseIndex = false;
     this.m_ContextPopupPanel.ShowOutLine            = true;
     //
     this.m_ToolStripControlHost = new ToolStripControlHost(
         new BaseItemHost(this.m_ContextPopupPanel)
     {
         Width  = 10,
         Height = 20
     }
         );
     this.m_ContextPopupPanel.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(0);
     this.DropShadowEnabled = false;
     this.ShowItemToolTips  = false;
     //
     ((ISetOwnerHelper)(this.m_ToolStripControlHost.Control)).SetOwner(this);
 }
        public override object Clone()
        {
            ContextPopupPanelItem baseItem = new ContextPopupPanelItem();

            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.LeftBottomRadius  = this.LeftBottomRadius;
            baseItem.LeftTopRadius     = this.LeftTopRadius;
            baseItem.Padding           = this.Padding;
            baseItem.RightBottomRadius = this.RightBottomRadius;
            baseItem.RightTopRadius    = this.RightTopRadius;
            baseItem.Visible           = this.Visible;
            //
            baseItem.MinSize         = this.MinSize;
            baseItem.MaxSize         = this.MaxSize;
            baseItem.IsStretchItems  = this.IsStretchItems;
            baseItem.IsRestrictItems = this.IsRestrictItems;
            baseItem.LineDistance    = this.LineDistance;
            baseItem.ColumnDistance  = this.ColumnDistance;
            baseItem.eOrientation    = this.eOrientation;
            //
            //baseItem.ShowNomalOutLineState = this.ShowNomalOutLineState;
            //baseItem.ShowNomalBackgroudState = this.ShowNomalBackgroudState;
            //baseItem.ShowOutLineState = this.ShowOutLineState;
            //baseItem.ShowBackgroudState = this.ShowBackgroudState;
            //baseItem.AutoTopViewItemIndex = this.AutoTopViewItemIndex;
            baseItem.PreButtonIncreaseIndex = this.PreButtonIncreaseIndex;
            //
            baseItem.ShowBackgroud = this.ShowBackgroud;
            baseItem.ShowOutLine   = this.ShowOutLine;
            foreach (BaseItem one in this.BaseItems)
            {
                baseItem.BaseItems.Add(one.Clone() as BaseItem);
            }
            baseItem.TopViewItemIndex = this.TopViewItemIndex;
            //
            baseItem.CheckRegionWidth   = this.CheckRegionWidth;
            baseItem.ImageRegionWidth   = this.ImageRegionWidth;
            baseItem.eContextPopupStyle = this.eContextPopupStyle;
            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("TopViewItemIndexChanged") == EventStateStyle.eUsed)
            {
                baseItem.TopViewItemIndexChanged += new IntValueChangedHandler(baseItem_TopViewItemIndexChanged);
            }
            return(baseItem);
        }