Пример #1
0
        public void SetChild(IWidgetBackend child)
        {
            if (child != null)
            {
                var w = GetWidget(child);

                WidgetBackend wb = (WidgetBackend)child;

                if (wb.EventSink.SupportsCustomScrolling())
                {
                    CustomViewPort vp = new CustomViewPort(wb.EventSink);
                    vp.Show();
                    vp.Add(w);
                    Widget.Child = vp;
                }
                else if (w is Gtk.Viewport)
                {
                    Widget.Child = w;
                }
                else
                {
                    Gtk.Viewport vp = new Gtk.Viewport();
                    vp.Show();
                    vp.Add(w);
                    Widget.Child = vp;
                }
            }
            else
            {
                Widget.Child = null;
            }

            UpdateBorder();
        }
Пример #2
0
 public void SetChild(IWidgetBackend child)
 {
     if (alignment.Child != null)
     {
         WidgetBackend.RemoveChildPlacement(alignment.Child);
         alignment.Remove(alignment.Child);
     }
     alignment.Child = WidgetBackend.GetWidgetWithPlacement(child);
 }
Пример #3
0
        public void SetChild(IWidgetBackend child)
        {
            RemoveChildPlacement(currentChild);

            if (Widget.Child != null)
            {
                if (Widget.Child is Gtk.Bin)
                {
                    Gtk.Bin vp = (Gtk.Bin)Widget.Child;
                    vp.Remove(vp.Child);
                }
                Widget.Remove(Widget.Child);
            }

            if (child != null)
            {
                var w = currentChild = GetWidgetWithPlacement(child);

                WidgetBackend wb = (WidgetBackend)child;

                if (wb.EventSink.SupportsCustomScrolling())
                {
                    CustomViewPort vp = new CustomViewPort(wb.EventSink);
                    vp.Show();
                    vp.Add(w);
                    Widget.Child = vp;
                }
                                #if XWT_GTK3
                else if (w is Gtk.IScrollable)
                {
                    Widget.Child = w;
                }
                                #else
                // Gtk2 has no interface for natively scrollable widgets, therefore we manually check
                // for types that should not be packed into a Viewport.
                // see: https://developer.gnome.org/gtk2/stable/GtkScrolledWindow.html#gtk-scrolled-window-add-with-viewport
                else if (w is Gtk.Viewport || w is Gtk.TreeView || w is Gtk.TextView || w is Gtk.Layout || w is WebKit.WebView)
                {
                    Widget.Child = w;
                }
                                #endif
                else
                {
                    Gtk.Viewport vp = new Gtk.Viewport();
                    vp.Show();
                    vp.Add(w);
                    Widget.Child = vp;
                }
            }

            UpdateBorder();
        }
Пример #4
0
		public void SetContent (IWidgetBackend widget)
		{
			childBackend = (WidgetBackend)widget;

			var newWidget = GetWidgetWithPlacement (widget);
			var oldWidget = Widget.Child;

			if (oldWidget == null)
				Widget.Child = newWidget;
			else {
				GtkEngine.ReplaceChild (oldWidget, newWidget);
				RemoveChildPlacement (oldWidget);
			}
		}
Пример #5
0
        public void SetContent(IWidgetBackend widget)
        {
            childBackend = (WidgetBackend)widget;

            var newWidget = GetWidgetWithPlacement(widget);
            var oldWidget = Widget.Child;

            if (oldWidget == null)
            {
                Widget.Child = newWidget;
            }
            else
            {
                GtkEngine.ReplaceChild(oldWidget, newWidget);
                RemoveChildPlacement(oldWidget);
            }
        }
Пример #6
0
        public void SetChild(IWidgetBackend child)
        {
            RemoveChildPlacement(currentChild);

            if (Widget.Child != null)
            {
                if (Widget.Child is Gtk.Bin)
                {
                    Gtk.Bin vp = (Gtk.Bin)Widget.Child;
                    vp.Remove(vp.Child);
                }
                Widget.Remove(Widget.Child);
            }

            if (child != null)
            {
                var w = currentChild = GetWidgetWithPlacement(child);

                WidgetBackend wb = (WidgetBackend)child;

                if (wb.EventSink.SupportsCustomScrolling())
                {
                    CustomViewPort vp = new CustomViewPort(wb.EventSink);
                    vp.Show();
                    vp.Add(w);
                    Widget.Child = vp;
                }
                else if (w is Gtk.Viewport)
                {
                    Widget.Child = w;
                }
                else
                {
                    Gtk.Viewport vp = new Gtk.Viewport();
                    vp.Show();
                    vp.Add(w);
                    Widget.Child = vp;
                }
            }

            UpdateBorder();
        }
Пример #7
0
 public CustomTreeView(WidgetBackend b)
 {
     backend = b;
 }
Пример #8
0
 public CustomTreeView(WidgetBackend b)
 {
     backend         = b;
     base.DragBegin += (_, __) =>
                       delayedSelection = null;
 }
Пример #9
0
 public CustomTreeView(WidgetBackend b)
 {
     backend = b;
 }
Пример #10
0
 public virtual void UpdateChildPlacement(IWidgetBackend childBackend)
 {
     WidgetBackend.SetChildPlacement(childBackend);
 }
Пример #11
0
        public void Add(IWidgetBackend widget)
        {
            WidgetBackend wb = (WidgetBackend)widget;

            Widget.Add(wb.Frontend, GetWidget(widget));
        }