Inheritance: Xwt.GtkBackend.GtkViewPort
Ejemplo n.º 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();
        }
Ejemplo n.º 2
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();
        }
Ejemplo n.º 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;
                }
                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();
        }
Ejemplo n.º 4
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 ();
		}
Ejemplo n.º 5
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 ();
        }
Ejemplo n.º 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;
                }
                #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 ();
        }