Exemplo n.º 1
0
        public void DrawRect(CGRect aRect, bool selected)
        {
            NSGraphics.RectClip(aRect);

            aRect.Intersect(Frame);

            Color.Set();
            NSGraphics.RectFill(aRect);

            if (selected)
            {
                NSColor.Black.Set();
                NSGraphics.FrameRectWithWidth(Frame, 4.0f);
            }

            if (IsLocked)
            {
                float xSize = (Frame.Width > 10.0f) ? 5.0f : 3.0f;

                NSBezierPath path = new NSBezierPath();

                NSColor.Black.Set();
                path.LineWidth = 3.0f;
                path.MoveTo(new CGPoint(MidX(Frame) - xSize, MidY(Frame) - xSize));
                path.LineTo(new CGPoint(MidX(Frame) + xSize, MidY(Frame) + xSize));
                path.MoveTo(new CGPoint(MidX(Frame) - xSize, MidY(Frame) + xSize));
                path.LineTo(new CGPoint(MidX(Frame) + xSize, MidY(Frame) - xSize));
                path.Stroke();
            }
        }