示例#1
0
        internal void ClearEditBoxCell(bool bForgetCell = true)
        {
            if (bForgetCell)
            {
                SetCurrentCell(-1, null);
            }

            Hide();
            m_Parent.Invalidate();
        }
示例#2
0
        internal void OnMouseMove(MouseEventArgs e, int xOffset)
        {
            if (m_bMouseDownInHeader)
            {
                if (m_Resizing != null)
                {
                    int X           = FindColumnXPos(m_Resizing, xOffset);
                    int nWidth      = m_Resizing.Width;
                    int WidthAdjust = e.X - (X + nWidth);

                    nWidth = nWidth + WidthAdjust;
                    nWidth = nWidth < 0 ? 0 : nWidth;

                    if (nWidth != m_Resizing.Width)
                    {
                        m_Resizing.Width = nWidth;

                        if (ColumnResizing != null)
                        {
                            ColumnResizing(m_Resizing.Index);
                        }
                    }
                }
                else
                {
                    if (m_ResizingPrev != null)
                    {
                        int X           = FindColumnXPos(m_ResizingPrev, xOffset);
                        int nWidth      = m_ResizingPrev.Width;
                        int WidthAdjust = e.X - (X + nWidth);

                        nWidth = nWidth + WidthAdjust;
                        nWidth = nWidth < 0 ? 0 : nWidth;

                        if (nWidth != m_ResizingPrev.Width)
                        {
                            m_ResizingPrev.Width = nWidth;

                            if (ColumnResizing != null)
                            {
                                ColumnResizing(m_ResizingPrev.Index);
                            }
                        }
                    }
                    else
                    {
                        if (m_MouseDownIn != null)
                        {
                            int X = FindColumnXPos(m_MouseDownIn, xOffset);
                            m_Parent.Invalidate(new Rectangle(X, 0, m_MouseDownIn.Width, ColumnHeight));
                        }
                    }
                }
            }
            else
            {
                Column MouseIn = FindColumn(e.X, xOffset);

                if (MouseIn != null)
                {
                    int X = FindColumnXPos(MouseIn, xOffset);

                    if ((e.X - X <= 4) && MouseIn.Index != 0)
                    {
                        Column PrevVis = FindPrevVisibleColumn(MouseIn);
                        if (PrevVis != null && PrevVis.AllowResize)
                        {
                            Cursor.Current = Cursors.VSplit;
                        }
                    }
                    else
                    {
                        if (((X + MouseIn.Width) - e.X) <= 4)
                        {
                            if (MouseIn.AllowResize)
                            {
                                Cursor.Current = Cursors.VSplit;
                            }
                        }
                    }
                }
                else
                {
                    if (m_Columns.Count > 0 && (e.X - m_Columns.RowWidth + xOffset) <= 4)
                    {
                        if (m_Columns[m_Columns.Count - 1].AllowResize)
                        {
                            Cursor.Current = Cursors.VSplit;
                        }
                    }
                }
            }
        }