示例#1
0
        public void SetPanel(int panel, IWidgetBackend widget, bool resize, bool shrink)
        {
            IMacViewBackend view = (IMacViewBackend)widget;

            Widget.AddSubview(view.View);
            Widget.AdjustSubviews();
            view.NotifyPreferredSizeChanged();
        }
示例#2
0
 void IWindowBackend.SetChild(IWidgetBackend child)
 {
     if (this.child != null)
     {
         this.child.View.RemoveFromSuperview();
     }
     this.child = (IMacViewBackend)child;
     if (child != null)
     {
         ContentView.AddSubview(this.child.View);
         SetPadding(frontend.Padding.Left, frontend.Padding.Top, frontend.Padding.Right, frontend.Padding.Bottom);
         this.child.View.AutoresizingMask = NSViewResizingMask.HeightSizable | NSViewResizingMask.WidthSizable;
     }
 }
示例#3
0
 void IWindowBackend.SetChild(IWidgetBackend child)
 {
     if (this.child != null)
     {
         this.child.View.RemoveFromSuperview();
     }
     this.child = (IMacViewBackend)child;
     if (child != null)
     {
         ContentView.AddSubview(this.child.View);
         UpdateLayout();
         this.child.View.AutoresizingMask = NSViewResizingMask.HeightSizable | NSViewResizingMask.WidthSizable;
     }
 }
示例#4
0
        public void Show(Xwt.Popover.Position orientation, Xwt.Widget referenceWidget, Xwt.Rectangle positionRect, Xwt.Widget child)
        {
            var controller = new FactoryViewController(child);

            popover          = new NSPopover();
            popover.Behavior = NSPopoverBehavior.Transient;
            popover.ContentViewController = controller;
            IMacViewBackend backend   = (IMacViewBackend)Xwt.Engine.WidgetRegistry.GetBackend(referenceWidget);
            var             reference = backend.View;

            popover.Show(System.Drawing.RectangleF.Empty,
                         reference,
                         ToRectEdge(orientation));
        }
示例#5
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;
            }
        }
示例#6
0
 void IWindowBackend.SetChild(IWidgetBackend child)
 {
     if (this.child != null) {
         this.child.View.RemoveFromSuperview ();
     }
     this.child = (IMacViewBackend) child;
     if (child != null) {
         ContentView.AddSubview (this.child.View);
         SetPadding (frontend.Padding.Left, frontend.Padding.Top, frontend.Padding.Right, frontend.Padding.Bottom);
         this.child.View.AutoresizingMask = NSViewResizingMask.HeightSizable | NSViewResizingMask.WidthSizable;
     }
 }
示例#7
0
        public override object GetNativeWidget(Widget w)
        {
            IMacViewBackend wb = (IMacViewBackend)Xwt.Engine.WidgetRegistry.GetBackend(w);

            return(wb.View);
        }
示例#8
0
        public void Add(IWidgetBackend widget)
        {
            IMacViewBackend b = (IMacViewBackend)widget;

            Widget.AddSubview(b.View);
        }
示例#9
0
 void IWindowBackend.SetChild(IWidgetBackend child)
 {
     if (this.child != null) {
         this.child.View.RemoveFromSuperview ();
     }
     this.child = (IMacViewBackend) child;
     if (child != null) {
         ContentView.AddSubview (this.child.View);
         UpdateLayout ();
         this.child.View.AutoresizingMask = NSViewResizingMask.HeightSizable | NSViewResizingMask.WidthSizable;
     }
 }