Пример #1
0
            public override void DrawInteriorWithFrame(System.Drawing.RectangleF cellFrame, NSView inView)
            {
                var nscontext = NSGraphicsContext.CurrentContext;

                if (DrawsBackground)
                {
                    var context = nscontext.GraphicsPort;
                    context.SetFillColor(BackgroundColor.ToCGColor());
                    context.FillRect(cellFrame);
                }

                var drawableCellHandler = Handler as DrawableCellHandler;
                var handler             = new GraphicsHandler(null, nscontext, cellFrame.Height, flipped: false);
                var graphics            = new Graphics(drawableCellHandler.Widget.Generator, handler);

                if (drawableCellHandler.Widget.PaintHandler != null)
                {
                    var b = graphics.ClipBounds;
                    //graphics.SetClip(clipBounds);
                    drawableCellHandler.Widget.PaintHandler(new DrawableCellPaintArgs
                    {
                        Graphics   = graphics,                       // cachedGraphics,
                        CellBounds = cellFrame.ToEto(),
                        Item       = drawableCellHandler.dataItem,
                        CellState  = DrawableCellState.Normal, // cellState.ToEto(),
                    });
                    graphics.SetClip(b);                       // restore
                }
                //base.DrawInteriorWithFrame (cellFrame, inView);
            }
Пример #2
0
            public override void DrawInteriorWithFrame(System.Drawing.RectangleF cellFrame, NSView inView)
            {
                if (DrawsBackground)
                {
                    var nscontext = NSGraphicsContext.CurrentContext;
                    var context   = nscontext.GraphicsPort;
                    context.SetFillColor(BackgroundColor.ToCGColor());
                    context.FillRect(cellFrame);
                }

                base.DrawInteriorWithFrame(cellFrame, inView);
            }
Пример #3
0
            public override void DrawInteriorWithFrame(CGRect cellFrame, NSView inView)
            {
                var nscontext = NSGraphicsContext.CurrentContext;

                if (DrawsBackground)
                {
                    var context = nscontext.GraphicsPort;
                    context.SetFillColor(BackgroundColor.ToCGColor());
                    context.FillRect(cellFrame);
                }

                nscontext.ImageInterpolation = ImageInterpolation;

                base.DrawInteriorWithFrame(cellFrame, inView);
            }
Пример #4
0
            public override void DrawInteriorWithFrame(CGRect cellFrame, NSView inView)
            {
                var nscontext = NSGraphicsContext.CurrentContext;

                if (DrawsBackground)
                {
                    var context = nscontext.GraphicsPort;
                    context.SetFillColor(BackgroundColor.ToCGColor());
                    context.FillRect(cellFrame);
                }

                var handler         = Handler;
                var graphicsHandler = new GraphicsHandler(null, nscontext, (float)cellFrame.Height, flipped: true);

                using (var graphics = new Graphics(graphicsHandler))
                {
                    var state = Highlighted ? DrawableCellStates.Selected : DrawableCellStates.None;
                    var item  = ObjectValue as EtoCellValue;
                    var args  = new DrawableCellPaintEventArgs(graphics, cellFrame.ToEto(), state, item != null ? item.Item : null);
                    handler.Callback.OnPaint(handler.Widget, args);
                }
            }