Example #1
0
        private void RenderInsertIndicator(
            Graphics g, GridPanel panel, Rectangle r)
        {
            Image image = panel.GetInsertRowImage();

            if (image != null)
            {
                Rectangle u = r;
                u.Size = image.Size;

                if (r.Width > u.Width)
                    u.X = r.X + (r.Width - u.Width) / 2;

                if (r.Height > u.Height)
                    u.Y += (r.Height - u.Height) / 2;

                u.Intersect(r);

                g.DrawImageUnscaledAndClipped(image, u);
            }
        }
Example #2
0
        private Size MeasureRowHeader(GridPanel panel)
        {
            Size size = panel.RowHeaderSize;

            if (size.IsEmpty == true)
            {
                if (NeedsMeasured == true)
                {
                    size.Width = panel.RowHeaderWidth;

                    if (GetRowHeight() == 0)
                    {
                        RowHeaderVisualStyle style = GetEffectiveRowStyle().RowHeaderStyle;

                        if (panel.ActiveRowIndicatorStyle == ActiveRowIndicatorStyle.Image ||
                            panel.ActiveRowIndicatorStyle == ActiveRowIndicatorStyle.Both)
                        {
                            MaxImageHeight(style.GetActiveRowImage(panel), ref size);
                        }

                        if (panel.ShowEditingImage == true)
                            MaxImageHeight(style.GetEditingRowImage(panel), ref size);

                        if (panel.ShowInsertRow == true)
                            MaxImageHeight(panel.GetInsertRowImage(), ref size);
                    }

                    _RowHeaderSize = size;
                }

                size = _RowHeaderSize;
            }

            return (size);
        }