Ejemplo n.º 1
0
        // Draw the view
        public override void DrawRect(CoreGraphics.CGRect dirtyRect)
        {
            CGRect bounds = this.Bounds;

            // Using the system focus ring instead. Achieved by overriding DrawFocusRingMask and FocusRingMaskBounds
//			// Am I the window's first responder?
//			if (this.Window.FirstResponder == this) {
//				NSColor.KeyboardFocusIndicator.Set();
//				NSBezierPath.DefaultLineWidth = 4.0f;
//				NSBezierPath.StrokeRect(bounds);
//			}

            if (Highlighted)
            {
                NSGradient gr = new NSGradient(NSColor.White, mBgColor);
                gr.DrawInRect(bounds, new CGPoint(0.0f, 0.0f));
            }
            else
            {
                mBgColor.Set();
                NSBezierPath.FillRect(bounds);
            }

            DrawStringCenteredInRectangle(mLetter, bounds);
        }
Ejemplo n.º 2
0
 public override void DrawRect(RectangleF dirtyRect)
 {
     backgroundGradient.DrawInRect(Frame, -90);
     if (dirtyRect == Frame)
     {
         strokeColor.SetStroke();
         NSBezierPath.StrokeRect(dirtyRect);
     }
 }
Ejemplo n.º 3
0
        // Draw the view
        public override void DrawRect(CoreGraphics.CGRect dirtyRect)
        {
            CGRect bounds = this.Bounds;

            // Using the system focus ring instead. Achieved by overriding DrawFocusRingMask and FocusRingMaskBounds
            //			// Am I the window's first responder?
            //			if (this.Window.FirstResponder == this) {
            //				NSColor.KeyboardFocusIndicator.Set();
            //				NSBezierPath.DefaultLineWidth = 4.0f;
            //				NSBezierPath.StrokeRect(bounds);
            //			}

            if (Highlighted) {
                NSGradient gr = new NSGradient(NSColor.White, mBgColor);
                gr.DrawInRect(bounds, new CGPoint(0.0f, 0.0f));
            } else {
                mBgColor.Set();
                NSBezierPath.FillRect(bounds);
            }

            DrawStringCenteredInRectangle(mLetter, bounds);
        }