public virtual void SetTitlePosition(NSTitlePosition aPosition) { if (_title_position != aPosition) { _title_position = aPosition; if (_content_view != null) ((NSView)_content_view).Frame = CalcSizesAllowingNegative(false); this.SetNeedsDisplay(true); } }
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; }