public void SetChild(IWidgetBackend child) { this.child = child; ViewBackend backend = (ViewBackend)child; if (backend.EventSink.SupportsCustomScrolling()) { var vs = new ScrollAdjustmentBackend(Widget, true); var hs = new ScrollAdjustmentBackend(Widget, false); CustomClipView clipView = new CustomClipView(hs, vs); Widget.ContentView = clipView; var dummy = new DummyClipView(); dummy.AddSubview(backend.Widget); backend.Widget.Frame = new CGRect(0, 0, clipView.Frame.Width, clipView.Frame.Height); clipView.DocumentView = dummy; backend.EventSink.SetScrollAdjustments(hs, vs); vertScroll = vs; horScroll = hs; } else { clipView = new NormalClipView(); clipView.Scrolled += OnScrolled; Widget.ContentView = clipView; Widget.DocumentView = backend.Widget; UpdateChildSize(); } }
public override void Initialize() { Table = CreateView(); scroll = new ScrollView(); clipView = new NormalClipView(); clipView.Scrolled += OnScrolled; scroll.ContentView = clipView; scroll.DocumentView = Table; scroll.BorderType = NSBorderType.BezelBorder; ViewObject = scroll; Widget.AutoresizingMask = NSViewResizingMask.HeightSizable | NSViewResizingMask.WidthSizable; Widget.AutoresizesSubviews = true; }