コード例 #1
0
        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;
                    }
                }
            }
        }
コード例 #2
0
        private void MSMouseDoubleClick(MessageInfo messageInfo)
        {
            MouseEventArgs e = messageInfo.MessageParameter as MouseEventArgs;

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

            for (int i = this.TopViewItemIndex; i <= this.BottomViewItemIndex; i++)
            {
                viewItem = this.ViewItems[i];
                if (viewItem == null)
                {
                    continue;
                }
                //
                if (!viewItem.Visible)
                {
                    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;
                }
            }
        }
コード例 #3
0
 public ColumnTitleViewItem(ColumnViewItem columnViewItem, string name, string text, Font font)
     : base(name, text, font)
 {
     this.m_LinkColumnViewItem = columnViewItem;
 }
コード例 #4
0
 public ColumnTitleViewItem(ColumnViewItem columnViewItem, string text)
     : base(text)
 {
     this.m_LinkColumnViewItem = columnViewItem;
 }
コード例 #5
0
 public ColumnTitleViewItem(ColumnViewItem columnViewItem)
 {
     this.m_LinkColumnViewItem = columnViewItem;
 }
コード例 #6
0
        protected virtual void DrawItem(System.Windows.Forms.PaintEventArgs e)
        {
            //Rectangle rectangle = this.DisplayRectangle;
            IViewItemOwner pViewItemOwner     = this.pOwner as IViewItemOwner;
            Rectangle      viewItemsRectangle = e.ClipRectangle;// pViewItemOwner == null ? rectangle : pViewItemOwner.ViewItemsRectangle;

            GISShare.Controls.WinForm.WFNew.LayoutEngine.LayoutStackH_Row(e.Graphics, this, viewItemsRectangle, this.DisplayRectangle, ref this._TopViewItemIndex, ref this._BottomViewItemIndex);
            ColumnViewItem viewItem = null;
            IMessageChain  pMessageChain;

            for (int i = this.TopViewItemIndex; i <= this.BottomViewItemIndex; i++)
            {
                viewItem = this.ViewItems[i];
                if (viewItem == null || !viewItem.Visible)
                {
                    continue;
                }
                Rectangle clipRectangle = Rectangle.Intersect(viewItemsRectangle, viewItem.DisplayRectangle);
                if (clipRectangle.Width > 0 && clipRectangle.Height > 0)
                {
                    pMessageChain = viewItem as IMessageChain;
                    if (pMessageChain != null)
                    {
                        e.Graphics.SetClip(clipRectangle);
                        MessageInfo messageInfo = new MessageInfo(this, MessageStyle.eMSPaint, new PaintEventArgs(e.Graphics, clipRectangle));
                        pMessageChain.SendMessage(messageInfo);
                    }
                }
            }
            #region 已抛弃(布局移植到LayoutEngine)
            //Rectangle rectangle = this.DisplayRectangle;
            //int iW = 0;
            //int iOffsetX = 0;
            ////
            //IViewItemOwner pViewItemOwner = this.pOwner as IViewItemOwner;
            //Rectangle viewItemsRectangle = pViewItemOwner == null ? rectangle : pViewItemOwner.ViewItemsRectangle;
            ////
            //ColumnViewItem viewItem = null;
            //int iCount = this.ViewItems.Count;
            //int iLeftX = 0;
            //int iRightX = 0;
            //int iLeftIndex = 0;
            //int iRightIndex = iCount;
            //for (int i = 0; i < iCount; i++)
            //{
            //    viewItem = this.ViewItems[i];
            //    //
            //    if (!viewItem.Visible) continue;
            //    //
            //    iW = viewItem.MeasureSize(e.Graphics).Width;
            //    iLeftX = rectangle.Left + iOffsetX;
            //    iRightX = iLeftX + iW;
            //    if (iRightX <= viewItemsRectangle.Left)
            //    {
            //        iLeftIndex++;
            //    }
            //    else if (iLeftX >= viewItemsRectangle.Right)
            //    {
            //        iRightIndex--;
            //    }
            //    else
            //    {
            //        ISetViewItemHelper pSetViewItemHelper = viewItem as ISetViewItemHelper;
            //        if (pSetViewItemHelper != null)
            //        {
            //            pSetViewItemHelper.SetViewItemDisplayRectangle(new Rectangle(iLeftX, rectangle.Top, iW, rectangle.Height));
            //            //
            //            Rectangle clipRectangle = Rectangle.Intersect(viewItemsRectangle, viewItem.DisplayRectangle);
            //            if (clipRectangle.Width > 0 && clipRectangle.Height > 0)
            //            {
            //                IMessageChain pMessageChain = viewItem as IMessageChain;
            //                if (pMessageChain != null)
            //                {
            //                    e.Graphics.SetClip(clipRectangle);
            //                    MessageInfo messageInfo = new MessageInfo(this, MessageStyle.eMSPaint, new PaintEventArgs(e.Graphics, clipRectangle));
            //                    pMessageChain.SendMessage(messageInfo);
            //                }
            //            }
            //        }
            //    }
            //    //
            //    iOffsetX += iW;
            //}
            ////
            //this.m_TopViewItemIndex = iLeftIndex;
            //this.m_BottomViewItemIndex = iRightIndex - 1;
            #endregion
        }