Esempio n. 1
0
        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();
            }
        }
Esempio n. 2
0
        public void SetChild(IWidgetBackend child)
        {
            IMacViewBackend backend = (IMacViewBackend)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;
                clipView.DocumentView = backend.View;
                backend.EventSink.SetScrollAdjustments(hs, vs);
                backend.View.Frame = new System.Drawing.RectangleF(0, 0, 500, 500);
            }
            else
            {
                Widget.DocumentView = backend.View;
                backend.View.Frame  = Widget.ContentView.DocumentRect;
            }
        }
Esempio n. 3
0
 public CustomClipView(ScrollAdjustmentBackend hScroll, ScrollAdjustmentBackend vScroll)
 {
     this.hScroll   = hScroll;
     this.vScroll   = vScroll;
     CopiesOnScroll = false;
 }