Beispiel #1
0
        private void MSMouseDoubleClick(MessageInfo messageInfo)
        {
            MouseEventArgs e = messageInfo.MessageParameter as MouseEventArgs;

            if (e == null)
            {
                return;
            }
            //
            ViewItem viewItem = null;

            for (int i = this.TopViewItemIndex; i <= this.BottomViewItemIndex; i++)
            {
                viewItem = this.ViewItems[i];
                if (viewItem == null)
                {
                    continue;
                }
                //
                if (viewItem.DisplayRectangle.Contains(e.Location))
                {
                    IMessageChain pMessageChain = viewItem as IMessageChain;
                    if (pMessageChain != null)
                    {
                        pMessageChain.SendMessage(messageInfo);//new MessageInfo(this, messageInfo.eMessageStyle, messageInfo.MessageParameter)
                    }
                    //
                    break;
                }
            }
        }
Beispiel #2
0
        protected override void MessageMonitor(MessageInfo messageInfo)
        {
            base.MessageMonitor(messageInfo);
            //
            switch (messageInfo.eMessageStyle)
            {
            case MessageStyle.eMSPaint:
                ISetViewItemHelper pSetViewItemHelper = this.m_pRowViewItem as ISetViewItemHelper;
                if (pSetViewItemHelper != null)
                {
                    pSetViewItemHelper.SetViewItemDisplayRectangle(
                        Rectangle.FromLTRB(this.TextRectangle.Left, this.DisplayRectangle.Top, this.DisplayRectangle.Right, this.DisplayRectangle.Bottom));
                }
                break;

            default:
                break;
            }
            //
            IMessageChain pMessageChain = this.m_pRowViewItem as IMessageChain;

            if (pMessageChain != null)
            {
                pMessageChain.SendMessage(messageInfo);
            }
        }
Beispiel #3
0
 private void MSMouseMove(MessageInfo messageInfo)
 {
     if (this.m_OperationStyle < 0)
     {
         messageInfo.CancelPreEvent = true;//取消事件 1
     }
     else
     {
         ViewItem viewItem = null;
         for (int i = this.TopViewItemIndex; i <= this.BottomViewItemIndex; i++)
         {
             viewItem = this.ViewItems[i];
             if (viewItem == null)
             {
                 continue;
             }
             //
             IMessageChain pMessageChain = viewItem as IMessageChain;
             if (pMessageChain != null)
             {
                 pMessageChain.SendMessage(messageInfo);//new MessageInfo(this, messageInfo.eMessageStyle, messageInfo.MessageParameter)
             }
         }
     }
 }
        private void MSMouseDown(MessageInfo messageInfo)
        {
            MouseEventArgs mouseEventArgs = messageInfo.MessageParameter as MouseEventArgs;

            if (mouseEventArgs != null)
            {
                for (int i = this.TopViewItemIndex; i <= this.BottomViewItemIndex; i++)
                {
                    ColumnViewItem viewItem = this.ViewItems[i];
                    if (viewItem == null)
                    {
                        continue;
                    }
                    //
                    if (!viewItem.Visible)
                    {
                        continue;
                    }
                    //
                    if (viewItem.DisplayRectangle.Contains(mouseEventArgs.Location))
                    {
                        IMessageChain pMessageChain = viewItem as IMessageChain;
                        if (pMessageChain != null)
                        {
                            pMessageChain.SendMessage(new MessageInfo(this, messageInfo.eMessageStyle, messageInfo.MessageParameter));
                        }
                        //
                        this.SelectedIndex = i;
                        //
                        break;
                    }
                }
            }
        }
Beispiel #5
0
        private void MSMouseWheel(MessageInfo messageInfo)
        {
            ViewItem viewItem = this.ViewItems[this.SelectedIndex];

            if (viewItem != null)
            {
                IMessageChain pMessageChain = viewItem as IMessageChain;
                if (pMessageChain != null)
                {
                    pMessageChain.SendMessage(messageInfo);
                }
            }
        }
Beispiel #6
0
        private void MSVisibleChanged(MessageInfo messageInfo)
        {
            ViewItem viewItem = null;

            for (int i = this.TopViewItemIndex; i <= this.BottomViewItemIndex; i++)
            {
                viewItem = this.ViewItems[i];
                if (viewItem != null)
                {
                    IMessageChain pMessageChain = viewItem as IMessageChain;
                    if (pMessageChain != null)
                    {
                        pMessageChain.SendMessage(messageInfo);
                    }
                }
            }
        }
Beispiel #7
0
        protected override void MessageMonitor(MessageInfo messageInfo)
        {
            if (this.BaseItemObject == null)
            {
                return;
            }
            //
            switch (messageInfo.eMessageStyle)
            {
            case MessageStyle.eMSPaint:
                ISetViewItemHelper pSetViewItemHelper = this.BaseItemObject as ISetViewItemHelper;
                if (pSetViewItemHelper != null)
                {
                    pSetViewItemHelper.SetViewItemDisplayRectangle(this.BaseItemRectangle);
                }
                //
                System.Windows.Forms.PaintEventArgs e = messageInfo.MessageParameter as System.Windows.Forms.PaintEventArgs;
                if (e != null)
                {
                    this.m_ItemsViewRectangle = e.ClipRectangle;
                }
                break;

            default:
                base.MessageMonitor(messageInfo);
                break;
            }
            //
            IMessageChain pMessageChain = this.BaseItemObject as IMessageChain;

            if (pMessageChain != null)
            {
                if (messageInfo.eMessageStyle == MessageStyle.eMSMouseWheel)
                {
                    pMessageChain.SendMessage(messageInfo);//new MessageInfo(this, messageInfo.eMessageStyle, messageInfo.MessageParameter)
                }
                else
                {
                    pMessageChain.SendMessage(new MessageInfo(this, messageInfo.eMessageStyle, messageInfo.MessageParameter));//messageInfo
                }
            }
        }
Beispiel #8
0
        protected override void MessageMonitor(MessageInfo messageInfo)
        {
            base.MessageMonitor(messageInfo);
            //
            BaseItem baseItem;

            for (int i = 0; i < this.m_BaseItemCollection.Count; i++)
            {
                baseItem = this.m_BaseItemCollection[i];
                if (baseItem.pOwner != this)
                {
                    continue;
                }
                //
                IMessageChain pMessageChain = baseItem as IMessageChain;
                if (pMessageChain != null)
                {
                    pMessageChain.SendMessage(messageInfo);
                }
            }
        }
        private void MSVisibleChanged(MessageInfo messageInfo)
        {
            ICellViewItem viewItem;

            for (int i = this.TopViewItemIndex; i <= this.BottomViewItemIndex; i++)
            {
                viewItem = this.ViewItems[i];
                if (viewItem == null)
                {
                    continue;
                }
                //
                if (!viewItem.Visible)
                {
                    continue;
                }
                //
                IMessageChain pMessageChain = viewItem as IMessageChain;
                if (pMessageChain != null)
                {
                    pMessageChain.SendMessage(messageInfo);//new MessageInfo(this, messageInfo.eMessageStyle, messageInfo.MessageParameter)
                }
            }
        }
Beispiel #10
0
        private void MSMouseDown(MessageInfo messageInfo)
        {
            MouseEventArgs mouseEventArgs = messageInfo.MessageParameter as MouseEventArgs;

            if (mouseEventArgs != null)
            {
                if (this.CanResizeItemHeight && this.DisplayRectangle.Bottom - CONST_RESIZERECTANGLESIZE <= mouseEventArgs.Location.Y)
                {
                    this.m_OperationStyle         = 1;
                    this.m_MouseDownPoint         = mouseEventArgs.Location;
                    this.m_MouseDownSelectedIndex = -1;
                    Control ctr = this.TryGetDependControl_DG(this.pOwner);
                    if (ctr != null)
                    {
                        this.m_CursorDefault = ctr.Cursor;
                        ctr.Cursor           = Cursors.SizeNS;
                    }
                    messageInfo.CancelPreEvent = true;//取消事件 1
                    //Console.WriteLine(this.ToString() + " - " + this.m_OperationStyle);
                }
                else
                {
                    ViewItem viewItem = null;
                    for (int i = this.TopViewItemIndex; i <= this.BottomViewItemIndex; i++)
                    {
                        viewItem = this.ViewItems[i];
                        if (viewItem == null)
                        {
                            continue;
                        }
                        //
                        if (viewItem.DisplayRectangle.Contains(mouseEventArgs.Location))
                        {
                            if (this.CanResizeItemWidth && viewItem.DisplayRectangle.Right - CONST_RESIZERECTANGLESIZE <= mouseEventArgs.Location.X)
                            {
                                this.m_OperationStyle         = 0;
                                this.m_MouseDownPoint         = mouseEventArgs.Location;
                                this.m_MouseDownSelectedIndex = i;
                                Control ctr = this.TryGetDependControl_DG(this.pOwner);
                                if (ctr != null)
                                {
                                    this.m_CursorDefault = ctr.Cursor;
                                    ctr.Cursor           = Cursors.SizeWE;
                                }
                                messageInfo.CancelPreEvent = true;//取消事件 2
                                break;
                            }
                            else
                            {
                                //if (this.CanExchangeItem)
                                //{
                                //    this.m_OperationStyle = 2;
                                //    this.m_MouseDownSelectedIndex = i;
                                //    Control ctr = this.TryGetDependControl_DG(this.pOwner);
                                //    if (ctr != null)
                                //    {
                                //        this.m_CursorDefault = ctr.Cursor;
                                //        ctr.Cursor = Cursors.Hand;
                                //    }
                                //}
                                //else
                                //{
                                //    IMessageChain pMessageChain = viewItem as IMessageChain;
                                //    if (pMessageChain != null)
                                //    {
                                //        pMessageChain.SendMessage(messageInfo);//new MessageInfo(this, messageInfo.eMessageStyle, messageInfo.MessageParameter)
                                //    }
                                //}
                                IMessageChain pMessageChain = viewItem as IMessageChain;
                                if (pMessageChain != null)
                                {
                                    pMessageChain.SendMessage(messageInfo);//new MessageInfo(this, messageInfo.eMessageStyle, messageInfo.MessageParameter)
                                }
                                //
                                this.SelectedIndex = i;
                            }
                            //
                            break;
                        }
                    }
                }
            }
        }
        protected override void MessageMonitor(MessageInfo messageInfo)
        {
            base.MessageMonitor(messageInfo);
            if (this.m_BaseItemObject == null)
            {
                return;
            }
            //
            switch (messageInfo.eMessageStyle)
            {
            case MessageStyle.eMSPaint:
                Rectangle displayRectangle  = this.DisplayRectangle;
                Rectangle displayRectangle2 = this.m_BaseItemObject.DisplayRectangle;
                if (displayRectangle != displayRectangle2)
                {
                    Size size = displayRectangle2.Size;
                    if (this.m_BaseItemObject.LockWith)
                    {
                        if (!this.LockWith)
                        {
                            switch (this.Dock)
                            {
                            case System.Windows.Forms.DockStyle.Top:
                            case System.Windows.Forms.DockStyle.Bottom:
                            case System.Windows.Forms.DockStyle.Fill:
                                break;

                            default:
                                this.Width = displayRectangle2.Width;
                                break;
                            }
                        }
                    }
                    else
                    {
                        size.Width = displayRectangle.Width;
                    }
                    if (this.m_BaseItemObject.LockHeight)
                    {
                        if (!this.LockHeight)
                        {
                            switch (this.Dock)
                            {
                            case System.Windows.Forms.DockStyle.Left:
                            case System.Windows.Forms.DockStyle.Right:
                            case System.Windows.Forms.DockStyle.Fill:
                                break;

                            default:
                                this.Height = displayRectangle2.Height;
                                break;
                            }
                        }
                    }
                    else
                    {
                        size.Height = displayRectangle.Height;
                    }
                    displayRectangle = new Rectangle(displayRectangle.Location, size);
                    if (displayRectangle != displayRectangle2)
                    {
                        if (this.m_BaseItemObject is ISetBaseItemHelper)
                        {
                            ((ISetBaseItemHelper)this.m_BaseItemObject).SetDisplayRectangle(displayRectangle);
                        }
                    }
                }
                break;

            default:
                break;
            }
            //
            IMessageChain pMessageChain = this.m_BaseItemObject as IMessageChain;

            if (pMessageChain != null)
            {
                pMessageChain.SendMessage(messageInfo);
            }
        }