예제 #1
0
        public static BorderStyle ToBorderStyle(this NSBorderType self)
        {
            switch (self)
            {
            case NSBorderType.LineBorder: return(BorderStyle.FixedSingle);

            case NSBorderType.BezelBorder: return(BorderStyle.Fixed3D);

            case NSBorderType.GrooveBorder: return(BorderStyle.Fixed3D);

            default: return(BorderStyle.None);
            }
        }
예제 #2
0
        public static BorderType ToEto(this NSBorderType border)
        {
            switch (border)
            {
            case NSBorderType.BezelBorder:
                return(BorderType.Bezel);

            case NSBorderType.LineBorder:
                return(BorderType.Line);

            case NSBorderType.NoBorder:
                return(BorderType.None);

            default:
                throw new NotSupportedException();
            }
        }
        public BorderedWindow(CGRect frame, NSColor borderColor, NSColor fillColor, NSBorderType borderType = NSBorderType.LineBorder, float borderWidth = 3) : base(frame, NSWindowStyle.Borderless, NSBackingStore.Buffered, false)
        {
            IsOpaque           = false;
            ShowsToolbarButton = false;
            IgnoresMouseEvents = true;
            box = new NSBox()
            {
                BoxType = NSBoxType.NSBoxCustom
            };
            ContentView = box;

            FillColor   = fillColor;
            BorderWidth = borderWidth;
            BorderColor = borderColor;
            BorderType  = borderType;
            Visible     = false;
        }
 public BorderedWindow(CGRect frame, NSColor borderColor, NSBorderType borderType = NSBorderType.LineBorder, float borderWidth = 3) : this(frame, borderColor, NSColor.Clear, borderType, borderWidth)
 {
 }
예제 #5
0
 public virtual void SetBorderType(NSBorderType aType)
 {
     _border_type = aType;
     if (_content_view != null)
         ((NSView)_content_view).Frame = CalcSizesAllowingNegative(false);
     this.SetNeedsDisplay(true);
 }
예제 #6
0
        public override id InitWithFrame(NSRect frameRect)
        {
            id self = this;

            NSView cv;

            if (base.InitWithFrame(frameRect) == null)
                return null;

            _cell = (id)Objc.MsgSend(NSCell.Alloc(), "InitTextCell", @"Title");
            ((NSCell)_cell).Alignment = NSTextAlignment.NSCenterTextAlignment;
            ((NSCell)_cell).Bordered = false;
            ((NSCell)_cell).Editable = false;
            this.TitleFont = NSFont.SystemFontOfSize(NSFont.SmallSystemFontSize);

            _offsets.Width = 5;
            _offsets.Height = 5;
            _border_rect = _bounds;
            _border_type = NSBorderType.NSGrooveBorder;
            _title_position = NSTitlePosition.NSAtTop;
            _title_rect = NSRect.Zero;

            // FIXME
            //this.AutoresizesSubviews = false;

            cv = (NSView)NSView.Alloc().Init();
            this.ContentView = cv;

            return self;
        }