blob: 89626235a99e348dcb27a9ed936c6000049862ee (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
using System;
using System.Collections;
using System.ComponentModel;
using AppKit;
using CoreGraphics;
namespace Xamarin.PropertyEditing.Mac
{
class UnfocusableTextField : NSTextField
{
public UnfocusableTextField () : base ()
{
SetDefaultProperties ();
}
public UnfocusableTextField (CGRect frameRect, string text) : base (frameRect)
{
StringValue = text;
SetDefaultProperties ();
}
void SetDefaultProperties ()
{
Bordered = false;
Editable = false;
Selectable = false;
}
public override void DrawRect (CGRect dirtyRect)
{
CGPoint origin = new CGPoint (0.0f, 7.0f);
CGRect rect = new CGRect (origin, new CGSize (this.Bounds.Width, this.Bounds.Height));
this.AttributedStringValue.DrawInRect (rect);
}
}
}
|