Esempio n. 1
0
        private void StopResize()
        {
            _Resizing = false;

            if (_SeparatorFw != null)
            {
                _SeparatorFw.Close();
                _SeparatorFw.Dispose();

                _SeparatorFw = null;
            }
        }
Esempio n. 2
0
        private void StopReorder()
        {
            _Reordering = false;

            if (_HeaderFw != null)
            {
                _HeaderFw.Close();
                _HeaderFw.Paint -= ColumnHeaderFwPaint;
                _HeaderFw.Dispose();

                _HeaderFw = null;
            }

            if (_SeparatorFw != null)
            {
                _SeparatorFw.Close();
                _SeparatorFw.Dispose();

                _SeparatorFw = null;
            }

            if (_MouseDownHitColumn != null)
                InvalidateHeader(GridPanel, _MouseDownHitColumn);

            if (_HitColumn != null)
                InvalidateHeader(GridPanel, _HitColumn);
        }
Esempio n. 3
0
        private void StartResize()
        {
            GridPanel panel = Parent as GridPanel;

            if (panel != null)
            {
                _ResizeColumn = _MouseDownHitColumn;

                if (_ResizeColumn != null)
                {
                    _Resizing = true;
                    _ResizeWidth = _ResizeColumn.Size.Width;

                    if (panel.ImmediateResize == false)
                    {
                        _SeparatorFw = new FloatWindow();
                        _SeparatorFw.Opacity = .5;
                        _SeparatorFw.BackColor = Color.Black;
                        _SeparatorFw.Owner = SuperGrid.FindForm();
                    }
                }
            }
        }
Esempio n. 4
0
        private void ProcessInRowHeaderResize(Point pt, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                GridPanel panel = Parent as GridPanel;

                if (panel != null)
                {
                    if (_Resizing == false)
                    {
                        _Resizing = true;
                        _ResizeWidth = panel.RowHeaderWidth;

                        if (panel.ImmediateResize == false)
                        {
                            _SeparatorFw = new FloatWindow();
                            _SeparatorFw.Opacity = .5;
                            _SeparatorFw.BackColor = Color.Black;
                            _SeparatorFw.Owner = SuperGrid.FindForm();
                        }
                    }
                    else
                    {
                        if (panel.ImmediateResize == false)
                            ContinueRowHeaderResize(panel, pt);
                        else
                            ResizeRowHeader(panel, pt.X - MouseDownPoint.X);
                    }
                }
            }
        }
Esempio n. 5
0
        private void StartReorder(Point pt)
        {
            if (_MouseDownHitColumn != null && Math.Abs(MouseDownPoint.X - pt.X) > 5)
            {
                Capture = true;

                _Reordering = true;
                _SeparatorColumn = null;

                _HeaderFw = new FloatWindow();
                _HeaderFw.Opacity = .3;
                _HeaderFw.Owner = _MouseDownHitColumn.SuperGrid.FindForm();
                _HeaderFw.Paint += ColumnHeaderFwPaint;

                _SeparatorFw = new FloatWindow();
                _SeparatorFw.Opacity = .5;
                _SeparatorFw.BackColor = Color.Black;
                _SeparatorFw.Owner = _MouseDownHitColumn.SuperGrid.FindForm();
            }
        }
Esempio n. 6
0
        private void StopReorder()
        {
            IsReordering = false;

            if (_headerFw != null)
            {
                _headerFw.Close();
                _headerFw.Paint -= RowHeaderFwPaint;
                _headerFw.Dispose();

                _headerFw = null;
            }

            if (_separatorFw != null)
            {
                _separatorFw.Close();
                _separatorFw.Dispose();

                _separatorFw = null;
            }
        }
Esempio n. 7
0
        private void StartReorder(Point pt)
        {
            if (Math.Abs(MouseDownPoint.Y - pt.Y) > 5)
            {
                IsReordering = true;
                _SeparatorRow = null;

                _headerFw = new FloatWindow();
                _headerFw.Opacity = .3;
                _headerFw.Owner = SuperGrid.FindForm();
                _headerFw.Paint += RowHeaderFwPaint;

                _separatorFw = new FloatWindow();
                _separatorFw.BackColor = Color.Black;
                _separatorFw.Owner = SuperGrid.FindForm();

                using (GraphicsPath path = new GraphicsPath())
                {
                    path.AddLines(new Point[]
                    {
                        new Point(3, 3),
                        new Point(0, 6),
                        new Point(0, 0),
                        new Point(3, 3),
                    });

                    path.CloseFigure();

                    path.AddLines(new Point[]
                    {
                        new Point(4, 3),
                        new Point(1000, 3),
                        new Point(1000, 4),
                        new Point(4, 4),
                        new Point(4, 3),
                    });

                    path.CloseFigure();

                    Region rgn = new Region(path);

                    _separatorFw.Region = rgn;
                }

            }
        }
Esempio n. 8
0
        private void StartResize()
        {
            GridPanel panel = GridPanel;

            if (panel != null)
            {
                IsResizing = true;

                if (panel.ImmediateResize == false)
                {
                    _separatorFw = new FloatWindow();
                    _separatorFw.Opacity = .5;
                    _separatorFw.BackColor = Color.Black;
                    _separatorFw.Owner = SuperGrid.FindForm();
                }
            }
        }
Esempio n. 9
0
        private void DragEnd()
        {
            _Dragging = false;

            if (_GroupBoxWindow != null)
            {
                _GroupBoxWindow.Close();

                _GroupBoxWindow = null;
                _MouseDownHitBox = null;

                InvalidateRender(_InsertRect);
                _InsertRect = Rectangle.Empty;

                SuperGrid.PostInternalMouseMove();
            }
        }
Esempio n. 10
0
        internal bool DragStart(GridColumn column)
        {
            GridPanel panel = GridPanel;

            if (panel.VirtualMode == true)
                return (false);

            if (AllowSelection == true && panel.ColumnHeader.Visible == true &&
                column.GroupBoxEffectsEx != GroupBoxEffects.None)
            {
                Capture = true;

                _Dragging = true;

                _GroupBoxWindow = new FloatWindow();
                _GroupBoxWindow.Opacity = .5;
                _GroupBoxWindow.Owner = SuperGrid.FindForm();
                _GroupBoxWindow.Paint += GroupBoxWindowPaint;

                GridGroupBox box = new GridGroupBox(this, column);

                box.GroupBoxStyle = GroupBoxStyle;
                box.CornerRadius = CornerRadius;

                Size size = GetGroupBoxSize(box);
                Rectangle r = new Rectangle(Point.Empty, size);

                UpdateGroupBoxRects(GridPanel, box, ref r);

                box.RelativeBounds = r;
                box.IsDragBox = true;

                _GroupBoxWindow.Size = r.Size;

                int radius = GetCornerRadius(box);

                if (radius > 0 && box.GroupBoxStyle == GroupBoxStyle.RoundedRectangular)
                {
                    using (GraphicsPath path = GetRoundedPath(r, radius))
                    {
                        GraphicsPath cpath = (GraphicsPath)path.Clone();

                        using (Pen pen = new Pen(Color.Black, 2))
                            cpath.Widen(pen);

                        Region rgn = new Region(path);
                        rgn.Union(cpath);

                        _GroupBoxWindow.Region = rgn;
                    }
                }

                _GroupBoxWindow.Tag = box;

                return (true);
            }

            return (false);
        }