Ejemplo n.º 1
0
        protected override void OnDrawColumn(LayoutListDrawArgs e)
        {
            var format    = (DayOfWeek)e.GridIndex;
            var textBound = new Rectangle(new Point(e.Bound.Left + 3, e.Bound.Top + (e.Bound.Height - 20) / 2D),
                                          e.Bound.Size - new Size(6, 6));

            e.Context.DrawCell(listInfo.StyleColumn, format.ToString(), e.Bound, textBound, CellDisplayState.Default);
        }
Ejemplo n.º 2
0
        protected override void OnDrawHeader(LayoutListDrawArgs e)
        {
            base.OnDrawHeader(e);
            var close = GetRowCloseBound(e.Bound);

            e.Context.DrawCell(styleClose, GlyphType.CloseAlias, close, close,
                               cacheHitt != null && close.Contains(cacheHitt.HitTest.Point) ? CellDisplayState.Hover : CellDisplayState.Default);
        }
Ejemplo n.º 3
0
        public override void DrawCell(LayoutListDrawArgs e)
        {
            var colorBound = new Rectangle(e.Bound.Location, new Size(e.Bound.Height, e.Bound.Height)).Inflate(-3, -3);
            var textBound  = new Rectangle(e.Bound.X + e.Bound.Height, e.Bound.Y, e.Bound.Width - e.Bound.Height, e.Bound.Height).Inflate(-3, -3);

            e.Context.DrawCell(e.Style, e.Formated, e.Bound, textBound, e.State);
            e.Context.FillRectangle((Color)e.Value, colorBound);
        }
Ejemplo n.º 4
0
        public override void DrawCell(LayoutListDrawArgs e)
        {
            var layoutList = e.LayoutList;

            IGroup gitem = e.Item as IGroup;
            IGlyph image = e.Item as IGlyph;
            int    level = gitem == null ? -1 : GroupHelper.Level(gitem);

            e.Context.DrawCell(e.Style, null, e.Bound, e.Bound, e.State);

            if (layoutList.ListInfo.Tree && gitem != null && gitem.IsCompaund)
            {
                var glyphBound = layoutList.GetCellGlyphBound(gitem, level, e.Bound);
                e.Context.DrawGlyph(gitem.Expand ? GlyphType.CaretDown : GlyphType.CaretRight, glyphBound, e.Style, e.State);
            }
            if (layoutList.AllowCheck && e.Item is ICheck)
            {
                var checkBound = layoutList.GetCellCheckBound(e.Item, level, e.Bound);
                e.Context.DrawCheckBox(((ICheck)e.Item).Check ? CheckedState.Checked : CheckedState.Unchecked, checkBound, e.Style.FontBrush.GetColorByState(e.State));
            }
            if (layoutList.AllowImage && image != null)
            {
                var imageBound = layoutList.GetCellImageBound(e.Item, level, e.Bound);
                if (image.Image != null)
                {
                    e.Context.DrawImage(image.Image, imageBound);
                }
                else if (image.Glyph != GlyphType.None)
                {
                    var color = e.Style.FontBrush.GetColorByState(e.State);
                    if (image is Node && ((Node)image).GlyphColor != CellStyleBrush.ColorEmpty)
                    {
                        color = ((Node)image).GlyphColor;
                    }
                    e.Context.DrawGlyph(image.Glyph, imageBound, color);
                }
            }
            var textBound = layoutList.GetCellTextBound(e);

            if (e.Formated is string)
            {
                e.Context.DrawText((string)e.Formated, textBound, e.Style, e.State);
            }
            else if (e.Formated is TextLayout)
            {
                e.Context.DrawText((TextLayout)e.Formated, textBound, e.Style, e.State);
            }
        }
Ejemplo n.º 5
0
 protected override void OnDrawHeader(LayoutListDrawArgs e)
 {
     if (e.Item is StateInfo)
     {
         GlyphType type  = GlyphType.InfoCircle;
         Color     color = Colors.Blue;
         if (((StateInfo)e.Item).Type == StatusType.Error)
         {
             type  = GlyphType.ExclamationCircle;
             color = Colors.Red;
         }
         if (((StateInfo)e.Item).Type == StatusType.Warning)
         {
             type  = GlyphType.ExclamationTriangle;
             color = Colors.Yellow;
         }
         e.Context.DrawGlyph(type, e.Bound, color);
     }
     else
     {
         base.OnDrawHeader(e);
     }
 }
Ejemplo n.º 6
0
        public virtual void DrawCell(LayoutListDrawArgs e)
        {
            var textBound = e.LayoutList.GetCellTextBound(e);

            e.Context.DrawCell(e.Style, e.Formated, e.Bound, textBound, e.State);
        }